|
|
@ -9,10 +9,7 @@ import android.os.Bundle
|
|
|
|
import android.view.LayoutInflater
|
|
|
|
import android.view.LayoutInflater
|
|
|
|
import android.view.View
|
|
|
|
import android.view.View
|
|
|
|
import android.view.ViewGroup
|
|
|
|
import android.view.ViewGroup
|
|
|
|
import android.widget.Button
|
|
|
|
|
|
|
|
import android.widget.RadioButton
|
|
|
|
|
|
|
|
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
|
|
|
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
|
|
|
import androidx.core.content.ContextCompat
|
|
|
|
|
|
|
|
import androidx.transition.TransitionInflater
|
|
|
|
import androidx.transition.TransitionInflater
|
|
|
|
import com.google.android.material.snackbar.Snackbar
|
|
|
|
import com.google.android.material.snackbar.Snackbar
|
|
|
|
import kotlinx.android.synthetic.main.fragment_browser.*
|
|
|
|
import kotlinx.android.synthetic.main.fragment_browser.*
|
|
|
@ -100,12 +97,6 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
|
|
|
|
view = view
|
|
|
|
view = view
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
if ((activity as HomeActivity).browsingModeManager.mode.isPrivate) {
|
|
|
|
|
|
|
|
// We need to update styles for private mode programmatically for now:
|
|
|
|
|
|
|
|
// https://github.com/mozilla-mobile/android-components/issues/3400
|
|
|
|
|
|
|
|
themeReaderViewControlsForPrivateMode(view.readerViewControlsBar)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
consumeFrom(browserFragmentStore) {
|
|
|
|
consumeFrom(browserFragmentStore) {
|
|
|
|
browserToolbarView.update(it)
|
|
|
|
browserToolbarView.update(it)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -189,36 +180,6 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun themeReaderViewControlsForPrivateMode(view: View) = with(view) {
|
|
|
|
|
|
|
|
listOf(
|
|
|
|
|
|
|
|
R.id.mozac_feature_readerview_font_size_decrease,
|
|
|
|
|
|
|
|
R.id.mozac_feature_readerview_font_size_increase
|
|
|
|
|
|
|
|
).map {
|
|
|
|
|
|
|
|
findViewById<Button>(it)
|
|
|
|
|
|
|
|
}.forEach {
|
|
|
|
|
|
|
|
it.setTextColor(
|
|
|
|
|
|
|
|
ContextCompat.getColorStateList(
|
|
|
|
|
|
|
|
context,
|
|
|
|
|
|
|
|
R.color.readerview_private_button_color
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
listOf(
|
|
|
|
|
|
|
|
R.id.mozac_feature_readerview_font_serif,
|
|
|
|
|
|
|
|
R.id.mozac_feature_readerview_font_sans_serif
|
|
|
|
|
|
|
|
).map {
|
|
|
|
|
|
|
|
findViewById<RadioButton>(it)
|
|
|
|
|
|
|
|
}.forEach {
|
|
|
|
|
|
|
|
it.setTextColor(
|
|
|
|
|
|
|
|
ContextCompat.getColorStateList(
|
|
|
|
|
|
|
|
context,
|
|
|
|
|
|
|
|
R.color.readerview_private_radio_color
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private val collectionStorageObserver = object : TabCollectionStorage.Observer {
|
|
|
|
private val collectionStorageObserver = object : TabCollectionStorage.Observer {
|
|
|
|
override fun onCollectionCreated(title: String, sessions: List<Session>) {
|
|
|
|
override fun onCollectionCreated(title: String, sessions: List<Session>) {
|
|
|
|
showTabSavedToCollectionSnackbar()
|
|
|
|
showTabSavedToCollectionSnackbar()
|
|
|
|