From 2393d4512c25cdd9095a3546c2bc9aa139bca798 Mon Sep 17 00:00:00 2001 From: Petar Kukolj Date: Thu, 22 Nov 2018 17:05:04 +0100 Subject: [PATCH] Fix coding style problems --- .../java/de/danoeh/antennapod/activity/MainActivity.java | 8 ++++---- .../antennapod/preferences/PreferenceController.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index 122b6040e..5595aeac4 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -646,9 +646,9 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi @Override public void onBackPressed() { - if(isDrawerOpen()) { + if (isDrawerOpen()) { drawerLayout.closeDrawer(navDrawer); - } else if(getSupportFragmentManager().getBackStackEntryCount() != 0) { + } else if (getSupportFragmentManager().getBackStackEntryCount() != 0) { super.onBackPressed(); } else { switch (UserPreferences.getBackButtonBehavior()) { @@ -664,7 +664,7 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi .show(); break; case DOUBLE_TAP: - if(lastBackButtonPressTime < System.currentTimeMillis() - 2000) { + if (lastBackButtonPressTime < System.currentTimeMillis() - 2000) { Toast.makeText(this, R.string.double_tap_toast, Toast.LENGTH_SHORT).show(); lastBackButtonPressTime = System.currentTimeMillis(); } else { @@ -672,7 +672,7 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi } break; case GO_TO_PAGE: - if(getLastNavFragment().equals(UserPreferences.getBackButtonGoToPage())) { + if (getLastNavFragment().equals(UserPreferences.getBackButtonGoToPage())) { super.onBackPressed(); } else { loadFragment(UserPreferences.getBackButtonGoToPage(), null); diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java index ec1767062..587b533a2 100644 --- a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java +++ b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java @@ -229,7 +229,7 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc ui.findPreference(UserPreferences.PREF_BACK_BUTTON_BEHAVIOR) .setOnPreferenceChangeListener((preference, newValue) -> { - if(newValue.equals("page")) { + if (newValue.equals("page")) { final Context context = ui.getActivity(); final String[] navTitles = context.getResources().getStringArray(R.array.back_button_go_to_pages); final String[] navTags = new String[3]; @@ -239,7 +239,7 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(R.string.back_button_go_to_page_title); builder.setSingleChoiceItems(navTitles, ArrayUtils.indexOf(navTags, UserPreferences.getBackButtonGoToPage()), (dialogInterface, i) -> { - if(i >= 0) { + if (i >= 0) { choice[0] = navTags[i]; } });