1
0

style: Material Design 3

This commit is contained in:
Natsu 2024-06-18 02:43:10 +07:00
parent f01e9330a4
commit 181b6319f4
Signed by: NatsumeLS
GPG Key ID: 6DB67FB460CF46C6
10 changed files with 45 additions and 208 deletions

View File

@ -107,10 +107,10 @@ class GakumasHookMain : IXposedHookLoadPackage, IXposedHookZygoteInit {
val app = AndroidAppHelper.currentApplication()
if (nativeLibLoadSuccess) {
showToast("lib$nativeLibName.so loaded.")
showToast("Loaded lib$nativeLibName.so")
}
else {
showToast("Load native library lib$nativeLibName.so failed.")
showToast("lib$nativeLibName.so failed to load")
return
}

View File

@ -100,7 +100,7 @@ class MainActivity : AppCompatActivity(), ConfigUpdateListener {
configFile.readText()
}
else {
showToast("检测到第一次启动,初始化配置文件...")
showToast("Initializing configuration file...")
"{}"
}
}
@ -122,8 +122,7 @@ class MainActivity : AppCompatActivity(), ConfigUpdateListener {
val packInfo = packageManager.getPackageInfo(packageName, 0)
val version = packInfo.versionName
val versionCode = packInfo.longVersionCode
titleLabel.text = "${titleLabel.text} $version ($versionCode)"
titleLabel.text = "${titleLabel.text} $version"
}
catch (_: Exception) {}
versionLabel.text = "Assets Version: $versionText"
@ -135,7 +134,7 @@ class MainActivity : AppCompatActivity(), ConfigUpdateListener {
Gson().fromJson(configStr, GakumasConfig::class.java)
}
catch (e: JsonSyntaxException) {
showToast("配置文件异常,已重置: $e")
showToast("Configuration file has been reset: $e")
Gson().fromJson("{}", GakumasConfig::class.java)
}
saveConfig()

View File

@ -1,11 +0,0 @@
package io.github.chinosk.gakumas.localify.ui.theme
import androidx.compose.ui.graphics.Color
val Purple80 = Color(0xFFD0BCFF)
val PurpleGrey80 = Color(0xFFCCC2DC)
val Pink80 = Color(0xFFEFB8C8)
val Purple40 = Color(0xFF6650a4)
val PurpleGrey40 = Color(0xFF625b71)
val Pink40 = Color(0xFF7D5260)

View File

@ -1,70 +0,0 @@
package io.github.chinosk.gakumas.localify.ui.theme
import android.app.Activity
import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.material3.dynamicLightColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.SideEffect
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalView
import androidx.core.view.WindowCompat
private val DarkColorScheme = darkColorScheme(
primary = Purple80,
secondary = PurpleGrey80,
tertiary = Pink80
)
private val LightColorScheme = lightColorScheme(
primary = Purple40,
secondary = PurpleGrey40,
tertiary = Pink40
/* Other default colors to override
background = Color(0xFFFFFBFE),
surface = Color(0xFFFFFBFE),
onPrimary = Color.White,
onSecondary = Color.White,
onTertiary = Color.White,
onBackground = Color(0xFF1C1B1F),
onSurface = Color(0xFF1C1B1F),
*/
)
@Composable
fun GakumasLocalifyTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
// Dynamic color is available on Android 12+
dynamicColor: Boolean = true,
content: @Composable () -> Unit
) {
val colorScheme = when {
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
val context = LocalContext.current
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
}
darkTheme -> DarkColorScheme
else -> LightColorScheme
}
val view = LocalView.current
if (!view.isInEditMode) {
SideEffect {
val window = (view.context as Activity).window
window.statusBarColor = colorScheme.primary.toArgb()
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
}
}
MaterialTheme(
colorScheme = colorScheme,
typography = Typography,
content = content
)
}

View File

