Fix coding style problems

This commit is contained in:
Petar Kukolj 2018-11-22 17:05:04 +01:00
parent 98e75fc313
commit 2393d4512c
2 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -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];
}
});