import java.util.Locale;
import com.owncloud.android.R;
+import com.owncloud.android.utils.DisplayUtils;
/**
if (mProgress != null) {
if (mProgress instanceof SeekBar) {
SeekBar seeker = (SeekBar) mProgress;
+ DisplayUtils.colorPreLollipopHorizontalSeekBar(seeker);
seeker.setOnSeekBarChangeListener(this);
+ } else {
+ DisplayUtils.colorPreLollipopHorizontalProgressBar(mProgress);
}
mProgress.setMax(1000);
}
import com.owncloud.android.lib.common.network.OnDatatransferProgressListener;
import com.owncloud.android.lib.common.utils.Log_OC;
+import com.owncloud.android.utils.DisplayUtils;
/**
mIgnoreFirstSavedState = false;
}
}
-
- View view = null;
- view = inflater.inflate(R.layout.file_download_fragment, container, false);
- mView = view;
+
+ mView = inflater.inflate(R.layout.file_download_fragment, container, false);
ProgressBar progressBar = (ProgressBar)mView.findViewById(R.id.progressBar);
+ DisplayUtils.colorPreLollipopHorizontalProgressBar(progressBar);
mProgressListener = new ProgressListener(progressBar);
(mView.findViewById(R.id.cancelBtn)).setOnClickListener(this);
setButtonsForTransferring();
}
- return view;
+ return mView;
}
import android.annotation.TargetApi;\r
import android.app.Activity;\r
import android.content.Context;\r
+import android.graphics.Color;\r
import android.graphics.Point;\r
+import android.graphics.PorterDuff;\r
import android.os.Build;\r
import android.text.format.DateUtils;\r
import android.view.Display;\r
import android.webkit.MimeTypeMap;\r
+import android.widget.ProgressBar;\r
+import android.widget.SeekBar;\r
\r
import com.owncloud.android.MainApp;\r
import com.owncloud.android.R;\r
return size;\r
}\r
\r
+ /**\r
+ * sets the coloring of the given progress bar to color_accent.\r
+ *\r
+ * @param progressBar the progress bar to be colored\r
+ */\r
+ public static void colorPreLollipopHorizontalProgressBar(ProgressBar progressBar) {\r
+ if (progressBar != null && Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {\r
+ int color = progressBar.getResources().getColor(R.color.color_accent);\r
+ progressBar.getIndeterminateDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN);\r
+ progressBar.getProgressDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * sets the coloring of the given seek bar to color_accent.\r
+ *\r
+ * @param seekBar the seek bar to be colored\r
+ */\r
+ public static void colorPreLollipopHorizontalSeekBar(SeekBar seekBar) {\r
+ if (seekBar != null && Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {\r
+ colorPreLollipopHorizontalProgressBar(seekBar);\r
+\r
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {\r
+ int color = seekBar.getResources().getColor(R.color.color_accent);\r
+ seekBar.getThumb().setColorFilter(color, PorterDuff.Mode.SRC_IN);\r
+ seekBar.getThumb().setColorFilter(color, PorterDuff.Mode.SRC_IN);\r
+ }\r
+ }\r
+ }\r
}\r