feat: 新增关于页面与开源许可页面
- 新增 AboutActivity、LicensesActivity 及对应的 Slide 转场动画 - MainActivity 接入 CalendarMonthView,支持导航到关于页面 - 移除 composeResources 下的 AGENTS.md Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
50a42be9bc
commit
df0aa16d8e
@ -18,6 +18,14 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".AboutActivity"
|
||||
android:exported="false" />
|
||||
|
||||
<activity
|
||||
android:name=".LicensesActivity"
|
||||
android:exported="false" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
48
androidApp/src/main/kotlin/plus/rua/project/AboutActivity.kt
Normal file
48
androidApp/src/main/kotlin/plus/rua/project/AboutActivity.kt
Normal file
@ -0,0 +1,48 @@
|
||||
package plus.rua.project
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import plus.rua.project.ui.AboutScreen
|
||||
|
||||
class AboutActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
enableEdgeToEdge()
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
overrideActivityTransition(
|
||||
OVERRIDE_TRANSITION_OPEN,
|
||||
R.anim.slide_in_right,
|
||||
R.anim.slide_out_left
|
||||
)
|
||||
overrideActivityTransition(
|
||||
OVERRIDE_TRANSITION_CLOSE,
|
||||
R.anim.slide_in_left,
|
||||
R.anim.slide_out_right
|
||||
)
|
||||
}
|
||||
|
||||
setContent {
|
||||
AboutScreen(
|
||||
onBack = {
|
||||
finish()
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
@Suppress("DEPRECATION")
|
||||
overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right)
|
||||
}
|
||||
},
|
||||
onNavigateToLicenses = {
|
||||
startActivity(Intent(this, LicensesActivity::class.java))
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
@Suppress("DEPRECATION")
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package plus.rua.project
|
||||
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import plus.rua.project.ui.LicensesScreen
|
||||
|
||||
class LicensesActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
enableEdgeToEdge()
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
overrideActivityTransition(
|
||||
OVERRIDE_TRANSITION_OPEN,
|
||||
R.anim.slide_in_right,
|
||||
R.anim.slide_out_left
|
||||
)
|
||||
overrideActivityTransition(
|
||||
OVERRIDE_TRANSITION_CLOSE,
|
||||
R.anim.slide_in_left,
|
||||
R.anim.slide_out_right
|
||||
)
|
||||
}
|
||||
|
||||
setContent {
|
||||
LicensesScreen(
|
||||
onBack = {
|
||||
finish()
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
@Suppress("DEPRECATION")
|
||||
overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,14 @@
|
||||
package plus.rua.project
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import plus.rua.project.ui.CalendarMonthView
|
||||
|
||||
class MainActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
@ -13,7 +16,15 @@ class MainActivity : ComponentActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
setContent {
|
||||
App()
|
||||
CalendarMonthView(
|
||||
onNavigateToAbout = {
|
||||
startActivity(Intent(this, AboutActivity::class.java))
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
@Suppress("DEPRECATION")
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -21,5 +32,5 @@ class MainActivity : ComponentActivity() {
|
||||
@Preview
|
||||
@Composable
|
||||
fun AppAndroidPreview() {
|
||||
App()
|
||||
}
|
||||
CalendarMonthView()
|
||||
}
|
||||
|
||||
7
androidApp/src/main/res/anim/slide_in_left.xml
Normal file
7
androidApp/src/main/res/anim/slide_in_left.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<translate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="350"
|
||||
android:fromXDelta="-30%"
|
||||
android:toXDelta="0%"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in" />
|
||||
7
androidApp/src/main/res/anim/slide_in_right.xml
Normal file
7
androidApp/src/main/res/anim/slide_in_right.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<translate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="350"
|
||||
android:fromXDelta="100%"
|
||||
android:toXDelta="0%"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in" />
|
||||
7
androidApp/src/main/res/anim/slide_out_left.xml
Normal file
7
androidApp/src/main/res/anim/slide_out_left.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<translate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="350"
|
||||
android:fromXDelta="0%"
|
||||
android:toXDelta="-30%"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in" />
|
||||
7
androidApp/src/main/res/anim/slide_out_right.xml
Normal file
7
androidApp/src/main/res/anim/slide_out_right.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<translate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="350"
|
||||
android:fromXDelta="0%"
|
||||
android:toXDelta="100%"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in" />
|
||||
@ -1,26 +0,0 @@
|
||||
<!-- Parent: ../../../AGENTS.md -->
|
||||
<!-- Generated: 2026-05-20 | Updated: 2026-05-20 -->
|
||||
|
||||
# composeResources
|
||||
|
||||
## Purpose
|
||||
Compose Multiplatform 共享资源目录,存放跨平台可访问的图片和文件资源。
|
||||
|
||||
## Key Files
|
||||
|
||||
无(目录仅包含子目录)
|
||||
|
||||
## Subdirectories
|
||||
|
||||
| Directory | Purpose |
|
||||
|-----------|---------|
|
||||
| `drawable/` | 图片资源(图标、插图等) |
|
||||
| `files/` | 原始文件资源 |
|
||||
|
||||
## For AI Agents
|
||||
|
||||
### Working In This Directory
|
||||
- 资源通过 Compose 的 `Res` 对象访问(如 `Res.drawable.xxx`)
|
||||
- 添加新资源后需重新编译以生成访问代码
|
||||
|
||||
<!-- MANUAL: -->
|
||||
Loading…
x
Reference in New Issue
Block a user