Added BrowserDirection values for New Fragments
This commit is contained in:
parent
ffc8037a08
commit
ecdbdda94e
|
@ -31,7 +31,9 @@ import org.mozilla.fenix.library.bookmarks.BookmarkFragmentDirections
|
|||
import org.mozilla.fenix.library.bookmarks.selectfolder.SelectBookmarkFolderFragmentDirections
|
||||
import org.mozilla.fenix.library.history.HistoryFragmentDirections
|
||||
import org.mozilla.fenix.search.SearchFragmentDirections
|
||||
import org.mozilla.fenix.settings.PairFragmentDirections
|
||||
import org.mozilla.fenix.settings.SettingsFragmentDirections
|
||||
import org.mozilla.fenix.settings.TurnOnSyncFragmentDirections
|
||||
import org.mozilla.fenix.utils.Settings
|
||||
|
||||
@SuppressWarnings("TooManyFunctions")
|
||||
|
@ -176,6 +178,10 @@ open class HomeActivity : AppCompatActivity() {
|
|||
.actionBookmarkSelectFolderFragmentToBrowserFragment(customTabSessionId)
|
||||
BrowserDirection.FromHistory ->
|
||||
HistoryFragmentDirections.actionHistoryFragmentToBrowserFragment(customTabSessionId)
|
||||
BrowserDirection.FromPair -> PairFragmentDirections.actionPairFragmentToBrowserFragment(customTabSessionId)
|
||||
BrowserDirection.FromTurnOnSync -> TurnOnSyncFragmentDirections.actionTurnOnSyncFragmentToBrowserFragment(
|
||||
customTabSessionId
|
||||
)
|
||||
}
|
||||
if (sessionObserver == null)
|
||||
sessionObserver = subscribeToSessions()
|
||||
|
@ -263,5 +269,6 @@ open class HomeActivity : AppCompatActivity() {
|
|||
}
|
||||
|
||||
enum class BrowserDirection {
|
||||
FromGlobal, FromHome, FromSearch, FromSettings, FromBookmarks, FromBookmarksFolderSelect, FromHistory
|
||||
FromGlobal, FromHome, FromSearch, FromSettings, FromBookmarks,
|
||||
FromBookmarksFolderSelect, FromHistory, FromPair, FromTurnOnSync
|
||||
}
|
||||
|
|
|
@ -43,9 +43,7 @@ class PairFragment : Fragment(), BackHandler {
|
|||
},
|
||||
onScanResult = { pairingUrl ->
|
||||
requireComponents.services.accountsAuthFeature.beginPairingAuthentication(pairingUrl)
|
||||
view?.let {
|
||||
(activity as HomeActivity).openToBrowser(BrowserDirection.FromSettings)
|
||||
}
|
||||
(activity as HomeActivity).openToBrowser(BrowserDirection.FromPair)
|
||||
}),
|
||||
owner = this,
|
||||
view = view
|
||||
|
|
|
@ -46,7 +46,7 @@ class TurnOnSyncFragment : PreferenceFragmentCompat() {
|
|||
// We could auto-close this tab once we get to the end of the authentication process?
|
||||
// Via an interceptor, perhaps.
|
||||
view?.let {
|
||||
(activity as HomeActivity).openToBrowser(BrowserDirection.FromSettings)
|
||||
(activity as HomeActivity).openToBrowser(BrowserDirection.FromTurnOnSync)
|
||||
}
|
||||
true
|
||||
}
|
||||
|
|
|
@ -304,7 +304,8 @@
|
|||
<action
|
||||
android:id="@+id/action_turnOnSyncFragment_to_browserFragment"
|
||||
app:destination="@id/browserFragment"
|
||||
app:popUpTo="@+id/settingsFragment" />
|
||||
app:popUpTo="@+id/settingsFragment"
|
||||
app:popUpToInclusive="true" />
|
||||
<action
|
||||
android:id="@+id/action_turnOnSyncFragment_to_pairInstructionsFragment"
|
||||
app:destination="@id/pairInstructionsFragment" />
|
||||
|
@ -326,7 +327,8 @@
|
|||
<action
|
||||
android:id="@+id/action_pairFragment_to_browserFragment"
|
||||
app:destination="@id/browserFragment"
|
||||
app:popUpTo="@+id/settingsFragment" />
|
||||
app:popUpTo="@+id/settingsFragment"
|
||||
app:popUpToInclusive="true" />
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
|
|
Loading…
Reference in New Issue