mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 05:35:39 +03:00
theme quick sharing bottom sheet icons
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
b181336c6d
commit
c657461e6f
2 changed files with 21 additions and 13 deletions
|
@ -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<QuickPermissionModel>,
|
||||
private val onPermissionChangeListener: QuickSharingPermissionViewHolder.OnPermissionChangeListener
|
||||
private val onPermissionChangeListener: QuickSharingPermissionViewHolder.OnPermissionChangeListener,
|
||||
private val viewThemeUtils: ViewThemeUtils
|
||||
) :
|
||||
RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
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
|
||||
|
|
|
@ -88,7 +88,9 @@ public class QuickSharingPermissionsBottomSheetDialog extends BottomSheetDialog
|
|||
|
||||
private void setUpRecyclerView() {
|
||||
List<QuickPermissionModel> quickPermissionModelList = getQuickPermissionList();
|
||||
QuickSharingPermissionsAdapter adapter = new QuickSharingPermissionsAdapter(quickPermissionModelList, new QuickSharingPermissionsAdapter.QuickSharingPermissionViewHolder.OnPermissionChangeListener() {
|
||||
QuickSharingPermissionsAdapter adapter = new QuickSharingPermissionsAdapter(
|
||||
quickPermissionModelList,
|
||||
new QuickSharingPermissionsAdapter.QuickSharingPermissionViewHolder.OnPermissionChangeListener() {
|
||||
@Override
|
||||
public void onPermissionChanged(int position) {
|
||||
handlePermissionChanged(quickPermissionModelList, position);
|
||||
|
@ -98,7 +100,9 @@ public class QuickSharingPermissionsBottomSheetDialog extends BottomSheetDialog
|
|||
public void onDismissSheet() {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
},
|
||||
viewThemeUtils
|
||||
);
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(fileActivity);
|
||||
binding.rvQuickSharePermissions.setLayoutManager(linearLayoutManager);
|
||||
binding.rvQuickSharePermissions.setAdapter(adapter);
|
||||
|
|
Loading…
Reference in a new issue