|
@@ -17,8 +17,12 @@ public class CreativeStorePromoteCard extends LinearLayout {
|
|
|
|
|
|
private OnClickListener onClickImageListener;
|
|
|
|
|
|
+ private OnClickListener onClickFreeTrialListener;
|
|
|
+
|
|
|
private Button viewNow;
|
|
|
|
|
|
+ private Button freeTrial;
|
|
|
+
|
|
|
public CreativeStorePromoteCard(Context context) {
|
|
|
super(context);
|
|
|
initView();
|
|
@@ -36,11 +40,13 @@ public class CreativeStorePromoteCard extends LinearLayout {
|
|
|
|
|
|
public void setButtonColor(int color) {
|
|
|
viewNow.setTextColor(color);
|
|
|
+ freeTrial.setTextColor(color);
|
|
|
}
|
|
|
|
|
|
private void initView() {
|
|
|
View view = inflate(getContext(), R.layout.widget_creative_store_promote_card, this);
|
|
|
viewNow = (Button) view.findViewById(R.id.button_promote_card_creative_store_view_now);
|
|
|
+ freeTrial = (Button) view.findViewById(R.id.button_promote_card_creative_store_free_trial);
|
|
|
ImageView imageView = (ImageView) view.findViewById(R.id.image_view_promote_card_creative_store_view);
|
|
|
|
|
|
viewNow.setOnClickListener(view1 -> {
|
|
@@ -58,6 +64,13 @@ public class CreativeStorePromoteCard extends LinearLayout {
|
|
|
intentToCreativeStore();
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ freeTrial.setOnClickListener(view13 -> {
|
|
|
+ if (onClickFreeTrialListener != null) {
|
|
|
+ onClickFreeTrialListener.onClick(view13);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public void setOnClickViewNowListener(OnClickListener onClickViewNowListener) {
|
|
@@ -68,6 +81,10 @@ public class CreativeStorePromoteCard extends LinearLayout {
|
|
|
this.onClickImageListener = onClickImageListener;
|
|
|
}
|
|
|
|
|
|
+ public void setOnClickFreeTrialListener(OnClickListener onClickFreeTrialListener) {
|
|
|
+ this.onClickFreeTrialListener = onClickFreeTrialListener;
|
|
|
+ }
|
|
|
+
|
|
|
private void intentToCreativeStore() {
|
|
|
Uri uri = Uri.parse("https://creativestore.kdanmobile.com/subscription/creativity365?utm_source=Website&utm_campaign=KdanWeb_NL_C365&utm_medium=NL");
|
|
|
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
|