Skip to content
Snippets Groups Projects

Added feedback label in Search scene

Merged Rokas Bliudzius requested to merge feat/photos-feedback-label into dev
All threads resolved!
2 files
+ 22
18
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 19
0
package Css;
import javafx.animation.FadeTransition;
import javafx.geometry.Pos;
import javafx.scene.control.*;
import javafx.scene.layout.HBox;
@@ -8,6 +9,7 @@ import javafx.scene.layout.StackPane;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Screen;
import javafx.util.Duration;
/**
* Css class used for styling different JavaFX elements
@@ -177,6 +179,23 @@ public class Css {
}
}
/**
* Plays a fading transition on a feedback label
*
* @param feedBackType FeedBackType Enum, the type of feedback (success or error)
* @param labelDisplayText text to be displayed by the label when the transition will be shown
* @param fontSize the size of the font
* @param label label to play the transition on
*/
public static void playFeedBackLabelTransition(FeedBackType feedBackType, String labelDisplayText, int fontSize, Label label){
setFeedBackLabel(feedBackType, fontSize, label);
label.setText(labelDisplayText);
FadeTransition ft = new FadeTransition(Duration.seconds(5), label);
ft.setFromValue(1);
ft.setToValue(0);
ft.play();
}
/**
* Styles font of a text in the Action popup class
*
Loading