@ -85,6 +85,7 @@ class HomeFragment : Fragment() {
return view
}
@SuppressWarnings ( " LongMethod " )
override fun onViewCreated ( view : View , savedInstanceState : Bundle ? ) {
super . onViewCreated ( view , savedInstanceState )
@ -160,7 +161,10 @@ class HomeFragment : Fragment() {
override fun onTransitionCompleted ( p0 : MotionLayout ? , p1 : Int ) { }
} )
view . toolbar _wrapper . isPrivateModeEnabled = ( activity as HomeActivity ) . browsingModeManager . isPrivate
val isPrivate = ( activity as HomeActivity ) . browsingModeManager . isPrivate
view . toolbar _wrapper . isPrivateModeEnabled = isPrivate
privateBrowsingButton . contentDescription = contentDescriptionForPrivateBrowsingButton ( isPrivate )
privateBrowsingButton . setOnClickListener {
val browsingModeManager = ( activity as HomeActivity ) . browsingModeManager
@ -253,6 +257,14 @@ class HomeFragment : Fragment() {
}
}
private fun contentDescriptionForPrivateBrowsingButton ( isPrivate : Boolean ) : String {
val resourceId =
if ( isPrivate ) R . string . content _description _disable _private _browsing _button else
R . string . content _description _private _browsing _button
return getString ( resourceId )
}
private fun setupPrivateBrowsingDescription ( ) {
// Format the description text to include a hyperlink
val descriptionText = String