AChep/literaryclock

View on GitHub
app/src/main/res/layout/fragment_main.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.motion.widget.MotionLayout 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:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layoutDescription="@xml/desc_fragment_main"
    tools:showPaths="true">

    <View
        android:id="@+id/toolbarBg"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:background="?colorSecondaryContainer"
        android:elevation="4dp"
        app:layout_constraintBottom_toBottomOf="@id/barrier"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <View
        android:id="@+id/toolbarBgTower"
        android:layout_width="200dp"
        android:layout_height="0dp"
        android:background="@drawable/ic_bb2"
        android:backgroundTint="?colorOnSecondaryContainer"
        android:elevation="4dp"
        app:layout_constraintBottom_toBottomOf="@id/toolbarBg"
        app:layout_constraintStart_toStartOf="@id/toolbarBg"
        app:layout_constraintTop_toTopOf="@id/toolbarBg" />

    <TextView
        android:id="@+id/appName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:elevation="4dp"
        android:fontFamily="sans-serif-medium"
        android:text="@string/app_name"
        android:textColor="@color/white_88"
        android:textSize="13sp"
        app:layout_constraintBottom_toTopOf="@id/digitalClock"
        app:layout_constraintStart_toStartOf="@id/digitalClock" />

    <View
        android:id="@+id/analogClock"
        android:layout_width="88dp"
        android:layout_height="88dp"
        android:layout_marginTop="56dp"
        android:background="@drawable/bg_circle"
        android:elevation="4dp"
        app:layout_constraintBottom_toBottomOf="@id/toolbarBgTower"
        app:layout_constraintEnd_toEndOf="@id/toolbarBgTower"
        app:layout_constraintStart_toStartOf="@id/toolbarBgTower"
        app:layout_constraintTop_toTopOf="@id/toolbarBgTower" />

    <TextView
        android:id="@+id/digitalClock"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:elevation="4dp"
        android:fontFamily="sans-serif-light"
        android:letterSpacing="-0.03"
        android:text="10:24"
        android:textColor="?colorOnSecondaryContainer"
        android:textSize="48sp"
        app:layout_constraintBottom_toBottomOf="@id/analogClock"
        app:layout_constraintStart_toEndOf="@id/toolbarBgTower"
        app:layout_constraintTop_toTopOf="@id/analogClock" />

    <FrameLayout
        android:id="@+id/moreBtnContainer"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clipChildren="false"
        android:clipToPadding="false"
        android:elevation="8dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <ImageButton
            android:id="@+id/moreBtn"
            style="?actionButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/app_bar_height__collapsed"
            android:src="@drawable/ic_more"
            app:tint="?colorOnSecondaryContainer" />

    </FrameLayout>

    <Space
        android:id="@+id/barrier"
        android:layout_width="wrap_content"
        android:layout_height="@dimen/app_bar_height__expanded"
        app:layout_constraintTop_toTopOf="parent" />

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/recyclerView"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:clipToPadding="false"
        android:paddingTop="@dimen/frame_margin_vertical"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/barrier" />

    <com.google.android.material.progressindicator.LinearProgressIndicator
        android:id="@+id/progressBar"
        android:layout_width="0dp"
        android:layout_height="4dp"
        android:elevation="8dp"
        android:indeterminate="true"
        android:paddingTop="0dp"
        android:paddingBottom="0dp"
        app:layout_constraintBottom_toBottomOf="@id/barrier"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <FrameLayout
        android:id="@+id/btnContainer"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clipChildren="false"
        android:clipToPadding="false"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_chainStyle="packed"
        app:layout_constraintStart_toStartOf="parent">

        <com.google.android.material.button.MaterialButton
            android:id="@+id/btn"
            style="@style/Widget.Material3.Button"
            android:layout_width="wrap_content"
            android:layout_height="56dp"
            android:layout_marginBottom="16dp"
            android:paddingStart="32dp"
            android:paddingEnd="32dp"
            android:text="Pick a time"
            android:textAllCaps="false"
            app:cornerRadius="28dp" />
    </FrameLayout>

</androidx.constraintlayout.motion.widget.MotionLayout>