mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 13:08:00 +01:00
show gif/raw/svg indications at file thumbnails
This commit is contained in:
parent
629bc2d463
commit
2aed30bd72
4 changed files with 49 additions and 0 deletions
|
@ -21,6 +21,8 @@ import com.simplemobiletools.gallery.pro.R
|
||||||
import com.simplemobiletools.gallery.pro.dialogs.DeleteWithRememberDialog
|
import com.simplemobiletools.gallery.pro.dialogs.DeleteWithRememberDialog
|
||||||
import com.simplemobiletools.gallery.pro.extensions.*
|
import com.simplemobiletools.gallery.pro.extensions.*
|
||||||
import com.simplemobiletools.gallery.pro.helpers.SHOW_ALL
|
import com.simplemobiletools.gallery.pro.helpers.SHOW_ALL
|
||||||
|
import com.simplemobiletools.gallery.pro.helpers.TYPE_GIFS
|
||||||
|
import com.simplemobiletools.gallery.pro.helpers.TYPE_RAWS
|
||||||
import com.simplemobiletools.gallery.pro.helpers.VIEW_TYPE_LIST
|
import com.simplemobiletools.gallery.pro.helpers.VIEW_TYPE_LIST
|
||||||
import com.simplemobiletools.gallery.pro.interfaces.MediaOperationsListener
|
import com.simplemobiletools.gallery.pro.interfaces.MediaOperationsListener
|
||||||
import com.simplemobiletools.gallery.pro.models.Medium
|
import com.simplemobiletools.gallery.pro.models.Medium
|
||||||
|
@ -445,6 +447,18 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Thumbnai
|
||||||
val isSelected = selectedKeys.contains(medium.path.hashCode())
|
val isSelected = selectedKeys.contains(medium.path.hashCode())
|
||||||
view.apply {
|
view.apply {
|
||||||
play_outline.beVisibleIf(medium.isVideo())
|
play_outline.beVisibleIf(medium.isVideo())
|
||||||
|
|
||||||
|
if (medium.isGIF() || medium.isRaw() || medium.isSVG()) {
|
||||||
|
file_type.setText(when (medium.type) {
|
||||||
|
TYPE_GIFS -> R.string.gif
|
||||||
|
TYPE_RAWS -> R.string.raw
|
||||||
|
else -> R.string.svg
|
||||||
|
})
|
||||||
|
file_type.beVisible()
|
||||||
|
} else {
|
||||||
|
file_type.beGone()
|
||||||
|
}
|
||||||
|
|
||||||
medium_name.beVisibleIf(displayFilenames || isListViewType)
|
medium_name.beVisibleIf(displayFilenames || isListViewType)
|
||||||
medium_name.text = medium.name
|
medium_name.text = medium.name
|
||||||
medium_name.tag = medium.path
|
medium_name.tag = medium.path
|
||||||
|
|
|
@ -24,6 +24,21 @@
|
||||||
android:src="@drawable/img_play_outline"
|
android:src="@drawable/img_play_outline"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/file_type"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_margin="@dimen/small_margin"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:shadowColor="@color/default_background_color"
|
||||||
|
android:shadowRadius="4"
|
||||||
|
android:text="@string/gif"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="@dimen/bigger_text_size"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/video_duration"
|
android:id="@+id/video_duration"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -55,6 +55,23 @@
|
||||||
android:src="@drawable/img_play_outline_empty"
|
android:src="@drawable/img_play_outline_empty"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/file_type"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_marginEnd="@dimen/small_margin"
|
||||||
|
android:paddingBottom="6dp"
|
||||||
|
android:paddingEnd="@dimen/small_margin"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:shadowColor="@color/default_background_color"
|
||||||
|
android:shadowRadius="4"
|
||||||
|
android:text="@string/gif"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="@dimen/normal_text_size"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/video_duration"
|
android:id="@+id/video_duration"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
<string name="gif">GIF</string>
|
||||||
|
<string name="raw">RAW</string>
|
||||||
|
<string name="svg">SVG</string>
|
||||||
<string name="package_name">com.simplemobiletools.gallery.pro</string>
|
<string name="package_name">com.simplemobiletools.gallery.pro</string>
|
||||||
|
|
||||||
<!-- Release notes -->
|
<!-- Release notes -->
|
||||||
|
|
Loading…
Reference in a new issue