2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-17 15:26:23 +00:00
This was merged in after feature freeze so we're pulling it out for
now. Pull to refresh will continue to work in debug mode so that the
design can be iterated on easily.
This commit is contained in:
Tiger Oakes 2019-06-03 12:10:53 -07:00 committed by Colin Lee
parent 242169b1fd
commit b297d8c4b8
2 changed files with 20 additions and 13 deletions

View File

@ -250,6 +250,7 @@ android.applicationVariants.all { variant ->
// Feature build flags
// -------------------------------------------------------------------------------------------------
buildConfigField 'Boolean', 'SEND_TAB_ENABLED', (buildType == "nightly" || isDebug).toString()
buildConfigField 'Boolean', 'PULL_TO_REFRESH_ENABLED', (false).toString()
}
androidExtensions {

View File

@ -56,6 +56,7 @@ import mozilla.components.support.ktx.android.view.enterToImmersiveMode
import mozilla.components.support.ktx.android.view.exitImmersiveModeIfNeeded
import mozilla.components.support.ktx.kotlin.toUri
import org.mozilla.fenix.BrowsingModeManager
import org.mozilla.fenix.BuildConfig
import org.mozilla.fenix.FenixViewModelProvider
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.IntentReceiverActivity
@ -185,7 +186,7 @@ class BrowserFragment : Fragment(), BackHandler, CoroutineScope {
return view
}
@Suppress("LongMethod")
@Suppress("LongMethod", "ComplexMethod")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
@ -334,6 +335,7 @@ class BrowserFragment : Fragment(), BackHandler, CoroutineScope {
view = view
)
if (BuildConfig.PULL_TO_REFRESH_ENABLED) {
val primaryTextColor = ThemeManager.resolveAttribute(R.attr.primaryText, requireContext())
view.swipeRefresh.setColorSchemeColors(primaryTextColor)
swipeRefreshFeature.set(
@ -346,6 +348,10 @@ class BrowserFragment : Fragment(), BackHandler, CoroutineScope {
owner = this,
view = view
)
} else {
// Disable pull to refresh
view.swipeRefresh.setOnChildScrollUpCallback { _, _ -> true }
}
readerViewFeature.set(
feature = ReaderViewFeature(