Skip to content

Commit

Permalink
Fix dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
LionZXY committed Oct 6, 2021
1 parent 783daad commit 7f8e3fb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import android.content.Context
import android.content.IntentSender
import android.os.Build
import android.os.Bundle
import android.view.View
import androidx.activity.result.ActivityResult
import androidx.activity.result.IntentSenderRequest
import androidx.activity.result.contract.ActivityResultContracts
Expand Down Expand Up @@ -80,8 +79,8 @@ class CompanionFindFragment : ComposeFragment() {
}
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
override fun onResume() {
super.onResume()
openFindDeviceDialog()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,18 @@ fun ComposeFindDevice(
TextButton(onClick = onClickBackButton) {
Text(stringResource(R.string.pair_companion_back_button))
}
if (connectionState == null ||
connectionState is ConnectionState.Disconnecting ||
connectionState is ConnectionState.Disconnected
) {
IconButton(onClick = onClickRefreshButton) {
Icon(
painter = painterResource(
if (errorText != null) {
R.drawable.ic_sync_problem
} else {
R.drawable.ic_sync
}
),
contentDescription = stringResource(R.string.pair_companion_pic_update)
)
}

IconButton(onClick = onClickRefreshButton) {
Icon(
painter = painterResource(
if (errorText != null) {
R.drawable.ic_sync_problem
} else {
R.drawable.ic_sync
}
),
contentDescription = stringResource(R.string.pair_companion_pic_update)
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class PairScreenStateDispatcherImpl @Inject constructor(
val prevState = stateStack.pop()
val screen = getScreenForStateUnsafe(prevState) ?: error("Call back on finish state")
router.replaceScreen(screen)
currentState = prevState
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PairStateStorageImpl @Inject constructor(
tosAccepted = tosAccepted,
devicePaired = devicePaired,
permissionGranted = permissionGranted,
guidePassed = true // Temporary disabled
guidePassed = devicePaired
)
}

Expand Down

0 comments on commit 7f8e3fb

Please sign in to comment.