From 88069c0b56bfeb10f44672f73f89da6e060e3203 Mon Sep 17 00:00:00 2001 From: riz081 Date: Sun, 29 Jun 2025 20:33:23 +0700 Subject: [PATCH] Implement BantuanActivity UI --- app/build.gradle | 1 + .../bdkipoc/bantuan/BantuanActivity.java | 19 +- .../main/res/drawable/border_button_red.xml | 6 + app/src/main/res/drawable/ic_whatsapp.png | Bin 0 -> 1211 bytes app/src/main/res/drawable/tab_active_bg.xml | 8 + app/src/main/res/drawable/tab_inactive_bg.xml | 8 + .../res/layout/activity_bantuan_riwayat.xml | 216 ++++++++++++++---- .../main/res/layout/activity_bantuan_umum.xml | 141 ++++++++---- 8 files changed, 305 insertions(+), 94 deletions(-) create mode 100644 app/src/main/res/drawable/border_button_red.xml create mode 100644 app/src/main/res/drawable/ic_whatsapp.png create mode 100644 app/src/main/res/drawable/tab_active_bg.xml create mode 100644 app/src/main/res/drawable/tab_inactive_bg.xml diff --git a/app/build.gradle b/app/build.gradle index d9a4138..59c1869 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -53,6 +53,7 @@ dependencies { implementation libs.cardview implementation 'androidx.recyclerview:recyclerview:1.3.0' implementation 'androidx.cardview:cardview:1.0.0' + implementation 'com.google.android.material:material:1.11.0' implementation 'com.sunmi:printerlibrary:1.0.15' diff --git a/app/src/main/java/com/example/bdkipoc/bantuan/BantuanActivity.java b/app/src/main/java/com/example/bdkipoc/bantuan/BantuanActivity.java index ad131f9..4d890f4 100644 --- a/app/src/main/java/com/example/bdkipoc/bantuan/BantuanActivity.java +++ b/app/src/main/java/com/example/bdkipoc/bantuan/BantuanActivity.java @@ -1,6 +1,7 @@ package com.example.bdkipoc.bantuan; import android.content.Intent; +import android.graphics.Color; import android.os.Bundle; import android.view.View; import android.widget.Button; @@ -16,7 +17,7 @@ public class BantuanActivity extends AppCompatActivity { private LinearLayout tabUmum, tabRiwayat; private TextView textUmum, textRiwayat; private View contentUmum, contentRiwayat; - private Button btnForm, btnWhatsApp; + private LinearLayout btnForm, btnWhatsApp; private LinearLayout backNavigation; @Override @@ -68,12 +69,12 @@ public class BantuanActivity extends AppCompatActivity { initViews(); setupListeners(); - // Update tab appearance - tabUmum.setBackgroundResource(android.R.color.holo_red_dark); + // Update tab appearance menggunakan drawable yang sudah dibuat + tabUmum.setBackgroundResource(R.drawable.tab_active_bg); textUmum.setTextColor(ContextCompat.getColor(this, android.R.color.white)); - tabRiwayat.setBackgroundResource(android.R.color.transparent); - textRiwayat.setTextColor(ContextCompat.getColor(this, android.R.color.holo_red_dark)); + tabRiwayat.setBackgroundResource(R.drawable.tab_inactive_bg); + textRiwayat.setTextColor(Color.parseColor("#DE0701")); } private void showRiwayatTab() { @@ -81,12 +82,12 @@ public class BantuanActivity extends AppCompatActivity { initViews(); setupListeners(); - // Update tab appearance - tabRiwayat.setBackgroundResource(android.R.color.holo_red_dark); + // Update tab appearance menggunakan drawable yang sudah dibuat + tabRiwayat.setBackgroundResource(R.drawable.tab_active_bg); textRiwayat.setTextColor(ContextCompat.getColor(this, android.R.color.white)); - tabUmum.setBackgroundResource(android.R.color.transparent); - textUmum.setTextColor(ContextCompat.getColor(this, android.R.color.holo_red_dark)); + tabUmum.setBackgroundResource(R.drawable.tab_inactive_bg); + textUmum.setTextColor(Color.parseColor("#DE0701")); } private void setupFormView() { diff --git a/app/src/main/res/drawable/border_button_red.xml b/app/src/main/res/drawable/border_button_red.xml new file mode 100644 index 0000000..8aed961 --- /dev/null +++ b/app/src/main/res/drawable/border_button_red.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_whatsapp.png b/app/src/main/res/drawable/ic_whatsapp.png new file mode 100644 index 0000000000000000000000000000000000000000..954b53733a0aa2dd9edb77187bc26205b55336a9 GIT binary patch literal 1211 zcmV;s1VsCZP)V;IvS@b3h)z;HnFdVnYAJsodfX;`9!P}!DhOz77F1mFznCWk5z?BP+h&yos z97%ji`U=}~jU>d9UrT%kNY4;S-YlO`pWYGD3hSz$oYf4rLR?ij7@pbU<}D{F9>i$x$D zdKRdbcnWJ{SjWexYd-N?lmq9{56g8zT&x`%U?NxhaV7ZaomiYPKnXCQ7xrC?4U(iO zCu?Um{1GL9g{!)Y@q=P?h^e55lJJ`}E`}(%5nxc_=KQfKMLk*=vg#>0pgR_xl@q7-Qhh`*Z?xIxCv(&`rbLc#{lCSB_2*+%)c%9WX6$VV1 z8r~dmNc0JB@P(mN(4*xFDgwvhefoqFRi#n2x50V`ys93x>`SA2vf;gQK?>1kKc)r1 zt*z=~>COkl+$o8?XN1VcrJ6->NyS}Be<69q2W$Yo5Pc(?4(+=?6eVMzf%8dTkLu*g(`+)!IXjdlVx8fmbjtPAeaPOXRQ>}_C`IhAK zG*33f+Na`v;pSI{o<(GsqM?;mi`M+PRawiW&%%@7RSwWyKDj{rx+YK0ihH(G1ST13 z&1huF;^r8;gV?lc7C-O{>;?u&wcugsxg&0(foLbf2?ebBaHwvwu8ZToq_Kb4ig()P z(BBh{{>qN?M#+oAboiwv3Nf@e_vJzl2l%iY7^?IN-2hLjwyER1IZWR@S>ltzgR>~I z>oD1Xc0treCPW)24N^Z@j)LkDoj>X*Pj04Dv4-5X5iZcifOsg^1_5xRjZ5Vay)0zs Z@e9i8*YUi*8o>Yn002ovPDHLkV1gq{Im!S4 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable/tab_active_bg.xml b/app/src/main/res/drawable/tab_active_bg.xml new file mode 100644 index 0000000..7a3ad71 --- /dev/null +++ b/app/src/main/res/drawable/tab_active_bg.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/tab_inactive_bg.xml b/app/src/main/res/drawable/tab_inactive_bg.xml new file mode 100644 index 0000000..68284f3 --- /dev/null +++ b/app/src/main/res/drawable/tab_inactive_bg.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_bantuan_riwayat.xml b/app/src/main/res/layout/activity_bantuan_riwayat.xml index 793874b..703e7fe 100644 --- a/app/src/main/res/layout/activity_bantuan_riwayat.xml +++ b/app/src/main/res/layout/activity_bantuan_riwayat.xml @@ -1,5 +1,6 @@ + app:cardCornerRadius="12dp" + app:cardElevation="4dp"> - - - + + android:layout_marginTop="16dp" + android:paddingHorizontal="16dp" + android:gravity="center_horizontal"> + android:padding="12dp" + android:background="@drawable/tab_inactive_bg" + android:layout_marginEnd="8dp"> - + android:padding="12dp" + android:layout_marginStart="8dp"> - @@ -107,7 +103,8 @@ + android:layout_height="match_parent" + android:paddingBottom="16dp"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -325,34 +425,64 @@ - + + android:layout_marginTop="8dp" + android:paddingHorizontal="16dp" + android:paddingVertical="16dp" + android:background="@android:color/white" + android:gravity="center"> -