Commit e01ee605 authored by mengcuiguang's avatar mengcuiguang

添加钻石提现功能

parent 198a1d0f
......@@ -10,8 +10,8 @@ android {
applicationId "com.mints.highgold"
minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode 7
versionName "1.0.6"
versionCode 8
versionName "1.0.7"
flavorDimensions "default"
// dex突破65535的限制
......@@ -309,6 +309,15 @@ dependencies {
exclude group: 'com.google.code.gson'
}
// 珊瑚广告
// implementation(name:'adapt-1.3.3', ext:'aar')
// implementation(name:'commonbase-1.0.2', ext:'aar')
// implementation(name:'discovery-2.0.12', ext:'aar')
// implementation(name:'shanhuAD-1.0.14', ext:'aar')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
......
......@@ -6,7 +6,6 @@ import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.RequiresApi;
import android.support.multidex.MultiDex;
import android.support.multidex.MultiDexApplication;
import android.support.v4.content.LocalBroadcastManager;
......@@ -178,31 +177,31 @@ public class MintsApplication extends MultiDexApplication {
// 一览视频
initYL();
// // 鱼丸盒子
// if (UserManager.getInstance().userIsLogin()) {
// if (Build.VERSION.SDK_INT > 28) {
//
// // android10 延迟加载 因为获取不到oaid
// RxjavaUtil.executeRxTask(new CommonRxTask<String>("") {
// @Override
// public void doInIOThread() {
// try {
// Thread.sleep(1500);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// }
//
// @Override
// public void doInUIThread() {
// initYwSdk();
// }
// });
//
// } else {
// initYwSdk();
// }
// }
// 鱼丸盒子
if (UserManager.getInstance().userIsLogin()) {
if (Build.VERSION.SDK_INT > 28) {
// android10 延迟加载 因为获取不到oaid
RxjavaUtil.executeRxTask(new CommonRxTask<String>("") {
@Override
public void doInIOThread() {
try {
Thread.sleep(1500);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
@Override
public void doInUIThread() {
initYwSdk();
}
});
} else {
initYwSdk();
}
}
// 推啊广告
initTuia();
......
......@@ -27,7 +27,20 @@ public class DrawcashBean implements Serializable {
private int coinRate;
private String alipayAccount;
private int coin;
private int diamonds;
private int vedioCompleteSum;
private int vedioNeedSum;
private double firstValue;
private List<CashOutMoneyArrBean> cashOutMoneyArr;
private List<CashOutMoneyArrBean> cashOutDiamondsArr;
public int getDiamonds() {
return diamonds;
}
public void setDiamonds(int diamonds) {
this.diamonds = diamonds;
}
public String getMsg() {
return msg;
......@@ -109,6 +122,38 @@ public class DrawcashBean implements Serializable {
this.cashOutMoneyArr = cashOutMoneyArr;
}
public int getVedioCompleteSum() {
return vedioCompleteSum;
}
public void setVedioCompleteSum(int vedioCompleteSum) {
this.vedioCompleteSum = vedioCompleteSum;
}
public int getVedioNeedSum() {
return vedioNeedSum;
}
public void setVedioNeedSum(int vedioNeedSum) {
this.vedioNeedSum = vedioNeedSum;
}
public double getFirstValue() {
return firstValue;
}
public void setFirstValue(double firstValue) {
this.firstValue = firstValue;
}
public List<CashOutMoneyArrBean> getCashOutDiamondsArr() {
return cashOutDiamondsArr;
}
public void setCashOutDiamondsArr(List<CashOutMoneyArrBean> cashOutDiamondsArr) {
this.cashOutDiamondsArr = cashOutDiamondsArr;
}
public class CashOutMoneyArrBean implements Serializable{
/**
* money : 1
......@@ -120,7 +165,7 @@ public class DrawcashBean implements Serializable {
* canCashOut : false
*/
private double money;
private int money;
private boolean canUseOnce;//还有没有新人专享的机会
private int needFs;//需要多少朋友才能提现
private int nowFriends;//现在有多少了
......@@ -128,11 +173,11 @@ public class DrawcashBean implements Serializable {
private boolean once;//是否是新人专享
private boolean canCashOut;//最终能不能提现
public double getMoney() {
public int getMoney() {
return money;
}
public void setMoney(double money) {
public void setMoney(int money) {
this.money = money;
}
......
......@@ -33,6 +33,7 @@ public class GameBean implements Serializable {
private int status; // 0-未完成挑战,不可点击领取 1-已完成挑战可以领取 2-已领取不可再领取
private int coin;
private int time;
private int rewardType;//0-金币
private int hotType;// 0-不显示 1-显示hot 2-显示new;
private String buttonText;
......@@ -107,5 +108,13 @@ public class GameBean implements Serializable {
public void setTime(int time) {
this.time = time;
}
public int getRewardType() {
return rewardType;
}
public void setRewardType(int rewardType) {
this.rewardType = rewardType;
}
}
}
......@@ -55,6 +55,7 @@ public class GoldRecordBean implements Serializable {
private String day;
private boolean showDay;
private int oldCoin;
private int rewardType;
private int unitCoin;
private int newCoin;
private int detailType;
......@@ -132,5 +133,13 @@ public class GoldRecordBean implements Serializable {
public void setShowDay(boolean showDay) {
this.showDay = showDay;
}
public int getRewardType() {
return rewardType;
}
public void setRewardType(int rewardType) {
this.rewardType = rewardType;
}
}
}
......@@ -229,12 +229,7 @@ public class LoanPresenter extends BasePresenter<LoanView> {
private void getGameList() {
HashMap<String, Object> vo = new HashMap<>();
// if (Build.VERSION.SDK_INT <= 28) {
// vo.put("isShowYwhzGame", true);
// } else {
// vo.put("isShowYwhzGame", false);
// }
vo.put("isShowYwhzGame", false);
vo.put("isShowYwhzGame", true);
AppHttpManager.getInstance(loanApplication)
.call(loanService.getGameList(vo),
......
......@@ -120,7 +120,7 @@ public class MyPresenter extends BasePresenter<MyView> {
// } else {
// vo.put("isShowYwhzGame", false);
// }
vo.put("isShowYwhzGame", false);
vo.put("isShowYwhzGame", true);
AppHttpManager.getInstance(loanApplication)
.call(loanService.myHotActivity(vo),
new BaseSubscriber<BaseResponse<BannerBean>>() {
......
......@@ -488,7 +488,7 @@ public interface LoanService {
// if (BuildConfig.DEBUG) {
// SPUtil spUtil = SPUtil.getInstance(context);
// if (TextUtils.isEmpty(spUtil.getString(Constant.LOCAL_IP))) {
// spUtil.putString(Constant.LOCAL_IP, "http://39.106.5.102:9082/api-p1/");
// spUtil.putString(Constant.LOCAL_IP, "http://39.97.65.143:9082/api-p1/");
// }
// retrofit = new Retrofit.Builder()
// .client(builder.build())
......
......@@ -45,6 +45,7 @@ import com.mints.highgold.utils.SpanUtils;
import com.mints.highgold.utils.Utils;
import com.mints.highgold.utils.rxutil.CommonRxTask;
import com.mints.highgold.utils.rxutil.RxjavaUtil;
import com.mints.library.utils.GlideUtils;
import com.mints.library.utils.json.JsonUtil;
import com.mints.library.utils.nodoubleclick.AntiShake;
import com.qq.e.ads.rewardvideo.RewardVideoAD;
......@@ -156,7 +157,8 @@ public class AwardActivity extends BaseActivity implements AwardView {
} else {
ivBanner.setVisibility(View.VISIBLE);
fsvAward.setVisibility(View.GONE);
ivBanner.setImageResource(R.mipmap.ic_award_banner);
GlideUtils.loadImageViewGif(getContext(), R.drawable.bg_banner, ivBanner);
AppConfig.bannerAdType = 0;
}
}
......@@ -668,13 +670,16 @@ public class AwardActivity extends BaseActivity implements AwardView {
tvAwardContent.setText("提交申请成功");
tvAwardNext.setText("需要更多现金");
break;
case Constant.CARRIER_VERSUS_HEALTH:// 任务赚健康
case Constant.CARRIER_HOMEPAGE_YWHZ:// 首页高额游戏挑战奖励
case Constant.CARRIER_MOBILE_COIN_EXCHANGE_REWARD:// 任务赚健康
tvAwardContent.setText("恭喜获取" + curCoin + "钻石");
tvAwardNext.setVisibility(View.GONE);
llAwardBg.setBackground(getResources().getDrawable(R.mipmap.bg_award_gold));
break;
case Constant.CARRIER_VERSUS_HEALTH:// 任务赚健康
tvAwardContent.setText("恭喜获取" + curCoin + "金币");
tvAwardNext.setVisibility(View.GONE);
llAwardBg.setBackground(getResources().getDrawable(R.mipmap.bg_award_gold));
// tvAwardNext.setText("我知道了");
break;
default:
tvAwardContent.setText("恭喜获取" + curCoin + "金币");
......
......@@ -55,7 +55,6 @@ public class GoldTryActivity extends BaseActivity implements GoldTryView,
protected void initViewsAndEvents() {
tvActivityTitle.setText("金币兑换");
goldTryPresenter = new GoldTryPresenter();
goldTryPresenter.attachView(this);
......@@ -74,7 +73,6 @@ public class GoldTryActivity extends BaseActivity implements GoldTryView,
public void onDestroy() {
super.onDestroy();
goldTryPresenter.detachView();
}
......
......@@ -346,11 +346,11 @@ public class LoginActivity extends BaseActivity implements LoginView {
@Override
public void loginSuc() {
// try {
// // 登录成功初始化鱼玩盒子userid
// getBaseApplication().initYwSdk();
// } catch (Exception e) {
// }
try {
// 登录成功初始化鱼玩盒子userid
getBaseApplication().initYwSdk();
} catch (Exception e) {
}
// try {
// 登录成功初始化愉悦推
......
......@@ -230,11 +230,11 @@ public class WxLoginActivity extends BaseActivity implements WxLoginView, OnLogi
public void loginSuc() {
// UserManager.getInstance().userLogout();
// try {
// // 登录成功初始化鱼玩盒子userid
// getBaseApplication().initYwSdk();
// } catch (Exception e) {
// }
try {
// 登录成功初始化鱼玩盒子userid
getBaseApplication().initYwSdk();
} catch (Exception e) {
}
// try {
// 登录成功初始化愉悦推
......
......@@ -59,6 +59,7 @@ public class GoldRecordAdapter extends BaseAdapter {
viewHolder.tv_goldrecord_time = (TextView) convertView.findViewById(R.id.tv_goldrecord_time);
viewHolder.tv_goldrecord_content = (TextView) convertView.findViewById(R.id.tv_goldrecord_content);
viewHolder.tv_goldrecord_cash = (TextView) convertView.findViewById(R.id.tv_goldrecord_cash);
viewHolder.tv_goldrecord_cash_type = (TextView) convertView.findViewById(R.id.tv_goldrecord_cash_type);
convertView.setTag(viewHolder);
} else {
......@@ -84,10 +85,25 @@ public class GoldRecordAdapter extends BaseAdapter {
switch (data.getType()) {//2-积分兑换入账 3-朋友推荐入账
case 0://增加
viewHolder.tv_goldrecord_cash.setText("+" + data.getUnitCoin());
if(data.getRewardType()==0){
// 0-金币
viewHolder.tv_goldrecord_cash.setText("金币");
viewHolder.tv_goldrecord_cash.setTextColor(ContextCompat.getColor(context, R.color.main_mints));
}else{
viewHolder.tv_goldrecord_cash.setText("钻石");
viewHolder.tv_goldrecord_cash.setTextColor(ContextCompat.getColor(context, R.color.versus_task_play_text));
}
viewHolder.tv_goldrecord_cash.setText("+" + data.getUnitCoin());
break;
default://减少
if(data.getRewardType()==0){
// 0-金币
viewHolder.tv_goldrecord_cash.setText("金币");
}else{
viewHolder.tv_goldrecord_cash.setText("钻石");
}
viewHolder.tv_goldrecord_cash.setText("-" + data.getUnitCoin());
viewHolder.tv_goldrecord_cash.setTextColor(ContextCompat.getColor(context, R.color.loan_green));
break;
......@@ -101,6 +117,7 @@ public class GoldRecordAdapter extends BaseAdapter {
public TextView tv_goldrecord_time;
public TextView tv_goldrecord_content;
public TextView tv_goldrecord_cash;
public TextView tv_goldrecord_cash_type;
}
}
......@@ -79,17 +79,8 @@ public class MainGameAdapter extends BaseAdapter {
viewHolder.iv_main_item_gametype.setBackground(context.getResources().getDrawable(R.mipmap.ic_game_hot));
} else if (hotType == 2) {
viewHolder.iv_main_item_gametype.setBackground(context.getResources().getDrawable(R.mipmap.ic_game_new));
}
// if (hotType == 2) {
// destoryTimerList();
// startTime(viewHolder.tv_main_item_next, 60, gameList.getButtonText());
// } else {
// viewHolder.tv_main_item_next.setText(gameList.getButtonText());
// viewHolder.tv_main_item_next.setBackground(context.getResources().getDrawable(R.drawable.shape_main_water));
// }
GlideUtils.loadImageViewLoding(context, gameList.getImgUrl(), viewHolder.ic_main_item_game, R.mipmap.ic_launcher, R.mipmap.ic_launcher);
viewHolder.tv_main_item_title.setText(gameList.getTitle());
viewHolder.tv_main_item_gold.setText("+" + gameList.getCoin());
......@@ -99,12 +90,17 @@ public class MainGameAdapter extends BaseAdapter {
if (gameList.getStatus() == 0) {
//0-未完成不可点击领取 1-已完成挑战可以领取 2-已领取不可再领取
viewHolder.tv_main_item_next.setBackground(context.getResources().getDrawable(R.drawable.shape_main_water));
} else if(gameList.getStatus() == 1){
} else if (gameList.getStatus() == 1) {
viewHolder.tv_main_item_next.setBackground(context.getResources().getDrawable(R.drawable.shape_tv_gold));
}else{
} else {
viewHolder.tv_main_item_next.setBackground(context.getResources().getDrawable(R.drawable.shape_tv_gold_gury));
}
if (gameList.getRewardType() == 0) {
viewHolder.tv_main_item_gold.setCompoundDrawablesWithIntrinsicBounds(context.getResources().getDrawable(R.mipmap.ic_gold), null, null, null);
} else {
viewHolder.tv_main_item_gold.setCompoundDrawablesWithIntrinsicBounds(context.getResources().getDrawable(R.mipmap.ic_diamond), null, null, null);
}
}
return convertView;
......
......@@ -969,6 +969,48 @@ public class MainFragment extends BaseFragment
getRandomVedioAd(Constant.CARRIER_DAILY_VIDEO, userConfig.getVideoCoin(), "", userConfig.getConfigH5DownloadCoin());
}
} else if (TextUtils.equals(gameId, "homeywhz")) {
// 鱼玩盒子
//0-未完成挑战,不可点击领取 1-已完成挑战可以领取 2-已领取不可再领取
int status = gameList.get(position).getStatus();
switch (status) {
case 0:
case 2:
if (!userManager.userIsLogin()) {
readyGo(WxLoginActivity.class);
return;
}
new RxPermissions(getActivity())
.request(Manifest.permission.READ_PHONE_STATE, Manifest.permission.READ_EXTERNAL_STORAGE)
.subscribe(granted -> {
if (granted) {
try {
YwSDK_WebActivity.Companion.open(getActivity());
// toggleIsBack2Left();
} catch (Exception e) {
e.printStackTrace();
showToast("暂不支持该版本");
}
} else {
showMissingPermissionDialog("设备、储存");
}
});
break;
case 1:
HashMap<String, Object> vo = new HashMap<>();
vo.put("gameId", gameId);
vo.put("carrierType", Constant.CARRIER_HOMEPAGE_YWHZ);
loanPresenter.reportAddCoinMsg(vo, "");
Bundle bundle = new Bundle();
bundle.putString(Constant.MAIN_CARRIET_TURN, Constant.CARRIER_HOMEPAGE_YWHZ);
bundle.putInt(Constant.MAIN_CUR_FLAG, Constant.MAIN_CUR_ONE);
bundle.putInt(Constant.MAIN_CUR_COIN, gameList.get(position).getCoin());
// bundle.putInt(Constant.MAIN_ALL_COIN, userConfig.getCoin());
readyGo(AwardActivity.class, bundle);
break;
}
} else if (TextUtils.equals(gameId, "homemobile")) {
// 移动积分
//0-未完成挑战,不可点击领取 1-已完成挑战可以领取 2-已领取不可再领取
......
......@@ -560,22 +560,6 @@ public class VersusFragment extends BaseFragment
showToast("挑战看视频任务已完成,请明日再来");
return;
}
// if (!isFirstVedioTimeFlag) {
// int sysTaskTimeInterval = userConfig.getSys_task_time_interval();
// if (sysTaskTimeInterval > 0) {
// startTime(sysTaskTimeInterval * 60 * 1000);
// }
// loadAd(Constant.CARRIER_VERSUS_VIDEO, TTAdManagerHolder.TT_AD_VEDIO_MAIN_2);
// }
// if (!isFirstVedioTimeFlag) {
// int sysTaskTimeInterval = userConfig.getSys_task_time_interval();
// if (sysTaskTimeInterval > 0) {
// startTime(sysTaskTimeInterval * 60 * 1000);
// }
// getRandomVedioAd(Constant.CARRIER_VERSUS_VIDEO, userConfig.getChallenge_vedio1_vedio_coin(), "", userConfig.getChallenge_vedio1_download_coin());
// }
getRandomVedioAd(Constant.CARRIER_VERSUS_VIDEO, userConfig.getChallenge_vedio1_vedio_coin(), "", userConfig.getChallenge_vedio1_download_coin());
break;
case R.id.ll_versus_tryplay:
......@@ -584,14 +568,6 @@ public class VersusFragment extends BaseFragment
showToast("挑战玩应用任务已完成,请明日再来");
return;
}
// loadAd(Constant.CARRIER_VERSUS_DOWNLOAD, TTAdManagerHolder.TT_AD_VEDIO_MAIN_2);
// tryVedio();
// getRandomVedioAd(Constant.CARRIER_VERSUS_VIDEO, userConfig.getChallenge_download1_vedio_coin(), "", userConfig.getChallenge_download1_download_coin());
break;
case R.id.ll_versus_drinktea:
case R.id.tv_versus_drinktea:
......@@ -923,19 +899,16 @@ public class VersusFragment extends BaseFragment
}
// 鱼玩盒子
// if (userManager.getAdShowFlag()) {
//// if (Build.VERSION.SDK_INT <= 28) {
// // 目前只支持anrdoid 10以下
// tvVersusYwhzgold.setText("+" + data.getYwhzCoin());
// if (data.isYwhzShow()) {
// llVersusYwhz.setVisibility(View.VISIBLE);
// viewVersusYwhz.setVisibility(View.VISIBLE);
// } else {
// llVersusYwhz.setVisibility(View.GONE);
// viewVersusYwhz.setVisibility(View.GONE);
// }
//// }
// }
if (userManager.getAdShowFlag()) {
tvVersusYwhzgold.setText("+" + data.getYwhzCoin());
if (data.isYwhzShow()) {
llVersusYwhz.setVisibility(View.VISIBLE);
viewVersusYwhz.setVisibility(View.VISIBLE);
} else {
llVersusYwhz.setVisibility(View.GONE);
viewVersusYwhz.setVisibility(View.GONE);
}
}
// ----------------------------
//第一次喝水 Complete 0-未完成 1-完成 2-领取
......@@ -2261,6 +2234,7 @@ public class VersusFragment extends BaseFragment
});
vedioAdingManager.loadAding(bean);
}
/**
* 广告返回结果
*
......
......@@ -113,6 +113,11 @@ public class GlideUtils {
Glide.with(mContext).load(path).asGif().into(mImageView);
}
//设置动态GIF Drawable
public static void loadImageViewGif(Context mContext, int drawPath, ImageView mImageView) {
Glide.with(mContext).load(drawPath).asGif().into(mImageView);
}
//设置静态GIF加载方式
public static void loadImageViewStaticGif(Context mContext, String path, ImageView mImageView) {
Glide.with(mContext).load(path).asBitmap().into(mImageView);
......
......@@ -817,7 +817,7 @@
android:layout_centerVertical="true"
android:layout_marginLeft="10pt"
android:layout_toRightOf="@+id/tv_versus_exchange_title"
android:drawableLeft="@mipmap/ic_gold"
android:drawableLeft="@mipmap/ic_diamond"
android:drawablePadding="2pt"
android:gravity="center_vertical"
android:textColor="@color/main_mints"
......@@ -898,7 +898,7 @@
android:layout_centerVertical="true"
android:layout_marginLeft="10pt"
android:layout_toRightOf="@+id/tv_versus_ywhz_title"
android:drawableLeft="@mipmap/ic_gold"
android:drawableLeft="@mipmap/ic_diamond"
android:drawablePadding="2pt"
android:gravity="center_vertical"
android:text="+10w"
......
......@@ -58,6 +58,7 @@
android:textSize="14sp" />
<TextView
android:id="@+id/tv_goldrecord_cash_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="金币"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment