File tree Expand file tree Collapse file tree 4 files changed +12
-14
lines changed
src/main/kotlin/com/simplemobiletools/filemanager/pro Expand file tree Collapse file tree 4 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ android {
5858}
5959
6060dependencies {
61- implementation ' com.github.SimpleMobileTools:Simple-Commons:f07ca31126 '
61+ implementation ' com.github.SimpleMobileTools:Simple-Commons:fe68ccdac8 '
6262 implementation ' com.github.Stericson:RootTools:df729dcb13'
6363 implementation ' com.github.Stericson:RootShell:1.6'
6464 implementation ' com.alexvasilkov:gesture-views:2.5.2'
Original file line number Diff line number Diff line change @@ -31,8 +31,7 @@ import com.simplemobiletools.filemanager.pro.fragments.ItemsFragment
3131import com.simplemobiletools.filemanager.pro.fragments.MyViewPagerFragment
3232import com.simplemobiletools.filemanager.pro.helpers.MAX_COLUMN_COUNT
3333import com.simplemobiletools.filemanager.pro.helpers.RootHelpers
34- import com.simplemobiletools.filemanager.pro.helpers.TAB_FILES
35- import com.simplemobiletools.filemanager.pro.helpers.TAB_RECENTS
34+ import com.simplemobiletools.filemanager.pro.helpers.tabsList
3635import com.stericson.RootTools.RootTools
3736import kotlinx.android.synthetic.main.activity_main.*
3837import kotlinx.android.synthetic.main.items_fragment.*
@@ -591,14 +590,11 @@ class MainActivity : SimpleActivity() {
591590 }
592591 }
593592
594- private fun getInactiveTabIndexes (activeIndex : Int ) = arrayListOf ( TAB_FILES , TAB_RECENTS ).filter { it != activeIndex }
593+ private fun getInactiveTabIndexes (activeIndex : Int ) = ( 0 until tabsList.size ).filter { it != activeIndex }
595594
596595 private fun getAllFragments (): ArrayList <MyViewPagerFragment ?> = arrayListOf (items_fragment, recents_fragment)
597596
598- private fun getCurrentFragment (): MyViewPagerFragment ? = when (main_view_pager.currentItem) {
599- TAB_FILES -> items_fragment
600- else -> recents_fragment
601- }
597+ private fun getCurrentFragment () = getAllFragments().getOrNull(main_view_pager.currentItem)
602598
603599 private fun checkWhatsNewDialog () {
604600 arrayListOf<Release >().apply {
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import com.simplemobiletools.filemanager.pro.R
77import com.simplemobiletools.filemanager.pro.activities.SimpleActivity
88import com.simplemobiletools.filemanager.pro.extensions.config
99import com.simplemobiletools.filemanager.pro.fragments.MyViewPagerFragment
10- import com.simplemobiletools.filemanager.pro.helpers.TAB_FILES
1110
1211class ViewPagerAdapter (val activity : SimpleActivity ) : PagerAdapter() {
1312 override fun instantiateItem (container : ViewGroup , position : Int ): Any {
@@ -31,8 +30,8 @@ class ViewPagerAdapter(val activity: SimpleActivity) : PagerAdapter() {
3130
3231 override fun isViewFromObject (view : View , item : Any ) = view == item
3332
34- private fun getFragment (position : Int ) = when (position) {
35- TAB_FILES -> R .layout.items_fragment
36- else -> R .layout.recents_fragment
33+ private fun getFragment (position : Int ): Int {
34+ val fragments = arrayListOf ( R .layout.items_fragment, R .layout.recents_fragment)
35+ return fragments[position]
3736 }
3837}
Original file line number Diff line number Diff line change 11package com.simplemobiletools.filemanager.pro.helpers
22
3+ import com.simplemobiletools.commons.helpers.TAB_FILES
4+ import com.simplemobiletools.commons.helpers.TAB_RECENT_FILES
5+
36const val PATH = " path"
47const val MAX_COLUMN_COUNT = 20
58
@@ -25,5 +28,5 @@ const val OPEN_AS_AUDIO = 3
2528const val OPEN_AS_VIDEO = 4
2629const val OPEN_AS_OTHER = 5
2730
28- const val TAB_FILES = 0
29- const val TAB_RECENTS = 1
31+ const val ALL_TABS_MASK = TAB_FILES or TAB_RECENT_FILES
32+ val tabsList = arrayListOf ( TAB_FILES , TAB_RECENT_FILES )
You can’t perform that action at this time.
0 commit comments