Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliskov committed Nov 2, 2020
1 parent 681f613 commit 33a69ad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private void appendUIAutoHideCategory(AppSettingsPresenter settingsPresenter) {
option -> mPlayerUIData.setUIHideTimoutSec(PlayerData.AUTO_HIDE_NEVER),
mPlayerUIData.getUIHideTimoutSec() == PlayerData.AUTO_HIDE_NEVER));

for (int i = 1; i <= 10; i++) {
for (int i = 1; i <= 15; i++) {
int timeoutSec = i;
options.add(UiOptionItem.from(
String.format("%s sec", i),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ public boolean isAnimatedPreviewsEnabled() {
private void restoreData() {
String data = mPrefs.getMainUIData();

if (data != null) {
String[] split = data.split(",");
String[] split = Helpers.split(data);

mIsAnimatedPreviewsEnabled = Helpers.parseBoolean(split, 0, true);
}
mIsAnimatedPreviewsEnabled = Helpers.parseBoolean(split, 0, true);
}

private void persistData() {
mPrefs.setMainUIData(String.format("%s", mIsAnimatedPreviewsEnabled));
mPrefs.setMainUIData(Helpers.merge(mIsAnimatedPreviewsEnabled));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,13 @@ public int getUIHideTimoutSec() {
private void restoreData() {
String data = mPrefs.getPlayerData();

if (data != null) {
String[] split = data.split(",");
String[] split = Helpers.split(data);

mOKButtonBehavior = Helpers.parseInt(split, 0, ONLY_UI);
mUIHideTimeoutSec = Helpers.parseInt(split, 1, 3);
}
mOKButtonBehavior = Helpers.parseInt(split, 0, ONLY_UI);
mUIHideTimeoutSec = Helpers.parseInt(split, 1, 3);
}

private void persistData() {
mPrefs.setPlayerData(String.format("%s,%s", mOKButtonBehavior, mUIHideTimeoutSec));
mPrefs.setPlayerData(Helpers.merge(mOKButtonBehavior, mUIHideTimeoutSec));
}
}

0 comments on commit 33a69ad

Please sign in to comment.