Add vCard attachment preview

This commit is contained in:
Naveen 2022-08-29 03:19:50 +05:30
parent d874e16024
commit f07abeb54c
58 changed files with 1263 additions and 117 deletions

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/main_app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/vcard_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/color_primary"
app:menu="@menu/menu_vcard"
app:title="@string/contact_info"
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
</com.google.android.material.appbar.AppBarLayout>
<com.simplemobiletools.commons.views.MyRecyclerView
android:id="@+id/contacts_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:overScrollMode="ifContentScrolls"
android:scrollbars="none"
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
</androidx.appcompat.widget.LinearLayoutCompat>

View file

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/section_holder_stroke"
android:orientation="vertical"
android:padding="@dimen/normal_margin">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/vcard_photo"
android:layout_width="@dimen/normal_icon_size"
android:layout_height="@dimen/normal_icon_size"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@color/md_red" />
<TextView
android:id="@+id/vcard_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/normal_margin"
android:textSize="@dimen/big_text_size"
app:layout_constraintStart_toEndOf="@id/vcard_photo"
app:layout_constraintTop_toTopOf="parent"
tools:text="Bob" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/vcard_subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/normal_margin"
android:textSize="@dimen/normal_text_size"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/vcard_view_contact"
app:layout_constraintStart_toEndOf="@id/vcard_photo"
app:layout_constraintTop_toBottomOf="@id/vcard_title"
tools:text="and 6 others"
tools:visibility="visible" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/vcard_view_contact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/normal_margin"
android:layout_marginTop="@dimen/small_margin"
android:textSize="@dimen/smaller_text_size"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/vcard_photo"
app:layout_constraintTop_toBottomOf="@id/vcard_subtitle"
tools:text="View contact" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_contact_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:foreground="@drawable/selector">
<RelativeLayout
android:id="@+id/item_contact_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/min_row_height"
android:paddingStart="@dimen/tiny_margin"
android:paddingTop="@dimen/medium_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/medium_margin">
<ImageView
android:id="@+id/item_contact_image"
android:layout_width="@dimen/normal_icon_size"
android:layout_height="@dimen/normal_icon_size"
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/small_margin"
android:padding="@dimen/tiny_margin"
android:src="@drawable/ic_person_vector" />
<TextView
android:id="@+id/item_contact_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/expand_collapse_icon"
android:layout_toEndOf="@+id/item_contact_image"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:paddingStart="@dimen/medium_margin"
android:paddingEnd="@dimen/activity_margin"
android:textSize="@dimen/big_text_size"
tools:text="John Doe" />
<ImageView
android:id="@+id/expand_collapse_icon"
android:layout_width="@dimen/normal_icon_size"
android:layout_height="@dimen/normal_icon_size"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/small_margin"
android:padding="@dimen/medium_margin"
android:src="@drawable/ic_expand_down"
android:visibility="visible" />
</RelativeLayout>
</FrameLayout>

View file

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_vcard_property_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:foreground="@drawable/selector">
<RelativeLayout
android:id="@+id/item_vcard_property_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/min_row_height"
android:paddingStart="@dimen/tiny_margin"
android:paddingTop="@dimen/medium_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/medium_margin">
<TextView
android:id="@+id/item_vcard_property_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/vcard_property_start_margin"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:textSize="@dimen/big_text_size"
tools:text="John Doe" />
<TextView
android:id="@+id/item_vcard_property_subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/item_vcard_property_title"
android:layout_alignStart="@+id/item_vcard_property_title"
android:alpha="0.6"
android:gravity="center_vertical"
android:maxLines="1"
android:textSize="@dimen/normal_text_size"
tools:text="0123 456 789" />
</RelativeLayout>
</FrameLayout>