Browse Source

fixed Hamburger icon has wrong color after color change

pull/5/head
Jannik 4 years ago
parent
commit
85a403a834
  1. 40
      src/main/java/kellerkinder/HomeFlix/application/MainWindowController.java
  2. 28
      src/main/java/kellerkinder/HomeFlix/controller/DBController.java
  3. 2
      src/main/java/kellerkinder/HomeFlix/player/PlayerController.java

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

@ -550,17 +550,6 @@ public class MainWindowController {
}
}
/**
* check if a film is supported by the HomeFlixPlayer or not
* this is the case if the mime type is mp4
* @param entry the film you want to check
* @return true if so, false if not
*/
private boolean isSupportedFormat(FilmTabelDataType film) {
String mimeType = URLConnection.guessContentTypeFromName(film.getStreamUrl());
return mimeType != null && (mimeType.contains("mp4") || mimeType.contains("vp6"));
}
@FXML
private void openfolderbtnclicked() {
String dest = new File(getCurrentStreamUrl()).getParentFile().getAbsolutePath();
@ -629,13 +618,14 @@ public class MainWindowController {
}
@FXML
private void colorPickerAction(){
editColor(colorPicker.getValue().toString());
private void colorPickerAction() {
setColor(colorPicker.getValue().toString().substring(2, 10));
saveSettings();
applyColor();
}
@FXML
private void updateBtnAction(){
private void updateBtnAction() {
updateController = new UpdateController(this, buildNumber, useBeta);
Thread updateThread = new Thread(updateController);
updateThread.setName("Updater");
@ -757,9 +747,12 @@ public class MainWindowController {
openfolderbtn.setStyle(btnStyleWhite);
returnBtn.setStyle(btnStyleWhite);
forwardBtn.setStyle(btnStyleWhite);
playbtn.setGraphic(play_arrow_white);
returnBtn.setGraphic(skip_previous_white);
forwardBtn.setGraphic(skip_next_white);
menuHam.getStyleClass().clear();
menuHam.getStyleClass().add("jfx-hamburgerW");
} else {
dialogBtnStyle = btnStyleBlack;
@ -772,9 +765,12 @@ public class MainWindowController {
openfolderbtn.setStyle(btnStyleBlack);
returnBtn.setStyle(btnStyleBlack);
forwardBtn.setStyle(btnStyleBlack);
playbtn.setGraphic(play_arrow_black);
returnBtn.setGraphic(skip_previous_black);
forwardBtn.setGraphic(skip_next_black);
menuHam.getStyleClass().clear();
menuHam.getStyleClass().add("jfx-hamburgerB");
}
}
@ -953,14 +949,18 @@ public class MainWindowController {
}
}
// cuts 0x of the Color-pickers return value
private void editColor(String input) {
StringBuilder sb = new StringBuilder(input);
sb.delete(0, 2);
this.color = sb.toString();
saveSettings();
/**
* check if a film is supported by the HomeFlixPlayer or not
* this is the case if the mime type is mp4
* @param entry the film you want to check
* @return true if so, false if not
*/
private boolean isSupportedFormat(FilmTabelDataType film) {
String mimeType = URLConnection.guessContentTypeFromName(film.getStreamUrl());
return mimeType != null && (mimeType.contains("mp4") || mimeType.contains("vp6"));
}
// getter and setter
public DBController getDbController() {
return dbController;

28
src/main/java/kellerkinder/HomeFlix/controller/DBController.java

@ -731,7 +731,7 @@ public class DBController {
return nextFilm;
}
/** TODO check if we relay need to separate between favorites and none favorites
/**
* get the last watched episode
* @param title the title of the series
* @return the last watched episode as {@link FilmTabelDataType} object
@ -745,26 +745,16 @@ public class DBController {
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM films WHERE title = \"" + title + "\";");
while (rs.next()) {
if (rs.getBoolean("favorite") == true) {
nextFilm = new FilmTabelDataType(rs.getString("streamUrl"),
rs.getString("title"), rs.getString("season"), rs.getString("episode") ,rs.getBoolean("favorite"),
rs.getBoolean("cached"), new ImageView(favorite_black));
} else {
nextFilm = new FilmTabelDataType(rs.getString("streamUrl"),
rs.getString("title"), rs.getString("season"), rs.getString("episode"), rs.getBoolean("favorite"),
rs.getBoolean("cached"), new ImageView(favorite_border_black));
}
// favorite image is black
nextFilm = new FilmTabelDataType(rs.getString("streamUrl"), rs.getString("title"),
rs.getString("season"), rs.getString("episode"), rs.getBoolean("favorite"),
rs.getBoolean("cached"), new ImageView(favorite_black));
if (rs.getDouble("currentTime") > lastCurrentTime) {
lastCurrentTime = rs.getDouble("currentTime");
if (rs.getBoolean("favorite") == true) {
nextFilm = new FilmTabelDataType(rs.getString("streamUrl"),
rs.getString("title"), rs.getString("season"), rs.getString("episode") ,rs.getBoolean("favorite"),
rs.getBoolean("cached"), new ImageView(favorite_black));
} else {
nextFilm = new FilmTabelDataType(rs.getString("streamUrl"),
rs.getString("title"), rs.getString("season"), rs.getString("episode"), rs.getBoolean("favorite"),
rs.getBoolean("cached"), new ImageView(favorite_border_black));
}
// favorite image is black
nextFilm = new FilmTabelDataType(rs.getString("streamUrl"), rs.getString("title"),
rs.getString("season"), rs.getString("episode"), rs.getBoolean("favorite"),
rs.getBoolean("cached"), new ImageView(favorite_black));
break;
}
}

2
src/main/java/kellerkinder/HomeFlix/player/PlayerController.java

@ -92,7 +92,7 @@ public class PlayerController {
private ImageView fullscreen_black = new ImageView(new Image("icons/ic_fullscreen_black_24dp_1x.png"));
private ImageView fullscreen_exit_black = new ImageView(new Image("icons/ic_fullscreen_exit_black_24dp_1x.png"));
/** FIXME double set currentTime(
/** FIXME double set currentTime()
* initialize the new PlayerWindow
* @param entry the film object
* @param player the player object (needed for closing action)

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