import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
+import android.widget.LinearLayout;
import android.widget.TextView;
import net.ktnx.mobileledger.R;
}
return false;
};
- holder.mRearrangeHandle.setOnTouchListener(dragStarter);
- holder.mColorTag.setOnTouchListener(dragStarter);
+
+ holder.tagAndHandleLayout.setOnTouchListener(dragStarter);
return holder;
}
@Override
holder.mEditButton.setVisibility(View.VISIBLE);
}
else {
- holder.mRearrangeHandle.setVisibility(View.GONE);
+ holder.mRearrangeHandle.setVisibility(View.INVISIBLE);
holder.mEditButton.setVisibility(View.GONE);
}
}
class ProfileListViewHolder extends RecyclerView.ViewHolder {
final TextView mEditButton;
final TextView mTitle, mColorTag;
+ final LinearLayout tagAndHandleLayout;
final ImageView mRearrangeHandle;
ProfileListViewHolder(View view) {
mTitle = view.findViewById(R.id.title);
mColorTag = view.findViewById(R.id.colorTag);
mRearrangeHandle = view.findViewById(R.id.profile_list_rearrange_handle);
+ tagAndHandleLayout = view.findViewById(R.id.handle_and_tag);
}
}
}
android:layout_gravity="center_horizontal"
android:foregroundGravity="center_vertical">
- <TextView
- android:id="@+id/colorTag"
- android:layout_width="16dp"
- android:layout_height="0dp"
- android:layout_marginStart="40dp"
- android:layout_marginTop="4dp"
- android:layout_marginBottom="4dp"
- android:background="?colorPrimary"
- app:layout_constraintBottom_toBottomOf="parent"
+ <LinearLayout
+ android:id="@+id/handle_and_tag"
+ android:layout_width="56dp"
+ android:layout_height="match_parent"
+ android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent" />
+ app:layout_constraintTop_toTopOf="parent">
+
+ <ImageView
+ android:id="@+id/profile_list_rearrange_handle"
+ android:layout_width="40dp"
+ android:layout_height="match_parent"
+ android:layout_margin="8dp"
+ android:layout_weight="9"
+ android:background="@drawable/ic_unfold_more_black_24dp"
+ android:contentDescription="@string/profile_list_rearrange_handle_label"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <TextView
+ android:id="@+id/colorTag"
+ android:layout_width="16dp"
+ android:layout_height="match_parent"
+ android:layout_marginTop="6dp"
+ android:layout_marginBottom="6dp"
+ android:background="?colorPrimary" />
+ </LinearLayout>
<TextView
android:id="@+id/profile_list_edit_button"
android:layout_weight="9"
android:drawableStart="@drawable/ic_mode_edit_black_24dp"
android:padding="8dp"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintTop_toTopOf="parent"
- android:visibility="invisible"/>
-
- <ImageView
- android:id="@+id/profile_list_rearrange_handle"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:layout_weight="9"
- android:background="@drawable/ic_unfold_more_black_24dp"
- android:contentDescription="@string/profile_list_rearrange_handle_label"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:text="Profile name"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/profile_list_edit_button"
- app:layout_constraintStart_toEndOf="@id/colorTag"
+ app:layout_constraintStart_toEndOf="@id/handle_and_tag"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />