From ad52afc6bcdaad95583ef7c619bc8c5749e78d76 Mon Sep 17 00:00:00 2001
From: Linjiajia <319408893@qq.com>
Date: 星期六, 18 三月 2023 03:58:19 +0800
Subject: [PATCH] 功能fragment标题栏
---
app/src/main/res/drawable-xhdpi/ic_menu.png | 0
app/src/main/res/drawable-xhdpi/ic_search.png | 0
app/src/main/res/drawable-xhdpi/ic_operate.png | 0
app/src/main/res/drawable-xxhdpi/ic_operate.png | 0
app/src/main/res/layout/fragment_function.xml | 42 +++++++++++++++++++++++++++++++++++++++++-
app/src/main/java/com/application/zhangshi_app_android/module/function/FunctionFragment.java | 5 +++++
app/src/main/res/drawable-xxhdpi/ic_search.png | 0
app/src/main/res/drawable-xxhdpi/ic_menu.png | 0
app/src/main/res/values/colors.xml | 1 +
9 files changed, 47 insertions(+), 1 deletions(-)
diff --git a/app/src/main/java/com/application/zhangshi_app_android/module/function/FunctionFragment.java b/app/src/main/java/com/application/zhangshi_app_android/module/function/FunctionFragment.java
index d32b6ee..5366273 100644
--- a/app/src/main/java/com/application/zhangshi_app_android/module/function/FunctionFragment.java
+++ b/app/src/main/java/com/application/zhangshi_app_android/module/function/FunctionFragment.java
@@ -51,4 +51,9 @@
protected void initLiveDataObserve() {
}
+
+ @Override
+ protected boolean isStatusBarImmersionEnabled() {
+ return true;
+ }
}
diff --git a/app/src/main/res/drawable-xhdpi/ic_menu.png b/app/src/main/res/drawable-xhdpi/ic_menu.png
new file mode 100644
index 0000000..cdba7a9
--- /dev/null
+++ b/app/src/main/res/drawable-xhdpi/ic_menu.png
Binary files differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_operate.png b/app/src/main/res/drawable-xhdpi/ic_operate.png
new file mode 100644
index 0000000..04d49e3
--- /dev/null
+++ b/app/src/main/res/drawable-xhdpi/ic_operate.png
Binary files differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_search.png b/app/src/main/res/drawable-xhdpi/ic_search.png
new file mode 100644
index 0000000..32a7de3
--- /dev/null
+++ b/app/src/main/res/drawable-xhdpi/ic_search.png
Binary files differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_menu.png b/app/src/main/res/drawable-xxhdpi/ic_menu.png
new file mode 100644
index 0000000..92289d6
--- /dev/null
+++ b/app/src/main/res/drawable-xxhdpi/ic_menu.png
Binary files differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_operate.png b/app/src/main/res/drawable-xxhdpi/ic_operate.png
new file mode 100644
index 0000000..83357c8
--- /dev/null
+++ b/app/src/main/res/drawable-xxhdpi/ic_operate.png
Binary files differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_search.png b/app/src/main/res/drawable-xxhdpi/ic_search.png
new file mode 100644
index 0000000..bf1e161
--- /dev/null
+++ b/app/src/main/res/drawable-xxhdpi/ic_search.png
Binary files differ
diff --git a/app/src/main/res/layout/fragment_function.xml b/app/src/main/res/layout/fragment_function.xml
index 81522cf..c1375ea 100644
--- a/app/src/main/res/layout/fragment_function.xml
+++ b/app/src/main/res/layout/fragment_function.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<layout xmlns:android="http://schemas.android.com/apk/res/android">
+<layout xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
@@ -11,5 +12,44 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
+ <com.hjq.bar.TitleBar
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/dp_55"
+ app:layout_constraintTop_toTopOf="parent"
+ android:background="@color/color_title_background"
+ android:paddingHorizontal="@dimen/dp_16"
+ app:leftIcon="@drawable/ic_menu"
+ app:leftTitle="鍔熻兘"
+ app:leftTitleSize="@dimen/sp_20"
+ app:leftTitleColor="@color/white"
+ app:leftIconWidth="@dimen/dp_24"
+ app:leftIconHeight="@dimen/dp_24"
+ app:leftIconPadding="@dimen/dp_32"
+ app:leftHorizontalPadding="@dimen/dp_0"
+ app:rightIcon="@null"
+ >
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="end|center_vertical"
+ android:orientation="horizontal" >
+
+ <ImageView
+ android:layout_width="@dimen/dp_24"
+ android:layout_height="@dimen/dp_24"
+ android:background="@drawable/ic_search"
+ />
+
+ <ImageView
+ android:layout_width="@dimen/dp_24"
+ android:layout_height="@dimen/dp_24"
+ android:background="@drawable/ic_operate"
+ android:layout_marginStart="@dimen/dp_16"
+ />
+
+ </LinearLayout>
+ </com.hjq.bar.TitleBar>
+
+
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 795bbd5..c167fe1 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -8,6 +8,7 @@
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
+ <color name="color_title_background">#FFF08EBA</color>
<color name="color_FFF08EBA_text_pink">#FFF08EBA</color>
<color name="color_FF666666_text_default">#FF666666</color>
--
Gitblit v1.9.1