@ -1,34 +0,0 @@
package io.github.chinosk.gakumas.localify.ui.theme
import androidx.compose.material3.Typography
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.sp
// Set of Material typography styles to start with
val Typography = Typography(
bodyLarge = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 16.sp,
lineHeight = 24.sp,
letterSpacing = 0.5.sp
)
/* Other default text styles to override
titleLarge = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 22.sp,
lineHeight = 28.sp,
letterSpacing = 0.sp
),
labelSmall = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Medium,
fontSize = 11.sp,
lineHeight = 16.sp,
letterSpacing = 0.5.sp
)
*/
)

View File

@ -26,6 +26,7 @@
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@ -45,14 +46,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/gakumas_localify"
android:textColor="@color/black"
android:textSize="20sp" />
<TextView
android:id="@+id/textViewResVersion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/black" />
android:layout_height="wrap_content" />
<Space
android:layout_width="match_parent"
@ -123,7 +122,7 @@
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_height="60dp"
android:background="@android:color/transparent"
android:hint="@string/setFpsTitle"
app:boxBackgroundColor="@android:color/transparent">
@ -131,7 +130,7 @@
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/editTextTargetFps"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_height="match_parent"
android:ems="10"
android:inputType="numberSigned"
android:onTextChanged="@{(s, st, b, a) -> listener.onTargetFpsChanged(s, st, b, a)}"
@ -269,8 +268,7 @@
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/orientation_lock"
android:textColor="@color/material_dynamic_neutral0"/>
android:text="@string/orientation_lock" />
<RadioGroup
android:layout_width="match_parent"
@ -359,7 +357,8 @@
android:layout_weight="1"
android:minWidth="1sp"
android:onClick="@{() -> listener.onChangePresetQuality(4)}"
android:text="@string/max_high" />
android:text="@string/max_high"
android:textSize="12sp" />
<com.google.android.material.button.MaterialButton
android:id="@+id/qualityVeryHighButton"
@ -369,7 +368,8 @@
android:layout_weight="1"
android:minWidth="1sp"
android:onClick="@{() -> listener.onChangePresetQuality(3)}"
android:text="@string/very_high" />
android:text="@string/very_high"
android:textSize="12sp" />
<com.google.android.material.button.MaterialButton
android:id="@+id/qualityHighButton"
@ -379,7 +379,8 @@
android:layout_weight="1"
android:minWidth="1sp"
android:onClick="@{() -> listener.onChangePresetQuality(2)}"
android:text="@string/hign" />
android:text="@string/hign"
android:textSize="12sp" />
<com.google.android.material.button.MaterialButton
android:id="@+id/qualityMidButton"
@ -389,7 +390,8 @@
android:layout_weight="1"
android:minWidth="1sp"
android:onClick="@{() -> listener.onChangePresetQuality(1)}"
android:text="@string/middle" />
android:text="@string/middle"
android:textSize="12sp" />
<com.google.android.material.button.MaterialButton
android:id="@+id/qualityLowButton"
@ -398,7 +400,8 @@
android:layout_weight="1"
android:minWidth="1sp"
android:onClick="@{() -> listener.onChangePresetQuality(0)}"
android:text="@string/low" />
android:text="@string/low"
android:textSize="12sp" />
</LinearLayout>
@ -422,6 +425,7 @@
android:id="@+id/editTextRenderScaleLayout"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginRight="6dp"
android:layout_weight="1"
android:background="@android:color/transparent"
android:hint="@string/renderscale"
@ -448,7 +452,7 @@
android:layout_height="48dp"
android:layout_weight="1"
android:background="@android:color/transparent"
android:hint="QualityLevel (1/1/2/3/5)"
android:hint="Quality Level (1-5)"
app:boxBackgroundColor="@android:color/transparent">
<com.google.android.material.textfield.TextInputEditText
@ -456,7 +460,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:ems="10"
android:hint="1/1/2/3/5"
android:hint="1/2/3/4/5"
android:inputType="number"
android:onTextChanged="@{(s, st, b, a) -> listener.onQualitySettingsLevelChanged(s, st, b, a)}"
android:paddingStart="0dp"
@ -478,9 +482,10 @@
android:id="@+id/editTextVolumeIndexLayout"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginRight="6dp"
android:layout_weight="1"
android:background="@android:color/transparent"
android:hint="VolumeIndex (0/1/2/3/4)"
android:hint="Volume Index (0-4)"
app:boxBackgroundColor="@android:color/transparent">
<com.google.android.material.textfield.TextInputEditText
@ -504,7 +509,7 @@
android:layout_height="48dp"
android:layout_weight="1"
android:background="@android:color/transparent"
android:hint="MaxBufferPixel (1024/1440/2538/3384/8190)"
android:hint="Max Buffer Pixel (1024-8190)"
app:boxBackgroundColor="@android:color/transparent">
<com.google.android.material.textfield.TextInputEditText
@ -534,9 +539,10 @@
android:id="@+id/editTextReflectionQualityLevelLayout"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginRight="6dp"
android:layout_weight="1"
android:background="@android:color/transparent"
android:hint="ReflectionLevel (0~5)"
android:hint="Reflection Level (1-5)"
app:boxBackgroundColor="@android:color/transparent">
<com.google.android.material.textfield.TextInputEditText
@ -544,7 +550,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:ems="10"
android:hint="0/1/2/3/4/5"
android:hint="1/2/3/4/5"
android:inputType="number"
android:onTextChanged="@{(s, st, b, a) -> listener.onReflectionQualityLevelChanged(s, st, b, a)}"
android:paddingStart="0dp"
@ -560,7 +566,7 @@
android:layout_height="48dp"
android:layout_weight="1"
android:background="@android:color/transparent"
android:hint="LOD Level (0~5)"
android:hint="LOD Level (1-5)"
app:boxBackgroundColor="@android:color/transparent">
<com.google.android.material.textfield.TextInputEditText
@ -568,7 +574,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:ems="10"
android:hint="0/1/2/3/4/5"
android:hint="1/2/3/4/5"
android:inputType="number"
android:onTextChanged="@{(s, st, b, a) -> listener.onLodQualityLevelChanged(s, st, b, a)}"
android:paddingStart="0dp"
@ -704,6 +710,7 @@
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginRight="6dp"
android:layout_weight="1"
android:background="@android:color/transparent"
android:hint="@string/damping"
@ -754,6 +761,7 @@
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginRight="6dp"
android:layout_weight="1"
android:background="@android:color/transparent"
android:hint="@string/spring"
@ -804,6 +812,7 @@
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginRight="6dp"
android:layout_weight="1"
android:background="@android:color/transparent"
android:hint="@string/pendulumrange"

