QR codes for profiles
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/profile_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
@@ -291,8 +292,9 @@
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/profile_action_btn_wrap"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<org.joinmastodon.android.ui.views.ProgressBarButton
|
||||
android:id="@+id/profile_action_btn"
|
||||
@@ -314,6 +316,20 @@
|
||||
android:outlineProvider="none"
|
||||
android:visibility="gone" />
|
||||
</FrameLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/qr_code"
|
||||
android:layout_width="36.67dp"
|
||||
android:layout_height="36.67dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
style="@style/Widget.Mastodon.M3.Button.Outlined"
|
||||
android:tint="?colorM3OnSurfaceVariant"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="1.67dp"
|
||||
android:contentDescription="@string/qr_code"
|
||||
android:scaleType="centerCrop"
|
||||
android:padding="9dp"
|
||||
android:src="@drawable/ic_qr_code_20px"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
132
mastodon/src/main/res/layout/fragment_profile_qr.xml
Normal file
132
mastodon/src/main/res/layout/fragment_profile_qr.xml
Normal file
@@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipChildren="false">
|
||||
|
||||
<include layout="@layout/profile_qr_toolbar" />
|
||||
|
||||
<view class="org.joinmastodon.android.fragments.ProfileQrCodeFragment$CustomizedLinearLayout"
|
||||
android:id="@+id/particle_animation_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<org.joinmastodon.android.ui.views.FixedAspectRatioFrameLayout
|
||||
android:id="@+id/corner_animation_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:aspectRatio="1">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/code_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="40dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="17dp"
|
||||
android:background="@drawable/rect_24dp"
|
||||
android:backgroundTint="?colorM3Primary">
|
||||
<View
|
||||
android:id="@+id/code"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"/>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<me.grishka.appkit.views.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
app:cornerRadius="10dp"
|
||||
android:importantForAccessibility="no"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/username"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginHorizontal="4dp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="@style/m3_body_medium"
|
||||
android:textColor="?colorM3OnPrimary"
|
||||
android:alpha="0.7"
|
||||
tools:text="Gargron"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/domain"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:alpha="0.7"
|
||||
android:textAppearance="@style/m3_label_small"
|
||||
android:textColor="?colorM3Primary"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:background="@drawable/rect_4dp"
|
||||
android:backgroundTint="?colorM3OnPrimary"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
tools:text="mastodon.social"/>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</org.joinmastodon.android.ui.views.FixedAspectRatioFrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/share_btn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_weight="1"
|
||||
style="@style/Widget.Mastodon.M3.Button.Filled">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:drawableStart="@drawable/ic_share_20px"
|
||||
style="@style/Widget.Mastodon.M3.Button.Filled"
|
||||
android:background="@null"
|
||||
android:padding="0dp"
|
||||
android:drawablePadding="7dp"
|
||||
android:drawableTint="?colorM3OnPrimary"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:text="@string/share_user"/>
|
||||
</FrameLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/save_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:drawableStart="@drawable/ic_download_20px"
|
||||
android:drawablePadding="7dp"
|
||||
android:drawableTint="?colorM3OnPrimary"
|
||||
style="@style/Widget.Mastodon.M3.Button.Filled"
|
||||
android:text="@string/save"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</view>
|
||||
|
||||
</LinearLayout>
|
||||
7
mastodon/src/main/res/layout/profile_qr_toolbar.xml
Normal file
7
mastodon/src/main/res/layout/profile_qr_toolbar.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/actionBarSize"
|
||||
tools:showIn="@layout/fragment_profile_qr" />
|
||||
Reference in New Issue
Block a user