Skip to content

Commit

Permalink
feat: add about page
Browse files Browse the repository at this point in the history
  • Loading branch information
xz-dev committed Apr 16, 2023
1 parent f561b94 commit f8e539f
Show file tree
Hide file tree
Showing 15 changed files with 114 additions and 14 deletions.
15 changes: 15 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ android {
// 视图绑定
dataBinding true
viewBinding true
compose true
}

dependenciesInfo.includeInApk false
Expand All @@ -85,6 +86,9 @@ android {
}
buildToolsVersion '33.0.0'
namespace 'net.xzos.upgradeall'
composeOptions {
kotlinCompilerExtensionVersion '1.4.5'
}
}

dependencies {
Expand Down Expand Up @@ -112,10 +116,21 @@ dependencies {
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
implementation 'androidx.core:core-ktx:1.10.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'
implementation 'androidx.activity:activity-compose:1.7.0'
implementation 'androidx.compose.ui:ui-viewbinding:1.5.0-alpha02'
implementation platform('androidx.compose:compose-bom:2023.04.00')
implementation 'androidx.compose.ui:ui:1.5.0-alpha02'
implementation 'androidx.compose.ui:ui-graphics:1.5.0-alpha02'
implementation 'androidx.compose.ui:ui-tooling-preview:1.5.0-alpha02'
implementation 'androidx.compose.material3:material3:1.1.0-beta02'
androidTestImplementation platform('androidx.compose:compose-bom:2023.04.00')
androidTestImplementation 'androidx.compose.ui:ui-test-junit4:1.5.0-alpha02'

// Java desugar
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
implementation 'com.jakewharton.threetenabp:threetenabp:1.4.6'
debugImplementation 'androidx.compose.ui:ui-tooling:1.5.0-alpha02'
debugImplementation 'androidx.compose.ui:ui-test-manifest:1.5.0-alpha02'

// WorkManager
def work_version = '2.8.1'
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
tools:targetApi="m">
<activity
android:name=".ui.home.AboutActivity"
android:exported="false"
android:label="@string/about"
android:theme="@style/AppTheme" />
<activity
android:name=".ui.restore.RestoreActivity"
android:exported="false" />
Expand All @@ -51,7 +56,7 @@
</intent-filter>
</receiver>
<receiver
android:name="net.xzos.upgradeall.core.installer.status.AppInstallReceiver"
android:name=".core.installer.status.AppInstallReceiver"
android:exported="true">
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
Expand Down
72 changes: 72 additions & 0 deletions app/src/main/java/net/xzos/upgradeall/ui/home/AboutActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package net.xzos.upgradeall.ui.home

import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.viewinterop.AndroidViewBinding
import androidx.core.content.ContextCompat
import net.xzos.upgradeall.R
import net.xzos.upgradeall.databinding.LayoutHomeTitleBarBinding
import net.xzos.upgradeall.databinding.LayoutHomeUpdatingCardBinding
import net.xzos.upgradeall.ui.base.BaseActivity
import net.xzos.upgradeall.utils.MiscellaneousUtils

class AboutActivity : BaseActivity() {
@OptIn(ExperimentalMaterial3Api::class)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
@Composable
fun AboutText() {
Text(stringResource(R.string.about))
}
Scaffold(
topBar = {
TopAppBar(title = { AboutText() },
navigationIcon = {
IconButton(onClick = { finish() }) {
Icon(
imageVector = Icons.Filled.ArrowBack,
contentDescription = "Back"
)
}
}
)
}
) { innerPadding ->
Column(modifier = Modifier.padding(innerPadding)) {
AndroidViewBinding(LayoutHomeTitleBarBinding::inflate)
AndroidViewBinding(LayoutHomeUpdatingCardBinding::inflate) {
ivIcon.setImageResource(R.drawable.ic_url)
tsTitle.setText(getString(R.string.official_website))
val url = "https://up-a.org/"
tvSubtitle.text = url
layoutCard.setOnClickListener {
MiscellaneousUtils.accessByBrowser(url, layoutCard.context)
}
}
AndroidViewBinding(LayoutHomeUpdatingCardBinding::inflate) {
tsTitle.setText(getString(R.string.donate))
val url = "https://afdian.net/a/inkflaw"
tvSubtitle.text = url
layoutCard.setOnClickListener {
MiscellaneousUtils.accessByBrowser(url, layoutCard.context)
}
}
}
}
}
}
}
14 changes: 11 additions & 3 deletions app/src/main/java/net/xzos/upgradeall/ui/home/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ import net.xzos.upgradeall.ui.applist.magisk.MagiskModuleActivity
import net.xzos.upgradeall.ui.base.BaseActivity
import net.xzos.upgradeall.ui.discover.DiscoverActivity
import net.xzos.upgradeall.ui.filemanagement.FileManagementActivity
import net.xzos.upgradeall.ui.home.adapter.*
import net.xzos.upgradeall.ui.home.adapter.HomeModuleAdapter
import net.xzos.upgradeall.ui.home.adapter.HomeModuleBean
import net.xzos.upgradeall.ui.home.adapter.HomeModuleCardBean
import net.xzos.upgradeall.ui.home.adapter.HomeModuleNonCardBean
import net.xzos.upgradeall.ui.home.adapter.HomeSimpleCardBean
import net.xzos.upgradeall.ui.hubmanager.HubManagerActivity
import net.xzos.upgradeall.ui.log.LogActivity
import net.xzos.upgradeall.ui.preference.SettingsActivity
import net.xzos.upgradeall.utils.MiscellaneousUtils
import net.xzos.upgradeall.utils.UxUtils


