diff options
author | Allan Wang <me@allanwang.ca> | 2017-07-08 03:03:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-08 03:03:55 -0400 |
commit | b10a745c7f0f46f4f014e1ba7fa71172d7442b83 (patch) | |
tree | ef2516b69fb04ec0f565c5bb569fd5d80b7bd262 /app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt | |
parent | 6adfc496374eb88919f70a240eb15a726d2c18e0 (diff) | |
download | frost-b10a745c7f0f46f4f014e1ba7fa71172d7442b83.tar.gz frost-b10a745c7f0f46f4f014e1ba7fa71172d7442b83.tar.bz2 frost-b10a745c7f0f46f4f014e1ba7fa71172d7442b83.zip |
Dev-1.1.7 (#39) - feature overload + context menuv1.2
* Address some crashlytics issues
* Add text scaling
* Kau fixes and cleanup
* WIP formatter
* Create in house url formatter
* Update context menu
* Update themes
* Test proguard without R
* Implement sharing and clean up context menu
* Disable viewpager swipe on long press
* Test keeping lib strings
* Update changelog and proguard
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt index 592c3b5b..f9a597db 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt @@ -52,6 +52,7 @@ import com.pitchedapps.frost.fragments.WebFragment import com.pitchedapps.frost.utils.* import com.pitchedapps.frost.utils.iab.validatePro import com.pitchedapps.frost.views.BadgedIcon +import com.pitchedapps.frost.views.FrostViewPager import com.pitchedapps.frost.web.FrostWebViewSearch import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.disposables.Disposable @@ -65,7 +66,7 @@ class MainActivity : BaseActivity(), FrostWebViewSearch.SearchContract, lateinit var adapter: SectionsPagerAdapter val toolbar: Toolbar by bindView(R.id.toolbar) - val viewPager: ViewPager by bindView(R.id.container) + val viewPager: FrostViewPager by bindView(R.id.container) val fab: FloatingActionButton by bindView(R.id.fab) val tabs: TabLayout by bindView(R.id.tabs) val appBar: AppBarLayout by bindView(R.id.appbar) @@ -89,7 +90,6 @@ class MainActivity : BaseActivity(), FrostWebViewSearch.SearchContract, get() = searchView?.isOpen ?: false companion object { - const val FRAGMENT_REFRESH = 99 const val ACTIVITY_SETTINGS = 97 /* * Possible responses from the SettingsActivity @@ -97,6 +97,7 @@ class MainActivity : BaseActivity(), FrostWebViewSearch.SearchContract, */ const val REQUEST_RESTART = 90909 const val REQUEST_REFRESH = 80808 + const val REQUEST_WEB_ZOOM = 50505 const val REQUEST_NAV = 10101 const val REQUEST_SEARCH = 70707 const val REQUEST_RESTART_APPLICATION = 60606 @@ -333,7 +334,7 @@ class MainActivity : BaseActivity(), FrostWebViewSearch.SearchContract, } fun refreshAll() { - webFragmentObservable.onNext(FRAGMENT_REFRESH) + webFragmentObservable.onNext(WebFragment.REQUEST_REFRESH) } override fun onCreateOptionsMenu(menu: Menu): Boolean { @@ -384,8 +385,9 @@ class MainActivity : BaseActivity(), FrostWebViewSearch.SearchContract, if (requestCode == ACTIVITY_SETTINGS) { when (resultCode) { REQUEST_RESTART -> restart() - REQUEST_REFRESH -> webFragmentObservable.onNext(FRAGMENT_REFRESH) + REQUEST_REFRESH -> webFragmentObservable.onNext(WebFragment.REQUEST_REFRESH) REQUEST_NAV -> frostNavigationBar() + REQUEST_WEB_ZOOM -> webFragmentObservable.onNext(WebFragment.REQUEST_TEXT_ZOOM) REQUEST_SEARCH -> invalidateOptionsMenu() REQUEST_RESTART_APPLICATION -> { //completely restart application L.d("Restart Application Requested") |