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

View File

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

View File

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

View File

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