show a button at folder searching for switching to file searching
This commit is contained in:
parent
a84821f57c
commit
ee929a9d1b
2 changed files with 21 additions and 0 deletions
|
@ -151,6 +151,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
|
|
||||||
updateWidgets()
|
updateWidgets()
|
||||||
registerFileUpdateListener()
|
registerFileUpdateListener()
|
||||||
|
|
||||||
|
directories_switch_searching.setOnClickListener {
|
||||||
|
launchSearchActivity()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
|
@ -198,6 +202,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
invalidateOptionsMenu()
|
invalidateOptionsMenu()
|
||||||
directories_empty_text_label.setTextColor(config.textColor)
|
directories_empty_text_label.setTextColor(config.textColor)
|
||||||
directories_empty_text.setTextColor(getAdjustedPrimaryColor())
|
directories_empty_text.setTextColor(getAdjustedPrimaryColor())
|
||||||
|
directories_switch_searching.setTextColor(getAdjustedPrimaryColor())
|
||||||
|
directories_switch_searching.underlineText()
|
||||||
|
|
||||||
if (mIsPasswordProtectionPending && !mWasProtectionHandled) {
|
if (mIsPasswordProtectionPending && !mWasProtectionHandled) {
|
||||||
handleAppPasswordProtection {
|
handleAppPasswordProtection {
|
||||||
|
@ -351,6 +357,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
|
|
||||||
MenuItemCompat.setOnActionExpandListener(mSearchMenuItem, object : MenuItemCompat.OnActionExpandListener {
|
MenuItemCompat.setOnActionExpandListener(mSearchMenuItem, object : MenuItemCompat.OnActionExpandListener {
|
||||||
override fun onMenuItemActionExpand(item: MenuItem?): Boolean {
|
override fun onMenuItemActionExpand(item: MenuItem?): Boolean {
|
||||||
|
directories_switch_searching.beVisible()
|
||||||
mIsSearchOpen = true
|
mIsSearchOpen = true
|
||||||
directories_refresh_layout.isEnabled = false
|
directories_refresh_layout.isEnabled = false
|
||||||
return true
|
return true
|
||||||
|
@ -359,6 +366,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
// this triggers on device rotation too, avoid doing anything
|
// this triggers on device rotation too, avoid doing anything
|
||||||
override fun onMenuItemActionCollapse(item: MenuItem?): Boolean {
|
override fun onMenuItemActionCollapse(item: MenuItem?): Boolean {
|
||||||
if (mIsSearchOpen) {
|
if (mIsSearchOpen) {
|
||||||
|
directories_switch_searching.beGone()
|
||||||
mIsSearchOpen = false
|
mIsSearchOpen = false
|
||||||
directories_refresh_layout.isEnabled = config.enablePullToRefresh
|
directories_refresh_layout.isEnabled = config.enablePullToRefresh
|
||||||
setupAdapter(mDirs, "")
|
setupAdapter(mDirs, "")
|
||||||
|
|
|
@ -11,10 +11,21 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/directories_switch_searching"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="@dimen/activity_margin"
|
||||||
|
android:text="@string/switch_to_file_search"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
android:id="@+id/directories_empty_text_label"
|
android:id="@+id/directories_empty_text_label"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/directories_switch_searching"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:paddingLeft="@dimen/big_margin"
|
android:paddingLeft="@dimen/big_margin"
|
||||||
android:paddingTop="@dimen/activity_margin"
|
android:paddingTop="@dimen/activity_margin"
|
||||||
|
@ -39,6 +50,7 @@
|
||||||
android:id="@+id/directories_grid"
|
android:id="@+id/directories_grid"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_below="@+id/directories_switch_searching"
|
||||||
android:scrollbars="none"
|
android:scrollbars="none"
|
||||||
app:layoutManager="com.simplemobiletools.commons.views.MyGridLayoutManager"
|
app:layoutManager="com.simplemobiletools.commons.views.MyGridLayoutManager"
|
||||||
app:spanCount="@integer/directory_columns_vertical_scroll"/>
|
app:spanCount="@integer/directory_columns_vertical_scroll"/>
|
||||||
|
@ -47,6 +59,7 @@
|
||||||
android:id="@+id/directories_vertical_fastscroller"
|
android:id="@+id/directories_vertical_fastscroller"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_below="@+id/directories_switch_searching"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:paddingStart="@dimen/normal_margin"
|
android:paddingStart="@dimen/normal_margin"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
Loading…
Reference in a new issue