Skip to content

Commit

Permalink
fix losses due to rebase (6d89383, UI of #2652)
Browse files Browse the repository at this point in the history
  • Loading branch information
orionlee committed Sep 1, 2019
1 parent 5a9f8cb commit e643fb9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.os.Bundle;
import android.support.v7.preference.ListPreference;
import android.support.v7.preference.PreferenceFragmentCompat;

import de.danoeh.antennapod.R;
import de.danoeh.antennapod.activity.MediaplayerActivity;
import de.danoeh.antennapod.core.preferences.UserPreferences;
Expand Down Expand Up @@ -56,6 +57,20 @@ private void setupPlaybackScreen() {
behaviour.setEntries(R.array.video_background_behavior_options_without_pip);
behaviour.setEntryValues(R.array.video_background_behavior_values_without_pip);
}

findPreference(UserPreferences.PREF_QUEUE_ADD_TO_FRONT).setOnPreferenceChangeListener(
(preference, newValue) -> {
if (newValue instanceof Boolean) {
boolean enableKeepInProgressAtFront = ((Boolean) newValue);
checkKeepInProgressAtFrontItemVisibility(enableKeepInProgressAtFront);
}
return true;
});
checkKeepInProgressAtFrontItemVisibility(UserPreferences.enqueueAtFront());
}

private void checkKeepInProgressAtFrontItemVisibility(boolean enabled) {
findPreference(UserPreferences.PREF_QUEUE_KEEP_IN_PROGESS_AT_FRONT).setEnabled(enabled);
}

private void buildSmartMarkAsPlayedPreference() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private UserPreferences(){}
private static final String PREF_BACK_BUTTON_GO_TO_PAGE = "prefBackButtonGoToPage";

// Queue
private static final String PREF_QUEUE_ADD_TO_FRONT = "prefQueueAddToFront";
public static final String PREF_QUEUE_ADD_TO_FRONT = "prefQueueAddToFront";
public static final String PREF_QUEUE_KEEP_IN_PROGESS_AT_FRONT = "prefQueueKeepInProgressAtFront";
public static final String PREF_QUEUE_KEEP_SORTED = "prefQueueKeepSorted";
public static final String PREF_QUEUE_KEEP_SORTED_ORDER = "prefQueueKeepSortedOrder";
Expand Down

0 comments on commit e643fb9

Please sign in to comment.