Skip to content

Commit

Permalink
fix: improve compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
std-microblock committed Feb 6, 2024
1 parent 7cb5032 commit 264c240
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ class RecyclerAdapterStickerList(private val act: MainActivity) :
holder.totalAll.text = s.all.toString();

when (s.type) {
"image/webp" -> {
"unknown", "image/webp" -> {
Glide.with(act)
.load(s.preview.url)
.load(if(s.preview.type==="webp") s.preview.url else R.drawable.bg_dark_round)
.error(ColorDrawable(Color.RED))
.into(holder.imageView)
holder.videoCard.visibility = View.GONE
Expand Down Expand Up @@ -138,7 +138,9 @@ class RecyclerAdapterStickerList(private val act: MainActivity) :

holder.syncBtn.setOnClickListener {
act.syncStickerPack(s, {
Toast.makeText(act, "同步完成", Toast.LENGTH_SHORT).show()
act.runOnUiThread {
Toast.makeText(act, "同步完成", Toast.LENGTH_SHORT).show()
}
}, { count, reasons ->
act.runOnUiThread {
AlertDialog.Builder(act)
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
</com.google.android.material.textfield.TextInputLayout>

<LinearLayout
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

Expand All @@ -188,10 +188,11 @@

<Button
android:id="@+id/syncAllBtn"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="同步所有" />
android:text="同步所有表情包"
android:textColor="#fff" />

<Button
android:id="@+id/refreshBtn"
Expand Down

0 comments on commit 264c240

Please sign in to comment.