Browse Source

fixed scrollpane jumping to the top after returning from detailview

* use plot=full to get a better description
pull/12/head
Jannik 3 years ago
parent
commit
9f8a7c0f4c
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
  1. 9
      src/main/java/kellerkinder/HomeFlix/application/MainWindowController.java
  2. 5
      src/main/java/kellerkinder/HomeFlix/controller/OMDbAPIController.java
  3. 2
      src/main/resources/fxml/MainWindow.fxml

9
src/main/java/kellerkinder/HomeFlix/application/MainWindowController.java

@ -158,6 +158,7 @@ public class MainWindowController {
// general actions
HamburgerBackArrowBasicTransition burgerTask = new HamburgerBackArrowBasicTransition(menuHam);
menuHam.addEventHandler(MouseEvent.MOUSE_PRESSED, (e) -> {
if (menuTrue) {
sideMenuSlideOut();
burgerTask.setRate(-1.0);
@ -173,8 +174,7 @@ public class MainWindowController {
if (settingsViewController.isVisible()) {
settingsViewController.setVisible(false);
}
});primaryStage.setMinHeight(600.00 + 34); // 34 -> window decoration
primaryStage.setMinWidth(1130.00);
});
}
// general fxml actions
@ -296,7 +296,6 @@ public class MainWindowController {
// slide in in 400ms
private void sideMenuSlideIn() {
sideMenuVBox.setVisible(true);
TranslateTransition translateTransition = new TranslateTransition(Duration.millis(400), sideMenuVBox);
translateTransition.setFromX(-150);
translateTransition.setToX(0);
@ -374,7 +373,7 @@ public class MainWindowController {
ExecutorService executor = Executors.newFixedThreadPool(5);
for (FilmTabelDataType entry : dbController.getAllNotCachedEntries()) {
System.out.println(entry.getStreamUrl() + " is NOT cached!");
// System.out.println(entry.getStreamUrl() + " is NOT cached!");
Runnable OMDbAPIWorker = new OMDbAPIController(entry);
executor.execute(OMDbAPIWorker);
@ -432,7 +431,7 @@ public class MainWindowController {
for(FilmTabelDataType entry : dbController.getStreamsList()) {
if (dbController.getCacheDate(entry.getStreamUrl()).isBefore(lastValidCache)) {
System.out.println(entry.getTitle() + " chached on: " + dbController.getCacheDate(entry.getStreamUrl()));
// System.out.println(entry.getTitle() + " chached on: " + dbController.getCacheDate(entry.getStreamUrl()));
Runnable OMDbAPIWorker = new OMDbAPIController(entry);
executor.execute(OMDbAPIWorker);
}

5
src/main/java/kellerkinder/HomeFlix/controller/OMDbAPIController.java

@ -165,10 +165,11 @@ public class OMDbAPIController implements Runnable {
apiUrl = new URL(URL + omdbAPIKey + "&t="
+ title.replace(" ", "%20")
+ "&Season=" + currentTableFilm.getSeason()
+ "&Episode=" + currentTableFilm.getEpisode());
+ "&Episode=" + currentTableFilm.getEpisode()
+ "&plot=full");
} else {
apiUrl = new URL(URL + omdbAPIKey + "&t="
+ title.replace(" ", "%20"));
+ title.replace(" ", "%20") + "&plot=full");
}
BufferedReader ina = new BufferedReader(new InputStreamReader(apiUrl.openStream()));

2
src/main/resources/fxml/MainWindow.fxml

@ -33,7 +33,7 @@
</JFXHamburger>
</children>
</HBox>
<VBox fx:id="sideMenuVBox" layoutY="32.0" prefHeight="660.0" prefWidth="150.0" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="32.0">
<VBox fx:id="sideMenuVBox" layoutX="-150.0" layoutY="32.0" prefHeight="660.0" prefWidth="150.0" AnchorPane.bottomAnchor="0.0" AnchorPane.topAnchor="32.0">
<children>
<JFXButton fx:id="aboutBtn" onAction="#aboutBtnAction" prefHeight="32.0" prefWidth="150.0" textAlignment="CENTER">
<font>

Loading…
Cancel
Save

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close