Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_android_sdk_maven_plugin
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
thkouk00
2022-03-28 13:26:18 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a840281b3e72de3640072300a7f4f21d71ba212d
a840281b
1 parent
17fb06f9
spannable textview in success bill payment
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
16 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BillPaymentActivity.java
warply_android_sdk/src/main/res/layout/activity_bill_payment.xml
warply_android_sdk/src/main/res/layout/payment_success_dialog.xml
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BillPaymentActivity.java
View file @
a840281
...
...
@@ -2,10 +2,16 @@ package ly.warp.sdk.activities;
import
android.app.Activity
;
import
android.app.Dialog
;
import
android.graphics.Typeface
;
import
android.os.Bundle
;
import
android.text.Spannable
;
import
android.text.SpannableString
;
import
android.text.SpannableStringBuilder
;
import
android.text.style.StyleSpan
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
ly.warp.sdk.R
;
...
...
@@ -22,6 +28,7 @@ public class BillPaymentActivity extends Activity implements View.OnClickListene
private
ImageView
mIvBack
;
private
Button
mPayBtn
;
private
TextView
mTvLuckyDraw
;
// ===========================================================
// Methods for/from SuperClass/Interfaces
...
...
@@ -69,6 +76,19 @@ public class BillPaymentActivity extends Activity implements View.OnClickListene
dialog
.
setContentView
(
R
.
layout
.
payment_success_dialog
);
dialog
.
getWindow
().
setBackgroundDrawableResource
(
R
.
drawable
.
banner_border_white
);
dialog
.
show
();
mTvLuckyDraw
=
dialog
.
findViewById
(
R
.
id
.
tv_lucky_draw
);
SpannableStringBuilder
builder
=
new
SpannableStringBuilder
();
String
s1
=
"My Lucky Day Draw"
;
String
s2
=
" 10 συμμετοχές αντί για 1"
;
SpannableString
ss1
=
new
SpannableString
(
s1
);
ss1
.
setSpan
(
new
StyleSpan
(
Typeface
.
BOLD
),
0
,
s1
.
length
(),
Spannable
.
SPAN_EXCLUSIVE_EXCLUSIVE
);
// set size
ss1
.
setSpan
(
"#3A5266"
,
0
,
s1
.
length
(),
Spannable
.
SPAN_EXCLUSIVE_EXCLUSIVE
);
// set color
builder
.
append
(
ss1
);
builder
.
append
(
s2
);
mTvLuckyDraw
.
setText
(
builder
,
TextView
.
BufferType
.
SPANNABLE
);
}
// ===========================================================
// Inner and Anonymous Classes
...
...
warply_android_sdk/src/main/res/layout/activity_bill_payment.xml
View file @
a840281
...
...
@@ -28,9 +28,12 @@
android:layout_height=
"32dp"
android:gravity=
"center"
android:text=
"Πληρωμή Λογαριασμού"
android:textColor=
"@color/grey"
android:textSize=
"17sp"
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.3
48
"
app:layout_constraintHorizontal_bias=
"0.3
56
"
app:layout_constraintStart_toEndOf=
"@+id/iv_bill_payment_close"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
...
...
warply_android_sdk/src/main/res/layout/payment_success_dialog.xml
View file @
a840281
...
...
@@ -60,8 +60,8 @@
<LinearLayout
android:id=
"@+id/constraintLayout"
android:layout_width=
"
364dp
"
android:layout_height=
"5
6
dp"
android:layout_width=
"
wrap_content
"
android:layout_height=
"5
4
dp"
android:layout_below=
"@+id/textView7"
android:layout_alignStart=
"@+id/textView7"
android:layout_alignEnd=
"@+id/textView7"
...
...
@@ -72,28 +72,16 @@
android:gravity=
"center_vertical"
>
<TextView
android:id=
"@+id/t
extView8
"
android:id=
"@+id/t
v_lucky_draw
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:text=
"Μy Lucky Day Draw"
android:textFontWeight=
"800"
android:textSize=
"17dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/textView9"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
" 10 συμμετοχές αντί για 1"
android:textColor=
"#3A5266"
app:layout_constraintBottom_toBottomOf=
"@+id/textView8"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.428"
app:layout_constraintStart_toEndOf=
"@+id/textView8"
app:layout_constraintTop_toTopOf=
"@+id/textView8"
/>
</LinearLayout>
<LinearLayout
...
...
Please
register
or
login
to post a comment