diff --git a/app/src/main/java/com/nextcloud/client/logger/ui/LogsActivity.kt b/app/src/main/java/com/nextcloud/client/logger/ui/LogsActivity.kt index 183b8fe00600..2bdd352884c3 100644 --- a/app/src/main/java/com/nextcloud/client/logger/ui/LogsActivity.kt +++ b/app/src/main/java/com/nextcloud/client/logger/ui/LogsActivity.kt @@ -34,6 +34,7 @@ import com.owncloud.android.R import com.owncloud.android.databinding.LogsActivityBinding import com.owncloud.android.ui.activity.ToolbarActivity import com.owncloud.android.utils.theme.ViewThemeUtils +import com.nmc.android.ui.utils.ProgressBarThemeUtils import javax.inject.Inject class LogsActivity : ToolbarActivity() { @@ -68,7 +69,8 @@ class LogsActivity : ToolbarActivity() { } findViewById(R.id.logs_loading_progress).apply { - viewThemeUtils.platform.themeHorizontalProgressBar(this) + //NMC Customization + ProgressBarThemeUtils.themeHorizontalProgressBar(this, resources.getColor(R.color.primary, null)) } logsAdapter = LogsAdapter(this) diff --git a/app/src/main/java/com/nmc/android/ui/utils/ProgressBarThemeUtils.kt b/app/src/main/java/com/nmc/android/ui/utils/ProgressBarThemeUtils.kt new file mode 100644 index 000000000000..ea274bb68c3a --- /dev/null +++ b/app/src/main/java/com/nmc/android/ui/utils/ProgressBarThemeUtils.kt @@ -0,0 +1,28 @@ +package com.nmc.android.ui.utils + +import android.widget.ProgressBar +import android.widget.SeekBar +import androidx.annotation.ColorInt +import androidx.core.graphics.BlendModeColorFilterCompat +import androidx.core.graphics.BlendModeCompat + +/** + * theming progress and seek bar for NMC + */ +object ProgressBarThemeUtils { + + @JvmStatic + fun themeHorizontalSeekBar(seekBar: SeekBar, @ColorInt color: Int) { + themeHorizontalProgressBar(seekBar, color) + seekBar.thumb.colorFilter = + BlendModeColorFilterCompat.createBlendModeColorFilterCompat(color, BlendModeCompat.SRC_IN) + } + + @JvmStatic + fun themeHorizontalProgressBar(progressBar: ProgressBar?, @ColorInt color: Int) { + progressBar?.indeterminateDrawable?.colorFilter = + BlendModeColorFilterCompat.createBlendModeColorFilterCompat(color, BlendModeCompat.SRC_IN) + progressBar?.progressDrawable?.colorFilter = + BlendModeColorFilterCompat.createBlendModeColorFilterCompat(color, BlendModeCompat.SRC_IN) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/owncloud/android/media/MediaControlView.java b/app/src/main/java/com/owncloud/android/media/MediaControlView.java index 5204050af3e3..2bdd2b03a1b0 100644 --- a/app/src/main/java/com/owncloud/android/media/MediaControlView.java +++ b/app/src/main/java/com/owncloud/android/media/MediaControlView.java @@ -36,6 +36,7 @@ import android.widget.SeekBar; import android.widget.SeekBar.OnSeekBarChangeListener; +import com.nmc.android.ui.utils.ProgressBarThemeUtils; import com.owncloud.android.MainApp; import com.owncloud.android.R; import com.owncloud.android.databinding.MediaControlBinding; @@ -109,7 +110,8 @@ private void initControllerView() { binding.rewindBtn.setOnClickListener(this); - viewThemeUtils.platform.themeHorizontalSeekBar(binding.progressBar); + //NMC Customization + ProgressBarThemeUtils.themeHorizontalSeekBar(binding.progressBar, getResources().getColor(R.color.primary, null)); binding.progressBar.setOnSeekBarChangeListener(this); binding.progressBar.setMax(1000); } diff --git a/app/src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java b/app/src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java index 1b1763ce01e8..dd195fb2681d 100755 --- a/app/src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java +++ b/app/src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java @@ -46,6 +46,7 @@ import com.nextcloud.client.jobs.FilesUploadWorker; import com.nextcloud.client.network.ConnectivityService; import com.nextcloud.java.util.Optional; +import com.nmc.android.ui.utils.ProgressBarThemeUtils; import com.owncloud.android.MainApp; import com.owncloud.android.R; import com.owncloud.android.databinding.UploadListHeaderBinding; @@ -267,7 +268,9 @@ public void onBindViewHolder(SectionedViewHolder holder, int section, int relati String status = getStatusText(item); switch (item.getUploadStatus()) { case UPLOAD_IN_PROGRESS -> { - viewThemeUtils.platform.themeHorizontalProgressBar(itemViewHolder.binding.uploadProgressBar); + // NMC Customization + ProgressBarThemeUtils.themeHorizontalProgressBar(itemViewHolder.binding.uploadProgressBar, + holder.itemView.getContext().getResources().getColor(R.color.primary, null)); itemViewHolder.binding.uploadProgressBar.setProgress(0); itemViewHolder.binding.uploadProgressBar.setVisibility(View.VISIBLE); FileUploader.FileUploaderBinder binder = parentActivity.getFileUploaderBinder(); diff --git a/app/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java b/app/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java index db1f3e2c0497..9cbd55d74bb2 100644 --- a/app/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/app/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java @@ -75,6 +75,7 @@ import com.owncloud.android.utils.DisplayUtils; import com.owncloud.android.utils.EncryptionUtils; import com.owncloud.android.utils.MimeTypeUtil; +import com.nmc.android.ui.utils.ProgressBarThemeUtils; import com.owncloud.android.utils.theme.ViewThemeUtils; import org.greenrobot.eventbus.EventBus; @@ -262,7 +263,8 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { if (getFile() != null && user != null) { - viewThemeUtils.platform.themeHorizontalProgressBar(binding.progressBar); + //NMC Customization + ProgressBarThemeUtils.themeHorizontalProgressBar(binding.progressBar, getResources().getColor(R.color.primary, null)); progressListener = new ProgressListener(binding.progressBar); binding.cancelBtn.setOnClickListener(this); binding.favorite.setOnClickListener(this); diff --git a/app/src/main/java/com/owncloud/android/ui/preview/FileDownloadFragment.java b/app/src/main/java/com/owncloud/android/ui/preview/FileDownloadFragment.java index 37272639fcd9..3c41daf4a839 100644 --- a/app/src/main/java/com/owncloud/android/ui/preview/FileDownloadFragment.java +++ b/app/src/main/java/com/owncloud/android/ui/preview/FileDownloadFragment.java @@ -30,6 +30,7 @@ import com.nextcloud.client.account.User; import com.nextcloud.client.di.Injectable; import com.nextcloud.utils.extensions.BundleExtensionsKt; +import com.nmc.android.ui.utils.ProgressBarThemeUtils; import com.owncloud.android.R; import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.lib.common.network.OnDatatransferProgressListener; @@ -144,7 +145,8 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, mView = inflater.inflate(R.layout.file_download_fragment, container, false); ProgressBar progressBar = mView.findViewById(R.id.progressBar); - viewThemeUtils.platform.themeHorizontalProgressBar(progressBar); + //NMC Customization + ProgressBarThemeUtils.themeHorizontalProgressBar(progressBar, getResources().getColor(R.color.primary, null)); mProgressListener = new ProgressListener(progressBar); (mView.findViewById(R.id.cancelBtn)).setOnClickListener(this);