mirror of
https://github.com/gsantner/dandelion
synced 2024-11-24 13:22:08 +01:00
Auto reformat code
This commit is contained in:
parent
fb8eb60974
commit
24571f6921
5 changed files with 13 additions and 16 deletions
|
@ -58,7 +58,7 @@ public class App extends Application {
|
||||||
String a = new ContextUtils(this).bcstr("FLAVOR", "");
|
String a = new ContextUtils(this).bcstr("FLAVOR", "");
|
||||||
a += "__";
|
a += "__";
|
||||||
|
|
||||||
if (appSettings.isAppFirstStart() && "flavorDandelior".equals(new ContextUtils(this).bcstr("FLAVOR", ""))){
|
if (appSettings.isAppFirstStart() && "flavorDandelior".equals(new ContextUtils(this).bcstr("FLAVOR", ""))) {
|
||||||
appSettings.setAmoledColorMode(true);
|
appSettings.setAmoledColorMode(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -565,12 +565,10 @@ public class MainActivity extends ThemedActivity
|
||||||
} else if ("sc_activities".equals(action)) {
|
} else if ("sc_activities".equals(action)) {
|
||||||
openDiasporaUrl(urls.getActivityUrl());
|
openDiasporaUrl(urls.getActivityUrl());
|
||||||
return;
|
return;
|
||||||
}
|
} else if ("sc_contacts".equals(action)) {
|
||||||
else if ("sc_contacts".equals(action)) {
|
|
||||||
onNavigationItemSelected(navView.getMenu().findItem(R.id.nav_aspects));
|
onNavigationItemSelected(navView.getMenu().findItem(R.id.nav_aspects));
|
||||||
return;
|
return;
|
||||||
}
|
} else if ("sc_tags".equals(action)) {
|
||||||
else if ("sc_tags".equals(action)) {
|
|
||||||
onNavigationItemSelected(navView.getMenu().findItem(R.id.nav_followed_tags));
|
onNavigationItemSelected(navView.getMenu().findItem(R.id.nav_followed_tags));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -451,6 +451,7 @@ public class AppSettings extends SharedPreferencesPropertyBackend {
|
||||||
public boolean isAmoledColorMode() {
|
public boolean isAmoledColorMode() {
|
||||||
return getBool(R.string.pref_key__primary_color__amoled_mode, false);
|
return getBool(R.string.pref_key__primary_color__amoled_mode, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAmoledColorMode(boolean enable) {
|
public void setAmoledColorMode(boolean enable) {
|
||||||
setBool(R.string.pref_key__primary_color__amoled_mode, enable);
|
setBool(R.string.pref_key__primary_color__amoled_mode, enable);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ package com.github.dfa.diaspora_android.web;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.MutableContextWrapper;
|
import android.content.MutableContextWrapper;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v4.widget.SwipeRefreshLayout;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.webkit.WebSettings;
|
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.ui.theme.ThemedFragment;
|
||||||
import com.github.dfa.diaspora_android.util.AppLog;
|
import com.github.dfa.diaspora_android.util.AppLog;
|
||||||
import com.github.dfa.diaspora_android.util.AppSettings;
|
import com.github.dfa.diaspora_android.util.AppSettings;
|
||||||
import android.support.v4.widget.SwipeRefreshLayout;//pull to refresh
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fragment with a webView and a ProgressBar.
|
* Fragment with a webView and a ProgressBar.
|
||||||
|
@ -94,15 +94,14 @@ public class BrowserFragment extends ThemedFragment {
|
||||||
this.setRetainInstance(true);
|
this.setRetainInstance(true);
|
||||||
|
|
||||||
//pull to refresh
|
//pull to refresh
|
||||||
swipe = view.findViewById( R.id.swipe );
|
swipe = view.findViewById(R.id.swipe);
|
||||||
swipe.setDistanceToTriggerSync( 2000 );
|
swipe.setDistanceToTriggerSync(2000);
|
||||||
swipe.setOnRefreshListener( () -> reloadUrl() );
|
swipe.setOnRefreshListener(() -> reloadUrl());
|
||||||
if (appSettings.isSwipeRefreshEnabled()){
|
if (appSettings.isSwipeRefreshEnabled()) {
|
||||||
swipe.setEnabled( true );
|
swipe.setEnabled(true);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
swipe.setRefreshing( false );
|
swipe.setRefreshing(false);
|
||||||
swipe.setEnabled( false );
|
swipe.setEnabled(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
package com.github.dfa.diaspora_android.web;
|
package com.github.dfa.diaspora_android.web;
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
@ -60,7 +59,7 @@ public class CustomWebViewClient extends WebViewClient {
|
||||||
|| url.startsWith("http://" + host)))) {
|
|| url.startsWith("http://" + host)))) {
|
||||||
return false;
|
return false;
|
||||||
}//make youtube links open external-->never customtab
|
}//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));
|
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||||
view.getContext().startActivity(intent);
|
view.getContext().startActivity(intent);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue