Initial implementation of donations
This commit is contained in:
32
mastodon/src/main/res/layout/donation_banner.xml
Normal file
32
mastodon/src/main/res/layout/donation_banner.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="12dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@drawable/bg_donation_banner">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/banner_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textAppearance="@style/m3_body_medium"
|
||||
android:textColor="@color/masterialDark_onSecondaryContainer"
|
||||
tools:text="Donation banner text goes here"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/banner_dismiss"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:background="?android:actionBarItemBackground"
|
||||
android:tint="@color/masterialDark_onSecondaryContainer"
|
||||
android:backgroundTint="@color/masterialDark_onSecondaryContainer"
|
||||
android:src="@drawable/ic_baseline_close_24"
|
||||
android:contentDescription="@string/dismiss"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -58,5 +58,12 @@
|
||||
android:text="@string/see_new_posts"/>
|
||||
</FrameLayout>
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/donation_banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout="@layout/donation_banner"/>
|
||||
|
||||
</FrameLayout>
|
||||
</me.grishka.appkit.views.RecursiveSwipeRefreshLayout>
|
||||
114
mastodon/src/main/res/layout/sheet_donation.xml
Normal file
114
mastodon/src/main/res/layout/sheet_donation.xml
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.joinmastodon.android.ui.views.CustomScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_bottom_sheet"
|
||||
android:outlineProvider="background"
|
||||
android:elevation="1dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingHorizontal="16dp">
|
||||
|
||||
<View
|
||||
android:id="@+id/handle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@drawable/bg_bottom_sheet_handle"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/m3_body_large"
|
||||
android:textColor="?colorM3OnSurfaceVariant"
|
||||
tools:text="By supporting Mastodon, you help sustain a global network that values people over profit. Will you join us today?"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/tabbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tabbar_inner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center"
|
||||
style="@style/Widget.Mastodon.M3.SegmentedButtonContainer">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/once"
|
||||
style="@style/Widget.Mastodon.M3.SegmentedButton">
|
||||
<org.joinmastodon.android.ui.views.CheckIconSelectableTextView
|
||||
style="@style/Widget.Mastodon.M3.SegmentedButtonText"
|
||||
android:text="@string/donation_once"/>
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/monthly"
|
||||
style="@style/Widget.Mastodon.M3.SegmentedButton">
|
||||
<TextView
|
||||
style="@style/Widget.Mastodon.M3.SegmentedButtonText"
|
||||
android:drawableStart="@drawable/ic_donation_monthly"
|
||||
android:drawableTint="?colorM3OnSurface"
|
||||
android:text="@string/donation_monthly"/>
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/yearly"
|
||||
style="@style/Widget.Mastodon.M3.SegmentedButton">
|
||||
<org.joinmastodon.android.ui.views.CheckIconSelectableTextView
|
||||
style="@style/Widget.Mastodon.M3.SegmentedButtonText"
|
||||
android:text="@string/donation_yearly"/>
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<org.joinmastodon.android.ui.views.CurrencyAmountInput
|
||||
android:id="@+id/amount"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginTop="16dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/suggested_amounts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="32dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="8dp"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="28dp"
|
||||
style="@style/Widget.Mastodon.M3.Button.Filled">
|
||||
<TextView
|
||||
android:id="@+id/button_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:drawableStart="@drawable/ic_volunteer_activism_20px"
|
||||
style="@style/Widget.Mastodon.M3.Button.Filled"
|
||||
android:background="@null"
|
||||
android:padding="0dp"
|
||||
android:drawablePadding="8dp"
|
||||
android:drawableTint="@color/button_text_m3_filled"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:duplicateParentState="true"
|
||||
tools:text="Donate"/>
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</org.joinmastodon.android.ui.views.CustomScrollView>
|
||||
Reference in New Issue
Block a user