From 24571f6921171762a9b0ab1e9faa8059207b6e82 Mon Sep 17 00:00:00 2001 From: Gregor Santner Date: Thu, 7 Feb 2019 10:31:18 +0100 Subject: [PATCH] Auto reformat code --- .../com/github/dfa/diaspora_android/App.java | 2 +- .../diaspora_android/activity/MainActivity.java | 6 ++---- .../dfa/diaspora_android/util/AppSettings.java | 1 + .../diaspora_android/web/BrowserFragment.java | 17 ++++++++--------- .../web/CustomWebViewClient.java | 3 +-- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/com/github/dfa/diaspora_android/App.java b/app/src/main/java/com/github/dfa/diaspora_android/App.java index 841730e2..6f5ca2e6 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/App.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/App.java @@ -58,7 +58,7 @@ public class App extends Application { String a = new ContextUtils(this).bcstr("FLAVOR", ""); a += "__"; - if (appSettings.isAppFirstStart() && "flavorDandelior".equals(new ContextUtils(this).bcstr("FLAVOR", ""))){ + if (appSettings.isAppFirstStart() && "flavorDandelior".equals(new ContextUtils(this).bcstr("FLAVOR", ""))) { appSettings.setAmoledColorMode(true); } diff --git a/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java b/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java index 9eb6045a..ba8af918 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java @@ -565,12 +565,10 @@ public class MainActivity extends ThemedActivity } else if ("sc_activities".equals(action)) { openDiasporaUrl(urls.getActivityUrl()); return; - } - else if ("sc_contacts".equals(action)) { + } else if ("sc_contacts".equals(action)) { onNavigationItemSelected(navView.getMenu().findItem(R.id.nav_aspects)); return; - } - else if ("sc_tags".equals(action)) { + } else if ("sc_tags".equals(action)) { onNavigationItemSelected(navView.getMenu().findItem(R.id.nav_followed_tags)); return; } diff --git a/app/src/main/java/com/github/dfa/diaspora_android/util/AppSettings.java b/app/src/main/java/com/github/dfa/diaspora_android/util/AppSettings.java index 80c672ad..d1a48f03 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/util/AppSettings.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/util/AppSettings.java @@ -451,6 +451,7 @@ public class AppSettings extends SharedPreferencesPropertyBackend { public boolean isAmoledColorMode() { return getBool(R.string.pref_key__primary_color__amoled_mode, false); } + public void setAmoledColorMode(boolean enable) { setBool(R.string.pref_key__primary_color__amoled_mode, enable); } diff --git a/app/src/main/java/com/github/dfa/diaspora_android/web/BrowserFragment.java b/app/src/main/java/com/github/dfa/diaspora_android/web/BrowserFragment.java index 892426f3..bfc53fd9 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/web/BrowserFragment.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/web/BrowserFragment.java @@ -21,6 +21,7 @@ package com.github.dfa.diaspora_android.web; import android.content.Context; import android.content.MutableContextWrapper; import android.os.Bundle; +import android.support.v4.widget.SwipeRefreshLayout; import android.view.View; import android.view.ViewGroup; import android.webkit.WebSettings; @@ -33,7 +34,6 @@ import com.github.dfa.diaspora_android.ui.theme.ThemeHelper; import com.github.dfa.diaspora_android.ui.theme.ThemedFragment; import com.github.dfa.diaspora_android.util.AppLog; import com.github.dfa.diaspora_android.util.AppSettings; -import android.support.v4.widget.SwipeRefreshLayout;//pull to refresh /** * Fragment with a webView and a ProgressBar. @@ -94,15 +94,14 @@ public class BrowserFragment extends ThemedFragment { this.setRetainInstance(true); //pull to refresh - swipe = view.findViewById( R.id.swipe ); - swipe.setDistanceToTriggerSync( 2000 ); - swipe.setOnRefreshListener( () -> reloadUrl() ); - if (appSettings.isSwipeRefreshEnabled()){ - swipe.setEnabled( true ); - + swipe = view.findViewById(R.id.swipe); + swipe.setDistanceToTriggerSync(2000); + swipe.setOnRefreshListener(() -> reloadUrl()); + if (appSettings.isSwipeRefreshEnabled()) { + swipe.setEnabled(true); } else { - swipe.setRefreshing( false ); - swipe.setEnabled( false ); + swipe.setRefreshing(false); + swipe.setEnabled(false); return; } } diff --git a/app/src/main/java/com/github/dfa/diaspora_android/web/CustomWebViewClient.java b/app/src/main/java/com/github/dfa/diaspora_android/web/CustomWebViewClient.java index 848e1b65..5e0011d8 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/web/CustomWebViewClient.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/web/CustomWebViewClient.java @@ -19,7 +19,6 @@ package com.github.dfa.diaspora_android.web; import android.annotation.TargetApi; -import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Build; @@ -60,7 +59,7 @@ public class CustomWebViewClient extends WebViewClient { || url.startsWith("http://" + host)))) { return false; }//make youtube links open external-->never customtab - else if (appSettings.isOpenYoutubeExternalEnabled()&&(url.startsWith("https://youtube.com/") || url.startsWith("https://www.youtube.com/") || url.startsWith("https://m.youtube.com/") || url.startsWith("https://youtu.be/"))){ + else if (appSettings.isOpenYoutubeExternalEnabled() && (url.startsWith("https://youtube.com/") || url.startsWith("https://www.youtube.com/") || url.startsWith("https://m.youtube.com/") || url.startsWith("https://youtu.be/"))) { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); view.getContext().startActivity(intent); return true;