mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-31 06:15:48 +00:00
Clean paths (#425)
* Clean path display This removes slashes from end of directories in the label, and the start and end slash of the item headline. * Item icon alignment Change icon alignment to bottom, which makes the display look cleaner when there is no path.
This commit is contained in:
@@ -101,13 +101,12 @@ public abstract class EntryRecyclerAdapter extends RecyclerView.Adapter<EntryRec
|
|||||||
holder.name.setText(pass.toString());
|
holder.name.setText(pass.toString());
|
||||||
if (pass.getType() == PasswordItem.TYPE_CATEGORY) {
|
if (pass.getType() == PasswordItem.TYPE_CATEGORY) {
|
||||||
holder.typeImage.setImageResource(R.drawable.ic_folder_grey600_24dp);
|
holder.typeImage.setImageResource(R.drawable.ic_folder_grey600_24dp);
|
||||||
holder.name.setText(pass.toString() + "/");
|
|
||||||
} else {
|
} else {
|
||||||
holder.typeImage.setImageResource(R.drawable.ic_action_secure);
|
holder.typeImage.setImageResource(R.drawable.ic_action_secure);
|
||||||
holder.name.setText(pass.toString());
|
holder.name.setText(pass.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.type.setText(pass.getFullPathToParent());
|
holder.type.setText(pass.getFullPathToParent().replaceAll("(^/)|(/$)", ""));
|
||||||
|
|
||||||
holder.view.setOnClickListener(getOnClickListener(holder, pass));
|
holder.view.setOnClickListener(getOnClickListener(holder, pass));
|
||||||
|
|
||||||
|
@@ -14,46 +14,56 @@
|
|||||||
android:paddingRight="16dp"
|
android:paddingRight="16dp"
|
||||||
android:gravity="start">
|
android:gravity="start">
|
||||||
|
|
||||||
<ImageView
|
<LinearLayout
|
||||||
android:layout_width="40dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="32dp"
|
|
||||||
android:id="@+id/type_image"
|
|
||||||
android:src="@drawable/ic_folder_grey600_24dp"
|
|
||||||
android:contentDescription="@string/folder_icon_hint"
|
|
||||||
android:alpha="0.5"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:paddingRight="8dp"
|
|
||||||
android:paddingEnd="8dp"
|
|
||||||
tools:ignore="RtlSymmetry" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/type"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:ellipsize="start"
|
android:orientation="horizontal">
|
||||||
android:text="TYPE"
|
|
||||||
android:textSize="14sp"
|
<ImageView
|
||||||
android:textColor="@color/grey_500"
|
android:id="@+id/type_image"
|
||||||
android:layout_alignTop="@+id/type_image"
|
android:layout_width="80dp"
|
||||||
android:layout_toRightOf="@+id/type_image"
|
android:layout_height="32dp"
|
||||||
android:layout_toEndOf="@+id/type_image"
|
android:layout_gravity="bottom"
|
||||||
android:singleLine="true"
|
android:layout_weight="1"
|
||||||
tools:ignore="HardcodedText" />
|
android:alpha="0.5"
|
||||||
|
android:contentDescription="@string/folder_icon_hint"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
android:paddingRight="8dp"
|
||||||
|
android:src="@drawable/ic_folder_grey600_24dp"
|
||||||
|
tools:ignore="RtlSymmetry" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/type"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="start"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="TYPE"
|
||||||
|
android:textColor="@color/grey_500"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/label"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:text="FILE_NAME"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/label"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:text="FILE_NAME"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:layout_below="@+id/type"
|
|
||||||
android:layout_alignLeft="@+id/type"
|
|
||||||
android:layout_alignStart="@+id/type"
|
|
||||||
tools:ignore="HardcodedText" />
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
Reference in New Issue
Block a user