-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add jetpack compose #1280
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e7c0c55
feat: jetpack compose up and running
Syn-McJ ed0e253
feat: add ZenLedger item in Compose
HashEngineering d71aecd
fix: ksp error
Syn-McJ d3c8f97
fix: various fixes
HashEngineering 0557e1c
fix: various fixes
HashEngineering 2a09ffc
tests: fix test
HashEngineering 77f6ffe
fix: remove Compose ZenLedger menu item
HashEngineering 79032ab
fix: handle intent after setting up result launcher
HashEngineering 54c2bce
fix: handle intent after setting up result launcher
HashEngineering File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,4 @@ class RoomConverters { | |
fun dateToTimestamp(date: Date?): Long? { | ||
return date?.time | ||
} | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,11 @@ | |
|
||
package de.schildbach.wallet.ui | ||
|
||
import android.app.Activity | ||
import android.content.Intent | ||
import android.os.Bundle | ||
import androidx.activity.result.ActivityResultLauncher | ||
import androidx.activity.result.contract.ActivityResultContracts | ||
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.localbroadcastmanager.content.LocalBroadcastManager | ||
import de.schildbach.wallet.Constants | ||
|
@@ -27,6 +30,7 @@ import de.schildbach.wallet.data.PaymentIntent | |
import de.schildbach.wallet.integration.android.BitcoinIntegration | ||
import de.schildbach.wallet.ui.buy_sell.IntegrationOverviewFragment | ||
import de.schildbach.wallet.ui.main.WalletActivity | ||
import de.schildbach.wallet.ui.send.SendCoinsActivity | ||
import de.schildbach.wallet.ui.send.SendCoinsActivity.Companion.sendFromWalletUri | ||
import de.schildbach.wallet.ui.util.InputParser.WalletUriParser | ||
import de.schildbach.wallet.ui.util.WalletUri | ||
|
@@ -49,11 +53,23 @@ class WalletUriHandlerActivity : AppCompatActivity() { | |
} | ||
|
||
private var wallet: Wallet? = null | ||
private lateinit var walletUriResultLauncher: ActivityResultLauncher<Intent> | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
wallet = (application as WalletApplication).wallet | ||
handleIntent(intent) | ||
walletUriResultLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result -> | ||
var resultIntent: Intent? = null | ||
if (result.resultCode == Activity.RESULT_OK) { | ||
val data = result.data | ||
val requestData = intent.data | ||
val transactionHash = BitcoinIntegration.transactionHashFromResult(data) | ||
resultIntent = WalletUri.createPaymentResult(requestData, transactionHash) | ||
} | ||
setResult(result.resultCode, resultIntent) | ||
finish() | ||
} | ||
Comment on lines
+61
to
+71
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. replaces deprecated onActiivtyResult There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not used internally, but when apps externally request data using |
||
} | ||
|
||
override fun onNewIntent(intent: Intent) { | ||
|
@@ -90,9 +106,10 @@ class WalletUriHandlerActivity : AppCompatActivity() { | |
} else { | ||
object : WalletUriParser(intentUri) { | ||
override fun handlePaymentIntent(paymentIntent: PaymentIntent, forceInstantSend: Boolean) { | ||
sendFromWalletUri( | ||
this@WalletUriHandlerActivity, REQUEST_CODE_SEND_FROM_WALLET_URI, paymentIntent | ||
) | ||
val intent = Intent(this@WalletUriHandlerActivity, SendCoinsActivity::class.java) | ||
intent.action = SendCoinsActivity.ACTION_SEND_FROM_WALLET_URI | ||
intent.putExtra(SendCoinsActivity.INTENT_EXTRA_PAYMENT_INTENT, paymentIntent) | ||
walletUriResultLauncher.launch(intent) | ||
} | ||
|
||
override fun handleMasterPublicKeyRequest(sender: String) { | ||
|
@@ -140,6 +157,7 @@ class WalletUriHandlerActivity : AppCompatActivity() { | |
confirmationAlertDialogBuilder.buildAlertDialog().show() | ||
} | ||
|
||
@Deprecated("Deprecated in Java") | ||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { | ||
super.onActivityResult(requestCode, resultCode, data) | ||
|
||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these were added after running the 1.8 to 1.9 migration tool.