mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-01-31 10:11:38 -05:00
[app] Wrap repo items in a card
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
android:layout_marginHorizontal="8dp"
|
||||
android:layout_marginVertical="4dp"
|
||||
android:descendantFocusability="blocksDescendants">
|
||||
<!--
|
||||
descendantFocusability is here because if you have a child that responds
|
||||
to touch events (in our case, the switch/toggle button) then the list item
|
||||
@@ -15,72 +13,82 @@
|
||||
http://syedasaraahmed.wordpress.com/2012/10/03/android-onitemclicklistener-not-responding-clickable-rowitem-of-custom-listview/
|
||||
-->
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/repo_icon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:scaleType="fitCenter"
|
||||
tools:src="@tools:sample/avatars" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="RtlSymmetry">
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repo_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="marquee"
|
||||
android:gravity="center_vertical|start"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?attr/textAppearanceListItem"
|
||||
tools:text="This is the name of the Repo as taken from the index. It can be long." />
|
||||
<ImageView
|
||||
android:id="@+id/repo_icon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:scaleType="fitCenter"
|
||||
tools:src="@tools:sample/avatars" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repo_address"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical|start"
|
||||
android:singleLine="true"
|
||||
android:textSize="14sp"
|
||||
tools:text="this.is.a.repo.at.the.official.domain.it.can.be.long.at.f-droid.org" />
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="RtlSymmetry">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repo_unverified"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical|start"
|
||||
android:singleLine="true"
|
||||
android:text="@string/unverified"
|
||||
android:textColor="@color/unverified"
|
||||
android:textSize="14sp"
|
||||
tools:visibility="visible" />
|
||||
<TextView
|
||||
android:id="@+id/repo_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="marquee"
|
||||
android:gravity="center_vertical|start"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?attr/textAppearanceListItem"
|
||||
tools:text="This is the name of the Repo as taken from the index. It can be long." />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repo_unsigned"
|
||||
<TextView
|
||||
android:id="@+id/repo_address"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical|start"
|
||||
android:singleLine="true"
|
||||
android:textSize="14sp"
|
||||
tools:text="this.is.a.repo.at.the.official.domain.it.can.be.long.at.f-droid.org" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repo_unverified"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical|start"
|
||||
android:singleLine="true"
|
||||
android:text="@string/unverified"
|
||||
android:textColor="@color/unverified"
|
||||
android:textSize="14sp"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repo_unsigned"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical|start"
|
||||
android:singleLine="true"
|
||||
android:text="@string/unsigned"
|
||||
android:textColor="@color/unsigned"
|
||||
android:textSize="14sp"
|
||||
tools:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/repo_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical|start"
|
||||
android:singleLine="true"
|
||||
android:text="@string/unsigned"
|
||||
android:textColor="@color/unsigned"
|
||||
android:textSize="14sp"
|
||||
tools:visibility="gone" />
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/repo_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
Reference in New Issue
Block a user