mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
highlight selected items at list views too
This commit is contained in:
parent
9ff50cc48a
commit
1b5040ebcd
4 changed files with 27 additions and 19 deletions
|
@ -680,6 +680,10 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
|
|||
dir_check.background?.applyColorFilter(primaryColor)
|
||||
}
|
||||
|
||||
if (isListViewType) {
|
||||
dir_holder.isSelected = isSelected
|
||||
}
|
||||
|
||||
if (scrollHorizontally && !isListViewType && folderStyle == FOLDER_STYLE_ROUNDED_CORNERS) {
|
||||
(dir_thumbnail.layoutParams as RelativeLayout.LayoutParams).addRule(RelativeLayout.ABOVE, dir_name.id)
|
||||
|
||||
|
|
|
@ -534,6 +534,10 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: ArrayList<ThumbnailI
|
|||
medium_check?.background?.applyColorFilter(primaryColor)
|
||||
}
|
||||
|
||||
if (isListViewType) {
|
||||
media_item_holder.isSelected = isSelected
|
||||
}
|
||||
|
||||
var path = medium.path
|
||||
if (hasOTGConnected && context.isPathOnOTG(path)) {
|
||||
path = path.getOTGPublicPath(context)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/dir_holder"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:foreground="@drawable/selector"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:paddingTop="@dimen/small_margin"
|
||||
android:paddingBottom="@dimen/small_margin">
|
||||
|
@ -14,7 +14,7 @@
|
|||
<com.simplemobiletools.gallery.pro.views.MySquareImageView
|
||||
android:id="@+id/dir_thumbnail"
|
||||
android:layout_width="@dimen/list_view_folder_thumbnail_size"
|
||||
android:layout_height="@dimen/list_view_folder_thumbnail_size"/>
|
||||
android:layout_height="@dimen/list_view_folder_thumbnail_size" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dir_lock"
|
||||
|
@ -29,7 +29,7 @@
|
|||
android:contentDescription="@string/lock_folder"
|
||||
android:padding="@dimen/medium_margin"
|
||||
android:src="@drawable/ic_lock_vector"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dir_check"
|
||||
|
@ -43,7 +43,7 @@
|
|||
android:contentDescription="@null"
|
||||
android:padding="@dimen/tiny_margin"
|
||||
android:src="@drawable/ic_check_vector"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dir_name"
|
||||
|
@ -55,7 +55,7 @@
|
|||
android:paddingStart="@dimen/medium_margin"
|
||||
android:paddingEnd="@dimen/medium_margin"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/bigger_text_size"/>
|
||||
android:textSize="@dimen/bigger_text_size" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dir_path"
|
||||
|
@ -70,7 +70,7 @@
|
|||
android:paddingStart="@dimen/medium_margin"
|
||||
android:paddingEnd="@dimen/medium_margin"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/smaller_text_size"/>
|
||||
android:textSize="@dimen/smaller_text_size" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/photo_cnt"
|
||||
|
@ -80,7 +80,7 @@
|
|||
android:layout_toEndOf="@+id/dir_name"
|
||||
android:alpha="0.4"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/smaller_text_size"/>
|
||||
android:textSize="@dimen/smaller_text_size" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dir_icon_holder"
|
||||
|
@ -100,7 +100,7 @@
|
|||
android:contentDescription="@null"
|
||||
android:paddingBottom="@dimen/small_margin"
|
||||
android:src="@drawable/ic_sd_card_vector"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dir_pin"
|
||||
|
@ -109,7 +109,7 @@
|
|||
android:contentDescription="@string/pin"
|
||||
android:paddingBottom="@dimen/small_margin"
|
||||
android:src="@drawable/ic_pin"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/media_item_holder"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -8,6 +7,7 @@
|
|||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:foreground="@drawable/selector"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:paddingTop="@dimen/small_margin"
|
||||
android:paddingBottom="@dimen/small_margin">
|
||||
|
@ -15,7 +15,7 @@
|
|||
<com.simplemobiletools.gallery.pro.views.MySquareImageView
|
||||
android:id="@+id/medium_thumbnail"
|
||||
android:layout_width="@dimen/list_view_folder_thumbnail_size"
|
||||
android:layout_height="@dimen/list_view_folder_thumbnail_size"/>
|
||||
android:layout_height="@dimen/list_view_folder_thumbnail_size" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/medium_check"
|
||||
|
@ -29,7 +29,7 @@
|
|||
android:contentDescription="@null"
|
||||
android:padding="@dimen/tiny_margin"
|
||||
android:src="@drawable/ic_check_vector"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/medium_name"
|
||||
|
@ -45,7 +45,7 @@
|
|||
android:paddingEnd="@dimen/normal_margin"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/bigger_text_size"
|
||||
tools:text="My photo"/>
|
||||
tools:text="My photo" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/play_outline"
|
||||
|
@ -56,7 +56,7 @@
|
|||
android:layout_marginEnd="@dimen/small_margin"
|
||||
android:paddingBottom="6dp"
|
||||
android:src="@drawable/ic_play_outline_vector"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/file_type"
|
||||
|
@ -65,9 +65,9 @@
|
|||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginEnd="@dimen/small_margin"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:paddingEnd="@dimen/small_margin"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:paddingEnd="@dimen/small_margin"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:shadowColor="@color/default_background_color"
|
||||
android:shadowRadius="4"
|
||||
android:text="@string/gif"
|
||||
|
@ -87,6 +87,6 @@
|
|||
android:paddingBottom="@dimen/small_margin"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/normal_text_size"
|
||||
tools:text="00:05"/>
|
||||
tools:text="00:05" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
Loading…
Reference in a new issue