Panagiotis Triantafyllou

minor addition 2

......@@ -2,11 +2,13 @@ package ly.warp.sdk.activities;
import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.graphics.Paint;
import android.os.Bundle;
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;
......@@ -23,7 +25,8 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
// ===========================================================
private ImageView mIvBack;
private TextView mTvTerms;
private TextView mTvTerms, mTvCouponCode;
private LinearLayout mLlGiftIt;
// ===========================================================
// Methods for/from SuperClass/Interfaces
......@@ -36,6 +39,8 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
mIvBack = findViewById(R.id.iv_coupon_info_back);
mTvTerms = findViewById(R.id.tv_terms);
mLlGiftIt = findViewById(R.id.ll_gift_it);
mTvCouponCode = findViewById(R.id.textView16);
initViews();
}
......@@ -49,6 +54,13 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
public void onClick(View view) {
if (view.getId() == R.id.iv_coupon_info_back) {
onBackPressed();
return;
}
if (view.getId() == R.id.ll_gift_it) {
Intent intent = new Intent(android.content.Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(android.content.Intent.EXTRA_TEXT, "Link: https://cosmote.page.link /referal\n\nΧρησιμοποίησε τον κωδικό " + mTvCouponCode.getText().toString() + " για εκπτωτικό κουπόνι 4€ στο BOX: XMAS4");
startActivity(Intent.createChooser(intent, "Άνοιγμα με"));
}
}
......@@ -59,6 +71,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
private void initViews() {
mIvBack.setOnClickListener(this);
mTvTerms.setPaintFlags(mTvTerms.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
mLlGiftIt.setOnClickListener(this);
}
// ===========================================================
......