|
|
@@ -12,6 +12,7 @@ import android.content.Intent;
|
|
|
import android.graphics.Bitmap;
|
|
|
import android.graphics.Canvas;
|
|
|
import android.graphics.Color;
|
|
|
+import android.graphics.Typeface;
|
|
|
import android.graphics.drawable.BitmapDrawable;
|
|
|
import android.graphics.drawable.Drawable;
|
|
|
import android.media.MediaPlayer;
|
|
|
@@ -67,6 +68,7 @@ import com.sheep.gamegroup.absBase.ITag;
|
|
|
import com.sheep.gamegroup.dateview.DatePickerDialog;
|
|
|
import com.sheep.gamegroup.dateview.DateUtil;
|
|
|
import com.sheep.gamegroup.model.entity.Advertising;
|
|
|
+import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.Container;
|
|
|
import com.sheep.gamegroup.model.entity.DialogConfig;
|
|
|
import com.sheep.gamegroup.model.entity.GameAccountEntity;
|
|
|
@@ -75,8 +77,12 @@ import com.sheep.gamegroup.model.entity.Lp;
|
|
|
import com.sheep.gamegroup.model.entity.PayEntity;
|
|
|
import com.sheep.gamegroup.model.entity.RobTask;
|
|
|
import com.sheep.gamegroup.model.entity.TaskEty;
|
|
|
+import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
+import com.sheep.gamegroup.module.yf_shop.model.ReceiveCouponsCheckResq;
|
|
|
+import com.sheep.gamegroup.module.yf_shop.model.ReceiveCouponsResp;
|
|
|
import com.sheep.gamegroup.util.glide.RoundedCornersTransformation;
|
|
|
import com.sheep.gamegroup.util.share.ShareLinkConfig;
|
|
|
+import com.sheep.gamegroup.util.string.SpannableSb;
|
|
|
import com.sheep.gamegroup.util.viewHelper.LayoutParamsUtil;
|
|
|
import com.sheep.gamegroup.view.activity.ActMain;
|
|
|
import com.sheep.gamegroup.view.activity.PersonalInfoAct;
|
|
|
@@ -1362,6 +1368,7 @@ public class ViewUtil {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ //展示弹窗广告
|
|
|
public static void showHalfScreenAd(final Activity activity, final Advertising advertising, Container<Action1<Integer>> container) {
|
|
|
if (activity != null) {
|
|
|
View dialog_parent = View.inflate(activity, R.layout.dialog_parent, null);
|
|
|
@@ -1484,7 +1491,11 @@ public class ViewUtil {
|
|
|
}
|
|
|
});
|
|
|
if (TextUtils.isEmpty(advertising.getDesc())) {
|
|
|
- ad_msg.setVisibility(View.GONE);
|
|
|
+ ViewUtil.setVisibility(ad_msg, false);
|
|
|
+ //3.4.7添加 -- 不显示标题栏,不显示背景 start
|
|
|
+ ViewUtil.setVisibility(dialog_title, false);
|
|
|
+ dialog_center_ll.setBackgroundColor(Color.TRANSPARENT);
|
|
|
+ //3.4.7添加 -- 不显示标题栏,不显示背景 end
|
|
|
} else {
|
|
|
ad_msg.setText(advertising.getDesc());
|
|
|
}
|
|
|
@@ -1496,6 +1507,68 @@ public class ViewUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //3.4.7添加 -- 展示商城优惠券领取对话框
|
|
|
+ public static void showYfShopAd(final Activity activity, ReceiveCouponsCheckResq data, Container<Action1<Integer>> container) {
|
|
|
+ if (activity != null) {
|
|
|
+ View dialog_parent = View.inflate(activity, R.layout.dialog_parent, null);
|
|
|
+ final AlertDialog dialog = new AlertDialog.Builder(activity, R.style.MyDialogActivityTheme)
|
|
|
+ .setView(dialog_parent)
|
|
|
+ .create();
|
|
|
+ TextView dialog_title = dialog_parent.findViewById(R.id.dialog_title);
|
|
|
+ final View dialog_close = dialog_parent.findViewById(R.id.dialog_close);
|
|
|
+ final LinearLayout dialog_center_ll = dialog_parent.findViewById(R.id.dialog_center_ll);
|
|
|
+ View view = LayoutInflater.from(activity).inflate(R.layout.dialog_yf_shop_ad, dialog_center_ll, true);
|
|
|
+ ViewUtil.setVisibility(dialog_title, false);
|
|
|
+ dialog_center_ll.setBackgroundColor(Color.TRANSPARENT);
|
|
|
+
|
|
|
+ TextView dialog_yf_shop_ad_yuan_tv = view.findViewById(R.id.dialog_yf_shop_ad_yuan_tv);
|
|
|
+ TextView dialog_yf_shop_ad_tip_tv = view.findViewById(R.id.dialog_yf_shop_ad_tip_tv);
|
|
|
+ TextView dialog_yf_shop_ad_btn_tv = view.findViewById(R.id.dialog_yf_shop_ad_btn_tv);
|
|
|
+
|
|
|
+ ViewUtil.setText(dialog_yf_shop_ad_yuan_tv, new SpannableSb().append("¥", R.dimen.text_size_2).append(data.getAmountText(), R.dimen.text_size_28).setTextStyle(Typeface.BOLD).getSsb());
|
|
|
+ ViewUtil.setText(dialog_yf_shop_ad_tip_tv, R.string.yf_shop_quan_tip, data.getAmountText());
|
|
|
+ dialog_close.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ dialog.dismiss();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ dialog_yf_shop_ad_btn_tv.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ //调用接口兑换商城优惠券, 然后跳转到对应的商城h5界面
|
|
|
+ ApiJSONUtil.postYfShopReceiveCoupons(ReceiveCouponsResp.TYPE_NEW_TASK, 6f)
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
+ @Override
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
+ G.showToast(baseMessage);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
+ G.showToast(baseMessage);
|
|
|
+ ReceiveCouponsResp data = baseMessage.getData(ReceiveCouponsResp.class);
|
|
|
+ if(data != null){
|
|
|
+ Jump2View.getInstance().goWeb(activity, data.getBuy_url(), Config.YF_SHOP_NAME);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
|
|
+ @Override
|
|
|
+ public void onDismiss(DialogInterface dialogInterface) {
|
|
|
+ Jump2View.getInstance().tryShowReservation(activity);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ try {
|
|
|
+ dialog.show();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//显示定向货币详情
|
|
|
public static void showOrienteeringDetails(Activity activity) {
|
|
|
new DialogOrienteeringDetails(activity).showOrienteeringDetails();
|