Panagiotis Triantafyllou

lucky draw campaign

......@@ -11,9 +11,11 @@ import android.text.style.StyleSpan;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import ly.warp.sdk.R;
import ly.warp.sdk.fragments.BaseFragment;
public class BillPaymentActivity extends Activity implements View.OnClickListener {
......@@ -28,7 +30,6 @@ public class BillPaymentActivity extends Activity implements View.OnClickListene
private ImageView mIvBack;
private Button mPayBtn;
private TextView mTvLuckyDraw;
// ===========================================================
// Methods for/from SuperClass/Interfaces
......@@ -77,18 +78,30 @@ public class BillPaymentActivity extends Activity implements View.OnClickListene
dialog.getWindow().setBackgroundDrawableResource(R.drawable.banner_border_white);
dialog.show();
mTvLuckyDraw = dialog.findViewById(R.id.tv_lucky_draw);
TextView mTvLuckyDraw = dialog.findViewById(R.id.tv_lucky_draw);
LinearLayout mClLuckyDraw = dialog.findViewById(R.id.constraintLayout);
SpannableStringBuilder builder = new SpannableStringBuilder();
String s1= "My Lucky Day Draw";
String s2= " 10 συμμετοχές αντί για 1";
SpannableString ss1= new SpannableString(s1);
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);
mClLuckyDraw.setOnClickListener(view -> {
if (BaseFragment.getUniqueCampaignList() != null && !BaseFragment.getUniqueCampaignList().isEmpty()) {
if (BaseFragment.getUniqueCampaignList().containsKey("lucky_draw") && BaseFragment.getUniqueCampaignList().get("lucky_draw").size() > 0) {
startActivity(WarpViewActivity.createIntentFromSessionUUID(this,
BaseFragment.getUniqueCampaignList().get("lucky_draw").get(0).getSessionUUID()));
dialog.dismiss();
}
}
});
}
// ===========================================================
// Inner and Anonymous Classes
......
......@@ -4,7 +4,6 @@ import android.os.Bundle;
import androidx.fragment.app.Fragment;
import java.util.ArrayList;
import java.util.HashMap;
import ly.warp.sdk.Warply;
......@@ -47,6 +46,10 @@ public class BaseFragment extends Fragment {
return mConsumer;
}
public static HashMap<String, CampaignList> getUniqueCampaignList() {
return mUniqueCampaignList;
}
private final CallbackReceiver<Consumer> mConsumerReceiver = new CallbackReceiver<Consumer>() {
@Override
public void onSuccess(Consumer result) {
......
......@@ -76,9 +76,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:gravity="center"
android:text="Μy Lucky Day Draw"
android:textSize="17dp"
android:gravity="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......