Skip to content

Commit

Permalink
feat: unsupported tips
Browse files Browse the repository at this point in the history
  • Loading branch information
MicroCBer committed Feb 5, 2024
1 parent eda2392 commit 62e90d8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class RecyclerAdapterStickerList(private val act: MainActivity) :
val imageView: ShapeableImageView = view.findViewById(R.id.imageView)
val videoView: VideoView = view.findViewById(R.id.videoView)
val videoCard: CardView = view.findViewById(R.id.videoCard)
val unsupported: TextView = view.findViewById(R.id.unsupported)
}

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
Expand Down Expand Up @@ -103,6 +104,9 @@ class RecyclerAdapterStickerList(private val act: MainActivity) :
holder.videoCard.visibility = View.GONE
holder.imageView.visibility = View.VISIBLE
holder.videoView.stopPlayback()
holder.unsupported.visibility = View.GONE
holder.rmBtn.visibility = View.VISIBLE
holder.syncBtn.visibility = View.VISIBLE
}
"webm" -> {
holder.videoView.setVideoPath(s.preview.url)
Expand All @@ -118,12 +122,18 @@ class RecyclerAdapterStickerList(private val act: MainActivity) :

holder.videoCard.visibility = View.VISIBLE
holder.imageView.visibility = View.GONE
holder.unsupported.visibility = View.GONE
holder.rmBtn.visibility = View.VISIBLE
holder.syncBtn.visibility = View.VISIBLE
}
else -> {
holder.imageView.setImageResource(R.drawable.ic_launcher_background)
holder.imageView.visibility = View.VISIBLE
holder.videoCard.visibility = View.GONE
holder.videoView.stopPlayback()
holder.rmBtn.visibility = View.GONE
holder.syncBtn.visibility = View.GONE
holder.unsupported.visibility = View.VISIBLE
}
}

Expand Down Expand Up @@ -360,7 +370,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
it.set(binding.stickerManageView, 1000)
}


stickerList.observe(this) {
runOnUiThread {
(binding.stickerManageView.adapter as RecyclerAdapterStickerList).stickerList = it.filter {
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/res/layout/item_sticker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,15 @@
android:paddingBottom="-10dp" />
</androidx.cardview.widget.CardView>

<TextView
android:id="@+id/unsupported"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="-20dp"
android:layout_marginBottom="24dp"
android:text="不支持的格式"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/rmBtn" />

</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit 62e90d8

Please sign in to comment.