From c657461e6fc2c2c9742fddd62f0acc0aa882a95b Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Wed, 14 Sep 2022 20:44:40 +0200 Subject: [PATCH] theme quick sharing bottom sheet icons Signed-off-by: Andy Scherzinger --- .../adapter/QuickSharingPermissionsAdapter.kt | 10 +++++--- ...ckSharingPermissionsBottomSheetDialog.java | 24 +++++++++++-------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/ui/adapter/QuickSharingPermissionsAdapter.kt b/app/src/main/java/com/owncloud/android/ui/adapter/QuickSharingPermissionsAdapter.kt index 36e54ee8ae..f415d5cb2f 100644 --- a/app/src/main/java/com/owncloud/android/ui/adapter/QuickSharingPermissionsAdapter.kt +++ b/app/src/main/java/com/owncloud/android/ui/adapter/QuickSharingPermissionsAdapter.kt @@ -27,15 +27,17 @@ import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.owncloud.android.databinding.ItemQuickSharePermissionsBinding import com.owncloud.android.datamodel.QuickPermissionModel +import com.owncloud.android.utils.theme.newm3.ViewThemeUtils class QuickSharingPermissionsAdapter( private val quickPermissionList: MutableList, - private val onPermissionChangeListener: QuickSharingPermissionViewHolder.OnPermissionChangeListener + private val onPermissionChangeListener: QuickSharingPermissionViewHolder.OnPermissionChangeListener, + private val viewThemeUtils: ViewThemeUtils ) : RecyclerView.Adapter() { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { val binding = ItemQuickSharePermissionsBinding.inflate(LayoutInflater.from(parent.context), parent, false) - return QuickSharingPermissionViewHolder(binding, binding.root, onPermissionChangeListener) + return QuickSharingPermissionViewHolder(binding, binding.root, onPermissionChangeListener, viewThemeUtils) } override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { @@ -51,7 +53,8 @@ class QuickSharingPermissionsAdapter( class QuickSharingPermissionViewHolder( val binding: ItemQuickSharePermissionsBinding, itemView: View, - val onPermissionChangeListener: OnPermissionChangeListener + val onPermissionChangeListener: OnPermissionChangeListener, + private val viewThemeUtils: ViewThemeUtils ) : RecyclerView .ViewHolder(itemView) { @@ -59,6 +62,7 @@ class QuickSharingPermissionsAdapter( fun bindData(quickPermissionModel: QuickPermissionModel) { binding.tvQuickShareName.text = quickPermissionModel.permissionName if (quickPermissionModel.isSelected) { + viewThemeUtils.platform.colorImageView(binding.tvQuickShareCheckIcon) binding.tvQuickShareCheckIcon.visibility = View.VISIBLE } else { binding.tvQuickShareCheckIcon.visibility = View.INVISIBLE diff --git a/app/src/main/java/com/owncloud/android/ui/fragment/QuickSharingPermissionsBottomSheetDialog.java b/app/src/main/java/com/owncloud/android/ui/fragment/QuickSharingPermissionsBottomSheetDialog.java index 3b689feee4..bd7ebf9e9d 100644 --- a/app/src/main/java/com/owncloud/android/ui/fragment/QuickSharingPermissionsBottomSheetDialog.java +++ b/app/src/main/java/com/owncloud/android/ui/fragment/QuickSharingPermissionsBottomSheetDialog.java @@ -88,17 +88,21 @@ public class QuickSharingPermissionsBottomSheetDialog extends BottomSheetDialog private void setUpRecyclerView() { List quickPermissionModelList = getQuickPermissionList(); - QuickSharingPermissionsAdapter adapter = new QuickSharingPermissionsAdapter(quickPermissionModelList, new QuickSharingPermissionsAdapter.QuickSharingPermissionViewHolder.OnPermissionChangeListener() { - @Override - public void onPermissionChanged(int position) { - handlePermissionChanged(quickPermissionModelList, position); - } + QuickSharingPermissionsAdapter adapter = new QuickSharingPermissionsAdapter( + quickPermissionModelList, + new QuickSharingPermissionsAdapter.QuickSharingPermissionViewHolder.OnPermissionChangeListener() { + @Override + public void onPermissionChanged(int position) { + handlePermissionChanged(quickPermissionModelList, position); + } - @Override - public void onDismissSheet() { - dismiss(); - } - }); + @Override + public void onDismissSheet() { + dismiss(); + } + }, + viewThemeUtils + ); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(fileActivity); binding.rvQuickSharePermissions.setLayoutManager(linearLayoutManager); binding.rvQuickSharePermissions.setAdapter(adapter);