From e06e2f3ba1f55e1db3b053e8893931e3a037c640 Mon Sep 17 00:00:00 2001 From: vanitasvitae Date: Sat, 1 Oct 2016 00:24:53 +0200 Subject: [PATCH] Moved WebClients and ChromeClients to webview package --- .../github/dfa/diaspora_android/activity/MainActivity.java | 7 ------- .../dfa/diaspora_android/fragment/BrowserFragment.java | 4 ++-- .../diaspora_android/fragment/DiasporaStreamFragment.java | 5 ++--- .../dfa/diaspora_android/fragment/HashtagListFragment.java | 3 +++ .../{ui => webview}/CustomWebViewClient.java | 3 ++- .../{ui => webview}/DiasporaStreamWebChromeClient.java | 2 +- .../{ui => webview}/FileUploadWebChromeClient.java | 2 +- .../{ui => webview}/ProgressBarWebChromeClient.java | 2 +- 8 files changed, 12 insertions(+), 16 deletions(-) rename app/src/main/java/com/github/dfa/diaspora_android/{ui => webview}/CustomWebViewClient.java (95%) rename app/src/main/java/com/github/dfa/diaspora_android/{ui => webview}/DiasporaStreamWebChromeClient.java (96%) rename app/src/main/java/com/github/dfa/diaspora_android/{ui => webview}/FileUploadWebChromeClient.java (96%) rename app/src/main/java/com/github/dfa/diaspora_android/{ui => webview}/ProgressBarWebChromeClient.java (94%) 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 ab4b4035..44b06b45 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 @@ -288,13 +288,6 @@ public class MainActivity extends AppCompatActivity } } - @Override - public void onConfigurationChanged(Configuration newConfig) { - AppLog.i(this, "onConfigurationChanged()"); - - super.onConfigurationChanged(newConfig); - } - private void setupNavigationSlider() { ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this, navDrawer, toolbarTop, R.string.navigation_drawer_open, R.string.navigation_drawer_close); diff --git a/app/src/main/java/com/github/dfa/diaspora_android/fragment/BrowserFragment.java b/app/src/main/java/com/github/dfa/diaspora_android/fragment/BrowserFragment.java index 01fdb390..770c853e 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/fragment/BrowserFragment.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/fragment/BrowserFragment.java @@ -29,8 +29,8 @@ import com.github.dfa.diaspora_android.R; import com.github.dfa.diaspora_android.activity.MainActivity; import com.github.dfa.diaspora_android.data.AppSettings; import com.github.dfa.diaspora_android.ui.ContextMenuWebView; -import com.github.dfa.diaspora_android.ui.CustomWebViewClient; -import com.github.dfa.diaspora_android.ui.ProgressBarWebChromeClient; +import com.github.dfa.diaspora_android.webview.CustomWebViewClient; +import com.github.dfa.diaspora_android.webview.ProgressBarWebChromeClient; import com.github.dfa.diaspora_android.util.AppLog; import java.io.File; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/fragment/DiasporaStreamFragment.java b/app/src/main/java/com/github/dfa/diaspora_android/fragment/DiasporaStreamFragment.java index 2cd70e72..650c8fca 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/fragment/DiasporaStreamFragment.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/fragment/DiasporaStreamFragment.java @@ -26,8 +26,8 @@ import com.github.dfa.diaspora_android.App; import com.github.dfa.diaspora_android.R; import com.github.dfa.diaspora_android.activity.MainActivity; import com.github.dfa.diaspora_android.data.PodUserProfile; -import com.github.dfa.diaspora_android.ui.DiasporaStreamWebChromeClient; -import com.github.dfa.diaspora_android.ui.FileUploadWebChromeClient; +import com.github.dfa.diaspora_android.webview.DiasporaStreamWebChromeClient; +import com.github.dfa.diaspora_android.webview.FileUploadWebChromeClient; import com.github.dfa.diaspora_android.util.AppLog; import com.github.dfa.diaspora_android.util.DiasporaUrlHelper; import com.github.dfa.diaspora_android.util.Helpers; @@ -51,7 +51,6 @@ public class DiasporaStreamFragment extends BrowserFragment { private ValueCallback imageUploadFilePathCallbackNew; private ValueCallback imageUploadFilePathCallbackOld; private String mCameraPhotoPath; - private String sharedText; @SuppressLint("SetJavaScriptEnabled") @Override diff --git a/app/src/main/java/com/github/dfa/diaspora_android/fragment/HashtagListFragment.java b/app/src/main/java/com/github/dfa/diaspora_android/fragment/HashtagListFragment.java index 13ab9669..3cb70c38 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/fragment/HashtagListFragment.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/fragment/HashtagListFragment.java @@ -52,6 +52,9 @@ public class HashtagListFragment extends CustomFragment { final FollowedTagsAdapter adapter = new FollowedTagsAdapter(followedTags, onHashtagClickListener); followedTagsRecyclerView.setAdapter(adapter); + + //Set window title + getActivity().setTitle(R.string.nav_followed_tags); } @Override diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/CustomWebViewClient.java b/app/src/main/java/com/github/dfa/diaspora_android/webview/CustomWebViewClient.java similarity index 95% rename from app/src/main/java/com/github/dfa/diaspora_android/ui/CustomWebViewClient.java rename to app/src/main/java/com/github/dfa/diaspora_android/webview/CustomWebViewClient.java index 8e31a15c..914abcbb 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/CustomWebViewClient.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/webview/CustomWebViewClient.java @@ -16,7 +16,7 @@ If not, see . */ -package com.github.dfa.diaspora_android.ui; +package com.github.dfa.diaspora_android.webview; import android.content.Intent; import android.net.Uri; @@ -37,6 +37,7 @@ public class CustomWebViewClient extends WebViewClient { this.webView = webView; } + //Open non-diaspora links in customtab/external browser public boolean shouldOverrideUrlLoading(WebView view, String url) { if (!url.contains(app.getSettings().getPodDomain())) { Intent i = new Intent(MainActivity.ACTION_OPEN_EXTERNAL_URL); diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/DiasporaStreamWebChromeClient.java b/app/src/main/java/com/github/dfa/diaspora_android/webview/DiasporaStreamWebChromeClient.java similarity index 96% rename from app/src/main/java/com/github/dfa/diaspora_android/ui/DiasporaStreamWebChromeClient.java rename to app/src/main/java/com/github/dfa/diaspora_android/webview/DiasporaStreamWebChromeClient.java index 671075b2..22da0d8a 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/DiasporaStreamWebChromeClient.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/webview/DiasporaStreamWebChromeClient.java @@ -1,4 +1,4 @@ -package com.github.dfa.diaspora_android.ui; +package com.github.dfa.diaspora_android.webview; import android.webkit.WebView; import android.widget.ProgressBar; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/FileUploadWebChromeClient.java b/app/src/main/java/com/github/dfa/diaspora_android/webview/FileUploadWebChromeClient.java similarity index 96% rename from app/src/main/java/com/github/dfa/diaspora_android/ui/FileUploadWebChromeClient.java rename to app/src/main/java/com/github/dfa/diaspora_android/webview/FileUploadWebChromeClient.java index 6e3172e2..a33261cb 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/FileUploadWebChromeClient.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/webview/FileUploadWebChromeClient.java @@ -1,4 +1,4 @@ -package com.github.dfa.diaspora_android.ui; +package com.github.dfa.diaspora_android.webview; import android.net.Uri; import android.webkit.ValueCallback; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/ProgressBarWebChromeClient.java b/app/src/main/java/com/github/dfa/diaspora_android/webview/ProgressBarWebChromeClient.java similarity index 94% rename from app/src/main/java/com/github/dfa/diaspora_android/ui/ProgressBarWebChromeClient.java rename to app/src/main/java/com/github/dfa/diaspora_android/webview/ProgressBarWebChromeClient.java index 1c8e84c3..b630163c 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/ProgressBarWebChromeClient.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/webview/ProgressBarWebChromeClient.java @@ -1,4 +1,4 @@ -package com.github.dfa.diaspora_android.ui; +package com.github.dfa.diaspora_android.webview; import android.view.View; import android.webkit.WebChromeClient;