-
Notifications
You must be signed in to change notification settings - Fork 662
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[connect] Fix file uploading (#9879)
* rm duplicate color values; fix dynamic * fix webview file uploading * minor cleanup * cleanup chooseFileLaunchers * fix filePathCallback error edge case
- Loading branch information
1 parent
924207c
commit 0a13596
Showing
7 changed files
with
159 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
connect/src/main/java/com/stripe/android/connect/webview/ChooseFileActivityResultContract.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.stripe.android.connect.webview | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import android.net.Uri | ||
import android.webkit.WebChromeClient | ||
import androidx.activity.result.contract.ActivityResultContract | ||
|
||
/** | ||
* Contract for launching a file chooser activity and handling its result. | ||
* Used to select files for upload in Connect web flows. | ||
*/ | ||
internal class ChooseFileActivityResultContract : ActivityResultContract<Intent, Array<Uri>?>() { | ||
override fun createIntent(context: Context, input: Intent): Intent { | ||
return input | ||
} | ||
|
||
override fun parseResult(resultCode: Int, intent: Intent?): Array<Uri>? { | ||
return WebChromeClient.FileChooserParams.parseResult(resultCode, intent) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters