File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed
ui/src/main/java/io/snabble/sdk/ui/checkout Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import io.snabble.sdk.ui.R
1717import io.snabble.sdk.ui.SnabbleUI
1818import io.snabble.sdk.ui.scanner.BarcodeView
1919import io.snabble.sdk.ui.utils.getFragmentActivity
20+ import io.snabble.sdk.ui.utils.setOrHide
2021import io.snabble.sdk.utils.Utils.dp2px
2122
2223@Suppress(" LeakingThis" )
@@ -77,25 +78,15 @@ open class PaymentStatusItemView @JvmOverloads constructor(
7778 }
7879
7980 fun setTitle (title : String? ) {
80- if (title == null ) {
81- titleView.visibility = View .GONE
82- } else {
83- titleView.visibility = View .VISIBLE
84- titleView.text = title
85- }
81+ titleView.setOrHide(title)
8682 }
8783
8884 fun setText (t : String? ) {
89- if (t == null ) {
90- text.visibility = View .GONE
91- } else {
92- text.visibility = View .VISIBLE
93- text.text = t
94- }
85+ text.setOrHide(t)
9586 }
9687
97- fun setAction (text : String? , onClickListener : OnClickListener ? ) {
98- if (text != null && onClickListener != null ) {
88+ fun setAction (text : String? , onClickListener : OnClickListener ) {
89+ if (text != null ) {
9990 action.isVisible = true
10091 action.text = text
10192 action.setOnClickListener(onClickListener)
You can’t perform that action at this time.
0 commit comments