增加app列表页面,app数据存入数据库,优化icon cache

This commit is contained in:
2025-10-31 09:37:13 +08:00
parent 56341f6888
commit 5cc7caf34f
33 changed files with 1930 additions and 115 deletions

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M271.96,64c-115.28,0 -208.87,93.67 -208.87,208.95C63.08,388.34 156.63,481.9 272.02,481.9h144.89c35.35,0 63.92,-28.76 63.92,-64.11L480.83,272.89c-0.01,-115.37 -93.5,-208.89 -208.87,-208.89zM416.88,417.79v0.03a0.93,0.93 0,0 1,0.04 0.14L272.02,417.96a145.24,145.24 0,1 1,144.86 -145.06v144.89zM416.9,542.23L272.02,542.23c-115.37,0 -208.9,93.52 -208.9,208.89 0,115.28 93.56,208.89 208.86,208.89 115.37,0 208.86,-93.53 208.86,-208.9v-144.89c-0.02,-35.35 -28.59,-63.98 -63.94,-63.98zM416.88,751.1a144.72,144.72 0,0 1,-88.48 133.5C310.56,892.15 291.6,895.88 272.02,895.88c-19.56,0 -38.52,-3.74 -56.35,-11.29A144.88,144.88 0,0 1,272.02 606.17h144.92a0.09,0.09 0,0 0,-0.04 0v144.92zM751.1,542.23h-144.89A63.97,63.97 0,0 0,542.23 606.21v144.89c0,115.37 93.52,208.9 208.89,208.9 115.28,0 208.89,-93.61 208.89,-208.89 -0,-115.37 -93.53,-208.89 -208.9,-208.89zM884.69,807.45a144.93,144.93 0,0 1,-278.52 -56.35L606.17,606.17h144.92A145,145 0,0 1,884.69 807.45zM606.21,481.9h144.89c115.37,0 208.9,-93.56 208.9,-208.95 0,-115.28 -93.61,-208.92 -208.89,-208.92 -115.37,0 -208.89,93.5 -208.89,208.87v144.89c0,35.35 28.63,64.11 63.98,64.11zM606.17,272.89A144.95,144.95 0,1 1,751.1 417.96L606.17,417.96a0.52,0.52 0,0 1,0 -0.14L606.17,272.89z"
android:fillColor="#8BC34A"/>
</vector>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<layout 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"
tools:context=".activity.app.AppListActivity">
<data>
<variable
name="click"
type="com.ttstd.dialer.activity.app.AppListActivity.BtnClick" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@@ -27,7 +27,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:layout_weight="2"
android:orientation="horizontal">
<TextView
@@ -181,6 +181,7 @@
android:scaleType="centerCrop"
android:src="@drawable/ic_douyin"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -250,6 +251,101 @@
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.shehuan.niv.NiceImageView
android:id="@+id/niceImageView5"
android:layout_width="100dp"
android:layout_height="100dp"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/black"
android:textSize="@dimen/home_item_text_size"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="@+id/niceImageView5"
app:layout_constraintStart_toStartOf="@+id/niceImageView5"
app:layout_constraintTop_toBottomOf="@+id/niceImageView5" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:onClick="@{click::openAppList}"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.shehuan.niv.NiceImageView
android:id="@+id/niceImageView6"
android:layout_width="100dp"
android:layout_height="100dp"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/ic_app"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:maxLines="1"
android:singleLine="true"
android:text="应用"
android:textColor="@color/black"
android:textSize="@dimen/home_item_text_size"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="@+id/niceImageView6"
app:layout_constraintStart_toStartOf="@+id/niceImageView6"
app:layout_constraintTop_toBottomOf="@+id/niceImageView6" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="120dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_icon"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginTop="8dp"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@mipmap/ic_launcher"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_app_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="8dp"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:text="appname"
android:textColor="@color/black"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/iv_icon" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>