Skip to content

Commit 02b9eb6

Browse files
author
minhnq
committed
feat: add skin builder web-base
1 parent 6c1c0fe commit 02b9eb6

6 files changed

Lines changed: 41 additions & 16 deletions

File tree

app/src/main/java/org/nqmgaming/aneko/presentation/StandardScaffold.kt

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import androidx.compose.runtime.mutableStateOf
3636
import androidx.compose.runtime.rememberCoroutineScope
3737
import androidx.compose.runtime.saveable.rememberSaveable
3838
import androidx.compose.runtime.setValue
39+
import androidx.compose.ui.Alignment
3940
import androidx.compose.ui.Modifier
4041
import androidx.compose.ui.draw.scale
4142
import androidx.compose.ui.draw.shadow
@@ -49,11 +50,14 @@ import androidx.compose.ui.unit.sp
4950
import androidx.hilt.navigation.compose.hiltViewModel
5051
import androidx.navigation.NavController
5152
import androidx.navigation.compose.currentBackStackEntryAsState
53+
import coil.compose.AsyncImage
5254
import com.ramcosta.composedestinations.utils.isRouteOnBackStackAsState
5355
import com.ramcosta.composedestinations.utils.rememberDestinationsNavigator
5456
import kotlinx.coroutines.Dispatchers
5557
import kotlinx.coroutines.launch
5658
import kotlinx.coroutines.withContext
59+
import org.nqmgaming.aneko.R
60+
import org.nqmgaming.aneko.util.openUrl
5761
import timber.log.Timber
5862

5963
@OptIn(ExperimentalMaterial3Api::class)
@@ -233,24 +237,36 @@ fun StandardScaffold(
233237
viewModel.setFirstLaunchDone()
234238
},
235239
title = {
236-
Text("Impotant Notice", style = typography.headlineSmall)
240+
Text(
241+
"Custom skins made easy with ANeko Builder",
242+
style = typography.headlineSmall
243+
)
237244
},
238245
text = {
239-
Column {
240-
Text("Thank you for installing ANeko! From version 1.3.0 you are no longer needed to import skins by installing APKs. You can now import skin by selecting ZIP files directly from the app.")
246+
Column(
247+
horizontalAlignment = Alignment.CenterHorizontally
248+
) {
249+
AsyncImage(
250+
model = R.drawable.skin_builder,
251+
contentDescription = "Skin builder preview",
252+
modifier = Modifier
253+
.size(200.dp),
254+
255+
)
256+
Text(
257+
"Thank you for installing ANeko! ANeko Builder is a new web tool designed to make creating and customizing skins simple and fun.",
258+
style = typography.bodyMedium
259+
)
241260
}
242261
},
243262
confirmButton = {
244263
TextButton(onClick = {
245264
// go to explore
246265
isShowingDialog = false
247266
viewModel.setFirstLaunchDone()
248-
navigator.navigate(BottomNavItem.Explore.direction) {
249-
launchSingleTop = true
250-
restoreState = true
251-
}
267+
context.openUrl(context.getString(R.string.skin_builder_url))
252268
}) {
253-
Text("Explore Now")
269+
Text("Take me there")
254270
}
255271
},
256272
dismissButton = {
@@ -259,7 +275,7 @@ fun StandardScaffold(
259275
viewModel.setFirstLaunchDone()
260276
Toast.makeText(
261277
context,
262-
"You can access Explore from the bottom navigation bar later.",
278+
"You can access ANeko Builder later from the Explore tab.",
263279
Toast.LENGTH_LONG
264280
).show()
265281
}) {

app/src/main/java/org/nqmgaming/aneko/presentation/explore/ExploreSkinScreen.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import androidx.compose.foundation.layout.padding
1616
import androidx.compose.foundation.layout.size
1717
import androidx.compose.foundation.lazy.LazyColumn
1818
import androidx.compose.material.icons.Icons
19+
import androidx.compose.material.icons.filled.Add
1920
import androidx.compose.material.icons.filled.Download
2021
import androidx.compose.material.icons.filled.Info
2122
import androidx.compose.material3.AlertDialog
@@ -204,6 +205,14 @@ fun ExploreSkin(
204205
)
205206
},
206207
actions = {
208+
IconButton(onClick = {
209+
context.openUrl(context.getString(R.string.skin_builder_url))
210+
}) {
211+
Icon(
212+
imageVector = Icons.Default.Add,
213+
contentDescription = null
214+
)
215+
}
207216
IconButton(onClick = { isShowInfoDialog = true }) {
208217
Icon(
209218
imageVector = Icons.Default.Info,
@@ -389,8 +398,7 @@ fun ExploreSkin(
389398
)
390399
TextButton(
391400
onClick = {
392-
openUrl(
393-
context,
401+
context.openUrl(
394402
context.getString(R.string.skin_collection_link)
395403
)
396404
}

app/src/main/java/org/nqmgaming/aneko/presentation/setting/SettingScreen.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fun SettingsScreen() {
8383
summary = stringResource(R.string.github_contribute_summary),
8484
icon = R.drawable.ic_github_mark,
8585
onClick = {
86-
openUrl(context, context.getString(R.string.github_uri))
86+
context.openUrl(context.getString(R.string.github_uri))
8787
}
8888
)
8989

@@ -96,7 +96,7 @@ fun SettingsScreen() {
9696
summary = stringResource(R.string.translate_contribute_summary),
9797
icon = R.drawable.ic_language,
9898
onClick = {
99-
openUrl(context, context.getString(R.string.poeditor_url))
99+
context.openUrl(context.getString(R.string.poeditor_url))
100100
}
101101
)
102102

@@ -109,7 +109,7 @@ fun SettingsScreen() {
109109
summary = stringResource(R.string.rate_app_summary),
110110
icon = R.drawable.ic_star, // Or any icon you have
111111
onClick = {
112-
openUrl(context, context.getString(R.string.rate_app_url))
112+
context.openUrl(context.getString(R.string.rate_app_url))
113113
}
114114
)
115115
}

app/src/main/java/org/nqmgaming/aneko/util/IntentUtil.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import android.content.Context
44
import android.content.Intent
55
import androidx.core.net.toUri
66

7-
fun openUrl(context: Context, url: String) {
7+
fun Context.openUrl(url: String) {
88
val intent = Intent(Intent.ACTION_VIEW, url.toUri())
9-
context.startActivity(intent)
9+
this.startActivity(intent)
1010
}
95.5 KB
Loading

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,6 @@
9292
<string name="importing">Importing…</string>
9393
<string name="installed">Installed</string>
9494
<string name="retry">Retry</string>
95+
<string name="skin_builder_url">https://devtool.pwhs.app/aneko-builder</string>
9596

9697
</resources>

0 commit comments

Comments
 (0)