Snippets

DeviantDev Android Wear Confirmation Activity using the BoxInsetLayout

Created by Hendrik Schuster last modified
<?xml version="1.0" encoding="utf-8"?>

<!-- Related blog post: https://www.journal.deviantdev.com/?p=917&preview=true -->
<android.support.wear.widget.BoxInsetLayout 
    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:background="@color/dark_grey">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        app:boxedEdges="all">

        <TextView
            android:id="@+id/text_description"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="4dp"
            android:layout_marginTop="4dp"
            android:fontFamily="sans-serif-condensed"
            android:gravity="bottom|center"
            android:text="@string/my_really_long_text" />

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

            <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" />

            <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" />
        </FrameLayout>
    </LinearLayout>

</android.support.wear.widget.BoxInsetLayout>

Comments (0)