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 72175489..acb342cd 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 @@ -30,6 +30,7 @@ import android.webkit.WebView; import com.github.dfa.diaspora_android.data.AppSettings; import com.github.dfa.diaspora_android.data.PodUserProfile; import com.github.dfa.diaspora_android.util.AvatarImageLoader; +import com.github.dfa.diaspora_android.util.DiasporaUrlHelper; public class App extends Application { public static final String TAG = "DIASPORA_"; @@ -51,6 +52,7 @@ public class App extends Application { // Get cookie manager cookieManager = CookieManager.getInstance(); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { + //noinspection deprecation CookieSyncManager.createInstance(c); } cookieManager.setAcceptCookie(true); @@ -59,7 +61,7 @@ public class App extends Application { public void resetPodData(@Nullable WebView webView){ if(webView != null){ webView.stopLoading(); - webView.loadUrl("about:blank"); + webView.loadUrl(DiasporaUrlHelper.URL_BLANK); webView.clearFormData(); webView.clearHistory(); webView.clearCache(true); @@ -72,6 +74,7 @@ public class App extends Application { appSettings.clearPodSettings(); // Clear cookies + //noinspection deprecation cookieManager.removeAllCookie(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { cookieManager.removeAllCookies(null); diff --git a/app/src/main/java/com/github/dfa/diaspora_android/listener/WebUserProfileChangedListener.java b/app/src/main/java/com/github/dfa/diaspora_android/listener/WebUserProfileChangedListener.java index af9c3f68..9ef24a1f 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/listener/WebUserProfileChangedListener.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/listener/WebUserProfileChangedListener.java @@ -20,6 +20,7 @@ package com.github.dfa.diaspora_android.listener; /** * Created by gsantner (https://gsantner.github.io/) on 26.03.16. + * Interface that needs to be implemented by classes that listen for Profile related changes */ public interface WebUserProfileChangedListener { void onUserProfileNameChanged(String name); diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/BottomBarBehavior.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/BottomBarBehavior.java index 79789489..6e89bfc4 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/BottomBarBehavior.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/BottomBarBehavior.java @@ -19,12 +19,15 @@ package com.github.dfa.diaspora_android.ui; import android.content.Context; import android.support.design.widget.AppBarLayout; import android.support.design.widget.CoordinatorLayout; -import android.support.v4.view.ViewCompat; import android.util.AttributeSet; -import android.util.Log; import android.view.View; import android.widget.LinearLayout; +/** + * Behaviour of the bottom Toolbar + * WARNING: This class is NOT UNUSED + */ +@SuppressWarnings("unused") public class BottomBarBehavior extends CoordinatorLayout.Behavior { private int defaultDependencyTop = -1; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/FloatingActionsMenuBehavior.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/FloatingActionsMenuBehavior.java deleted file mode 100644 index 4fb53f0c..00000000 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/FloatingActionsMenuBehavior.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - This file is part of the Diaspora for Android. - - Diaspora for Android is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Diaspora for Android is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with the Diaspora for Android. - - If not, see . - */ -package com.github.dfa.diaspora_android.ui; - -import android.content.Context; -import android.support.design.widget.CoordinatorLayout; -import android.support.design.widget.Snackbar.SnackbarLayout; -import android.util.AttributeSet; -import android.view.View; - -import com.getbase.floatingactionbutton.FloatingActionsMenu; - -public class FloatingActionsMenuBehavior extends CoordinatorLayout.Behavior { - - public FloatingActionsMenuBehavior(Context context, AttributeSet attrs) { - } - - @Override - public boolean layoutDependsOn(CoordinatorLayout parent, FloatingActionsMenu child, View dependency) { - return dependency instanceof SnackbarLayout; - } - - @Override - public boolean onDependentViewChanged(CoordinatorLayout parent, FloatingActionsMenu child, View dependency) { - float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight()); - child.setTranslationY(translationY); - return true; - } -} diff --git a/app/src/main/java/com/github/dfa/diaspora_android/util/WebHelper.java b/app/src/main/java/com/github/dfa/diaspora_android/util/WebHelper.java index fb1d0c2b..691481be 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/util/WebHelper.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/util/WebHelper.java @@ -19,13 +19,9 @@ package com.github.dfa.diaspora_android.util; -import android.app.Activity; import android.content.Context; -import android.content.Intent; import android.net.ConnectivityManager; import android.net.NetworkInfo; -import android.support.v4.content.ContextCompat; -import android.support.v4.text.TextUtilsCompat; import android.text.Html; import android.webkit.URLUtil; import android.webkit.WebView; @@ -36,7 +32,6 @@ import com.github.dfa.diaspora_android.data.AppSettings; import com.github.dfa.diaspora_android.data.PodAspect; import com.github.dfa.diaspora_android.data.PodUserProfile; -import java.net.URL; import java.util.Locale; /** @@ -59,7 +54,7 @@ public class WebHelper { } public static String escapeHtmlText(String text){ - text = Html.escapeHtml(text);; + text = Html.escapeHtml(text); text = text.replace("\n", " "); return text; }