File tree Expand file tree Collapse file tree
app/src/main/java/com/owncloud/android/ui Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import com.owncloud.android.ui.activity.ComponentsGetter
3434import com.owncloud.android.ui.fragment.GalleryFragment
3535import com.owncloud.android.ui.fragment.SearchType
3636import com.owncloud.android.ui.fragment.albums.AlbumItemsFragment
37+ import com.owncloud.android.ui.fragment.albums.AlbumsPickerActivity
3738import com.owncloud.android.ui.interfaces.OCFileListFragmentInterface
3839import com.owncloud.android.utils.BitmapUtils
3940import com.owncloud.android.utils.DisplayUtils
@@ -114,9 +115,16 @@ class OCFileListDelegate(
114115 )
115116
116117 imageView.setOnClickListener {
117- ocFileListFragmentInterface.onItemClicked(file)
118- GalleryFragment .setLastMediaItemPosition(galleryRowHolder.absoluteAdapterPosition)
119- AlbumItemsFragment .lastMediaItemPosition = galleryRowHolder.absoluteAdapterPosition
118+ // NMC Customization: while picking media directly perform long click
119+ if (context is AlbumsPickerActivity ) {
120+ ocFileListFragmentInterface.onLongItemClicked(
121+ file
122+ )
123+ } else {
124+ ocFileListFragmentInterface.onItemClicked(file)
125+ GalleryFragment .setLastMediaItemPosition(galleryRowHolder.absoluteAdapterPosition)
126+ AlbumItemsFragment .lastMediaItemPosition = galleryRowHolder.absoluteAdapterPosition
127+ }
120128 }
121129
122130 if (! hideItemOptions) {
Original file line number Diff line number Diff line change @@ -100,7 +100,12 @@ public void onCreate(Bundle savedInstanceState) {
100100 super .onCreate (savedInstanceState );
101101 searchFragment = true ;
102102
103- setHasOptionsMenu (true );
103+ if (getArguments () != null ) {
104+ isFromAlbum = getArguments ().getBoolean (AlbumsPickerActivity .Companion .getEXTRA_FROM_ALBUM (), false );
105+ }
106+
107+ // NMC Customization: only show menu when not opened from media picker
108+ setHasOptionsMenu (!isFromAlbum );
104109
105110 if (galleryFragmentBottomSheetDialog == null ) {
106111 galleryFragmentBottomSheetDialog = new GalleryFragmentBottomSheetDialog (this );
@@ -113,10 +118,6 @@ public void onCreate(Bundle savedInstanceState) {
113118 }
114119
115120 registerRefreshSearchEventReceiver ();
116-
117- if (getArguments () != null ) {
118- isFromAlbum = getArguments ().getBoolean (AlbumsPickerActivity .Companion .getEXTRA_FROM_ALBUM (), false );
119- }
120121 }
121122
122123 private void registerRefreshSearchEventReceiver () {
@@ -425,6 +426,11 @@ public void showAllGalleryItems() {
425426 }
426427
427428 private void updateSubtitle (GalleryFragmentBottomSheetDialog .MediaState mediaState ) {
429+ // NMC Customization: while picking media don't show subtitle
430+ if (isFromAlbum ) {
431+ return ;
432+ }
433+
428434 requireActivity ().runOnUiThread (() -> {
429435 if (!isAdded ()) {
430436 return ;
You can’t perform that action at this time.
0 commit comments