mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 22:03:55 +01:00
Add nearby custom card view class
This commit is contained in:
parent
5f91d7de0c
commit
730dabd61c
6 changed files with 154 additions and 1 deletions
86
app/src/main/res/layout/nearby_card_view.xml
Normal file
86
app/src/main/res/layout/nearby_card_view.xml
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
<RelativeLayout 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"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?attr/mainCardBackround"
|
||||
android:layout_centerVertical="true"
|
||||
android:minHeight="72dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/nearby_icon"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:contentDescription="@string/no_image_found"
|
||||
android:visibility="gone"
|
||||
android:scaleType="centerCrop"
|
||||
app:srcCompat="@drawable/ic_location_white_24dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:orientation="horizontal"
|
||||
android:layout_toRightOf="@id/nearby_icon"
|
||||
android:weightSum="4"
|
||||
>
|
||||
|
||||
<TextSwitcher
|
||||
android:id="@+id/nearby_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
android:layout_toRightOf="@id/nearby_icon"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
tools:text="test distance">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/white"
|
||||
android:singleLine="true"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/white"
|
||||
android:singleLine="true"
|
||||
/>
|
||||
</TextSwitcher>
|
||||
|
||||
<TextSwitcher
|
||||
android:id="@+id/nearby_distance"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:minWidth="48dp"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
|
||||
tools:text="test distance">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/white"
|
||||
android:singleLine="true"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/white"
|
||||
android:singleLine="true"
|
||||
/>
|
||||
</TextSwitcher>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
Loading…
Add table
Add a link
Reference in a new issue