Snippets

DeviantDev Android Wear: Scrollable Confirmation Activity with manually calculated inset/padding

You are viewing an old version of this snippet. View the current version.
Revised by Hendrik Schuster 221356c
<?xml version="1.0" encoding="utf-8"?>

<!-- Related blog post: https://www.journal.deviantdev.com/?p=917 -->
<ScrollView 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">

    <LinearLayout
        android:id="@+id/layout_content"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:orientation="vertical"
        android:showDividers="middle">

        <TextView
            android:id="@+id/layout_question"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/short_text_question"
            android:textAlignment="center"
            android:textSize="16sp" />

        <TextView
            android:id="@+id/text_description"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:layout_marginTop="8dp"
            android:text="@string/long_text_description"
            android:textAlignment="center"
            android:textSize="14sp" />

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp">

            <android.support.wearable.view.CircledImageView
                android:id="@+id/button_ok"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="end|bottom"
                android:src="@drawable/ic_check_24dp"
                app:circle_color="#0EB695"
                app:circle_radius="25dp"
                app:circle_radius_pressed="20dp" />

            <android.support.wearable.view.CircledImageView
                android:id="@+id/button_cancel"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="start|end"
                android:src="@drawable/ic_close_24dp"
                app:circle_color="#AFAFAF"
                app:circle_radius="25dp"
                app:circle_radius_pressed="20dp" />
        </FrameLayout>
    </LinearLayout>

</ScrollView>
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.