thkouk00

Merge branch 'cosmote' of https://git.warp.ly/open-source/warply_android_sdk_mav…

…en_plugin into cosmote
...@@ -11,9 +11,11 @@ import android.text.style.StyleSpan; ...@@ -11,9 +11,11 @@ import android.text.style.StyleSpan;
11 import android.view.View; 11 import android.view.View;
12 import android.widget.Button; 12 import android.widget.Button;
13 import android.widget.ImageView; 13 import android.widget.ImageView;
14 +import android.widget.LinearLayout;
14 import android.widget.TextView; 15 import android.widget.TextView;
15 16
16 import ly.warp.sdk.R; 17 import ly.warp.sdk.R;
18 +import ly.warp.sdk.fragments.BaseFragment;
17 19
18 20
19 public class BillPaymentActivity extends Activity implements View.OnClickListener { 21 public class BillPaymentActivity extends Activity implements View.OnClickListener {
...@@ -28,7 +30,6 @@ public class BillPaymentActivity extends Activity implements View.OnClickListene ...@@ -28,7 +30,6 @@ public class BillPaymentActivity extends Activity implements View.OnClickListene
28 30
29 private ImageView mIvBack; 31 private ImageView mIvBack;
30 private Button mPayBtn; 32 private Button mPayBtn;
31 - private TextView mTvLuckyDraw;
32 33
33 // =========================================================== 34 // ===========================================================
34 // Methods for/from SuperClass/Interfaces 35 // Methods for/from SuperClass/Interfaces
...@@ -77,18 +78,30 @@ public class BillPaymentActivity extends Activity implements View.OnClickListene ...@@ -77,18 +78,30 @@ public class BillPaymentActivity extends Activity implements View.OnClickListene
77 dialog.getWindow().setBackgroundDrawableResource(R.drawable.banner_border_white); 78 dialog.getWindow().setBackgroundDrawableResource(R.drawable.banner_border_white);
78 dialog.show(); 79 dialog.show();
79 80
80 - mTvLuckyDraw = dialog.findViewById(R.id.tv_lucky_draw); 81 + TextView mTvLuckyDraw = dialog.findViewById(R.id.tv_lucky_draw);
82 + LinearLayout mClLuckyDraw = dialog.findViewById(R.id.constraintLayout);
81 83
82 SpannableStringBuilder builder = new SpannableStringBuilder(); 84 SpannableStringBuilder builder = new SpannableStringBuilder();
83 - String s1= "My Lucky Day Draw"; 85 + String s1 = "My Lucky Day Draw";
84 - String s2= " 10 συμμετοχές αντί για 1"; 86 + String s2 = " 10 συμμετοχές αντί για 1";
85 - SpannableString ss1= new SpannableString(s1); 87 + SpannableString ss1 = new SpannableString(s1);
86 ss1.setSpan(new StyleSpan(Typeface.BOLD), 0, s1.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); // set size 88 ss1.setSpan(new StyleSpan(Typeface.BOLD), 0, s1.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); // set size
87 ss1.setSpan("#3A5266", 0, s1.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);// set color 89 ss1.setSpan("#3A5266", 0, s1.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);// set color
88 90
89 builder.append(ss1); 91 builder.append(ss1);
90 builder.append(s2); 92 builder.append(s2);
91 mTvLuckyDraw.setText(builder, TextView.BufferType.SPANNABLE); 93 mTvLuckyDraw.setText(builder, TextView.BufferType.SPANNABLE);
94 +
95 + mClLuckyDraw.setOnClickListener(view -> {
96 + if (BaseFragment.getUniqueCampaignList() != null && !BaseFragment.getUniqueCampaignList().isEmpty()) {
97 + if (BaseFragment.getUniqueCampaignList().containsKey("lucky_draw") && BaseFragment.getUniqueCampaignList().get("lucky_draw").size() > 0) {
98 + startActivity(WarpViewActivity.createIntentFromSessionUUID(this,
99 + BaseFragment.getUniqueCampaignList().get("lucky_draw").get(0).getSessionUUID()));
100 + dialog.dismiss();
101 + }
102 + }
103 + });
104 +
92 } 105 }
93 // =========================================================== 106 // ===========================================================
94 // Inner and Anonymous Classes 107 // Inner and Anonymous Classes
......
...@@ -4,7 +4,6 @@ import android.os.Bundle; ...@@ -4,7 +4,6 @@ import android.os.Bundle;
4 4
5 import androidx.fragment.app.Fragment; 5 import androidx.fragment.app.Fragment;
6 6
7 -import java.util.ArrayList;
8 import java.util.HashMap; 7 import java.util.HashMap;
9 8
10 import ly.warp.sdk.Warply; 9 import ly.warp.sdk.Warply;
...@@ -47,6 +46,10 @@ public class BaseFragment extends Fragment { ...@@ -47,6 +46,10 @@ public class BaseFragment extends Fragment {
47 return mConsumer; 46 return mConsumer;
48 } 47 }
49 48
49 + public static HashMap<String, CampaignList> getUniqueCampaignList() {
50 + return mUniqueCampaignList;
51 + }
52 +
50 private final CallbackReceiver<Consumer> mConsumerReceiver = new CallbackReceiver<Consumer>() { 53 private final CallbackReceiver<Consumer> mConsumerReceiver = new CallbackReceiver<Consumer>() {
51 @Override 54 @Override
52 public void onSuccess(Consumer result) { 55 public void onSuccess(Consumer result) {
......
...@@ -76,9 +76,9 @@ ...@@ -76,9 +76,9 @@
76 android:layout_width="wrap_content" 76 android:layout_width="wrap_content"
77 android:layout_height="wrap_content" 77 android:layout_height="wrap_content"
78 android:layout_marginStart="16dp" 78 android:layout_marginStart="16dp"
79 + android:gravity="center"
79 android:text="Μy Lucky Day Draw" 80 android:text="Μy Lucky Day Draw"
80 android:textSize="17dp" 81 android:textSize="17dp"
81 - android:gravity="center"
82 app:layout_constraintBottom_toBottomOf="parent" 82 app:layout_constraintBottom_toBottomOf="parent"
83 app:layout_constraintStart_toStartOf="parent" 83 app:layout_constraintStart_toStartOf="parent"
84 app:layout_constraintTop_toTopOf="parent" /> 84 app:layout_constraintTop_toTopOf="parent" />
......