Expand Down Expand Up @@ -72,7 +75,7 @@ class MainActivity : BaseActivity() {
startActivity(Intent(this, SettingsActivity::class.java))
},
HomeModuleNonCardBean(R.drawable.ic_home_about, R.string.home_about) {
MiscellaneousUtils.accessByBrowser("https://up-a.org/", this)
startActivity(Intent(this, AboutActivity::class.java))
}
))
} else {
Expand Down Expand Up @@ -106,28 +109,33 @@ class MainActivity : BaseActivity() {
HomeModuleCardBean(R.drawable.ic_home_discovery, R.string.home_module_discovery) {
startActivity(Intent(this, DiscoverActivity::class.java))
}

HOME_MODULE_HUB_MANAGER ->
HomeModuleCardBean(R.drawable.ic_home_hub, R.string.app_hub) {
startActivity(Intent(this, HubManagerActivity::class.java))
}

HOME_MODULE_FILE_MANAGER ->
HomeModuleCardBean(
R.drawable.ic_home_file_management,
R.string.home_module_file_management
) {
startActivity(Intent(this, FileManagementActivity::class.java))
}

HOME_MODULE_APPS_LIST ->
HomeModuleCardBean(R.drawable.ic_home_apps, R.string.home_module_apps) {
startActivity(Intent(this, AppsActivity::class.java))
}

HOME_MODULE_MAGISK_LIST ->
HomeModuleCardBean(
R.drawable.ic_home_magisk_module,
R.string.home_module_magisk_module
) {
startActivity(Intent(this, MagiskModuleActivity::class.java))
}

else -> null
}
}
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-de-rDE/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,4 @@
<string name="url">URL</string>
<string name="app_base_hub">Base APP Hub</string>
<string name="app_id">APP ID</string>
<string name="title_activity_neo_app_setting">NeoAppSettingActivity</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@
<string name="url">Url</string>
<string name="app_base_hub">App Hub básica</string>
<string name="app_id">APP ID</string>
<string name="title_activity_neo_app_setting">NeoApp ConfiguraciónActividad</string>
<string name="download_paused">Descargar Pausa</string>
<string name="download_service_running">Descargar Servicio en marcha</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,4 @@
<string name="url">URL:</string>
<string name="app_base_hub">Base APP Hub</string>
<string name="app_id">APP ID</string>
<string name="title_activity_neo_app_setting">NeoAppSettingActivity</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
<string name="app_base_hub">Base APP Hub</string>
<string name="app_id">APP ID</string>
<string name="url">URL</string>
<string name="title_activity_neo_app_setting">NeoAppSettingActivity</string>
<string name="app">App</string>
<string name="help">Ajuda</string>
<string name="update">Atualizar</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-ru-rRU/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@
<string name="url">URL</string>
<string name="app_base_hub">Base APP Hub</string>
<string name="app_id">APP ID</string>
<string name="title_activity_neo_app_setting">NeoAppSettingActivity</string>
<string name="data_expiration_time_desc">Время истечения срока действия кэша данных о номере версии, полученных из Интернета.
\nОтключено для значения 0 (только для отладки).</string>
<string name="custom_include_version_number_field_regex">Regex для поля обязательного включения имени версии</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-tr-rTR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,4 @@
<string name="url">URL</string>
<string name="app_base_hub">Temel APP Hub</string>
<string name="app_id">Uygulama Kimliği</string>
<string name="title_activity_neo_app_setting">NeoAppSettingActivity</string>
</resources>
5 changes: 4 additions & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,8 @@
<string name="url">网址</string>
<string name="app_base_hub">基础软件源</string>
<string name="app_id">应用 ID</string>
<string name="title_activity_neo_app_setting">NeoAppSettingActivity</string>
<!-- About -->
<string name="official_website">官网</string>
<string name="about">关于</string>
<string name="donate">打赏</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,4 @@
<string name="url">網址</string>
<string name="app_base_hub">Base APP Hub</string>
<string name="app_id">APP ID</string>
<string name="title_activity_neo_app_setting">NeoAppSettingActivity</string>
</resources>
5 changes: 4 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -210,5 +210,8 @@
<string name="example_url" translatable="false">https://example.com/</string>
<string name="app_base_hub">Basic App Hub</string>
<string name="app_id">App ID</string>
<string name="title_activity_neo_app_setting">NeoAppSettingActivity</string>
<!-- About -->
<string name="official_website">Official Website</string>
<string name="about">About</string>
<string name="donate">Donate</string>
</resources>
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ buildscript {

plugins {
id 'org.jetbrains.kotlin.jvm' version '1.8.20'
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
}

allprojects {
Expand Down
2 changes: 1 addition & 1 deletion core-installer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ dependencies {
implementation "androidx.documentfile:documentfile:1.0.1"

// Shizuku
def shizuku_version = '12.2.0'
def shizuku_version = '13.1.1'
implementation "dev.rikka.shizuku:api:$shizuku_version"
// add this if you want to support Shizuku
implementation "dev.rikka.shizuku:provider:$shizuku_version"
Expand Down

0 comments on commit f8e539f

Please sign in to comment.