Small layout improvement

This commit is contained in:
M66B 2019-04-25 19:34:10 +02:00
parent 67fb4a0e72
commit d1b9345cf5
2 changed files with 15 additions and 3 deletions

View File

@ -101,6 +101,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
private ImageView ivSync; private ImageView ivSync;
private TextView tvKeywords; private TextView tvKeywords;
private TextView tvError; private TextView tvError;
private View vwHidden;
private View vwRipple; private View vwRipple;
private RecyclerView rvChilds; private RecyclerView rvChilds;
@ -133,6 +134,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
ivSync = itemView.findViewById(R.id.ivSync); ivSync = itemView.findViewById(R.id.ivSync);
tvKeywords = itemView.findViewById(R.id.tvKeywords); tvKeywords = itemView.findViewById(R.id.tvKeywords);
tvError = itemView.findViewById(R.id.tvError); tvError = itemView.findViewById(R.id.tvError);
vwHidden = itemView.findViewById(R.id.vwHidden);
vwRipple = itemView.findViewById(R.id.vwRipple); vwRipple = itemView.findViewById(R.id.vwRipple);
rvChilds = itemView.findViewById(R.id.rvChilds); rvChilds = itemView.findViewById(R.id.rvChilds);
@ -184,10 +186,9 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
} }
private void bindTo(final TupleFolderEx folder) { private void bindTo(final TupleFolderEx folder) {
boolean hide = folder.isHidden(context); view.setVisibility(folder.isHidden(context) && !show_hidden ? View.GONE : View.VISIBLE);
view.setVisibility(hide && !show_hidden ? View.GONE : View.VISIBLE);
view.setActivated(folder.tbc != null || folder.tbd != null); view.setActivated(folder.tbc != null || folder.tbd != null);
view.setAlpha(hide ? Helper.LOW_LIGHT : 1.0f); vwHidden.setAlpha(folder.hide ? Helper.LOW_LIGHT : 0.0f);
if (textSize != 0) if (textSize != 0)
tvName.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize); tvName.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);

View File

@ -197,6 +197,17 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvError" /> app:layout_constraintTop_toBottomOf="@id/tvError" />
<View
android:id="@+id/vwHidden"
android:layout_width="0dp"
android:layout_height="0dp"
android:alpha="0"
android:background="?android:colorBackground"
app:layout_constraintBottom_toBottomOf="@id/paddingBottom"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View <View
android:id="@+id/vwRipple" android:id="@+id/vwRipple"
android:layout_width="0dp" android:layout_width="0dp"