fix #263, add an indicator to directories located on sd cards

This commit is contained in:
tibbi 2017-06-28 23:56:07 +02:00
parent e0702ee7cb
commit 3ec99cd43b
2 changed files with 18 additions and 5 deletions

View file

@ -14,10 +14,7 @@ import com.google.gson.Gson
import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.dialogs.ConfirmationDialog
import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.dialogs.PropertiesDialog
import com.simplemobiletools.commons.dialogs.RenameItemDialog import com.simplemobiletools.commons.dialogs.RenameItemDialog
import com.simplemobiletools.commons.extensions.isAStorageRootFolder import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.extensions.isImageVideoGif
import com.simplemobiletools.commons.extensions.needsStupidWritePermissions
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.SimpleActivity import com.simplemobiletools.gallery.activities.SimpleActivity
import com.simplemobiletools.gallery.dialogs.ExcludeFolderDialog import com.simplemobiletools.gallery.dialogs.ExcludeFolderDialog
@ -425,8 +422,9 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
itemView.apply { itemView.apply {
dir_name.text = directory.name dir_name.text = directory.name
photo_cnt.text = directory.mediaCnt.toString() photo_cnt.text = directory.mediaCnt.toString()
dir_pin.visibility = if (isPinned) View.VISIBLE else View.GONE
activity.loadImage(directory.tmb, dir_thumbnail, scrollVertically) activity.loadImage(directory.tmb, dir_thumbnail, scrollVertically)
dir_pin.beVisibleIf(isPinned)
dir_sd_card.beVisibleIf(activity.isPathOnSD(directory.path))
setOnClickListener { viewClicked(directory) } setOnClickListener { viewClicked(directory) }
setOnLongClickListener { if (isPickIntent) viewClicked(directory) else viewLongClicked(); true } setOnLongClickListener { if (isPickIntent) viewClicked(directory) else viewLongClicked(); true }

View file

@ -64,4 +64,19 @@
android:textSize="@dimen/normal_text_size"/> android:textSize="@dimen/normal_text_size"/>
</LinearLayout> </LinearLayout>
<ImageView
android:id="@+id/dir_sd_card"
android:layout_width="@dimen/pin_size"
android:layout_height="@dimen/pin_size"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:alpha="0.8"
android:paddingBottom="@dimen/small_margin"
android:paddingEnd="@dimen/small_margin"
android:paddingRight="@dimen/small_margin"
android:src="@drawable/ic_sd_card"
android:visibility="gone"/>
</RelativeLayout> </RelativeLayout>