
Almost all of the nearby/swap view classes could be condensed into a single base class that is instantiated in the view XML. This is the first step towards making that happen. It also lays the groundwork where "steps" are all SwapViews. The original concept of "steps" put all steps together, whether F-Droid could control them or not. For example, the Views were mixed with the system Bluetooth prompts. This is the first step towards converting the steps to always be SwapViews, which are always under control of this app. When coming back to a SwapView/step, it does not seem feasible to handle automatically restarting things like permissions and Bluetooth prompts. If there is a way, it should be possible to first load the proper SwapView instance, then trigger the system prompt. The makes the SwapView a pure View, without any Controller in it.
80 lines
3.2 KiB
XML
80 lines
3.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<org.fdroid.fdroid.views.swap.ConfirmReceiveView
|
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
xmlns:tools="http://schemas.android.com/tools"
|
|
xmlns:swap="http://schemas.android.com/apk/res-auto"
|
|
swap:toolbarTitle="@string/swap_confirm"
|
|
android:orientation="vertical"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:background="@color/swap_blue"
|
|
android:padding="18dp">
|
|
<!-- Padding is 32px * 0.56 = 18dip -->
|
|
|
|
<ImageView
|
|
android:id="@+id/icon"
|
|
android:src="@drawable/ic_launcher"
|
|
android:contentDescription="@string/icon"
|
|
android:layout_alignParentTop="true"
|
|
android:layout_width="117.6dp"
|
|
android:layout_height="117.6dp"
|
|
android:layout_centerHorizontal="true"/>
|
|
<!-- 210 * 0.56 = 117.6 -->
|
|
|
|
<TextView
|
|
android:id="@+id/text_title"
|
|
android:text="@string/swap_welcome"
|
|
style="@style/SwapTheme.Wizard.ReceiveSwap.MainText"
|
|
android:layout_below="@id/icon"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:textSize="28sp"
|
|
android:lines="1"/>
|
|
<!-- 60 * 0.56 = 33.6 -->
|
|
<!-- Temporarily making it smaller than 33.6 until we figure out how to
|
|
prevent line breaks on the hyphen in F-Droid. -->
|
|
|
|
<TextView
|
|
android:id="@+id/text_description"
|
|
tools:text="@string/swap_confirm_connect"
|
|
style="@style/SwapTheme.Wizard.Text"
|
|
android:layout_below="@id/text_title"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:textSize="25.75sp"/>
|
|
<!-- 46px * 0.56 = 25.76sp -->
|
|
|
|
<LinearLayout
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal"
|
|
android:layout_below="@+id/text_description"
|
|
android:layout_centerInParent="true"
|
|
android:layout_marginTop="45dp">
|
|
<!-- 80px * 0.56 = 45dp -->
|
|
|
|
<!-- TODO: Remove associated style files style="@style/SwapTheme.Wizard.ReceiveSwap.Deny"-->
|
|
<Button
|
|
android:id="@+id/no_button"
|
|
android:text="@string/no"
|
|
android:backgroundTint="@color/swap_deny"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginEnd="25dp"
|
|
android:layout_marginRight="25dp"
|
|
tools:ignore="UnusedAttribute"/>
|
|
|
|
<!-- TODO: Remove associated style files style="@style/SwapTheme.Wizard.ReceiveSwap.Confirm" -->
|
|
<Button
|
|
android:id="@+id/yes_button"
|
|
android:text="@string/yes"
|
|
android:backgroundTint="@color/swap_light_blue"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
tools:ignore="UnusedAttribute"/>
|
|
|
|
</LinearLayout>
|
|
|
|
</org.fdroid.fdroid.views.swap.ConfirmReceiveView>
|