testing - add log statements to trace navigation
This commit is contained in:
Родитель
c543f7438b
Коммит
794ae3b1d8
|
@ -9,6 +9,7 @@ package com.microsoft.device.samples.dualscreenexperience.presentation
|
|||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
|
@ -189,6 +190,7 @@ class MainActivity : AppCompatActivity() {
|
|||
if (windowLayoutInfo.isInDualMode() != layoutInfoViewModel.isDualMode.value) {
|
||||
tutorial.hide()
|
||||
invalidateOptionsMenu()
|
||||
Log.i("HISTORY_TEST", "spanned")
|
||||
}
|
||||
layoutInfoViewModel.isDualMode.value = windowLayoutInfo.isInDualMode()
|
||||
layoutInfoViewModel.foldingFeature.value = windowLayoutInfo.getFoldingFeature()
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
package com.microsoft.device.samples.dualscreenexperience.presentation
|
||||
|
||||
import android.util.Log
|
||||
import androidx.navigation.FoldableNavController
|
||||
import androidx.navigation.FoldableNavOptions
|
||||
import com.microsoft.device.dualscreen.navigation.LaunchScreen
|
||||
|
@ -33,62 +34,76 @@ class MainNavigator : StoreNavigator, CatalogNavigator, ProductNavigator, OrderN
|
|||
|
||||
override fun navigateUp() {
|
||||
navController?.navigateUp()
|
||||
Log.i("HISTORY_TEST", "navigateUp")
|
||||
}
|
||||
|
||||
override fun navigateToStores() {
|
||||
val navOptions = FoldableNavOptions.Builder().setLaunchScreen(LaunchScreen.BOTH).build()
|
||||
navController?.navigate(R.id.navigation_stores_graph, null, navOptions)
|
||||
Log.i("HISTORY_TEST", "navigateToStores")
|
||||
}
|
||||
|
||||
override fun navigateToStoreList() {
|
||||
navController?.navigate(R.id.action_store_map_to_list)
|
||||
Log.i("HISTORY_TEST", "navigateToStoreList")
|
||||
}
|
||||
|
||||
override fun navigateToStoreDetailsFromList() {
|
||||
navController?.navigate(R.id.action_store_list_to_details)
|
||||
Log.i("HISTORY_TEST", "navigateToStoreDetailsFromList")
|
||||
}
|
||||
|
||||
override fun navigateToStoreDetailsFromMap() {
|
||||
navController?.navigate(R.id.action_store_map_to_details)
|
||||
Log.i("HISTORY_TEST", "navigateToStoreDetailsFromMap")
|
||||
}
|
||||
|
||||
override fun navigateToStoreListFromDetails() {
|
||||
navController?.navigate(R.id.action_store_details_to_list)
|
||||
Log.i("HISTORY_TEST", "navigateToStoreListFromDetails")
|
||||
}
|
||||
|
||||
override fun navigateToCatalog() {
|
||||
val navOptions = FoldableNavOptions.Builder().setLaunchScreen(LaunchScreen.BOTH).build()
|
||||
navController?.navigate(R.id.navigation_catalog_graph, null, navOptions)
|
||||
Log.i("HISTORY_TEST", "navigateToCatalog")
|
||||
}
|
||||
|
||||
override fun navigateToProducts() {
|
||||
val navOptions = FoldableNavOptions.Builder().setLaunchScreen(LaunchScreen.START).build()
|
||||
navController?.navigate(R.id.navigation_products_graph, null, navOptions)
|
||||
Log.i("HISTORY_TEST", "navigateToProducts")
|
||||
}
|
||||
|
||||
override fun navigateToProductDetails() {
|
||||
navController?.navigate(R.id.action_product_list_to_details)
|
||||
Log.i("HISTORY_TEST", "navigateToProductDetails")
|
||||
}
|
||||
|
||||
override fun navigateToProductCustomize() {
|
||||
navController?.navigate(R.id.action_product_details_to_customize)
|
||||
Log.i("HISTORY_TEST", "navigateToProductCustomize")
|
||||
}
|
||||
|
||||
override fun navigateToOrders() {
|
||||
val navOptions = FoldableNavOptions.Builder().setLaunchScreen(LaunchScreen.BOTH).build()
|
||||
navController?.navigate(R.id.navigation_orders_graph, null, navOptions)
|
||||
Log.i("HISTORY_TEST", "navigateToOrders")
|
||||
}
|
||||
|
||||
override fun navigateToOrderReceipt() {
|
||||
navController?.navigate(R.id.action_order_to_receipt)
|
||||
Log.i("HISTORY_TEST", "navigateToOrderReceipt")
|
||||
}
|
||||
|
||||
override fun navigateToHistory() {
|
||||
val navOptions = FoldableNavOptions.Builder().setLaunchScreen(LaunchScreen.BOTH).build()
|
||||
navController?.navigate(R.id.navigation_history_graph, null, navOptions)
|
||||
Log.i("HISTORY_TEST", "navigateToHistory")
|
||||
}
|
||||
|
||||
override fun navigateToHistoryDetails() {
|
||||
navController?.navigate(R.id.action_history_list_to_details)
|
||||
Log.i("HISTORY_TEST", "navigateToHistoryDetails")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package com.microsoft.device.samples.dualscreenexperience.presentation.catalog
|
|||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
@ -105,6 +106,12 @@ class CatalogListFragment : Fragment() {
|
|||
override fun onResume() {
|
||||
super.onResume()
|
||||
setupToolbar()
|
||||
Log.i("HISTORY_TEST", "CatalogListFragment: onResume")
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
Log.i("HISTORY_TEST", "CatalogListFragment: onPause")
|
||||
}
|
||||
|
||||
private fun setupToolbar() {
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
package com.microsoft.device.samples.dualscreenexperience.presentation.history
|
||||
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
@ -77,6 +78,12 @@ class HistoryDetailFragment : Fragment() {
|
|||
override fun onResume() {
|
||||
super.onResume()
|
||||
setupToolbar()
|
||||
Log.i("HISTORY_TEST", "HistoryDetailFragment: onResume")
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
Log.i("HISTORY_TEST", "HistoryDetailFragment: onPause")
|
||||
}
|
||||
|
||||
private fun setupToolbar() {
|
||||
|
|
|
@ -9,6 +9,7 @@ package com.microsoft.device.samples.dualscreenexperience.presentation.history
|
|||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
@ -101,6 +102,12 @@ class HistoryListFragment : Fragment() {
|
|||
override fun onResume() {
|
||||
super.onResume()
|
||||
setupToolbar()
|
||||
Log.i("HISTORY_TEST", "HistoryListFragment: onResume")
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
Log.i("HISTORY_TEST", "HistoryListFragment: onPause")
|
||||
}
|
||||
|
||||
private fun setupToolbar() {
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
package com.microsoft.device.samples.dualscreenexperience.presentation.history
|
||||
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
|
@ -30,6 +31,7 @@ class HistoryViewModel @Inject constructor(
|
|||
|
||||
fun reset() {
|
||||
selectedOrder.value = null
|
||||
Log.i("HISTORY_TEST", "HistoryViewModel reset")
|
||||
}
|
||||
|
||||
fun onClick(model: Order) {
|
||||
|
|
|
@ -9,6 +9,7 @@ package com.microsoft.device.samples.dualscreenexperience.presentation.order
|
|||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
@ -144,6 +145,12 @@ class OrderFragment : Fragment() {
|
|||
super.onResume()
|
||||
setupConfirmationObservers()
|
||||
changeToolbarTitle()
|
||||
Log.i("HISTORY_TEST", "OrderFragment: onResume")
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
Log.i("HISTORY_TEST", "OrderFragment: onPause")
|
||||
}
|
||||
|
||||
private fun onWindowLayoutInfoChanged(windowLayoutInfo: WindowLayoutInfo) {
|
||||
|
|
|
@ -9,6 +9,7 @@ package com.microsoft.device.samples.dualscreenexperience.presentation.product.l
|
|||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
@ -75,6 +76,12 @@ class ProductListFragment : Fragment() {
|
|||
override fun onResume() {
|
||||
super.onResume()
|
||||
setupToolbar()
|
||||
Log.i("HISTORY_TEST", "ProductListFragment: onResume")
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
Log.i("HISTORY_TEST", "ProductListFragment: onPause")
|
||||
}
|
||||
|
||||
private fun setupToolbar() {
|
||||
|
|
|
@ -9,6 +9,7 @@ package com.microsoft.device.samples.dualscreenexperience.presentation.store.map
|
|||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
@ -281,11 +282,13 @@ class StoreMapFragment : Fragment() {
|
|||
override fun onResume() {
|
||||
super.onResume()
|
||||
mapController.onResume(mapView)
|
||||
Log.i("HISTORY_TEST", "StoreMapFragment: onResume")
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
mapController.onPause(mapView)
|
||||
Log.i("HISTORY_TEST", "StoreMapFragment: onPause")
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче