Skip to content

Commit

Permalink
Unify Material3 theme, add labels for action button, add gradient ove…
Browse files Browse the repository at this point in the history
…rlay under button panel
  • Loading branch information
0xf104a committed Nov 19, 2023
1 parent e2061dc commit ec75809
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 35 deletions.
8 changes: 8 additions & 0 deletions app/src/main/res/drawable/gradient_overlay.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="@android:color/transparent"
android:endColor="#AA000000"
android:angle="270"/>
</shape>
63 changes: 45 additions & 18 deletions app/src/main/res/layout/action_panel.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
android:layout_height="match_parent">

<LinearLayout
android:id="@+id/action_panel_layout"
Expand All @@ -14,25 +13,53 @@
android:layout_marginBottom="64dp"
android:visibility="visible">

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/exit_button"
style="@style/Widget.Mirror.FloatingActionButton"
<!-- Wrapper for Exit Button and Label -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:contentDescription="@string/exit"
android:src="@android:drawable/ic_menu_close_clear_cancel" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/freeze_button"
style="@style/Widget.Mirror.FloatingActionButton"
android:orientation="vertical"
android:layout_margin="16dp">

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/exit_button"
style="@style/Widget.Mirror.FloatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/exit"
android:src="@android:drawable/ic_menu_close_clear_cancel" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/exit"
android:textColor="@color/white" />

</LinearLayout>

<!-- Wrapper for Freeze Button and Label -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:contentDescription="@string/exit"
android:src="@android:drawable/ic_media_pause" />
android:orientation="vertical"
android:layout_margin="16dp">

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/freeze_button"
style="@style/Widget.Mirror.FloatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/freeze"
android:src="@android:drawable/ic_media_pause" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/freeze"
android:textColor="@color/white" />

</LinearLayout>

</LinearLayout>
</RelativeLayout>
</RelativeLayout>
12 changes: 11 additions & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<androidx.camera.view.PreviewView
android:id="@+id/preview_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent" >
</androidx.camera.view.PreviewView>

<ImageView
android:id="@+id/stop_view"
Expand All @@ -19,6 +20,15 @@
android:scaleType="centerCrop"
android:contentDescription="@string/stop_view_desc" />

<View
android:layout_width="match_parent"
android:layout_height="256dp"
android:layout_gravity="bottom"
android:background="@drawable/gradient_overlay"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<include layout="@layout/action_panel" />

</androidx.constraintlayout.widget.ConstraintLayout>
16 changes: 0 additions & 16 deletions app/src/main/res/values-night/themes.xml

This file was deleted.

0 comments on commit ec75809

Please sign in to comment.