mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 21:25:35 +03:00
Simplify extension
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
b2a8481124
commit
bdfa64ee2d
2 changed files with 7 additions and 0 deletions
|
@ -8,11 +8,17 @@
|
|||
package com.nextcloud.utils.extensions
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.graphics.Outline
|
||||
import android.util.TypedValue
|
||||
import android.view.View
|
||||
import android.view.ViewOutlineProvider
|
||||
|
||||
fun View.disableIf(condition: Boolean) {
|
||||
isEnabled = condition
|
||||
setBackgroundColor(if (condition) Color.TRANSPARENT else Color.GRAY)
|
||||
}
|
||||
|
||||
fun View.setVisibleIf(condition: Boolean) {
|
||||
visibility = if (condition) View.VISIBLE else View.GONE
|
||||
}
|
||||
|
|
|
@ -654,6 +654,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|||
holder.getOverflowMenu().setImageResource(R.drawable.ic_dots_vertical);
|
||||
}
|
||||
|
||||
// TODO make folder color gray and disable click event
|
||||
ViewExtensionsKt.setVisibleIf(holder.getOverflowMenu(),file.getRemoteId() != null);
|
||||
ViewExtensionsKt.setVisibleIf(holder.getShared(),file.getRemoteId() != null);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue