From ca4ac9fcc37e91096a94cacfc84e45bfaaf02bda Mon Sep 17 00:00:00 2001 From: Ghazi Akmal Fauzan <13521058@std.stei.itb.ac.id> Date: Wed, 3 Apr 2024 23:09:18 +0700 Subject: [PATCH] feat: twibbon fragment UI xml --- app/src/main/res/drawable/ic_camera.xml | 8 ++ .../main/res/layout-land/activity_main.xml | 2 +- .../main/res/layout-land/fragment_twibbon.xml | 100 ++++++++++++++++++ app/src/main/res/layout/fragment_twibbon.xml | 99 +++++++++++++++++ app/src/main/res/menu/bottom_navbar.xml | 3 + app/src/main/res/values/strings.xml | 4 + 6 files changed, 215 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/drawable/ic_camera.xml create mode 100644 app/src/main/res/layout-land/fragment_twibbon.xml create mode 100644 app/src/main/res/layout/fragment_twibbon.xml diff --git a/app/src/main/res/drawable/ic_camera.xml b/app/src/main/res/drawable/ic_camera.xml new file mode 100644 index 0000000..0ef209c --- /dev/null +++ b/app/src/main/res/drawable/ic_camera.xml @@ -0,0 +1,8 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:height="25dp" android:viewportHeight="20" android:viewportWidth="20" android:width="25dp"> + + <path android:fillColor="#7B78AA" android:pathData="M9.4,7H17.4C16.95,5.85 16.263,4.862 15.338,4.037C14.413,3.212 13.351,2.633 12.15,2.3L9.4,7ZM7.1,9L11.1,2.1C10.917,2.067 10.733,2.042 10.55,2.025C10.367,2.008 10.183,2 10,2C8.9,2 7.875,2.208 6.925,2.625C5.975,3.042 5.133,3.6 4.4,4.3L7.1,9ZM2.25,12H7.7L3.7,5.1C3.167,5.783 2.75,6.538 2.45,7.363C2.15,8.188 2,9.067 2,10C2,10.35 2.021,10.688 2.063,11.013C2.105,11.338 2.167,11.667 2.25,12ZM7.85,17.7L10.55,13H2.6C3.05,14.15 3.738,15.138 4.663,15.963C5.588,16.788 6.651,17.367 7.85,17.7ZM10,18C11.1,18 12.125,17.792 13.075,17.375C14.025,16.958 14.867,16.4 15.6,15.7L12.9,11L8.9,17.9C9.083,17.933 9.263,17.958 9.438,17.975C9.613,17.992 9.801,18 10,18ZM16.3,14.9C16.833,14.217 17.25,13.463 17.55,12.638C17.85,11.813 18,10.934 18,10C18,9.65 17.979,9.313 17.938,8.988C17.897,8.663 17.834,8.334 17.75,8H12.3L16.3,14.9ZM10,20C8.633,20 7.342,19.737 6.125,19.212C4.908,18.687 3.846,17.97 2.938,17.062C2.029,16.154 1.313,15.092 0.788,13.875C0.263,12.658 0.001,11.367 0,10C0,8.617 0.263,7.321 0.788,6.113C1.313,4.905 2.03,3.847 2.938,2.938C3.846,2.029 4.908,1.313 6.124,0.788C7.34,0.263 8.632,0.001 10,0C11.383,0 12.679,0.263 13.888,0.788C15.097,1.313 16.155,2.03 17.062,2.938C17.971,3.846 18.687,4.904 19.212,6.113C19.737,7.322 19.999,8.617 20,10C20,11.367 19.737,12.658 19.212,13.875C18.687,15.092 17.97,16.154 17.062,17.063C16.154,17.971 15.096,18.688 13.887,19.213C12.678,19.738 11.383,20.001 10,20Z" + tools:ignore="VectorPath" /> + +</vector> diff --git a/app/src/main/res/layout-land/activity_main.xml b/app/src/main/res/layout-land/activity_main.xml index 73537e6..8990f7d 100644 --- a/app/src/main/res/layout-land/activity_main.xml +++ b/app/src/main/res/layout-land/activity_main.xml @@ -44,7 +44,7 @@ android:layout_width="80dp" android:layout_height="0dp" android:orientation="vertical" - android:paddingTop="60dp" + android:paddingTop="40dp" android:background="@color/navbar_bg" app:itemBackground="@color/navbar_bg" app:itemIconTint="@color/navbar_icon" diff --git a/app/src/main/res/layout-land/fragment_twibbon.xml b/app/src/main/res/layout-land/fragment_twibbon.xml new file mode 100644 index 0000000..57974cc --- /dev/null +++ b/app/src/main/res/layout-land/fragment_twibbon.xml @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout 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" + android:background="@color/primary_bg" + android:orientation="vertical" + tools:context=".fragments.twibbon.TwibbonFragment"> + + <androidx.constraintlayout.widget.ConstraintLayout + android:id="@+id/twibbonConstrantLayout" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <LinearLayout + android:id="@+id/scanHorizontalLayout" + android:layout_width="0dp" + android:layout_height="match_parent" + android:orientation="horizontal" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toStartOf="@id/captureButton" + app:layout_constraintBottom_toBottomOf="parent" + android:layout_marginStart="50dp" + android:layout_marginEnd="50dp" + android:layout_gravity="center"> + + <ImageButton + android:id="@+id/leftButton" + android:layout_width="35dp" + android:layout_height="35dp" + android:layout_gravity="start|center" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toStartOf="@id/previewView" + android:background="@color/transparent" + android:layout_marginStart="50dp" + android:scaleType="fitCenter" + app:srcCompat="@drawable/ic_back" + android:contentDescription="@string/left_arrow" /> + + <FrameLayout + android:layout_width="300dp" + android:layout_height="300dp" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + android:layout_gravity="center" > + + <androidx.camera.view.PreviewView + android:id="@+id/previewView" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center" /> + + <ImageView + android:id="@+id/twibbonImageView" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:scaleType="fitXY" + android:contentDescription="@string/twibbon_preview" + app:srcCompat="@drawable/twibbon_template_1" /> + + </FrameLayout> + + <ImageButton + android:id="@+id/rightButton" + android:layout_width="35dp" + android:layout_height="35dp" + android:layout_gravity="end|center" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/previewView" + android:background="@color/transparent" + android:layout_marginEnd="50dp" + android:rotation="180" + android:scaleType="fitCenter" + app:srcCompat="@drawable/ic_back" + android:contentDescription="@string/right_arrow" /> + </LinearLayout> + + <ImageButton + android:id="@+id/captureButton" + android:layout_width="75dp" + android:layout_height="75dp" + android:layout_gravity="center" + android:layout_marginEnd="75dp" + android:background="@drawable/round_corner_button_weak" + android:contentDescription="@string/capture_button" + android:scaleType="fitCenter" + app:layout_constraintStart_toEndOf="@id/scanHorizontalLayout" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintTop_toTopOf="parent" + android:src="@android:drawable/ic_menu_camera" + tools:ignore="RedundantDescriptionCheck" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + +</FrameLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_twibbon.xml b/app/src/main/res/layout/fragment_twibbon.xml new file mode 100644 index 0000000..4a93581 --- /dev/null +++ b/app/src/main/res/layout/fragment_twibbon.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout 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" + android:background="@color/primary_bg" + android:orientation="vertical" + tools:context=".fragments.twibbon.TwibbonFragment"> + + <androidx.constraintlayout.widget.ConstraintLayout + android:id="@+id/twibbonConstrantLayout" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <LinearLayout + android:id="@+id/scanHorizontalLayout" + android:layout_width="match_parent" + android:layout_height="0dp" + android:orientation="horizontal" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintBottom_toTopOf="@id/captureButton" + android:layout_marginTop="50dp" + android:layout_marginBottom="50dp" + android:layout_gravity="center"> + + <ImageButton + android:id="@+id/leftButton" + android:layout_width="35dp" + android:layout_height="35dp" + android:layout_gravity="start|center" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toStartOf="@id/previewView" + android:background="@color/transparent" + android:layout_marginStart="20dp" + android:scaleType="fitCenter" + app:srcCompat="@drawable/ic_back" + android:contentDescription="@string/left_arrow" /> + + <FrameLayout + android:layout_width="0dp" + android:layout_height="300dp" + android:layout_weight="1" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + android:layout_gravity="center" > + + <androidx.camera.view.PreviewView + android:id="@+id/previewView" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center" /> + + <ImageView + android:id="@+id/twibbonImageView" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:contentDescription="@string/twibbon_preview" + android:scaleType="fitXY" + app:srcCompat="@drawable/twibbon_template_1" /> + + </FrameLayout> + + <ImageButton + android:id="@+id/rightButton" + android:layout_width="35dp" + android:layout_height="35dp" + android:layout_gravity="end|center" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/previewView" + android:background="@color/transparent" + android:layout_marginEnd="20dp" + android:rotation="180" + android:scaleType="fitCenter" + app:srcCompat="@drawable/ic_back" + android:contentDescription="@string/right_arrow" /> + </LinearLayout> + + <ImageButton + android:id="@+id/captureButton" + android:layout_width="75dp" + android:layout_height="75dp" + android:layout_gravity="center" + android:layout_marginBottom="100dp" + android:background="@drawable/round_corner_button_weak" + android:contentDescription="@string/capture_button" + android:scaleType="fitCenter" + app:layout_constraintTop_toBottomOf="@id/scanHorizontalLayout" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + android:src="@android:drawable/ic_menu_camera" + tools:ignore="RedundantDescriptionCheck" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + +</FrameLayout> \ No newline at end of file diff --git a/app/src/main/res/menu/bottom_navbar.xml b/app/src/main/res/menu/bottom_navbar.xml index 538d095..4b073f0 100644 --- a/app/src/main/res/menu/bottom_navbar.xml +++ b/app/src/main/res/menu/bottom_navbar.xml @@ -6,6 +6,9 @@ <item android:title="@string/navbar_scan" android:id="@+id/scan" android:icon="@drawable/ic_scan"/> + <item android:title="@string/navbar_twibbon" + android:id="@+id/twibbon" + android:icon="@drawable/ic_camera"/> <item android:title="@string/navbar_statistic" android:id="@+id/statistic" android:icon="@drawable/ic_statistic"/> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ebab2ec..0fdc113 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -70,5 +70,9 @@ <string name="back_button">Back Button</string> <string name="autofill_location_button">AutoFill Location Button</string> <string name="randomize_transaction_button">Randomize Transaction Button</string> + <string name="navbar_twibbon">Twibbon</string> + <string name="left_arrow">Left Arrow</string> + <string name="right_arrow">Right Arrow</string> + <string name="twibbon_preview">Twibbon Preview</string> </resources> \ No newline at end of file -- GitLab