mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-06-05 22:09:15 +02:00
adding some tab numbering changes
This commit is contained in:
@ -58,7 +58,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:f07ca31126'
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:fe68ccdac8'
|
||||
implementation 'com.github.Stericson:RootTools:df729dcb13'
|
||||
implementation 'com.github.Stericson:RootShell:1.6'
|
||||
implementation 'com.alexvasilkov:gesture-views:2.5.2'
|
||||
|
@ -31,8 +31,7 @@ import com.simplemobiletools.filemanager.pro.fragments.ItemsFragment
|
||||
import com.simplemobiletools.filemanager.pro.fragments.MyViewPagerFragment
|
||||
import com.simplemobiletools.filemanager.pro.helpers.MAX_COLUMN_COUNT
|
||||
import com.simplemobiletools.filemanager.pro.helpers.RootHelpers
|
||||
import com.simplemobiletools.filemanager.pro.helpers.TAB_FILES
|
||||
import com.simplemobiletools.filemanager.pro.helpers.TAB_RECENTS
|
||||
import com.simplemobiletools.filemanager.pro.helpers.tabsList
|
||||
import com.stericson.RootTools.RootTools
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.items_fragment.*
|
||||
@ -591,14 +590,11 @@ class MainActivity : SimpleActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun getInactiveTabIndexes(activeIndex: Int) = arrayListOf(TAB_FILES, TAB_RECENTS).filter { it != activeIndex }
|
||||
private fun getInactiveTabIndexes(activeIndex: Int) = (0 until tabsList.size).filter { it != activeIndex }
|
||||
|
||||
private fun getAllFragments(): ArrayList<MyViewPagerFragment?> = arrayListOf(items_fragment, recents_fragment)
|
||||
|
||||
private fun getCurrentFragment(): MyViewPagerFragment? = when (main_view_pager.currentItem) {
|
||||
TAB_FILES -> items_fragment
|
||||
else -> recents_fragment
|
||||
}
|
||||
private fun getCurrentFragment() = getAllFragments().getOrNull(main_view_pager.currentItem)
|
||||
|
||||
private fun checkWhatsNewDialog() {
|
||||
arrayListOf<Release>().apply {
|
||||
|
@ -7,7 +7,6 @@ import com.simplemobiletools.filemanager.pro.R
|
||||
import com.simplemobiletools.filemanager.pro.activities.SimpleActivity
|
||||
import com.simplemobiletools.filemanager.pro.extensions.config
|
||||
import com.simplemobiletools.filemanager.pro.fragments.MyViewPagerFragment
|
||||
import com.simplemobiletools.filemanager.pro.helpers.TAB_FILES
|
||||
|
||||
class ViewPagerAdapter(val activity: SimpleActivity) : PagerAdapter() {
|
||||
override fun instantiateItem(container: ViewGroup, position: Int): Any {
|
||||
@ -31,8 +30,8 @@ class ViewPagerAdapter(val activity: SimpleActivity) : PagerAdapter() {
|
||||
|
||||
override fun isViewFromObject(view: View, item: Any) = view == item
|
||||
|
||||
private fun getFragment(position: Int) = when (position) {
|
||||
TAB_FILES -> R.layout.items_fragment
|
||||
else -> R.layout.recents_fragment
|
||||
private fun getFragment(position: Int): Int {
|
||||
val fragments = arrayListOf(R.layout.items_fragment, R.layout.recents_fragment)
|
||||
return fragments[position]
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
package com.simplemobiletools.filemanager.pro.helpers
|
||||
|
||||
import com.simplemobiletools.commons.helpers.TAB_FILES
|
||||
import com.simplemobiletools.commons.helpers.TAB_RECENT_FILES
|
||||
|
||||
const val PATH = "path"
|
||||
const val MAX_COLUMN_COUNT = 20
|
||||
|
||||
@ -25,5 +28,5 @@ const val OPEN_AS_AUDIO = 3
|
||||
const val OPEN_AS_VIDEO = 4
|
||||
const val OPEN_AS_OTHER = 5
|
||||
|
||||
const val TAB_FILES = 0
|
||||
const val TAB_RECENTS = 1
|
||||
const val ALL_TABS_MASK = TAB_FILES or TAB_RECENT_FILES
|
||||
val tabsList = arrayListOf(TAB_FILES, TAB_RECENT_FILES)
|
||||
|
Reference in New Issue
Block a user