View File

@ -1,46 +0,0 @@
<resources>
<string name="app_name">Gakumas Localify</string>
<string name="gakumas_localify">Gakumas Localify</string>
<string name="enable_plugin">启用插件 (不可热重载)</string>
<string name="enable_free_camera">启用自由视角(可热重载; 需使用实体键盘)</string>
<string name="start_game">以上述配置启动游戏/重载配置</string>
<string name="setFpsTitle">最大 FPS (0 为保持游戏原设置)</string>
<string name="unlockAllLive">解锁所有 Live</string>
<string name="liveUseCustomeDress">Live 使用自定义角色</string>
<string name="live_costume_head_id">Live 自定义头部 ID (例: costume_head_hski-cstm-0002)</string>
<string name="live_custome_dress_id">Live 自定义服装 ID (例: hski-cstm-0002)</string>
<string name="useCustomeGraphicSettings">使用自定义画质设置</string>
<string name="renderscale">RenderScale (0.5/0.59/0.67/0.77/1.0)</string>
<string name="text_hook_test_mode">文本 hook 测试模式</string>
<string name="export_text">导出文本</string>
<string name="force_export_resource">启动后强制导出资源</string>
<string name="max_high">极高</string>
<string name="very_high">超高</string>
<string name="hign"></string>
<string name="middle"></string>
<string name="low"></string>
<string name="orientation_orig">游戏原版</string>
<string name="orientation_portrait">竖屏</string>
<string name="orientation_landscape">横屏</string>
<string name="orientation_lock">方向锁定</string>
<string name="enable_breast_param">启用胸部参数</string>
<string name="damping">阻尼 (Damping)</string>
<string name="stiffness">刚度 (Stiffness)</string>
<string name="spring">弹簧系数 (Spring)</string>
<string name="pendulum">钟摆系数 (Pendulum)</string>
<string name="pendulumrange">钟摆范围 (PendulumRange)</string>
<string name="average">Average</string>
<string name="rootweight">RootWeight</string>
<string name="uselimit_0_1">范围限制倍率 (0 为不限制, 1 为原版)</string>
<string name="usearmcorrection">使用手臂矫正</string>
<string name="isdirty">IsDirty</string>
<string name="usescale">应用缩放</string>
<string name="breast_scale">胸部缩放倍率</string>
<string name="uselimitmultiplier">启用范围限制倍率</string>
<string name="axisx_x">axisX.x</string>
<string name="axisy_x">axisY.x</string>
<string name="axisz_x">axisZ.x</string>
<string name="axisx_y">axisX.y</string>
<string name="axisy_y">axisY.y</string>
<string name="axisz_y">axisZ.y</string>
</resources>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>

