mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 13:45:35 +03:00
Added 3 dot menu to filter Media data.
This commit is contained in:
parent
eb442ac4a6
commit
74f8b2b36f
10 changed files with 124 additions and 1 deletions
|
@ -3,7 +3,7 @@ import org.gradle.internal.jvm.Jvm
|
|||
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.1.3'
|
||||
classpath 'com.android.tools.build:gradle:7.0.4'
|
||||
classpath 'com.hiya:jacoco-android:0.2'
|
||||
classpath 'com.github.spotbugs.snom:spotbugs-gradle-plugin:5.0.9'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
|
|
|
@ -377,4 +377,16 @@ public interface AppPreferences {
|
|||
boolean isStoragePermissionRequested();
|
||||
|
||||
void setStoragePermissionRequested(boolean value);
|
||||
|
||||
/**
|
||||
* Saves the show/hide Image State
|
||||
*/
|
||||
void setHideImageClicked(boolean isHideImageClicked);
|
||||
boolean getHideImageClicked();
|
||||
|
||||
/**
|
||||
* Saves the show/hide Video State
|
||||
*/
|
||||
void setHideVideoClicked(boolean isHideVideoClicked);
|
||||
boolean getHideVideoClicked();
|
||||
}
|
||||
|
|
|
@ -99,6 +99,9 @@ public final class AppPreferencesImpl implements AppPreferences {
|
|||
|
||||
private static final String PREF__STORAGE_PERMISSION_REQUESTED = "storage_permission_requested";
|
||||
|
||||
private static final String PREF__IS_HIDE_IMAGE_CLICKED = "is_hideImage_clicked";
|
||||
private static final String PREF__IS_HIDE_VIDEO_CLICKED = "is_hideVideo_clicked";
|
||||
|
||||
private final Context context;
|
||||
private final SharedPreferences preferences;
|
||||
private final CurrentAccountProvider currentAccountProvider;
|
||||
|
@ -712,4 +715,24 @@ public final class AppPreferencesImpl implements AppPreferences {
|
|||
public int computeBruteForceDelay(int count) {
|
||||
return (int) Math.min(count / 3d, 10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHideImageClicked(boolean isHideImageClicked) {
|
||||
preferences.edit().putBoolean(PREF__IS_HIDE_IMAGE_CLICKED, isHideImageClicked).apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getHideImageClicked() {
|
||||
return preferences.getBoolean(PREF__IS_HIDE_IMAGE_CLICKED,false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHideVideoClicked(boolean isHideVideoClicked) {
|
||||
preferences.edit().putBoolean(PREF__IS_HIDE_VIDEO_CLICKED, isHideVideoClicked).apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getHideVideoClicked() {
|
||||
return preferences.getBoolean(PREF__IS_HIDE_VIDEO_CLICKED,false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,12 +41,15 @@ import com.owncloud.android.datamodel.FileDataStorageManager
|
|||
import com.owncloud.android.datamodel.GalleryItems
|
||||
import com.owncloud.android.datamodel.OCFile
|
||||
import com.owncloud.android.ui.activity.ComponentsGetter
|
||||
import com.owncloud.android.ui.fragment.GalleryFragment
|
||||
import com.owncloud.android.ui.fragment.SearchType
|
||||
import com.owncloud.android.ui.interfaces.OCFileListFragmentInterface
|
||||
import com.owncloud.android.utils.DisplayUtils
|
||||
import com.owncloud.android.utils.FileSortOrder
|
||||
import com.owncloud.android.utils.FileStorageUtils
|
||||
import com.owncloud.android.utils.theme.ThemeColorUtils
|
||||
import com.owncloud.android.utils.theme.ThemeDrawableUtils
|
||||
import com.owncloud.android.utils.MimeTypeUtil
|
||||
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView.SectionedAdapter
|
||||
import java.util.Calendar
|
||||
import java.util.Date
|
||||
|
|
|
@ -125,6 +125,12 @@ public class GalleryFragment extends OCFileListFragment implements GalleryFragme
|
|||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
|
||||
if (mediaObject == null) {
|
||||
mediaObject = new ArrayList<>();
|
||||
} else {
|
||||
mediaObject.clear();
|
||||
}
|
||||
|
||||
currentSearchType = SearchType.GALLERY_SEARCH;
|
||||
|
||||
menuItemAddRemoveValue = MenuItemAddRemove.REMOVE_GRID_AND_SORT;
|
||||
|
@ -163,6 +169,7 @@ public class GalleryFragment extends OCFileListFragment implements GalleryFragme
|
|||
public void onRefresh() {
|
||||
super.onRefresh();
|
||||
|
||||
mediaObject.clear();
|
||||
handleSearchEvent();
|
||||
}
|
||||
|
||||
|
|
50
app/src/main/res/drawable/ic_no_camera.xml
Normal file
50
app/src/main/res/drawable/ic_no_camera.xml
Normal file
|
@ -0,0 +1,50 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M12,17.237C12.677,17.237 13.321,17.099 13.91,16.855L12.717,15.663C12.485,15.711 12.246,15.737 12,15.737C10.067,15.737 8.5,14.171 8.5,12.237C8.5,12.212 8.5,12.186 8.5,12.161C8.502,11.94 8.53,11.726 8.572,11.517L7.382,10.327C7.138,10.916 7,11.56 7,12.237C7.003,14.997 9.24,17.234 12,17.237"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#262626"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M15.792,18.737L4,18.737C3.977,18.738 3.954,18.738 3.931,18.737C3.122,18.718 2.481,18.047 2.5,17.237L2.5,8.737C2.5,8.715 2.5,8.693 2.5,8.671C2.519,7.86 3.19,7.218 4,7.237L4.292,7.237L2.981,5.926C1.829,6.345 1,7.44 1,8.737L1,17.237C1,18.894 2.343,20.237 4,20.237L17.292,20.237L15.792,18.737Z"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#262626"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M20,9.737C20,9.185 19.553,8.737 19,8.737C18.447,8.737 18,9.185 18,9.737C18,10.29 18.447,10.737 19,10.737C19.553,10.737 20,10.29 20,9.737"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#262626"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeColor="#00000000"/>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M7.1211,3.237l15.8789,0l0,15.692l-15.8789,0z"/>
|
||||
<path
|
||||
android:pathData="M8.2441,4.737L15.8001,4.737L17.3001,7.237L20.0001,7.237L20.0641,7.237C20.8751,7.255 21.5171,7.926 21.5001,8.737L21.5001,17.237C21.5011,17.259 21.5011,17.282 21.5001,17.303C21.4961,17.494 21.4521,17.675 21.3831,17.84L22.4751,18.929C22.8061,18.447 23.0001,17.865 23.0001,17.237L23.0001,8.737C23.0001,7.081 21.6571,5.737 20.0001,5.737L18.2001,5.737L16.7001,3.237L7.3501,3.237L7.1211,3.618L8.2441,4.737Z"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#262626"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeColor="#00000000"/>
|
||||
</group>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2.2825,2.0003l19.5504,0l0,19.474l-19.5504,0z"/>
|
||||
<path
|
||||
android:pathData="M20.5068,21.2741L2.5068,3.2741C2.2168,2.9981 2.2068,2.5381 2.4838,2.2481C2.4908,2.2401 2.4988,2.2321 2.5068,2.2241C2.7838,1.9341 3.2438,1.9241 3.5338,2.2011L3.5568,2.2241L21.6078,20.2241C21.8978,20.5001 21.9088,20.9581 21.6338,21.2481C21.6248,21.2571 21.6158,21.2661 21.6078,21.2741C21.2888,21.5411 20.8248,21.5411 20.5068,21.2741"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#262626"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeColor="#00000000"/>
|
||||
</group>
|
||||
<path
|
||||
android:pathData="M12.2842,8.7653C13.9832,8.9053 15.3272,10.2453 15.4712,11.9433L16.8742,13.3433C16.9562,12.9883 17.0002,12.6183 17.0002,12.2373C17.0002,9.4753 14.7622,7.2373 12.0002,7.2373C11.6142,7.2373 11.2402,7.2823 10.8812,7.3663L12.2842,8.7653Z"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#262626"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeColor="#00000000"/>
|
||||
</vector>
|
12
app/src/main/res/drawable/ic_no_video_camera.xml
Normal file
12
app/src/main/res/drawable/ic_no_video_camera.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M4.1,2.45C4.4,2.15 4.85,2.15 5.15,2.45L5.15,2.45L23.2,20.45C23.5,20.75 23.5,21.2 23.2,21.5C23.05,21.65 22.85,21.7 22.65,21.7C22.45,21.7 22.25,21.65 22.1,21.5L22.1,21.5L4.1,3.5C3.8,3.2 3.8,2.75 4.1,2.45ZM3.4,5L4.9,6.5L3.5,6.5L3.5,17C3.5,17.85 4.15,18.5 5,18.5L5,18.5L16.9,18.5L18.2,19.75C17.8,19.9 17.4,20 17,20L17,20L5,20C3.35,20 2,18.65 2,17L2,17L2,10.5L0.5,10.5L0.5,6.5L2,6.5L2,5L3.4,5ZM20,5L20,8.8L21.8,7L23.5,7L23.5,17L21.8,17L18.5,13.7L18.5,6.5L11.3,6.5L9.8,5L20,5ZM22,8.9L20,10.9L20,13.1L22,15.1L22,8.9Z"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#262626"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeColor="#00000000"/>
|
||||
</vector>
|
|
@ -910,6 +910,13 @@
|
|||
<item quantity="one">%d ausgewählt</item>
|
||||
<item quantity="other">%d ausgewählt</item>
|
||||
</plurals>
|
||||
<string name="hide_images">Bilder ausblenden</string>
|
||||
<string name="show_images">Bilder anzeigen</string>
|
||||
<string name="hide_video">Videos ausblenden</string>
|
||||
<string name="show_video">Videos anzeigen</string>
|
||||
<string name="select_media_folder">Den Ordner \"Medien\" auswählen</string>
|
||||
<string name="choose_location">Speicherort wählen</string>
|
||||
<string name="common_select">Auswählen</string>
|
||||
<string name="subtitle_photos_videos">Fotos & videos</string>
|
||||
<string name="show_images">Bilder anzeigen</string>
|
||||
<string name="subtitle_photos_only">Nur Fotos</string>
|
||||
|
|
|
@ -1008,6 +1008,13 @@
|
|||
<string name="pdf_zoom_tip">Tap on a page to zoom in</string>
|
||||
<string name="storage_permission_full_access">Full access</string>
|
||||
<string name="storage_permission_media_read_only">Media read-only</string>
|
||||
<string name="hide_images">Hide images</string>
|
||||
<string name="show_images">Show images</string>
|
||||
<string name="hide_video">Hide video</string>
|
||||
<string name="show_video">Show video</string>
|
||||
<string name="select_media_folder">Select the \"Media\" folder</string>
|
||||
<string name="choose_location">Choose location</string>
|
||||
<string name="common_select">Select</string>
|
||||
<string name="subtitle_photos_videos">Photos & videos</string>
|
||||
<string name="show_images">Show photos</string>
|
||||
<string name="subtitle_photos_only">Photos only</string>
|
||||
|
|
|
@ -5,3 +5,5 @@ NC_TEST_SERVER_PASSWORD=test
|
|||
android.enableJetifier=true
|
||||
android.useAndroidX=true
|
||||
#android.debug.obsoleteApi=true
|
||||
#Fix for --> Out of memory: Java heap space.
|
||||
org.gradle.jvmargs=-Xmx2048m
|
||||
|
|
Loading…
Reference in a new issue