Browse Source

theming fixes for ProgressBar elements

AndyScherzinger 7 years ago
parent
commit
016cb21575

+ 2 - 2
src/main/java/com/owncloud/android/media/MediaControlView.java

@@ -223,10 +223,10 @@ public class MediaControlView extends FrameLayout /* implements OnLayoutChangeLi
         if (mProgress != null) {
             if (mProgress instanceof SeekBar) {
                 SeekBar seeker = (SeekBar) mProgress;
-                ThemeUtils.colorPreLollipopHorizontalSeekBar(seeker);
+                ThemeUtils.colorHorizontalSeekBar(seeker);
                 seeker.setOnSeekBarChangeListener(this);
             } else {
-                ThemeUtils.colorPreLollipopHorizontalProgressBar(mProgress);
+                ThemeUtils.colorHorizontalProgressBar(mProgress, ThemeUtils.primaryAccentColor());
             }
             mProgress.setMax(1000);
         }

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

@@ -294,7 +294,7 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
         mQuotaProgressBar = (ProgressBar) findQuotaViewById(R.id.drawer_quota_ProgressBar);
         mQuotaTextPercentage = (TextView) findQuotaViewById(R.id.drawer_quota_percentage);
         mQuotaTextLink = (TextView) findQuotaViewById(R.id.drawer_quota_link);
-        ThemeUtils.colorPreLollipopHorizontalProgressBar(mQuotaProgressBar);
+        ThemeUtils.colorHorizontalProgressBar(mQuotaProgressBar, ThemeUtils.primaryAccentColor());
     }
 
     /**

+ 1 - 0
src/main/java/com/owncloud/android/ui/adapter/ExpandableUploadListAdapter.java

@@ -281,6 +281,7 @@ public class ExpandableUploadListAdapter extends BaseExpandableListAdapter imple
             String status = getStatusText(upload);
             switch (upload.getUploadStatus()) {
                 case UPLOAD_IN_PROGRESS:
+                    ThemeUtils.colorHorizontalProgressBar(progressBar, ThemeUtils.primaryAccentColor());
                     progressBar.setProgress(0);
                     progressBar.setVisibility(View.VISIBLE);
 

+ 1 - 1
src/main/java/com/owncloud/android/ui/preview/FileDownloadFragment.java

@@ -138,7 +138,7 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
         mView = inflater.inflate(R.layout.file_download_fragment, container, false);
         
         ProgressBar progressBar = (ProgressBar)mView.findViewById(R.id.progressBar);
-        ThemeUtils.colorPreLollipopHorizontalProgressBar(progressBar);
+        ThemeUtils.colorHorizontalProgressBar(progressBar, ThemeUtils.primaryAccentColor());
         mProgressListener = new ProgressListener(progressBar);
 
         (mView.findViewById(R.id.cancelBtn)).setOnClickListener(this);

+ 7 - 20
src/main/java/com/owncloud/android/utils/ThemeUtils.java

@@ -179,17 +179,6 @@ public class ThemeUtils {
         return ColorUtils.HSLToColor(hsl);
     }
 
-    /**
-     * sets the coloring of the given progress bar to color_accent.
-     *
-     * @param progressBar the progress bar to be colored
-     */
-    public static void colorPreLollipopHorizontalProgressBar(ProgressBar progressBar) {
-        if (progressBar != null && Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
-            colorHorizontalProgressBar(progressBar, ThemeUtils.primaryAccentColor());
-        }
-    }
-
     /**
      * sets the tinting of the given ImageButton's icon to color_accent.
      *
@@ -219,15 +208,13 @@ public class ThemeUtils {
      *
      * @param seekBar the seek bar to be colored
      */
-    public static void colorPreLollipopHorizontalSeekBar(SeekBar seekBar) {
-        if (seekBar != null && Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
-            colorPreLollipopHorizontalProgressBar(seekBar);
-
-            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
-                int color = ThemeUtils.primaryAccentColor();
-                seekBar.getThumb().setColorFilter(color, PorterDuff.Mode.SRC_IN);
-                seekBar.getThumb().setColorFilter(color, PorterDuff.Mode.SRC_IN);
-            }
+    public static void colorHorizontalSeekBar(SeekBar seekBar) {
+        int color = ThemeUtils.primaryAccentColor();
+        colorHorizontalProgressBar(seekBar, color);
+
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
+            seekBar.getThumb().setColorFilter(color, PorterDuff.Mode.SRC_IN);
+            seekBar.getThumb().setColorFilter(color, PorterDuff.Mode.SRC_IN);
         }
     }
 

+ 1 - 0
src/main/res/layout/upload_list_group.xml

@@ -6,6 +6,7 @@
    <TextView
        android:id="@+id/uploadListGroupName"
        style="@style/TextAppearance.AppCompat.Body2"
+       android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:divider="@null"