Эх сурвалжийг харах

Improve methode name

Signed-off-by: Joris Bodin <joris.bodin@infomaniak.com>
Joris Bodin 5 жил өмнө
parent
commit
121b60a17c

+ 2 - 2
src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java

@@ -292,8 +292,8 @@ public abstract class DrawerActivity extends ToolbarActivity
         mDrawerToggle.setDrawerIndicatorEnabled(true);
         mDrawerToggle.setDrawerIndicatorEnabled(true);
         mDrawerToggle.setDrawerSlideAnimationEnabled(true);
         mDrawerToggle.setDrawerSlideAnimationEnabled(true);
         Drawable backArrow = getResources().getDrawable(R.drawable.ic_arrow_back);
         Drawable backArrow = getResources().getDrawable(R.drawable.ic_arrow_back);
-        mDrawerToggle.setHomeAsUpIndicator(ThemeUtils.tintDrawable(backArrow, ThemeUtils.fontAppbarColor(this)));
-        mDrawerToggle.getDrawerArrowDrawable().setColor(ThemeUtils.fontAppbarColor(this));
+        mDrawerToggle.setHomeAsUpIndicator(ThemeUtils.tintDrawable(backArrow, ThemeUtils.appBarPrimaryFontColor(this)));
+        mDrawerToggle.getDrawerArrowDrawable().setColor(ThemeUtils.appBarPrimaryFontColor(this));
     }
     }
 
 
     /**
     /**

+ 1 - 1
src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -2227,7 +2227,7 @@ public class FileDisplayActivity extends FileActivity
                                         null
                                         null
                                 );
                                 );
 
 
-                                showProgressBar(true);//okkk
+                                showProgressBar(true);
 
 
                                 setBackgroundText();
                                 setBackgroundText();
 
 

+ 1 - 1
src/main/java/com/owncloud/android/ui/activity/ToolbarActivity.java

@@ -63,7 +63,7 @@ public abstract class ToolbarActivity extends BaseActivity {
      */
      */
     protected void setupToolbar(boolean useBackgroundImage) {
     protected void setupToolbar(boolean useBackgroundImage) {
         int primaryColor = ThemeUtils.primaryAppbarColor(this);
         int primaryColor = ThemeUtils.primaryAppbarColor(this);
-        int fontColor = ThemeUtils.fontAppbarColor(this);
+        int fontColor = ThemeUtils.appBarPrimaryFontColor(this);
 
 
         Toolbar toolbar = findViewById(R.id.toolbar);
         Toolbar toolbar = findViewById(R.id.toolbar);
         setSupportActionBar(toolbar);
         setSupportActionBar(toolbar);

+ 10 - 9
src/main/java/com/owncloud/android/utils/ThemeUtils.java

@@ -219,9 +219,10 @@ public final class ThemeUtils {
     /**
     /**
      * Tests if light color is set
      * Tests if light color is set
      *
      *
+     * @param color the color
      * @return true if primaryColor is lighter than MAX_LIGHTNESS
      * @return true if primaryColor is lighter than MAX_LIGHTNESS
      */
      */
-    public static boolean lightTheme(Context context, int color) {
+    public static boolean lightTheme(int color) {
         float[] hsl = colorToHSL(color);
         float[] hsl = colorToHSL(color);
 
 
         return hsl[INDEX_LUMINATION] >= MAX_LIGHTNESS;
         return hsl[INDEX_LUMINATION] >= MAX_LIGHTNESS;
@@ -243,11 +244,11 @@ public final class ThemeUtils {
         return ContextCompat.getColor(context, R.color.appbar);
         return ContextCompat.getColor(context, R.color.appbar);
     }
     }
 
 
-    public static int fontAppbarColor(Context context) {
+    public static int appBarPrimaryFontColor(Context context) {
         return ContextCompat.getColor(context, R.color.fontAppbar);
         return ContextCompat.getColor(context, R.color.fontAppbar);
     }
     }
 
 
-    public static int fontSecondaryAppbar(Context context) {
+    public static int appBarSecondaryFontColor(Context context) {
         return ContextCompat.getColor(context, R.color.fontSecondaryAppbar);
         return ContextCompat.getColor(context, R.color.fontSecondaryAppbar);
     }
     }
 
 
@@ -267,7 +268,7 @@ public final class ThemeUtils {
                 actionBar.setTitle(title);
                 actionBar.setTitle(title);
             } else {
             } else {
                 Spannable text = new SpannableString(title);
                 Spannable text = new SpannableString(title);
-                text.setSpan(new ForegroundColorSpan(fontAppbarColor(context)),
+                text.setSpan(new ForegroundColorSpan(appBarPrimaryFontColor(context)),
                              0,
                              0,
                              text.length(),
                              text.length(),
                              Spannable.SPAN_INCLUSIVE_INCLUSIVE);
                              Spannable.SPAN_INCLUSIVE_INCLUSIVE);
@@ -292,7 +293,7 @@ public final class ThemeUtils {
                 actionBar.setSubtitle(title);
                 actionBar.setSubtitle(title);
             } else {
             } else {
                 Spannable text = new SpannableString(title);
                 Spannable text = new SpannableString(title);
-                text.setSpan(new ForegroundColorSpan(fontSecondaryAppbar(context)),
+                text.setSpan(new ForegroundColorSpan(appBarSecondaryFontColor(context)),
                              0,
                              0,
                              text.length(),
                              text.length(),
                              Spannable.SPAN_INCLUSIVE_INCLUSIVE);
                              Spannable.SPAN_INCLUSIVE_INCLUSIVE);
@@ -313,7 +314,7 @@ public final class ThemeUtils {
         }
         }
 
 
         Drawable backArrow = context.getResources().getDrawable(R.drawable.ic_arrow_back);
         Drawable backArrow = context.getResources().getDrawable(R.drawable.ic_arrow_back);
-        supportActionBar.setHomeAsUpIndicator(ThemeUtils.tintDrawable(backArrow, ThemeUtils.fontAppbarColor(context)));
+        supportActionBar.setHomeAsUpIndicator(ThemeUtils.tintDrawable(backArrow, ThemeUtils.appBarPrimaryFontColor(context)));
     }
     }
 
 
     public static Spanned getColoredTitle(String title, int color) {
     public static Spanned getColoredTitle(String title, int color) {
@@ -461,7 +462,7 @@ public final class ThemeUtils {
      */
      */
     public static void colorStatusBar(Activity fragmentActivity, @ColorInt int color) {
     public static void colorStatusBar(Activity fragmentActivity, @ColorInt int color) {
         Window window = fragmentActivity.getWindow();
         Window window = fragmentActivity.getWindow();
-        boolean isLightTheme = lightTheme(fragmentActivity.getApplicationContext(), color);
+        boolean isLightTheme = lightTheme(color);
         if (window != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
         if (window != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
             window.setStatusBarColor(color);
             window.setStatusBarColor(color);
             if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
             if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
@@ -555,10 +556,10 @@ public final class ThemeUtils {
      */
      */
     public static void themeSearchView(SearchView searchView, boolean themedBackground, Context context) {
     public static void themeSearchView(SearchView searchView, boolean themedBackground, Context context) {
         // hacky as no default way is provided
         // hacky as no default way is provided
-        int fontColor = fontAppbarColor(context);
+        int fontColor = appBarPrimaryFontColor(context);
         SearchView.SearchAutoComplete editText = searchView.findViewById(R.id.search_src_text);
         SearchView.SearchAutoComplete editText = searchView.findViewById(R.id.search_src_text);
         setEditTextColor(context, editText, fontColor);
         setEditTextColor(context, editText, fontColor);
-        editText.setHintTextColor(fontSecondaryAppbar(context));
+        editText.setHintTextColor(appBarSecondaryFontColor(context));
 
 
         ImageView closeButton = searchView.findViewById(androidx.appcompat.R.id.search_close_btn);
         ImageView closeButton = searchView.findViewById(androidx.appcompat.R.id.search_close_btn);
         closeButton.setColorFilter(fontColor);
         closeButton.setColorFilter(fontColor);