Skip to content

Commit

Permalink
[Identity][Compose] Remove all fragments and use a Compose NavHost (#…
Browse files Browse the repository at this point in the history
…5981)

* [Identity][Compose] Remove all fragments and use a Compose NavHost

* resolve comments
  • Loading branch information
ccen-stripe authored Jan 12, 2023
1 parent 9634137 commit 3484ef9
Show file tree
Hide file tree
Showing 60 changed files with 2,057 additions and 3,745 deletions.
10 changes: 0 additions & 10 deletions identity/api/identity.api
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,6 @@ public final class com/stripe/android/identity/analytics/AnalyticsState$Creator
public synthetic fun newArray (I)[Ljava/lang/Object;
}

public final class com/stripe/android/identity/databinding/IdentityActivityBinding : androidx/viewbinding/ViewBinding {
public final field identityNavHost Landroidx/fragment/app/FragmentContainerView;
public final field topAppBar Lcom/google/android/material/appbar/MaterialToolbar;
public static fun bind (Landroid/view/View;)Lcom/stripe/android/identity/databinding/IdentityActivityBinding;
public synthetic fun getRoot ()Landroid/view/View;
public fun getRoot ()Landroidx/constraintlayout/widget/ConstraintLayout;
public static fun inflate (Landroid/view/LayoutInflater;)Lcom/stripe/android/identity/databinding/IdentityActivityBinding;
public static fun inflate (Landroid/view/LayoutInflater;Landroid/view/ViewGroup;Z)Lcom/stripe/android/identity/databinding/IdentityActivityBinding;
}

