Skip to content

Commit

Permalink
refactor: improve ui performance
Browse files Browse the repository at this point in the history
  • Loading branch information
std-microblock committed Feb 3, 2024
1 parent 702d38c commit d889dad
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class RecyclerAdapterStickerList(private val act: MainActivity) :
holder.syncedStatus.text = "低清 ${s.syncedState.lowQuality}\n高清 ${s.syncedState.highQuality}"
holder.exportedAll.text = s.remoteState.all.toString()
holder.exportedStatus.text = "低清 ${s.remoteState.lowQuality}\n高清 ${s.remoteState.highQuality}"
holder.totalAll.text = s.syncedState.all.toString();
holder.totalAll.text = s.all.toString();

holder.syncBtn.setOnClickListener {
val pd = ProgressDialog(act)
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/stickerManageView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:clipChildren="true"
android:clipToPadding="true" />
</LinearLayout>

</LinearLayout>
207 changes: 101 additions & 106 deletions app/src/main/res/layout/item_sticker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="70dp"
app:layout_constrainedWidth="true">

<TextView
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="69dp"
Expand All @@ -32,114 +40,101 @@
android:text=""
android:textSize="16sp" />

<LinearLayout
android:layout_width="wrap_content"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="200dp"
android:layout_height="match_parent"
android:orientation="horizontal">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="10sp"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="已同步"
android:textAlignment="gravity"
android:textSize="8sp" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">

<TextView
android:id="@+id/syncedAll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="1111" />

<TextView
android:id="@+id/syncedStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-7sp"
android:layout_weight="1"
android:text="111\n111"
android:textSize="8sp" />
</LinearLayout>

</LinearLayout>

<LinearLayout
android:visibility="gone">

<TextView
android:layout_width="24dp"
android:layout_height="12dp"
android:layout_marginStart="8dp"
android:layout_marginBottom="20dp"
android:text="已导出"
android:textAlignment="gravity"
android:textSize="8sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<TextView
android:id="@+id/exportedAll"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="10sp"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="已导出"
android:textAlignment="gravity"
android:textSize="8sp" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">

<TextView
android:id="@+id/exportedAll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="1111" />

<TextView
android:id="@+id/exportedStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-7sp"
android:layout_weight="1"
android:text="111\n111"
android:textSize="8sp" />
</LinearLayout>

</LinearLayout>

<LinearLayout
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginBottom="4dp"
android:layout_weight="1"
android:text="111"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<TextView
android:id="@+id/exportedStatus"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="包内表情总数"
android:textAlignment="gravity"
android:textSize="8sp" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">

<TextView
android:id="@+id/totalAll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="1111" />

</LinearLayout>

</LinearLayout>

</LinearLayout>
android:layout_height="wrap_content"
android:layout_marginStart="36dp"
android:layout_marginBottom="4dp"
android:layout_weight="1"
android:text="111\n111"
android:textSize="8sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="136dp"
android:layout_marginBottom="20dp"
android:text="包内表情总数"
android:textAlignment="gravity"
android:textSize="8sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<TextView
android:id="@+id/totalAll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="136dp"
android:layout_marginBottom="4dp"
android:layout_weight="1"
android:text="1111"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<TextView
android:id="@+id/syncedStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="100dp"
android:layout_marginBottom="4dp"
android:layout_weight="1"
android:text="111\n111"
android:textSize="8sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="72dp"
android:layout_marginBottom="20dp"
android:text="已同步"
android:textAlignment="gravity"
android:textSize="8sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<TextView
android:id="@+id/syncedAll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="72dp"
android:layout_marginBottom="4dp"
android:layout_weight="1"
android:text="111"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

</LinearLayout>

Expand Down

0 comments on commit d889dad

Please sign in to comment.