mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-01-18 06:17:59 +01:00
updating manage included/excluded/hidden folders
This commit is contained in:
parent
b798dac213
commit
aa3a9fdc88
4 changed files with 86 additions and 58 deletions
|
@ -1,13 +1,12 @@
|
||||||
package com.simplemobiletools.gallery.pro.activities
|
package com.simplemobiletools.gallery.pro.activities
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.Menu
|
|
||||||
import android.view.MenuItem
|
|
||||||
import com.simplemobiletools.commons.dialogs.FilePickerDialog
|
import com.simplemobiletools.commons.dialogs.FilePickerDialog
|
||||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||||
import com.simplemobiletools.commons.extensions.getProperTextColor
|
import com.simplemobiletools.commons.extensions.getProperTextColor
|
||||||
import com.simplemobiletools.commons.extensions.internalStoragePath
|
import com.simplemobiletools.commons.extensions.internalStoragePath
|
||||||
import com.simplemobiletools.commons.extensions.isExternalStorageManager
|
import com.simplemobiletools.commons.extensions.isExternalStorageManager
|
||||||
|
import com.simplemobiletools.commons.helpers.NavigationIcon
|
||||||
import com.simplemobiletools.commons.helpers.isRPlus
|
import com.simplemobiletools.commons.helpers.isRPlus
|
||||||
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
|
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
|
||||||
import com.simplemobiletools.gallery.pro.R
|
import com.simplemobiletools.gallery.pro.R
|
||||||
|
@ -20,6 +19,13 @@ class ExcludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_manage_folders)
|
setContentView(R.layout.activity_manage_folders)
|
||||||
updateFolders()
|
updateFolders()
|
||||||
|
setupOptionsMenu()
|
||||||
|
manage_folders_toolbar.title = getString(R.string.excluded_folders)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
setupToolbar(manage_folders_toolbar, NavigationIcon.Arrow)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateFolders() {
|
private fun updateFolders() {
|
||||||
|
@ -41,18 +47,14 @@ class ExcludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
||||||
manage_folders_list.adapter = adapter
|
manage_folders_list.adapter = adapter
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
private fun setupOptionsMenu() {
|
||||||
menuInflater.inflate(R.menu.menu_add_folder, menu)
|
manage_folders_toolbar.setOnMenuItemClickListener { menuItem ->
|
||||||
updateMenuItemColors(menu)
|
when (menuItem.itemId) {
|
||||||
return true
|
R.id.add_folder -> addFolder()
|
||||||
}
|
else -> return@setOnMenuItemClickListener false
|
||||||
|
}
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
return@setOnMenuItemClickListener true
|
||||||
when (item.itemId) {
|
|
||||||
R.id.add_folder -> addFolder()
|
|
||||||
else -> return super.onOptionsItemSelected(item)
|
|
||||||
}
|
}
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun refreshItems() {
|
override fun refreshItems() {
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
package com.simplemobiletools.gallery.pro.activities
|
package com.simplemobiletools.gallery.pro.activities
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.Menu
|
|
||||||
import android.view.MenuItem
|
|
||||||
import com.simplemobiletools.commons.dialogs.FilePickerDialog
|
import com.simplemobiletools.commons.dialogs.FilePickerDialog
|
||||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||||
import com.simplemobiletools.commons.extensions.getProperTextColor
|
import com.simplemobiletools.commons.extensions.getProperTextColor
|
||||||
|
import com.simplemobiletools.commons.helpers.NavigationIcon
|
||||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||||
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
|
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
|
||||||
import com.simplemobiletools.gallery.pro.R
|
import com.simplemobiletools.gallery.pro.R
|
||||||
|
@ -20,6 +19,13 @@ class HiddenFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_manage_folders)
|
setContentView(R.layout.activity_manage_folders)
|
||||||
updateFolders()
|
updateFolders()
|
||||||
|
setupOptionsMenu()
|
||||||
|
manage_folders_toolbar.title = getString(R.string.hidden_folders)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
setupToolbar(manage_folders_toolbar, NavigationIcon.Arrow)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateFolders() {
|
private fun updateFolders() {
|
||||||
|
@ -37,18 +43,14 @@ class HiddenFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
private fun setupOptionsMenu() {
|
||||||
menuInflater.inflate(R.menu.menu_add_folder, menu)
|
manage_folders_toolbar.setOnMenuItemClickListener { menuItem ->
|
||||||
updateMenuItemColors(menu)
|
when (menuItem.itemId) {
|
||||||
return true
|
R.id.add_folder -> addFolder()
|
||||||
}
|
else -> return@setOnMenuItemClickListener false
|
||||||
|
}
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
return@setOnMenuItemClickListener true
|
||||||
when (item.itemId) {
|
|
||||||
R.id.add_folder -> addFolder()
|
|
||||||
else -> return super.onOptionsItemSelected(item)
|
|
||||||
}
|
}
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun refreshItems() {
|
override fun refreshItems() {
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
package com.simplemobiletools.gallery.pro.activities
|
package com.simplemobiletools.gallery.pro.activities
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.Menu
|
|
||||||
import android.view.MenuItem
|
|
||||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||||
import com.simplemobiletools.commons.extensions.getProperTextColor
|
import com.simplemobiletools.commons.extensions.getProperTextColor
|
||||||
|
import com.simplemobiletools.commons.helpers.NavigationIcon
|
||||||
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
|
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
|
||||||
import com.simplemobiletools.gallery.pro.R
|
import com.simplemobiletools.gallery.pro.R
|
||||||
import com.simplemobiletools.gallery.pro.adapters.ManageFoldersAdapter
|
import com.simplemobiletools.gallery.pro.adapters.ManageFoldersAdapter
|
||||||
|
@ -16,6 +15,13 @@ class IncludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_manage_folders)
|
setContentView(R.layout.activity_manage_folders)
|
||||||
updateFolders()
|
updateFolders()
|
||||||
|
setupOptionsMenu()
|
||||||
|
manage_folders_toolbar.title = getString(R.string.excluded_folders)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
setupToolbar(manage_folders_toolbar, NavigationIcon.Arrow)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateFolders() {
|
private fun updateFolders() {
|
||||||
|
@ -31,18 +37,14 @@ class IncludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
||||||
manage_folders_list.adapter = adapter
|
manage_folders_list.adapter = adapter
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
private fun setupOptionsMenu() {
|
||||||
menuInflater.inflate(R.menu.menu_add_folder, menu)
|
manage_folders_toolbar.setOnMenuItemClickListener { menuItem ->
|
||||||
updateMenuItemColors(menu)
|
when (menuItem.itemId) {
|
||||||
return true
|
R.id.add_folder -> addFolder()
|
||||||
}
|
else -> return@setOnMenuItemClickListener false
|
||||||
|
}
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
return@setOnMenuItemClickListener true
|
||||||
when (item.itemId) {
|
|
||||||
R.id.add_folder -> addFolder()
|
|
||||||
else -> return super.onOptionsItemSelected(item)
|
|
||||||
}
|
}
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun refreshItems() {
|
override fun refreshItems() {
|
||||||
|
|
|
@ -1,28 +1,50 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/manage_folders_wrapper"
|
android:id="@+id/manage_folders_coordinator"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyRecyclerView
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/manage_folders_list"
|
android:id="@+id/manage_folders_app_bar_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content">
|
||||||
android:clipToPadding="false"
|
|
||||||
android:scrollbars="vertical"
|
|
||||||
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager"/>
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
android:id="@+id/manage_folders_placeholder"
|
android:id="@+id/manage_folders_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="@color/color_primary"
|
||||||
|
app:menu="@menu/menu_add_folder"
|
||||||
|
app:title=""
|
||||||
|
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/manage_folders_wrapper"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_horizontal"
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
android:paddingLeft="@dimen/big_margin"
|
|
||||||
android:paddingTop="@dimen/activity_margin"
|
|
||||||
android:paddingRight="@dimen/big_margin"
|
|
||||||
android:text="@string/excluded_activity_placeholder"
|
|
||||||
android:visibility="gone"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
<com.simplemobiletools.commons.views.MyRecyclerView
|
||||||
|
android:id="@+id/manage_folders_list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:scrollbars="vertical"
|
||||||
|
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/manage_folders_placeholder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:paddingLeft="@dimen/big_margin"
|
||||||
|
android:paddingTop="@dimen/activity_margin"
|
||||||
|
android:paddingRight="@dimen/big_margin"
|
||||||
|
android:text="@string/excluded_activity_placeholder"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
|
Loading…
Reference in a new issue