View File

@ -1,29 +1,29 @@
<resources>
<string name="app_name">Gakumas Localify EN</string>
<string name="gakumas_localify">Gakumas Localify EN</string>
<string name="enable_plugin">Enable Plugin (Not Hot Reloadable)</string>
<string name="enable_plugin">Enable Plugin (Require Game Restart)</string>
<string name="enable_free_camera">Enable Free Camera</string>
<string name="start_game">Start Game / Hot Reload Config</string>
<string name="setFpsTitle">Max FPS (0 is Use Original Settings)</string>
<string name="start_game">Start Game / Reload Config</string>
<string name="setFpsTitle">Custom Max FPS (0 is Disabled)</string>
<string name="unlockAllLive">Unlock All Live</string>
<string name="liveUseCustomeDress">Live Custom Character</string>
<string name="live_costume_head_id">Live Custom Head ID (eg. costume_head_hski-cstm-0002)</string>
<string name="live_custome_dress_id">Live Custom Dress ID (eg. hski-cstm-0002)</string>
<string name="useCustomeGraphicSettings">Use Custom Graphics Settings</string>
<string name="renderscale">RenderScale (0.5/0.59/0.67/0.77/1.0)</string>
<string name="text_hook_test_mode">Text Hook Test Mode</string>
<string name="export_text">Export Text</string>
<string name="renderscale">Render Scale (0.5-1.0)</string>
<string name="text_hook_test_mode">Text Hook Test Mode (For Testing Only)</string>
<string name="export_text">Export Text (For Collecting Strings)</string>
<string name="force_export_resource">Force Update Resource</string>
<string name="max_high">Ultra</string>
<string name="very_high">Very High</string>
<string name="hign">High</string>
<string name="middle">Mid</string>
<string name="middle">Med</string>
<string name="low">Low</string>
<string name="orientation_orig">Original</string>
<string name="orientation_orig">None</string>
<string name="orientation_portrait">Portrait</string>
<string name="orientation_landscape">Landscape</string>
<string name="orientation_lock">Orientation Lock</string>
<string name="enable_breast_param">Enable Breast Param</string>
<string name="enable_breast_param">Custom Breast Parameters</string>
<string name="damping">Damping</string>
<string name="stiffness">Stiffness</string>
<string name="spring">Spring</string>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.GakumasLocalify" parent="@style/Theme.MaterialComponents.Light.NoActionBar" />
<style name="Theme.GakumasLocalify" parent="@style/Theme.Material3.DynamicColors.DayNight.NoActionBar" />
</resources>