add linear-gradient to top & bottom bar, support start in fullscreen
continuous-integration/drone/push Build encountered an error Details

This commit is contained in:
Jannik 2020-07-13 23:44:28 +02:00
parent 257b09fc9c
commit 5c4b78436f
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
8 changed files with 70 additions and 65 deletions

View File

@ -44,8 +44,8 @@ public class Main extends Application {
private MainWindowController mainWindowController; private MainWindowController mainWindowController;
private static XMLController xmlController; private static XMLController xmlController;
private static Logger LOGGER; private static Logger LOGGER;
public static final String version = "0.8.90"; public static final String version = "0.8.91";
public static final String buildNumber = "175"; public static final String buildNumber = "177";
public static final String versionName = "nimbly xlr8"; public static final String versionName = "nimbly xlr8";
// TODO rename streamURL to mediaURL // TODO rename streamURL to mediaURL

View File

@ -87,6 +87,7 @@ public class SettingsView {
@FXML private JFXToggleButton autoUpdateToggleBtn; @FXML private JFXToggleButton autoUpdateToggleBtn;
@FXML private JFXToggleButton autoplayToggleBtn; @FXML private JFXToggleButton autoplayToggleBtn;
@FXML private JFXToggleButton fullscreenToggleBtn;
@FXML private TableView<SourceDataType> sourcesTable; @FXML private TableView<SourceDataType> sourcesTable;
@FXML private TableColumn<SourceDataType, String> sourceColumn; @FXML private TableColumn<SourceDataType, String> sourceColumn;
@ -109,6 +110,7 @@ public class SettingsView {
autoUpdateToggleBtn.setSelected(XMLController.isAutoUpdate()); autoUpdateToggleBtn.setSelected(XMLController.isAutoUpdate());
autoplayToggleBtn.setSelected(XMLController.isAutoplay()); autoplayToggleBtn.setSelected(XMLController.isAutoplay());
fullscreenToggleBtn.setSelected(XMLController.isFullscreen());
languageChoisBox.setItems(languages); languageChoisBox.setItems(languages);
branchChoisBox.setItems(branches); branchChoisBox.setItems(branches);
@ -197,6 +199,12 @@ public class SettingsView {
XMLController.setAutoplay(!XMLController.isAutoplay()); XMLController.setAutoplay(!XMLController.isAutoplay());
xmlController.saveSettings(); xmlController.saveSettings();
} }
@FXML
private void fullscreenToggleBtnAction(ActionEvent event) {
XMLController.setFullscreen(!XMLController.isFullscreen());
xmlController.saveSettings();
}
@FXML @FXML
private void colorPickerAction(ActionEvent event) { private void colorPickerAction(ActionEvent event) {
@ -272,6 +280,8 @@ public class SettingsView {
autoUpdateToggleBtn.setToggleLineColor(Color.valueOf(XMLController.getColor())); autoUpdateToggleBtn.setToggleLineColor(Color.valueOf(XMLController.getColor()));
autoplayToggleBtn.setToggleColor(Color.valueOf(XMLController.getColor())); autoplayToggleBtn.setToggleColor(Color.valueOf(XMLController.getColor()));
autoplayToggleBtn.setToggleLineColor(Color.valueOf(XMLController.getColor())); autoplayToggleBtn.setToggleLineColor(Color.valueOf(XMLController.getColor()));
fullscreenToggleBtn.setToggleColor(Color.valueOf(XMLController.getColor()));
fullscreenToggleBtn.setToggleLineColor(Color.valueOf(XMLController.getColor()));
} }
public void updateGUILocal() { public void updateGUILocal() {
@ -288,6 +298,7 @@ public class SettingsView {
autoUpdateToggleBtn.setText(XMLController.getLocalBundle().getString("autoUpdate")); autoUpdateToggleBtn.setText(XMLController.getLocalBundle().getString("autoUpdate"));
autoplayToggleBtn.setText(XMLController.getLocalBundle().getString("autoplay")); autoplayToggleBtn.setText(XMLController.getLocalBundle().getString("autoplay"));
fullscreenToggleBtn.setText(XMLController.getLocalBundle().getString("fullscreen"));
} }
public void setVisible(boolean visible) { public void setVisible(boolean visible) {

View File

@ -61,6 +61,7 @@ public class XMLController {
private static boolean autoUpdate = false; private static boolean autoUpdate = false;
private static boolean useBeta = false; private static boolean useBeta = false;
private static boolean autoplay = false; private static boolean autoplay = false;
private static boolean fullscreen = true;
private static double fontSize = 17; private static double fontSize = 17;
private static ResourceBundle localBundle = ResourceBundle.getBundle("locals.HomeFlix-Local", Locale.US); private static ResourceBundle localBundle = ResourceBundle.getBundle("locals.HomeFlix-Local", Locale.US);
@ -276,6 +277,14 @@ public class XMLController {
public static void setAutoplay(boolean autoplay) { public static void setAutoplay(boolean autoplay) {
XMLController.autoplay = autoplay; XMLController.autoplay = autoplay;
} }
public static boolean isFullscreen() {
return fullscreen;
}
public static void setFullscreen(boolean fullscreen) {
XMLController.fullscreen = fullscreen;
}
public static double getFontSize() { public static double getFontSize() {
return fontSize; return fontSize;

View File

@ -194,7 +194,7 @@ public class PlayerController {
// hide controls timer initialization // hide controls timer initialization
final Timer timer = new Timer(); final Timer timer = new Timer();
TimerTask controlAnimationTask = null; // task to execute save operation TimerTask controlAnimationTask = null; // task to execute save operation
final long delayTime = 4000; // hide the controls after 2 seconds final long delayTime = 3000; // hide the controls after 2 seconds
@Override @Override
public void handle(MouseEvent mouseEvent) { public void handle(MouseEvent mouseEvent) {
@ -223,6 +223,11 @@ public class PlayerController {
timer.schedule(controlAnimationTask, delayTime); timer.schedule(controlAnimationTask, delayTime);
} }
}); });
if (XMLController.isFullscreen()) {
player.getStage().setFullScreen(!player.getStage().isFullScreen());
fullscreenIcon.setImage(player.getStage().isFullScreen() ? fullscreenExit : fullscreen);
}
} }
/** /**
@ -283,6 +288,15 @@ public class PlayerController {
@Override @Override
public void handle(MouseEvent event) { public void handle(MouseEvent event) {
embeddedMediaPlayer.controls().skipTime(skipTime); embeddedMediaPlayer.controls().skipTime(skipTime);
// TODO update time-stamps if video is paused
// currentTime = currentTime + skipTime;
// endTime = endTime - skipTime;
//
// Platform.runLater(() -> {
// updateControls();
// });
mousePressed = false; mousePressed = false;
} }
}); });
@ -437,7 +451,6 @@ public class PlayerController {
setAudioTrack(list.getSelectionModel().getSelectedIndex()); setAudioTrack(list.getSelectionModel().getSelectedIndex());
audioPopup.hide(); audioPopup.hide();
}); });
// TODO style the JFXListView
Text heading = new Text("Audio"); Text heading = new Text("Audio");
heading.setFill(Color.WHITE); heading.setFill(Color.WHITE);
@ -462,13 +475,13 @@ public class PlayerController {
} }
@FXML @FXML
void btnFullscreenAction(ActionEvent event) { private void btnFullscreenAction(ActionEvent event) {
player.getStage().setFullScreen(!player.getStage().isFullScreen()); player.getStage().setFullScreen(!player.getStage().isFullScreen());
fullscreenIcon.setImage(player.getStage().isFullScreen() ? fullscreenExit : fullscreen); fullscreenIcon.setImage(player.getStage().isFullScreen() ? fullscreenExit : fullscreen);
} }
@FXML @FXML
void btnNextEpisodeAction(ActionEvent event) { private void btnNextEpisodeAction(ActionEvent event) {
btnNextEpisode.setVisible(false); btnNextEpisode.setVisible(false);
playNextMedia(); playNextMedia();
} }
@ -508,8 +521,6 @@ public class PlayerController {
} }
private class FXBufferFormatCallback implements BufferFormatCallback { private class FXBufferFormatCallback implements BufferFormatCallback {
int sourceWidth;
int sourceHeight;
@Override @Override
public BufferFormat getBufferFormat(int sourceWidth, int sourceHeight) { public BufferFormat getBufferFormat(int sourceWidth, int sourceHeight) {

View File

@ -11,31 +11,20 @@
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<AnchorPane fx:id="panePlayer" prefHeight="720.0" <AnchorPane fx:id="panePlayer" prefHeight="720.0" prefWidth="1280.0" style="-fx-background-color: black;" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
prefWidth="1280.0" style="-fx-background-color: black;"
xmlns="http://javafx.com/javafx/11.0.1"
xmlns:fx="http://javafx.com/fxml/1">
<children> <children>
<HBox alignment="CENTER" AnchorPane.bottomAnchor="0.0" <HBox alignment="CENTER" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
AnchorPane.topAnchor="0.0">
<children> <children>
<ImageView fx:id="videoImageView" pickOnBounds="true" <ImageView fx:id="videoImageView" pickOnBounds="true" preserveRatio="true" />
preserveRatio="true" />
</children> </children>
</HBox> </HBox>
<HBox fx:id="hBoxTop" alignment="CENTER_LEFT" spacing="10.0" <HBox fx:id="hBoxTop" alignment="CENTER_LEFT" spacing="10.0" style="-fx-background-color: linear-gradient(to bottom, #000000aa, #00000000);" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
AnchorPane.topAnchor="0.0">
<children> <children>
<JFXButton fx:id="btnBack" contentDisplay="GRAPHIC_ONLY" <JFXButton fx:id="btnBack" contentDisplay="GRAPHIC_ONLY" onAction="#btnBackAction">
onAction="#btnBackAction">
<graphic> <graphic>
<ImageView fitHeight="24.0" pickOnBounds="true" <ImageView fitHeight="24.0" pickOnBounds="true" preserveRatio="true">
preserveRatio="true">
<image> <image>
<Image <Image url="@../icons/baseline_keyboard_backspace_white_48dp.png" />
url="@../icons/baseline_keyboard_backspace_white_48dp.png" />
</image> </image>
</ImageView> </ImageView>
</graphic> </graphic>
@ -50,9 +39,7 @@
<Insets left="5.0" right="5.0" top="5.0" /> <Insets left="5.0" right="5.0" top="5.0" />
</padding> </padding>
</HBox> </HBox>
<VBox fx:id="bottomVBox" alignment="CENTER" <VBox fx:id="bottomVBox" alignment="CENTER" style="-fx-background-color: linear-gradient(to top, #000000dd, #00000000);" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0">
<children> <children>
<HBox spacing="10.0"> <HBox spacing="10.0">
<children> <children>
@ -78,37 +65,29 @@
<children> <children>
<HBox spacing="10.0"> <HBox spacing="10.0">
<children> <children>
<JFXButton fx:id="btnPlay" <JFXButton fx:id="btnPlay" contentDisplay="GRAPHIC_ONLY" onAction="#btnPlayAction">
contentDisplay="GRAPHIC_ONLY" onAction="#btnPlayAction">
<graphic> <graphic>
<ImageView fx:id="playIcon" fitHeight="42.0" <ImageView fx:id="playIcon" fitHeight="42.0" pickOnBounds="true" preserveRatio="true">
pickOnBounds="true" preserveRatio="true">
<image> <image>
<Image url="@../icons/baseline_pause_white_48dp.png" /> <Image url="@../icons/baseline_pause_white_48dp.png" />
</image> </image>
</ImageView> </ImageView>
</graphic> </graphic>
</JFXButton> </JFXButton>
<JFXButton fx:id="btnReplay" <JFXButton fx:id="btnReplay" contentDisplay="GRAPHIC_ONLY" onAction="#btnReplayAction">
contentDisplay="GRAPHIC_ONLY" onAction="#btnReplayAction">
<graphic> <graphic>
<ImageView fitHeight="42.0" pickOnBounds="true" <ImageView fitHeight="42.0" pickOnBounds="true" preserveRatio="true">
preserveRatio="true">
<image> <image>
<Image <Image url="@../icons/baseline_replay_10_white_48dp.png" />
url="@../icons/baseline_replay_10_white_48dp.png" />
</image> </image>
</ImageView> </ImageView>
</graphic> </graphic>
</JFXButton> </JFXButton>
<JFXButton fx:id="btnForward" <JFXButton fx:id="btnForward" contentDisplay="GRAPHIC_ONLY" onAction="#btnForwardAction">
contentDisplay="GRAPHIC_ONLY" onAction="#btnForwardAction">
<graphic> <graphic>
<ImageView fitHeight="42.0" pickOnBounds="true" <ImageView fitHeight="42.0" pickOnBounds="true" preserveRatio="true">
preserveRatio="true">
<image> <image>
<Image <Image url="@../icons/baseline_forward_10_white_48dp.png" />
url="@../icons/baseline_forward_10_white_48dp.png" />
</image> </image>
</ImageView> </ImageView>
</graphic> </graphic>
@ -118,30 +97,22 @@
<Insets left="5.0" right="5.0" /> <Insets left="5.0" right="5.0" />
</padding> </padding>
</HBox> </HBox>
<HBox alignment="TOP_RIGHT" spacing="10.0" <HBox alignment="TOP_RIGHT" spacing="10.0" HBox.hgrow="ALWAYS">
HBox.hgrow="ALWAYS">
<children> <children>
<JFXButton fx:id="btnAudio" <JFXButton fx:id="btnAudio" contentDisplay="GRAPHIC_ONLY" onAction="#btnAudioAction">
contentDisplay="GRAPHIC_ONLY" onAction="#btnAudioAction">
<graphic> <graphic>
<ImageView fitHeight="42.0" pickOnBounds="true" <ImageView fitHeight="42.0" pickOnBounds="true" preserveRatio="true">
preserveRatio="true">
<image> <image>
<Image <Image url="@../icons/baseline_subtitles_white_48dp.png" />
url="@../icons/baseline_subtitles_white_48dp.png" />
</image> </image>
</ImageView> </ImageView>
</graphic> </graphic>
</JFXButton> </JFXButton>
<JFXButton fx:id="btnFullscreen" <JFXButton fx:id="btnFullscreen" contentDisplay="GRAPHIC_ONLY" onAction="#btnFullscreenAction" prefHeight="39.0">
contentDisplay="GRAPHIC_ONLY" onAction="#btnFullscreenAction"
prefHeight="39.0">
<graphic> <graphic>
<ImageView fx:id="fullscreenIcon" fitHeight="42.0" <ImageView fx:id="fullscreenIcon" fitHeight="42.0" pickOnBounds="true" preserveRatio="true">
pickOnBounds="true" preserveRatio="true">
<image> <image>
<Image <Image url="@../icons/baseline_fullscreen_white_48dp.png" />
url="@../icons/baseline_fullscreen_white_48dp.png" />
</image> </image>
</ImageView> </ImageView>
</graphic> </graphic>
@ -161,11 +132,7 @@
<Insets bottom="5.0" /> <Insets bottom="5.0" />
</padding> </padding>
</VBox> </VBox>
<JFXButton fx:id="btnNextEpisode" <JFXButton fx:id="btnNextEpisode" onAction="#btnNextEpisodeAction" style="-fx-background-color: ee3523;" text="next episode in 10 seconds" textFill="WHITE" visible="false" AnchorPane.bottomAnchor="100.0" AnchorPane.rightAnchor="20.0">
onAction="#btnNextEpisodeAction"
style="-fx-background-color: ee3523;"
text="next episode in 10 seconds" textFill="WHITE" visible="false"
AnchorPane.bottomAnchor="100.0" AnchorPane.rightAnchor="20.0">
<font> <font>
<Font name="System Bold" size="14.0" /> <Font name="System Bold" size="14.0" />
</font> </font>

View File

@ -113,6 +113,11 @@
<Insets bottom="-5.0" top="-5.0" /> <Insets bottom="-5.0" top="-5.0" />
</padding> </padding>
</JFXToggleButton> </JFXToggleButton>
<JFXToggleButton fx:id="fullscreenToggleBtn" onAction="#fullscreenToggleBtnAction" text="start in fullscreen">
<padding>
<Insets bottom="-5.0" top="-5.0" />
</padding>
</JFXToggleButton>
</children> </children>
</VBox> </VBox>
<VBox spacing="10.0"> <VBox spacing="10.0">

View File

@ -40,6 +40,7 @@ updateBtnUpdateAvailable = Update verf\u00FCgbar
updateBtnNoUpdateAvailable = Kein Update verf\u00FCgbar updateBtnNoUpdateAvailable = Kein Update verf\u00FCgbar
autoUpdate = beim Start nach Updates suchen: autoUpdate = beim Start nach Updates suchen:
autoplay = Autoplay autoplay = Autoplay
fullscreen = starte im Vollbildmodus
branchLbl = Updatezweig branchLbl = Updatezweig
sourcesLbl = Quellen sourcesLbl = Quellen

View File

@ -40,6 +40,7 @@ updateBtnUpdateAvailable = update available
updateBtnNoUpdateAvailable = no update available updateBtnNoUpdateAvailable = no update available
autoUpdate = check at startup for updates: autoUpdate = check at startup for updates:
autoplay = Autoplay autoplay = Autoplay
fullscreen = start in fullscreen
branchLbl = Branch branchLbl = Branch
sourcesLbl = Sources sourcesLbl = Sources