This commit is contained in:
Light_summer
2024-10-04 12:41:20 +08:00
parent 6c2e7aef65
commit d26ec4edec
5 changed files with 30 additions and 20 deletions

4
app/.gitignore vendored
View File

@@ -1 +1,3 @@
/build /build
/release
/debug

View File

@@ -5,17 +5,19 @@
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<application <application
android:name=".App"
android:allowBackup="true" android:allowBackup="true"
android:enableOnBackInvokedCallback="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.KsuWebUI" android:theme="@style/Theme.KsuWebUI"
android:enableOnBackInvokedCallback="true" tools:targetApi="33">
android:networkSecurityConfig="@xml/network_security_config"
android:name=".App" <activity
tools:targetApi="33" > android:name=".MainActivity"
<activity android:name=".MainActivity"
android:exported="true"> android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@@ -23,11 +25,13 @@
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
android:name=".WebUIActivity" android:name=".WebUIActivity"
android:exported="true"
android:autoRemoveFromRecents="true" android:autoRemoveFromRecents="true"
android:documentLaunchMode="intoExisting" /> android:documentLaunchMode="intoExisting"
android:exported="true" />
</application> </application>
</manifest> </manifest>

View File

@@ -40,8 +40,7 @@ class WebUIActivity : ComponentActivity() {
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
setTaskDescription(ActivityManager.TaskDescription(name)) setTaskDescription(ActivityManager.TaskDescription(name))
} else { } else {
val taskDescription = val taskDescription = ActivityManager.TaskDescription.Builder().setLabel(name).build()
ActivityManager.TaskDescription.Builder().setLabel(name).build()
setTaskDescription(taskDescription) setTaskDescription(taskDescription)
} }
} }

View File

@@ -1,41 +1,44 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:id="@+id/appbar" android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:liftOnScroll="true" app:liftOnScroll="true"
app:liftOnScrollTargetViewId="@id/list" app:liftOnScrollTargetViewId="@id/list">
android:layout_height="wrap_content">
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:menu="@menu/main_menu" /> app:menu="@menu/main_menu" />
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/swipe_refresh" app:layout_behavior="@string/appbar_scrolling_view_behavior">
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" >
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/list" android:id="@+id/list"
android:clipToPadding="false"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:clipToPadding="false"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<TextView <TextView
android:id="@+id/info"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_anchor="@id/list"
android:id="@+id/info"
android:visibility="gone" android:visibility="gone"
app:layout_anchor="@id/list"
app:layout_anchorGravity="center" /> app:layout_anchorGravity="center" />
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@@ -1,3 +1,5 @@
@file:Suppress("UnstableApiUsage")
pluginManagement { pluginManagement {
repositories { repositories {
google { google {
@@ -12,7 +14,7 @@ pluginManagement {
} }
} }
dependencyResolutionManagement { dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS
repositories { repositories {
google() google()
mavenCentral() mavenCentral()