public final class com/stripe/android/identity/networking/Resource$Creator : android/os/Parcelable$Creator {
public fun <init> ()V
public final fun createFromParcel (Landroid/os/Parcel;)Lcom/stripe/android/identity/networking/Resource;
Expand Down
10 changes: 3 additions & 7 deletions identity/detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
<CurrentIssues>
<ID>ComplexMethod:CameraScreenLaunchedEffect.kt$@Composable internal fun CameraScreenLaunchedEffect( identityViewModel: IdentityViewModel, identityScanViewModel: IdentityScanViewModel, verificationPage: VerificationPage, navController: NavController, cameraManager: IdentityCameraManager, onCameraReady: () -> Unit )</ID>
<ID>ComplexMethod:DocumenetScanScreen.kt$@Composable internal fun DocumentScanScreen( navController: NavController, identityViewModel: IdentityViewModel, identityScanViewModel: IdentityScanViewModel, frontScanType: IdentityScanState.ScanType, backScanType: IdentityScanState.ScanType?, shouldStartFromBack: Boolean, messageRes: DocumentScanMessageRes, collectedDataParamType: CollectedDataParam.Type, route: String )</ID>
<ID>ComplexMethod:ErrorFragment.kt$ErrorFragment$private fun String.toFragmentId(): Int</ID>
<ID>ComplexMethod:IdentityFragmentFactory.kt$IdentityFragmentFactory$override fun instantiate(classLoader: ClassLoader, className: String): Fragment</ID>
<ID>ComplexMethod:IdentityTopLevelDestination.kt$internal fun String.routeToScreenName(): String</ID>
<ID>ComplexMethod:IdentityViewModel.kt$IdentityViewModel$fun updateNewScanType(scanType: IdentityScanState.ScanType)</ID>
<ID>ComplexMethod:NavigationDestinations.kt$internal fun String.routeToScreenName(): String</ID>
<ID>ComplexMethod:NavigationUtils.kt$internal fun Int.fragmentIdToScreenName(): String</ID>
<ID>ComplexMethod:UploadScreen.kt$@Composable internal fun UploadScreen( navController: NavController, identityViewModel: IdentityViewModel, collectedDataParamType: CollectedDataParam.Type, route: String, @StringRes titleRes: Int, @StringRes contextRes: Int, frontInfo: DocumentUploadSideInfo, backInfo: DocumentUploadSideInfo?, shouldShowTakePhoto: Boolean, shouldShowChoosePhoto: Boolean )</ID>
<ID>FunctionOnlyReturningConstant:FaceDetectorTransitioner.kt$FaceDetectorTransitioner$private fun isFaceFocused(): Boolean</ID>
<ID>LargeClass:IdentityViewModel.kt$IdentityViewModel : AndroidViewModel</ID>
Expand All @@ -21,6 +18,7 @@
<ID>LongMethod:ErrorScreen.kt$@Composable internal fun ErrorScreen( identityViewModel: IdentityViewModel, title: String, modifier: Modifier = Modifier, message1: String? = null, message2: String? = null, topButton: ErrorScreenButton? = null, bottomButton: ErrorScreenButton? = null, )</ID>
<ID>LongMethod:IDDetectorAnalyzer.kt$IDDetectorAnalyzer$override suspend fun analyze( data: AnalyzerInput, state: IdentityScanState ): AnalyzerOutput</ID>
<ID>LongMethod:IdentityActivity.kt$IdentityActivity$override fun onCreate(savedInstanceState: Bundle?)</ID>
<ID>LongMethod:IdentityNavGraph.kt$@Composable internal fun IdentityNavGraph( navController: NavHostController = rememberNavController(), identityViewModel: IdentityViewModel, fallbackUrlLauncher: FallbackUrlLauncher, appSettingsOpenable: AppSettingsOpenable, cameraPermissionEnsureable: CameraPermissionEnsureable, verificationFlowFinishable: VerificationFlowFinishable, identityScanViewModelFactory: IdentityScanViewModel.IdentityScanViewModelFactory, onTopBarNavigationClick: () -> Unit, topBarState: IdentityTopBarState, onNavControllerCreated: (NavController) -> Unit )</ID>
<ID>LongMethod:IdentityViewModel.kt$IdentityViewModel$internal fun uploadScanResult( result: IdentityAggregator.FinalResult, verificationPage: VerificationPage, targetScanType: IdentityScanState.ScanType? )</ID>
<ID>LongMethod:IdentityViewModel.kt$IdentityViewModel$private fun uploadDocumentImagesAndNotify( imageFile: File, filePurpose: StripeFilePurpose, uploadMethod: UploadMethod, scores: List&lt;Float>? = null, isHighRes: Boolean, isFront: Boolean, scanType: IdentityScanState.ScanType, compressionQuality: Float )</ID>
<ID>LongMethod:IdentityViewModel.kt$IdentityViewModel$suspend fun postVerificationPageDataForDocSelection( type: CollectedDataParam.Type, navController: NavController, viewLifecycleOwner: LifecycleOwner, cameraPermissionEnsureable: CameraPermissionEnsureable )</ID>
Expand All @@ -42,7 +40,6 @@
<ID>MaxLineLength:IDDetectorTransitionerTest.kt$IDDetectorTransitionerTest$whenever(mockReachAtClockMark.elapsedSince()).thenReturn((DEFAULT_DISPLAY_SATISFIED_DURATION - 1).milliseconds)</ID>
<ID>MaxLineLength:IDDetectorTransitionerTest.kt$IDDetectorTransitionerTest$whenever(mockReachAtClockMark.elapsedSince()).thenReturn((DEFAULT_DISPLAY_UNSATISFIED_DURATION + 1).milliseconds)</ID>
<ID>MaxLineLength:IDDetectorTransitionerTest.kt$IDDetectorTransitionerTest$whenever(mockReachAtClockMark.elapsedSince()).thenReturn((DEFAULT_DISPLAY_UNSATISFIED_DURATION - 1).milliseconds)</ID>
<ID>MaxLineLength:IdentityActivityTest.kt$IdentityActivityTest$(IdentityActivity, Toolbar, ImageButton, NavController, InjectableActivityScenario&lt;IdentityActivity>) -> Unit</ID>
<ID>MaxLineLength:IdentityNetworkResponseFixtures.kt$body</ID>
<ID>MaxLineLength:IdentityNetworkResponseFixtures.kt$face_detector_url</ID>
<ID>MaxLineLength:IdentityNetworkResponseFixtures.kt$fallback_url</ID>
Expand All @@ -59,13 +56,12 @@
<ID>ThrowsCount:DefaultIdentityRepository.kt$DefaultIdentityRepository$private suspend fun &lt;Response : StripeModel> executeRequestWithModelJsonParser( request: StripeRequest, responseJsonParser: ModelJsonParser&lt;Response>, onSuccessExecutionTimeBlock: (Long) -> Unit = {} ): Response</ID>
<ID>TooManyFunctions:IdentityAnalyticsRequestFactory.kt$IdentityAnalyticsRequestFactory</ID>
<ID>TooManyFunctions:IdentityViewModel.kt$IdentityViewModel : AndroidViewModel</ID>
<ID>TooManyFunctions:UploadDestinations.kt$DocumentUploadDestination$Companion</ID>
<ID>TopLevelPropertyNaming:ConfirmationScreen.kt$internal const val confirmationConfirmButtonTag = "ConfirmButton"</ID>
<ID>TopLevelPropertyNaming:ConfirmationScreen.kt$internal const val confirmationTitleTag = "ConfirmationTitle"</ID>
<ID>TopLevelPropertyNaming:DocSelectionScreen.kt$internal const val docSelectionTitleTag = "Title"</ID>
<ID>TopLevelPropertyNaming:DocSelectionScreen.kt$internal const val singleSelectionTag = "SingleSelection"</ID>
<ID>UnnecessaryAbstractClass:IdentityCommonModule.kt$IdentityCommonModule$IdentityCommonModule</ID>
<ID>UnusedPrivateMember:CameraPermissionDeniedFragmentTest.kt$CameraPermissionDeniedFragmentTest$@StringRes expectedTitleSuffix: Int = 0</ID>
<ID>UnusedPrivateMember:CouldNotCaptureFragmentTest.kt$CouldNotCaptureFragmentTest$testBlock: (Button, Button, TestNavHostController) -> Unit</ID>
<ID>UnusedPrivateMember:IDDetectorTransitionerTest.kt$IDDetectorTransitionerTest$i</ID>
<ID>VariableNaming:IdentityViewModel.kt$IdentityViewModel$/** * Response for initial VerificationPage, used for building UI. */ @VisibleForTesting internal val _verificationPage: MutableLiveData&lt;Resource&lt;VerificationPage>> = // No need to write to savedStateHandle for livedata savedStateHandle.getLiveData( key = VERIFICATION_PAGE, initialValue = Resource.idle() )</ID>
</CurrentIssues>
Expand Down
27 changes: 0 additions & 27 deletions identity/res/layout/identity_activity.xml

This file was deleted.

171 changes: 0 additions & 171 deletions identity/res/navigation/identity_nav_graph.xml

This file was deleted.

4 changes: 4 additions & 0 deletions identity/res/values/totranslate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@
<string name="description_privacy_policy">privacy policy icon</string>
<!-- Content description for exclamation icon -->
<string name="description_exclamation">exclamation icon</string>
<!-- Content description for close button -->
<string name="description_close">close verification page</string>
<!-- Content description for back button -->
<string name="description_go_back">go back to the previous screen</string>
</resources>
Loading

0 comments on commit 3484ef9

Please sign in to comment.