-
Notifications
You must be signed in to change notification settings - Fork 132
[Payment Method Improvements] Cash Payment Improvements #11414
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
97b0a24
Initial FF check
backwardstruck 5607c0d
Clean up the disorder
backwardstruck 1eddaf5
Add data class
backwardstruck 8920cc0
Start adding navigation logic
backwardstruck 4a3249e
Add placeholder UI
backwardstruck e4c2823
Merge branch 'trunk' into 10941-cash-payment-improvements
backwardstruck 3d77aa0
Add title string
backwardstruck 0face8a
No need to pop up
backwardstruck 23eb91d
Dialog fragment
backwardstruck 18f5e20
Changes to fragment and viewmodel
backwardstruck 85a6b79
Static code analysis
backwardstruck 62a5205
Add test class
backwardstruck 4ad0eb7
Update test class
backwardstruck 020cb3b
Update test class
backwardstruck c21d8a1
Update test class
backwardstruck cb30201
Update test class
backwardstruck de54aa8
Update test class
backwardstruck 8c45aa3
Detekt first pass
backwardstruck a905ee5
Detekt second pass
backwardstruck 886a518
Detekt third pass
backwardstruck 6b05cc5
Detekt fourth pass
backwardstruck 71a082d
Detekt imports
backwardstruck ec6e679
Merge remote-tracking branch 'origin/trunk' into 10941-cash-payment-i…
backwardstruck 5222b8f
Update detekt configuration
backwardstruck f676784
Move test to the module
backwardstruck 27412c1
Remove unused import
backwardstruck dcd90b0
Test simplified
backwardstruck a73d119
Address PR comments
backwardstruck cb6c05a
Use ScopedViewModel
backwardstruck 76ad3ab
Use ScopedViewModel
backwardstruck ff19eca
Don't try/catch
backwardstruck 9776bc2
It should be non-null.
backwardstruck 5acadcb
Assert TODO
backwardstruck 81fe1fc
FF as false for now
backwardstruck c919f23
Update test and method
backwardstruck 3a5645c
Detekt change
backwardstruck 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
55 changes: 55 additions & 0 deletions
55
...kotlin/com/woocommerce/android/ui/payments/methodselection/ChangeDueCalculatorFragment.kt
This file contains hidden or 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,55 @@ | ||
package com.woocommerce.android.ui.payments.methodselection | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material.MaterialTheme | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.platform.ComposeView | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.unit.dp | ||
import androidx.fragment.app.Fragment | ||
import com.woocommerce.android.R | ||
|
||
class ChangeDueCalculatorFragment : Fragment() { | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View { | ||
return ComposeView(requireContext()).apply { | ||
setContent { | ||
ChangeDueCalculatorScreen() | ||
} | ||
} | ||
} | ||
|
||
@Composable | ||
fun ChangeDueCalculatorScreen() { | ||
// This can be passed through arguments if needed | ||
val orderId = arguments?.getLong("orderId") ?: 0L | ||
backwardstruck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Column( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.padding(16.dp), | ||
verticalArrangement = Arrangement.Center, | ||
horizontalAlignment = Alignment.CenterHorizontally | ||
) { | ||
// Title | ||
Text( | ||
text = stringResource(R.string.payments_hub_title) + " " + orderId, | ||
style = MaterialTheme.typography.h5, | ||
modifier = Modifier.padding(bottom = 16.dp) | ||
) | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...otlin/com/woocommerce/android/ui/payments/methodselection/ChangeDueCalculatorViewModel.kt
This file contains hidden or 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,7 @@ | ||
package com.woocommerce.android.ui.payments.methodselection | ||
|
||
import androidx.lifecycle.ViewModel | ||
|
||
class ChangeDueCalculatorViewModel : ViewModel() { | ||
// State variables and methods | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.