Skip to content

Commit bd9aa18

Browse files
committed
feat: Update search empty image
Signed-off-by: Hu Shenghao <dede.hu@qq.com>
1 parent dbd68c4 commit bd9aa18

File tree

8 files changed

+82
-194
lines changed

8 files changed

+82
-194
lines changed

app/src/main/java/com/dede/android_eggs/ui/composes/icons/rounded/FamilyStar.kt

Lines changed: 0 additions & 112 deletions
This file was deleted.

app/src/main/java/com/dede/android_eggs/util/actions/WarningDialogAction.kt

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ import androidx.appcompat.widget.AppCompatTextView
77
import androidx.compose.foundation.layout.Arrangement
88
import androidx.compose.foundation.layout.Row
99
import androidx.compose.foundation.layout.fillMaxWidth
10-
import androidx.compose.foundation.layout.padding
1110
import androidx.compose.foundation.layout.size
1211
import androidx.compose.material.icons.Icons
13-
import androidx.compose.material.icons.rounded.TipsAndUpdates
12+
import androidx.compose.material.icons.rounded.WarningAmber
1413
import androidx.compose.material3.AlertDialog
1514
import androidx.compose.material3.Icon
1615
import androidx.compose.material3.MaterialTheme
@@ -66,8 +65,7 @@ class WarningDialogAction : ActivityActionDispatcher.ActivityAction {
6665

6766
override fun onCreate(activity: Activity) {
6867
val info = target[activity.javaClass.kotlin] ?: return
69-
val agreed = activity.getBoolean(info.key, false)
70-
if (agreed) return
68+
if (activity.getBoolean(info.key, false)) return
7169

7270
val composeView = ComposeView(activity)
7371
composeView.setViewTreeLifecycleOwner(activity.androidLifecycleOwner)
@@ -125,17 +123,14 @@ private fun WarningDialog(
125123
title = {
126124
Row(
127125
verticalAlignment = Alignment.CenterVertically,
128-
horizontalArrangement = Arrangement.Center
126+
horizontalArrangement = Arrangement.spacedBy(10.dp),
129127
) {
130128
Icon(
131-
imageVector = Icons.Rounded.TipsAndUpdates,
129+
imageVector = Icons.Rounded.WarningAmber,
132130
contentDescription = stringResource(id = title),
133-
modifier = Modifier.size(28.dp)
134-
)
135-
Text(
136-
text = stringResource(id = title),
137-
modifier = Modifier.padding(start = 10.dp)
131+
modifier = Modifier.size(30.dp)
138132
)
133+
Text(text = stringResource(id = title))
139134
}
140135
},
141136
text = {

app/src/main/java/com/dede/android_eggs/views/main/compose/EasterEggScreen.kt

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,10 @@ import androidx.compose.foundation.layout.Arrangement
66
import androidx.compose.foundation.layout.Box
77
import androidx.compose.foundation.layout.PaddingValues
88
import androidx.compose.foundation.layout.fillMaxSize
9-
import androidx.compose.foundation.layout.fillMaxWidth
109
import androidx.compose.foundation.layout.padding
11-
import androidx.compose.foundation.layout.size
1210
import androidx.compose.foundation.layout.sizeIn
1311
import androidx.compose.foundation.lazy.LazyColumn
1412
import androidx.compose.foundation.lazy.items
15-
import androidx.compose.material.icons.Icons
16-
import androidx.compose.material.icons.rounded.SearchOff
17-
import androidx.compose.material3.Icon
1813
import androidx.compose.runtime.Composable
1914
import androidx.compose.runtime.remember
2015
import androidx.compose.ui.Alignment
@@ -101,16 +96,16 @@ fun EasterEggScreen(
10196
@Composable
10297
private fun SearchEmpty(contentPadding: PaddingValues) {
10398
Box(
104-
contentAlignment = Alignment.TopCenter,
99+
contentAlignment = Alignment.Center,
105100
modifier = Modifier
106-
.fillMaxWidth()
101+
.fillMaxSize()
107102
.padding(contentPadding)
108-
.padding(top = 32.dp)
109103
) {
110-
Icon(
111-
imageVector = Icons.Rounded.SearchOff,
104+
DrawableImage(
105+
res = R.drawable.img_samples,
112106
contentDescription = null,
113-
modifier = Modifier.size(102.dp)
107+
modifier = Modifier
108+
.fillMaxSize(0.6f)
114109
)
115110
}
116111
}

app/src/main/java/com/dede/android_eggs/views/main/compose/Welcome.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ private val pagers = intArrayOf(
5555
R.drawable.img_compose_cluster,
5656
R.drawable.img_build_apps,
5757
R.drawable.img_launch_app,
58-
R.drawable.img_ui_guidelines,
5958
R.drawable.img_billions,
6059
R.drawable.img_better_together_hero,
6160
R.drawable.img_controllers,
6261
R.drawable.img_android_studio,
62+
R.drawable.img_samples,
6363
)
6464

6565
@Composable
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="128dp"
3+
android:height="128dp"
4+
android:viewportWidth="480"
5+
android:viewportHeight="480">
6+
<group
7+
android:pivotX="240"
8+
android:pivotY="240"
9+
android:scaleX="0.85"
10+
android:scaleY="0.85">
11+
<path
12+
android:fillColor="#34A853"
13+
android:pathData="M120,176.23a5.8,5.8 0,0 1,5.8 -5.8v28.02a5.8,5.8 0,0 1,-5.8 -5.8v-16.42ZM120,220.68a5.8,5.8 0,0 1,5.8 -5.8v46.38a5.8,5.8 0,0 1,-5.8 -5.8v-34.78Z" />
14+
<path
15+
android:fillColor="#34A853"
16+
android:pathData="M270,60.99L194.15,60.99A48.33,48.33 45,0 0,145.82 109.32L145.82,370.68A48.33,48.33 0,0 0,194.15 419.01L270,419.01A48.33,48.33 0,0 0,318.33 370.68L318.33,109.32A48.33,48.33 45,0 0,270 60.99z"
17+
android:strokeWidth="3.333"
18+
android:strokeColor="#34A853" />
19+
<path
20+
android:fillColor="#fff"
21+
android:pathData="M250.68,59.32L174.83,59.32A50,50 108.12,0 0,124.83 109.32L124.83,370.68A50,50 0,0 0,174.83 420.68L250.68,420.68A50,50 0,0 0,300.68 370.68L300.68,109.32A50,50 0,0 0,250.68 59.32z" />
22+
<path
23+
android:fillColor="#00000000"
24+
android:pathData="M252.37,419.71H174.83c-27.61,0 -50,-22.39 -50,-50V110.29c0,-27.61 22.39,-50 50,-50h74.64"
25+
android:strokeWidth="4.444"
26+
android:strokeColor="#A0C2F9"
27+
android:strokeLineCap="round" />
28+
<path
29+
android:fillColor="#4285F4"
30+
android:pathData="M213.24,77.2m5.31,0a5.31,5.31 0,1 0,-10.63 0a5.31,5.31 0,1 0,10.63 0" />
31+
<path
32+
android:fillColor="#CEEAD6"
33+
android:pathData="M53.8,136c0,-24.3 19.7,-44 44,-44h56c24.3,0 44,19.7 44,44s-19.7,44 -44,44h-56c-24.3,0 -44,-19.7 -44,-44Z" />
34+
<path
35+
android:fillColor="#34A853"
36+
android:pathData="M141.4,160c3.17,0 5.59,-0.87 7.26,-2.62 1.67,-1.71 2.51,-4.11 2.51,-7.18v-7.34c0,-1.43 0.38,-2.45 1.15,-3.04 0.73,-0.63 1.65,-0.94 2.77,-0.94h1.25v-5.76h-1.25c-1.11,0 -2.04,-0.3 -2.77,-0.89 -0.77,-0.63 -1.15,-1.66 -1.15,-3.09v-7.34c0,-3.11 -0.84,-5.52 -2.51,-7.23 -1.67,-1.71 -4.09,-2.57 -7.26,-2.57h-4.7v5.66h3.97c1.04,0 1.95,0.38 2.71,1.15 0.73,0.73 1.1,1.75 1.1,3.04v7.86c0,1.64 0.33,2.99 0.99,4.03 0.66,1.05 1.72,1.73 3.19,2.04v0.42c-1.46,0.31 -2.52,1 -3.19,2.04 -0.66,1.05 -0.99,2.39 -0.99,4.03v7.86c0,1.29 -0.37,2.32 -1.1,3.09 -0.77,0.73 -1.67,1.1 -2.71,1.1h-3.97V160h4.7ZM110.19,112c-3.17,0 -5.59,0.87 -7.26,2.62 -1.67,1.71 -2.51,4.11 -2.51,7.18v7.34c0,1.43 -0.38,2.45 -1.15,3.04 -0.73,0.63 -1.65,0.94 -2.77,0.94h-1.25v5.76h1.25c1.11,0 2.04,0.3 2.77,0.89 0.77,0.63 1.15,1.66 1.15,3.09v7.34c0,3.11 0.83,5.52 2.51,7.23 1.67,1.71 4.09,2.57 7.26,2.57h4.7v-5.66h-3.97c-1.04,0 -1.95,-0.38 -2.71,-1.15 -0.73,-0.73 -1.1,-1.75 -1.1,-3.04v-7.86c0,-1.64 -0.33,-2.99 -0.99,-4.03 -0.66,-1.05 -1.72,-1.73 -3.18,-2.04v-0.42c1.46,-0.31 2.52,-1 3.18,-2.04 0.66,-1.05 0.99,-2.39 0.99,-4.03v-7.86c0,-1.29 0.37,-2.32 1.1,-3.09 0.77,-0.73 1.67,-1.1 2.71,-1.1h3.97V112h-4.7ZM126.83,341.22l18,18 -11.25,11.25 -18,-18z" />
37+
<path
38+
android:fillColor="#34A853"
39+
android:pathData="M133.59,244.47c-29.82,29.82 -29.82,78.18 0,108 29.82,29.82 78.18,29.82 108,0 29.82,-29.82 29.82,-78.18 -0,-108 -29.82,-29.82 -78.18,-29.82 -108,0Z" />
40+
<path
41+
android:fillColor="#E8F0FE"
42+
android:pathData="M187.59,298.47m-45,-45a63.64,63.64 90,1 1,90 90a63.64,63.64 90,1 1,-90 -90" />
43+
<path
44+
android:fillColor="#0D652D"
45+
android:pathData="M93.08,356.97c9.94,-9.94 26.06,-9.94 36,0 9.94,9.94 9.94,26.06 0,36l-31.5,31.5c-9.94,9.94 -26.06,9.94 -36,0 -9.94,-9.94 -9.94,-26.06 0,-36l31.5,-31.5Z" />
46+
<path
47+
android:fillColor="#00000000"
48+
android:pathData="M216.99,269.06c7.42,11.31 11.38,26.21 7.55,42.62"
49+
android:strokeWidth="25.456"
50+
android:strokeColor="#fff"
51+
android:strokeLineCap="round" />
52+
<path
53+
android:fillColor="#fff"
54+
android:pathData="m328.84,228.3 l54.4,-14.58 31.7,118.31 -54.4,14.58z"
55+
android:strokeWidth="4"
56+
android:strokeColor="#AECBFA" />
57+
<path
58+
android:fillColor="#4285F4"
59+
android:pathData="M362.62,272.1c-6.09,7.78 -12.96,10.05 -17.59,10.28 -1.7,0.08 -3.26,1.72 -2.82,3.35l30.44,113.83c4.24,15.84 20.47,25.33 36.45,21.31 16.41,-4.13 26.24,-20.88 21.76,-37.11l-31.22,-116.51a1.99,1.99 0,0 0,-0.33 -0.68c-6.77,-8.96 -26.64,-7.32 -36.71,5.53Z" />
60+
<path
61+
android:fillColor="#fff"
62+
android:pathData="M327.32,214.3L378.07,200.7A7.73,7.73 120,0 1,387.54 206.16L387.54,206.16A7.73,7.73 120,0 1,382.07 215.63L331.32,229.23A7.73,7.73 120,0 1,321.86 223.76L321.86,223.76A7.73,7.73 120,0 1,327.32 214.3z"
63+
android:strokeWidth="4"
64+
android:strokeColor="#AECBFA" />
65+
<path
66+
android:fillColor="#C6FF00"
67+
android:pathData="M70.22,218.1c0.84,-2.84 4.87,-2.84 5.71,0l3.54,11.95a5.95,5.95 0,0 0,4.02 4.02l11.95,3.54c2.84,0.84 2.84,4.87 0,5.71l-11.95,3.54a5.95,5.95 0,0 0,-4.02 4.02l-3.54,11.95c-0.84,2.84 -4.87,2.84 -5.71,0L66.68,250.88a5.95,5.95 0,0 0,-4.02 -4.02l-11.95,-3.54c-2.84,-0.84 -2.84,-4.87 0,-5.71l11.95,-3.54a5.95,5.95 0,0 0,4.02 -4.02L70.22,218.1ZM358.83,126.02c0.53,-1.78 3.04,-1.78 3.57,0l2.21,7.47a3.72,3.72 0,0 0,2.51 2.51l7.47,2.21c1.78,0.53 1.78,3.04 0,3.57l-7.47,2.21a3.72,3.72 0,0 0,-2.51 2.51l-2.21,7.47c-0.53,1.78 -3.04,1.78 -3.57,0l-2.21,-7.47a3.72,3.72 0,0 0,-2.51 -2.51l-7.47,-2.21c-1.78,-0.53 -1.78,-3.04 0,-3.57l7.47,-2.21a3.72,3.72 0,0 0,2.51 -2.51l2.21,-7.47Z" />
68+
</group>
69+
</vector>

app/src/main/res/drawable-anydpi/img_ui_guidelines.xml

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
Rounded.FamilyStar
21
Rounded.Shapes

script/compose-material-icons-generator/raw-icons/rounded/family_star.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)