Commit f75af1b4 authored by mengcuiguang's avatar mengcuiguang

添加极光、数美、猎豹、通知、广告sdk, 走路页面,喝水界面,登录页,提现等

parent 5244decb
......@@ -32,7 +32,10 @@ android {
abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
}
manifestPlaceholders = [CHANNEL_NAME_VALUE: "mints",
manifestPlaceholders = [CHANNEL_NAME_VALUE: "goodmoney",
JPUSH_PKGNAME : applicationId,
JPUSH_APPKEY : RELEASE_JPUSH_KEY,
JPUSH_CHANNEL : "goodmoney",
UMENG_KEY : RELEASE_UMENG_KEY,
SHARE_KEY : RELEASE_SHARESDK_KEY,
SHARE_SECRET : RELEASE_SHARESDK_SECRET]
......@@ -107,8 +110,7 @@ android {
}
productFlavors {
yingyongbao {}
position {}
goodmoneypkg {}
}
productFlavors.all {
......@@ -168,6 +170,7 @@ dependencies {
// 动画库
implementation 'com.daimajia.easing:library:2.0@aar'
implementation 'com.daimajia.androidanimations:library:2.3@aar'
implementation 'com.romandanylyk:pageindicatorview:1.0.3'
// 工具类
......@@ -180,6 +183,9 @@ dependencies {
// 三方接入
// leakcanary
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4'
// 极光推送
implementation 'cn.jiguang.sdk:jpush:3.6.6'
implementation 'cn.jiguang.sdk:jcore:2.3.8'
// 移动安全联盟
implementation(name: 'msa_mdid_1.0.13', ext: 'aar')
// 穿山甲广告
......@@ -190,8 +196,9 @@ dependencies {
// shareSdk
implementation project(':shareSdkLib')
// umeng
implementation 'com.umeng.umsdk:analytics:8.0.0'
implementation 'com.umeng.umsdk:common:2.0.0'
implementation 'com.umeng.umsdk:common:9.1.0' // (必选)
implementation 'com.umeng.umsdk:asms:1.1.3' // asms包依赖(必选)
implementation 'com.umeng.umsdk:crash:0.0.4' // native crash包依赖(必选)
// TalkingDada
implementation files('libs/SaaS_AppAnalytics_Android_SDK_V4.0.36.jar')
// 一览视频
......
......@@ -4,9 +4,30 @@
package="com.mints.goodmoney">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS"
tools:ignore="ProtectedPermissions" />
<permission android:name="com.mints.goodmoney.permission.JPUSH_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="com.mints.goodmoney.permission.JPUSH_MESSAGE" />
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<application
android:name=".MintsApplication"
......@@ -53,6 +74,14 @@
android:name="Mob-AppSecret"
android:value="${SHARE_SECRET}" />
<!-- 极光 -->
<meta-data
android:name="JPUSH_APPKEY"
android:value="${JPUSH_APPKEY}" />
<meta-data
android:name="JPUSH_CHANNEL"
android:value="${JPUSH_CHANNEL}" />
<activity android:name=".ui.activitys.SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......@@ -79,9 +108,12 @@
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.SettingsActivity"
android:screenOrientation="portrait">
</activity>
android:screenOrientation="portrait"/>
<activity android:name=".ui.activitys.GuideActivity"/>
<activity android:name=".ui.activitys.LiebaoGameActivity"/>
<activity android:name=".ui.activitys.DrawcashActivity"/>
<activity android:name=".ui.activitys.WaterActivity"/>
<activity android:name=".ui.activitys.WalkActivity"/>
<service
android:name=".service.UpdateService"
......@@ -92,6 +124,30 @@
android:enabled="true"
android:exported="false" />
<!-- JPUSH 用户自定义的广播接收器 -->
<receiver
android:name="com.mints.goodmoney.service.JpushReceiver"
android:enabled="true"
android:exported="false">
<intent-filter>
<action android:name="cn.jpush.android.intent.REGISTRATION" /> <!-- Required 用户注册SDK的intent -->
<action android:name="cn.jpush.android.intent.UNREGISTRATION" />
<action android:name="cn.jpush.android.intent.MESSAGE_RECEIVED" /> <!-- Required 用户接收SDK消息的intent -->
<action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED" /> <!-- Required 用户接收SDK通知栏信息的intent -->
<action android:name="cn.jpush.android.intent.NOTIFICATION_OPENED" /> <!-- Required 用户打开自定义通知栏的intent -->
<action android:name="cn.jpush.android.intent.ACTION_RICHPUSH_CALLBACK" /> <!-- Optional 用户接受Rich Push Javascript 回调函数的intent -->
<action android:name="cn.jpush.android.intent.CONNECTION" /> <!-- 接收网络变化 连接/断开 since 1.6.3 -->
<category android:name="com.mints.goodmoney" />
</intent-filter>
</receiver>
<!--since 3.3.0 接收JPush相关事件-->
<receiver android:name=".service.PushMessageReceiver">
<intent-filter>
<action android:name="cn.jpush.android.intent.RECEIVE_MESSAGE" />
<category android:name="${applicationId}"></category>
</intent-filter>
</receiver>
<!-- ShareSDK start -->
<activity
android:name="com.mob.tools.MobUIShell"
......
package com.mints.goodmoney
import android.app.IntentService
import android.app.Notification
import android.content.Context
import android.content.Intent
import android.text.TextUtils
import cn.jpush.android.api.BasicPushNotificationBuilder
import cn.jpush.android.api.JPushInterface
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.LiebaoManager
import com.mints.goodmoney.manager.OaidManager
import com.mints.goodmoney.manager.ShumeiManager
import com.mints.library.utils.CommonUtils
......@@ -80,6 +84,12 @@ class InitAppService : IntentService("InitializeService") {
// 数美
ShumeiManager.getInstance().initShumei()
// 猎豹游戏初始化
// LiebaoManager.getInstance().initCmGameSdk()
// 极光推送
initJpush()
}
/**
......@@ -143,8 +153,8 @@ class InitAppService : IntentService("InitializeService") {
YLUIInit.getInstance()
.setCrashOpen(false)
.setApplication(application)
.setAccessKey("yleoq95t1aro")
.setAccessToken("m8de8rdyqiulcymymijh32pgq9pxgh9x")
.setAccessKey("ylxgszgwjrr8")
.setAccessToken("lmnzhm9yjdlc86xiy74cjgixnqpxe4o2")
.build()
//页面个性化配置
......@@ -161,4 +171,17 @@ class InitAppService : IntentService("InitializeService") {
.feedSwipeRefreshEnable(true) //feed是否可以下拉刷新
FeedConfig.getInstance().playerStyle = FeedConfig.STYLE_NATIVE //FeedConfig.STYLE_STYLE_FEED_PLAY当前页面播放
}
/**
* 绑定jpush
*/
private fun initJpush() {
JPushInterface.setDebugMode(BuildConfig.LOG_DEBUG) // 设置开启日志,发布时请关闭日志
JPushInterface.init(this)
val builder = BasicPushNotificationBuilder(applicationContext)
builder.statusBarDrawable = R.mipmap.ic_launcher
builder.notificationFlags = Notification.FLAG_AUTO_CANCEL //设置为自动消失
builder.notificationDefaults = Notification.DEFAULT_SOUND or Notification.DEFAULT_VIBRATE or Notification.DEFAULT_LIGHTS // 设置为铃声与震动都要
JPushInterface.setDefaultPushNotificationBuilder(builder)
}
}
\ No newline at end of file
......@@ -53,7 +53,7 @@ object Constant {
/**
* oaid
*/
var OAID = "device_oaid"
const val OAID = "device_oaid"
/**
* app应用首页 0-主页 1-pan 2-friends 3-我
......@@ -66,7 +66,6 @@ object Constant {
// 协议地址
var REGISTER_URL = BuildConfig.MainIp + "agreement/register.html"//服务协议
var PRIVACY_URL = BuildConfig.MainIp + "agreement/privacy.html"//隐私协议
var MEMBERS_URL = BuildConfig.MainIp + "agreement/members.html"//会员付费服务协议
/**
......@@ -168,4 +167,11 @@ object Constant {
const val CHUANGSHEN_VEDIO_AD = "CHUANGSHEN_VEDIO_AD"
const val DUOMENT_VEDIO_AD = "DUOMENT_VEDIO_AD"
const val SDHZ_VEDIO_AD = "SDHZ_VEDIO_AD"
// 游戏类型
const val EVENT_TYPE_CLICK = "CLICK"
const val EVENT_TYPE_TIME = "TIME"
const val EVENT_TYPE_ADCLICK = "GAME_AD_CLICK"
const val EVENT_TYPE_GAMEINFO = "GAMEINFO"
}
\ No newline at end of file
......@@ -77,43 +77,43 @@ public class LiebaoManager {
// 设置游戏的广告id
CmGameAppInfo.TTInfo ttInfo = new CmGameAppInfo.TTInfo();
// 游戏内广告有如下6种;
ttInfo.setGameLoad_EXADId(TtCsjAdManager.TT_AD_INSERT_LOADING_ID_LIEBAO); // 游戏加载时,插屏广告1:1,模板渲染
ttInfo.setRewardVideoId(TtCsjAdManager.TT_AD_VEDIO_GAME); // 激励视频
ttInfo.setFullVideoId(TtCsjAdManager.TT_AD_ALLVEDIO_ID_LIEBAO); // 全屏视频,插屏场景下展示
ttInfo.setExpressInteractionId(TtCsjAdManager.TT_AD_INSERT_ID_LIEBAO); // 插屏广告,插屏场景下展示,模板渲染,2:3
// ttInfo.setExpressBannerId("901121159"); // Banner广告,模板渲染,尺寸:600*150,会导致游戏卡慢,暂时不用
ttInfo.setGameEndExpressFeedAdId(TtCsjAdManager.TT_AD_NATIVEEXPRESS_ID_LIEBAO_LISTEXIT); // 游戏退出弹框,信息流广告,模板渲染
// 游戏列表页面有如下2种:
ttInfo.setGameListExpressFeedId(TtCsjAdManager.TT_AD_NATIVEEXPRESS_ID_LIEBAO_LISTEXIT); // 游戏列表,信息流广告,模板渲染
// ttInfo.setGamelistExpressInteractionId("901121536"); // 模板渲染1:1,不能用于游戏tab页的入口
cmGameAppInfo.setTtInfo(ttInfo);
// 需要支持广点通广告时,才需下面代码
// 【设置广点通广告id】
CmGameAppInfo.GDTAdInfo gdtAdInfo = new CmGameAppInfo.GDTAdInfo();
gdtAdInfo.setAppId(YlhAdManager.YLH_AD_APPID); // 广点通的APPID
// 游戏内广告场景;
gdtAdInfo.setRewardVideoId(YlhAdManager.YLH_AD_VEDIO_GAME_POSTID); // 激励视频
gdtAdInfo.setGameLoadInterId(YlhAdManager.YLH_AD_INTERSTITIALAD_LIEBAO);//游戏加载中的插屏
gdtAdInfo.setBannerId(YlhAdManager.YLH_AD_BANNER_LIEBAO); // banner广告
gdtAdInfo.setPlayGameInterId(YlhAdManager.YLH_AD_INTERSTITIALAD_LIEBAO);//游戏进行中关卡插屏
cmGameAppInfo.setGdtAdInfo(gdtAdInfo);
// 【设置广点通和穿山甲广告占比】
// 概率设置规则,如下:
// 0: 全部使用穿山甲广告
// 100: 全部采用广点通广告
// 40:穿山甲广告命中概率是60%,广点通是40%,如果一方没广告,则用另一方补量。
cmGameAppInfo.setRewardAdProbability(80); // 默认值为0,全部采用穿山甲激励视频广告
// 戏关卡间插屏广告概率设置建议,代码默认值为20
// 1)80%流量给穿山甲,20%给优量汇,原因:穿山甲全屏视频广告收益更高,优量汇收益低但体验 好
// 2)概率云端控制,媒体自行下发2种广告源占比
cmGameAppInfo.setExpressInterAdProbability(20);
// CmGameAppInfo.TTInfo ttInfo = new CmGameAppInfo.TTInfo();
// // 游戏内广告有如下6种;
// ttInfo.setGameLoad_EXADId(TtCsjAdManager.TT_AD_INSERT_LOADING_ID_LIEBAO); // 游戏加载时,插屏广告1:1,模板渲染
// ttInfo.setRewardVideoId(TtCsjAdManager.TT_AD_VEDIO_GAME); // 激励视频
// ttInfo.setFullVideoId(TtCsjAdManager.TT_AD_ALLVEDIO_ID_LIEBAO); // 全屏视频,插屏场景下展示
// ttInfo.setExpressInteractionId(TtCsjAdManager.TT_AD_INSERT_ID_LIEBAO); // 插屏广告,插屏场景下展示,模板渲染,2:3
//// ttInfo.setExpressBannerId("901121159"); // Banner广告,模板渲染,尺寸:600*150,会导致游戏卡慢,暂时不用
// ttInfo.setGameEndExpressFeedAdId(TtCsjAdManager.TT_AD_NATIVEEXPRESS_ID_LIEBAO_LISTEXIT); // 游戏退出弹框,信息流广告,模板渲染
// // 游戏列表页面有如下2种:
// ttInfo.setGameListExpressFeedId(TtCsjAdManager.TT_AD_NATIVEEXPRESS_ID_LIEBAO_LISTEXIT); // 游戏列表,信息流广告,模板渲染
//// ttInfo.setGamelistExpressInteractionId("901121536"); // 模板渲染1:1,不能用于游戏tab页的入口
// cmGameAppInfo.setTtInfo(ttInfo);
//
// // 需要支持广点通广告时,才需下面代码
// // 【设置广点通广告id】
// CmGameAppInfo.GDTAdInfo gdtAdInfo = new CmGameAppInfo.GDTAdInfo();
// gdtAdInfo.setAppId(YlhAdManager.YLH_AD_APPID); // 广点通的APPID
// // 游戏内广告场景;
// gdtAdInfo.setRewardVideoId(YlhAdManager.YLH_AD_VEDIO_GAME_POSTID); // 激励视频
// gdtAdInfo.setGameLoadInterId(YlhAdManager.YLH_AD_INTERSTITIALAD_LIEBAO);//游戏加载中的插屏
// gdtAdInfo.setBannerId(YlhAdManager.YLH_AD_BANNER_LIEBAO); // banner广告
// gdtAdInfo.setPlayGameInterId(YlhAdManager.YLH_AD_INTERSTITIALAD_LIEBAO);//游戏进行中关卡插屏
// cmGameAppInfo.setGdtAdInfo(gdtAdInfo);
//
//
// // 【设置广点通和穿山甲广告占比】
// // 概率设置规则,如下:
// // 0: 全部使用穿山甲广告
// // 100: 全部采用广点通广告
// // 40:穿山甲广告命中概率是60%,广点通是40%,如果一方没广告,则用另一方补量。
// cmGameAppInfo.setRewardAdProbability(80); // 默认值为0,全部采用穿山甲激励视频广告
//
//
// // 戏关卡间插屏广告概率设置建议,代码默认值为20
// // 1)80%流量给穿山甲,20%给优量汇,原因:穿山甲全屏视频广告收益更高,优量汇收益低但体验 好
// // 2)概率云端控制,媒体自行下发2种广告源占比
// cmGameAppInfo.setExpressInterAdProbability(20);
// 功能默认开启,可使用如下方法来关闭
// cmGameAppInfo.setShowLogin(false);
......
package com.mints.goodmoney.manager;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.widget.RemoteViews;
import androidx.core.app.NotificationCompat;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.R;
import com.mints.goodmoney.ui.activitys.MainActivity;
import com.mints.goodmoney.utils.SpanUtils;
import static android.content.Context.NOTIFICATION_SERVICE;
/**
* 通知管理
*/
public class NotifyManager {
public static final String CHINALL_ID = "GOODMONEY";
public static final String CHINALL_NAME = "好赚钱通知";
private static NotifyManager _inst;
private Activity activity;
private RemoteViews remoteViews;
private Notification notification;
private NotificationManager manager;
public static NotifyManager getInstance(Activity activity) {
if (_inst != null) {
return _inst;
} else {
_inst = new NotifyManager(activity);
return _inst;
}
}
private NotifyManager(Activity activity) {
this.activity = activity;
return;
}
/**
* 创建通知
*
* @param water
* @param step
*/
public void createNotifyDialog(int water, int step) {
manager = (NotificationManager) activity.getSystemService(NOTIFICATION_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
createNotificationChannel(CHINALL_ID, CHINALL_NAME, NotificationManager.IMPORTANCE_MAX);
}
notification = new NotificationCompat.Builder(activity, CHINALL_ID)
.setOngoing(true)
.setAutoCancel(true)
.setContentTitle("")
.setContentText("")
.setWhen(System.currentTimeMillis())
.setSmallIcon(R.mipmap.ic_launcher)
.setContent(getRemoteViews(water, step))
.setVibrate(new long[]{0})
.build();
updateRemoteView(water, step);
}
/**
* 创建通知渠道
*/
@TargetApi(Build.VERSION_CODES.O)
private void createNotificationChannel(String channelId, String channelName, int importance) {
NotificationChannel channel = new NotificationChannel(channelId, channelName, importance);
channel.enableVibration(false);//震动不可用
channel.setSound(null, null); //设置没有声
NotificationManager notificationManager = (NotificationManager) activity.getSystemService(
NOTIFICATION_SERVICE);
notificationManager.createNotificationChannel(channel);
}
/**
* 创建通知显示view
*
* @param water
* @param step
* @return
*/
private RemoteViews getRemoteViews(int water, int step) {
PendingIntent mainPendingIntent = PendingIntent.getActivity(activity, 0, new Intent(activity, MainActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
// PendingIntent waterPendingIntent = PendingIntent.getActivity(activity, 0, new Intent(activity, WaterActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
remoteViews = new RemoteViews(activity.getPackageName(), R.layout.remoteview);
// remoteViews.setTextViewText(R.id.notify_step, "今日步数 " + step + " 步");
remoteViews.setImageViewResource(R.id.icon, R.mipmap.ic_launcher);
remoteViews.setOnClickPendingIntent(R.id.notify_root, mainPendingIntent);
// remoteViews.setOnClickPendingIntent(R.id.notify_drink, waterPendingIntent);
return remoteViews;
}
/**
* 更新通知
*
* @param water
* @param step
*/
public void updateRemoteView(int water, int step) {
Context context = MintsApplication.getContext();
if (remoteViews != null && context != null) {
remoteViews.setTextViewText(R.id.notify_step,
new SpanUtils()
.append(step + "").setBold().setForegroundColor(context.getResources().getColor(R.color.main_mints))
.append("步 ︲ ").setForegroundColor(context.getResources().getColor(R.color.black_text))
.append(getDistanceByStep(step) + "").setBold().setForegroundColor(context.getResources().getColor(R.color.main_mints))
.append(" 公里").setForegroundColor(context.getResources().getColor(R.color.black_text))
.create());
// remoteViews.setTextViewText(R.id.notify_step, step + "步 ︲ " + getDistanceByStep(step) + "公里");
if (manager != null && notification != null) {
manager.notify(1, notification);
}
}
}
/**
* 计算公里数
*
* @param steps 步数
* @return
*/
private String getDistanceByStep(long steps) {
return String.format("%.2f", (float) steps * 0.6F / 1000.0F);
}
}
......@@ -2,6 +2,7 @@ package com.mints.goodmoney.manager;
import android.content.Context;
import android.text.TextUtils;
import com.ishumei.smantifraud.SmAntiFraud;
import com.mints.goodmoney.MintsApplication;
......@@ -80,6 +81,11 @@ public class ShumeiManager {
id = SmAntiFraud.getDeviceId();
} catch (Exception e) {
e.printStackTrace();
id = "";
}
if (TextUtils.isEmpty(id)) {
initShumei();
}
return id;
}
......
......@@ -176,39 +176,5 @@ public class TTNativeExpressManager {
if (ad.getInteractionType() != TTAdConstant.INTERACTION_TYPE_DOWNLOAD) {
return;
}
ad.setDownloadListener(new TTAppDownloadListener() {
@Override
public void onIdle() {
// showToast("点击开始下载");
}
@Override
public void onDownloadActive(long totalBytes, long currBytes, String fileName, String appName) {
// if (!mHasBannerShowDownloadActive) {
// mHasBannerShowDownloadActive = true;
//// showToast("下载中,点击暂停");
// }
}
@Override
public void onDownloadPaused(long totalBytes, long currBytes, String fileName, String appName) {
// showToast("下载暂停,点击继续");
}
@Override
public void onDownloadFailed(long totalBytes, long currBytes, String fileName, String appName) {
// showToast("下载失败,点击重新下载");
}
@Override
public void onInstalled(String fileName, String appName) {
// showToast("安装完成,点击图片打开");
}
@Override
public void onDownloadFinished(long totalBytes, String fileName, String appName) {
// showToast("点击安装");
}
});
}
}
package com.mints.goodmoney.mvp.model;
import java.io.Serializable;
import java.util.List;
public class DrawcashBean implements Serializable {
/**
* msg : 微信账户目前正在维护中,预计3月28日前恢复,请优先用支付宝提现。
* realName : null
* wxDrawFlag : true
* surplus : 0
* openid : null
* lastCashOutType : WEIXIN
* cashOutMoneyArr : [{"money":"1","canUseOnce":true,"needFs":2,"nowFriends":0,"fsGiveCoin":800,"once":true,"canCashOut":false},{"money":"100","canUseOnce":true,"needFs":20,"nowFriends":0,"fsGiveCoin":1800,"once":true,"canCashOut":false},{"money":"150","canUseOnce":null,"needFs":30,"nowFriends":0,"fsGiveCoin":2800,"once":false,"canCashOut":false},{"money":"200","canUseOnce":null,"needFs":40,"nowFriends":0,"fsGiveCoin":3800,"once":false,"canCashOut":false},{"money":"500","canUseOnce":null,"needFs":50,"nowFriends":0,"fsGiveCoin":4800,"once":false,"canCashOut":false}]
* coinRate : 10000
* alipayAccount : null
* coin : 5562
*/
private String msg;
private String realName;
private boolean wxDrawFlag;
private int surplus;
private String openid;
private String lastCashOutType;
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;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getRealName() {
return realName;
}
public void setRealName(String realName) {
this.realName = realName;
}
public boolean isWxDrawFlag() {
return wxDrawFlag;
}
public void setWxDrawFlag(boolean wxDrawFlag) {
this.wxDrawFlag = wxDrawFlag;
}
public int getSurplus() {
return surplus;
}
public void setSurplus(int surplus) {
this.surplus = surplus;
}
public String getOpenid() {
return openid;
}
public void setOpenid(String openid) {
this.openid = openid;
}
public String getLastCashOutType() {
return lastCashOutType;
}
public void setLastCashOutType(String lastCashOutType) {
this.lastCashOutType = lastCashOutType;
}
public int getCoinRate() {
return coinRate;
}
public void setCoinRate(int coinRate) {
this.coinRate = coinRate;
}
public String getAlipayAccount() {
return alipayAccount;
}
public void setAlipayAccount(String alipayAccount) {
this.alipayAccount = alipayAccount;
}
public int getCoin() {
return coin;
}
public void setCoin(int coin) {
this.coin = coin;
}
public List<CashOutMoneyArrBean> getCashOutMoneyArr() {
return cashOutMoneyArr;
}
public void setCashOutMoneyArr(List<CashOutMoneyArrBean> cashOutMoneyArr) {
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
* canUseOnce : true
* needFs : 2
* nowFriends : 0
* fsGiveCoin : 800
* once : true
* canCashOut : false
*/
private int money;
private boolean canUseOnce;//还有没有新人专享的机会
private int needFs;//需要多少朋友才能提现
private int nowFriends;//现在有多少了
private int fsGiveCoin;//朋友可以返给我多少
private boolean once;//是否是新人专享
private boolean canCashOut;//最终能不能提现
public int getMoney() {
return money;
}
public void setMoney(int money) {
this.money = money;
}
public boolean isCanUseOnce() {
return canUseOnce;
}
public void setCanUseOnce(boolean canUseOnce) {
this.canUseOnce = canUseOnce;
}
public int getNeedFs() {
return needFs;
}
public void setNeedFs(int needFs) {
this.needFs = needFs;
}
public int getNowFriends() {
return nowFriends;
}
public void setNowFriends(int nowFriends) {
this.nowFriends = nowFriends;
}
public int getFsGiveCoin() {
return fsGiveCoin;
}
public void setFsGiveCoin(int fsGiveCoin) {
this.fsGiveCoin = fsGiveCoin;
}
public boolean isOnce() {
return once;
}
public void setOnce(boolean once) {
this.once = once;
}
public boolean isCanCashOut() {
return canCashOut;
}
public void setCanCashOut(boolean canCashOut) {
this.canCashOut = canCashOut;
}
}
}
package com.mints.goodmoney.mvp.presenters;
import android.content.Context;
import android.text.TextUtils;
import com.google.gson.Gson;
import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.common.DeviceInfo;
import com.mints.goodmoney.manager.AppHttpManager;
import com.mints.goodmoney.manager.ShumeiManager;
import com.mints.goodmoney.manager.UserManager;
import com.mints.goodmoney.mvp.model.BaseResponse;
import com.mints.goodmoney.mvp.model.DrawcashBean;
import com.mints.goodmoney.mvp.model.LocationBean;
import com.mints.goodmoney.mvp.model.UserBean;
import com.mints.goodmoney.mvp.views.DrawcashView;
import com.mints.goodmoney.utils.DeviceUuidFactory;
import com.mints.goodmoney.utils.SPUtil;
import com.mints.library.net.neterror.BaseSubscriber;
import com.mints.library.net.neterror.Throwable;
import com.mints.library.utils.json.JsonUtil;
import net.grandcentrix.tray.AppPreferences;
import java.util.HashMap;
import cn.jpush.android.api.JPushInterface;
public class DrawcashPresenter extends BasePresenter<DrawcashView> {
/**
* 获取用户配置信息
*/
public void getUserTaskMsg() {
view.showLoading("加载中...");
AppHttpManager.getInstance(loanApplication)
.call(loanService.getDrawcashUserTaskMsg(),
new BaseSubscriber<BaseResponse<DrawcashBean>>() {
@Override
public void onCompleted() {
if (isLinkView()) return;
view.hideLoading();
}
@Override
public void onError(Throwable e) {
if (isLinkView()) return;
view.hideLoading();
view.showToast(e.getMessage());
}
@Override
public void onNext(BaseResponse<DrawcashBean> baseResponse) {
if (isLinkView()) return;
int code = baseResponse.getStatus();
String message = baseResponse.getMessage();
switch (code) {
case 200://成功
view.getUserTaskMsgSuc(baseResponse.getData());
break;
default:
view.showToast(message);
break;
}
}
});
}
/**
* 修改用户信息
*/
public void editUserMsg(String wxInfo) {
HashMap<String, Object> vo = new HashMap<>();
vo.put("type", "OPENID");
vo.put("value", wxInfo);
AppHttpManager.getInstance(loanApplication)
.call(loanService.bindingWechat(vo),
new BaseSubscriber<BaseResponse<UserBean>>() {
@Override
public void onCompleted() {
if (isLinkView()) return;
view.hideLoading();
}
@Override
public void onError(Throwable e) {
if (isLinkView()) return;
view.hideLoading();
view.showToast(e.getMessage());
}
@Override
public void onNext(BaseResponse<UserBean> baseResponse) {
if (isLinkView()) return;
int code = baseResponse.getStatus();
String message = baseResponse.getMessage();
switch (code) {
case 200://成功
UserBean data = baseResponse.getData();
if (data != null) {
UserManager.getInstance().saveUserInfo(data);
view.editUserMsgSuc();
}
break;
default:
view.showToast(message);
break;
}
}
});
}
/**
* 提交设备信息
*/
public void saveTerminalInfo(AppPreferences ps, double curCash) {
view.showLoading("加载中...");
HashMap<String, Object> vo = new HashMap<>();
DeviceInfo deviceInfo = DeviceInfo.Companion.getInstance();
String macAddress = deviceInfo.getMacAddress();
if (!TextUtils.isEmpty(macAddress)) {
String mac = macAddress.replace(":", "");
vo.put("mac", mac);
vo.put("mac1", macAddress);
}
vo.put("imei", deviceInfo.getIMEI());
vo.put("androidid", deviceInfo.getAndroidId(null));
vo.put("os", "android");
vo.put("shumeiId", ShumeiManager.getInstance().getShumeiDeviceId());
vo.put("model", deviceInfo.getBrand() + " " + deviceInfo.getMobileModel());
vo.put("uuid", new DeviceUuidFactory().getDeviceUuid());
vo.put("osversion", deviceInfo.getOSVersion());
vo.put("appversion", deviceInfo.getVersionName());
vo.put("oaid", ps.getString(Constant.OAID,""));
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo),
new BaseSubscriber<BaseResponse<UserBean>>() {
@Override
public void onCompleted() {
if (isLinkView()) return;
}
@Override
public void onError(Throwable e) {
if (isLinkView()) return;
view.hideLoading();
}
@Override
public void onNext(BaseResponse<UserBean> baseResponse) {
if (isLinkView()) return;
int code = baseResponse.getStatus();
String message = baseResponse.getMessage();
switch (code) {
case 200://成功
addCashoutReq(curCash);
break;
default:
view.showToast(message);
view.hideLoading();
break;
}
}
});
}
/**
* 金币/积分兑换
*/
public void addCashoutReq(double cash) {
HashMap<String, Object> vo = new HashMap<>();
vo.put("cash", cash);
vo.put("payChannel", "WEIXIN");
AppHttpManager.getInstance(loanApplication)
.call(loanService.addCashoutReq(vo),
new BaseSubscriber<BaseResponse<Object>>() {
@Override
public void onCompleted() {
if (isLinkView()) return;
view.hideLoading();
}
@Override
public void onError(Throwable e) {
if (isLinkView()) return;
view.hideLoading();
view.showToast(e.getMessage());
}
@Override
public void onNext(BaseResponse<Object> baseResponse) {
if (isLinkView()) return;
int code = baseResponse.getStatus();
String message = baseResponse.getMessage();
switch (code) {
case 200://成功
view.showToast("提现成功");
break;
default:
view.showToast(message);
break;
}
}
});
}
}
package com.mints.goodmoney.mvp.presenters;
import com.mints.goodmoney.manager.AppHttpManager;
import com.mints.goodmoney.manager.UserManager;
import com.mints.goodmoney.mvp.model.BaseResponse;
import com.mints.goodmoney.mvp.model.MyInfo;
import com.mints.goodmoney.mvp.model.UserBean;
import com.mints.goodmoney.mvp.views.GameView;
import com.mints.goodmoney.utils.DeviceUuidFactory;
import com.mints.library.net.neterror.BaseSubscriber;
import com.mints.library.net.neterror.Throwable;
import java.util.HashMap;
public class GamePresenter extends BasePresenter<GameView> {
/**
* 猎豹游戏上传信息
*/
public void gameAdd(String url, String eventType, HashMap<String, Object> vo) {
// view.showLoading("加载中...");
AppHttpManager.getInstance(loanApplication)
.call(loanService.gameAdd(url, vo),
new BaseSubscriber<BaseResponse<Object>>() {
@Override
public void onCompleted() {
if (isLinkView()) return;
view.hideLoading();
}
@Override
public void onError(Throwable e) {
if (isLinkView()) return;
view.hideLoading();
// view.showToast(e.getMessage());
}
@Override
public void onNext(BaseResponse<Object> baseResponse) {
if (isLinkView()) return;
int code = baseResponse.getStatus();
String message = baseResponse.getMessage();
switch (code) {
case 200://成功
view.gameAddSuc(eventType, baseResponse.getData());
break;
default:
// view.showToast(message);
break;
}
}
});
}
}
......@@ -95,6 +95,46 @@ class LoginPresenter : BasePresenter<LoginView>() {
})
}
/**
* 微信登录
*/
fun login(ps: AppPreferences,wxInfo: String) {
view.showLoading("加载中...")
val vo = HashMap<String, Any>()
vo["shumeiId"] = ShumeiManager.getInstance().shumeiDeviceId
vo["device"] = DeviceUuidFactory().deviceUuid.toString()
vo["wxInfo"] = wxInfo
AppHttpManager.getInstance(loanApplication)
.call(loanService.wechatlogin(vo),
object : BaseSubscriber<BaseResponse<UserBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
view.showToast(e.message)
}
override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
val data = baseResponse.data
when (code) {
200 -> if (data != null) {
UserManager.getInstance().saveUserInfo(data)
saveTerminalInfo(ps)
view.loginSuc()
}
else -> view.showToast(message)
}
}
})
}
/**
* 提交设备信息
*
......
package com.mints.goodmoney.mvp.views;
import com.mints.goodmoney.mvp.model.DrawcashBean;
public interface DrawcashView extends BaseView {
/**
* 获取用户配置信息成功
*/
void getUserTaskMsgSuc(DrawcashBean data);
/**
* 修改用户信息
*/
void editUserMsgSuc();
}
package com.mints.goodmoney.mvp.views;
public interface GameView extends BaseView {
void gameAddSuc(String eventType, Object data);
}
......@@ -6,6 +6,7 @@ import android.text.TextUtils;
import com.mints.goodmoney.BuildConfig;
import com.mints.goodmoney.mvp.model.BannerBean;
import com.mints.goodmoney.mvp.model.BaseResponse;
import com.mints.goodmoney.mvp.model.DrawcashBean;
import com.mints.goodmoney.mvp.model.MyInfo;
import com.mints.goodmoney.mvp.model.SignCardBean;
import com.mints.goodmoney.mvp.model.UserBean;
......@@ -23,6 +24,7 @@ import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.http.Body;
import retrofit2.http.POST;
import retrofit2.http.Url;
import rx.Observable;
/**
......@@ -113,6 +115,14 @@ public interface LoanService {
@POST("api/consumer/mobilelogin")
Observable<BaseResponse<UserBean>> login(@Body Map<String, Object> vo);
/**
* 微信登录
*
* @return
*/
@POST("api/v125/wechatlogin")
Observable<BaseResponse<UserBean>> wechatlogin(@Body Map<String, Object> vo);
/**
* 挑战任务 通用
*
......@@ -153,6 +163,38 @@ public interface LoanService {
@POST("api/offline")
Observable<BaseResponse<Object>> offline();
/**
* 猎豹游戏 上传信息
*
* @return
*/
@POST
Observable<BaseResponse<Object>> gameAdd(@Url String url, @Body Map<String, Object> vo);
/**
* 获取提现信息
*
* @return
*/
@POST("api/high/getUserCoinMsg")
Observable<BaseResponse<DrawcashBean>> getDrawcashUserTaskMsg();
/**
* 微信绑定
*
* @return
*/
@POST("api/v125/bindingWechat")
Observable<BaseResponse<UserBean>> bindingWechat(@Body Map<String, Object> vo);
/**
* 提现
*
* @return
*/
@POST("api/v115/addCashoutReq")
Observable<BaseResponse<Object>> addCashoutReq(@Body Map<String, Object> vo);
/**
* 默认http工厂
*/
......@@ -192,28 +234,7 @@ public interface LoanService {
OkHttpInterceptor okHttpInterceptor = new OkHttpInterceptor(AESUtils.getDefaultKey());
builder.interceptors().add(okHttpInterceptor);
Retrofit retrofit;
// 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:9081/");
// }
// retrofit = new Retrofit.Builder()
// .client(builder.build())
// .baseUrl(spUtil.getString(Constant.LOCAL_IP))
// .addConverterFactory(GsonConverterFactory.create())
// .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
// .build();
// } else {
// retrofit = new Retrofit.Builder()
// .client(builder.build())
// .baseUrl(BuildConfig.MainIp)
// .addConverterFactory(GsonConverterFactory.create())
// .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
// .build();
// }
retrofit = new Retrofit.Builder()
Retrofit retrofit = new Retrofit.Builder()
.client(builder.build())
.baseUrl(BuildConfig.MainIp)
.addConverterFactory(GsonConverterFactory.create())
......
package com.mints.goodmoney.service;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import com.mints.library.utils.TLog;
import com.mints.goodmoney.ui.activitys.MainActivity;
import com.mints.goodmoney.ui.widgets.CustomDialogAsApple;
import com.mints.goodmoney.ui.widgets.DialogListener;
import com.mints.goodmoney.utils.ForegroundOrBackground;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Iterator;
import cn.jpush.android.api.JPushInterface;
public class JpushReceiver extends BroadcastReceiver {
private static final String TAG = "JPush";
private CustomDialogAsApple cdaa;
@Override
public void onReceive(Context context, Intent intent) {
Bundle bundle = intent.getExtras();
TLog.d(TAG, "[MyReceiver] onReceive - " + intent.getAction() + ", extras: " + printBundle(bundle));
//
if (JPushInterface.ACTION_REGISTRATION_ID.equals(intent.getAction())) {
String regId = bundle.getString(JPushInterface.EXTRA_REGISTRATION_ID);
TLog.d(TAG, "[MyReceiver] 接收Registration Id : " + regId);
//send the Registration Id to your server...
} else if (JPushInterface.ACTION_MESSAGE_RECEIVED.equals(intent.getAction())) {
TLog.d(TAG, "[MyReceiver] 接收到推送下来的自定义消息: " + bundle.getString(JPushInterface.EXTRA_MESSAGE));
// processCustomMessage(context, bundle);
} else if (JPushInterface.ACTION_NOTIFICATION_RECEIVED.equals(intent.getAction())) {
TLog.d(TAG, "[MyReceiver] 接收到推送下来的通知");
int notifactionId = bundle.getInt(JPushInterface.EXTRA_NOTIFICATION_ID);
String alert = bundle.getString(JPushInterface.EXTRA_ALERT);
TLog.d(TAG, "[MyReceiver] 接收到推送下来的通知的ID: " + notifactionId);
String type = null;
try {
JSONObject json = new JSONObject(bundle.getString(JPushInterface.EXTRA_EXTRA));
type = json.getString("type");
} catch (JSONException e) {
TLog.e(TAG, "Get message extra JSON error!");
}
if (TextUtils.equals(type, "02") && !TextUtils.isEmpty(alert)) {
Activity forwardActivity = ForegroundOrBackground.getApp_activity();
try {
if (forwardActivity != null && !forwardActivity.isFinishing() && forwardActivity.hasWindowFocus()) {
cdaa = new CustomDialogAsApple(forwardActivity, new DialogListener() {
@Override
public void onClick(View v) {
if (cdaa != null && cdaa.isShowing()) {
cdaa.dismiss();
}
}
});
cdaa.setContent(alert);
cdaa.setLeft("确定");
cdaa.show();
}
} catch (Exception e) {
}
}
} else if (JPushInterface.ACTION_NOTIFICATION_OPENED.equals(intent.getAction())) {
TLog.d(TAG, "[MyReceiver] 用户点击打开了通知");
String type = null;
try {
JSONObject json = new JSONObject(bundle.getString(JPushInterface.EXTRA_EXTRA));
type = json.getString("type");
} catch (JSONException e) {
TLog.e(TAG, "Get message extra JSON error!");
}
Intent i;
if (TextUtils.equals(type, "01")) {
// i = new Intent(context, DrinkClockActivity.class);
} else {
i = new Intent(context, MainActivity.class);
}
i = new Intent(context, MainActivity.class);
i.putExtras(bundle);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
context.startActivity(i);
} else if (JPushInterface.ACTION_RICHPUSH_CALLBACK.equals(intent.getAction())) {
TLog.d(TAG, "[MyReceiver] 用户收到到RICH PUSH CALLBACK: " + bundle.getString(JPushInterface.EXTRA_EXTRA));
//在这里根据 JPushInterface.EXTRA_EXTRA 的内容处理代码,比如打开新的Activity, 打开一个网页等..
} else if (JPushInterface.ACTION_CONNECTION_CHANGE.equals(intent.getAction())) {
boolean connected = intent.getBooleanExtra(JPushInterface.EXTRA_CONNECTION_CHANGE, false);
TLog.w(TAG, "[MyReceiver]" + intent.getAction() + " connected state change to " + connected);
} else {
TLog.d(TAG, "[MyReceiver] Unhandled intent - " + intent.getAction());
}
}
// 打印所有的 intent extra 数据
private static String printBundle(Bundle bundle) {
StringBuilder sb = new StringBuilder();
for (String key : bundle.keySet()) {
if (key.equals(JPushInterface.EXTRA_NOTIFICATION_ID)) {
sb.append("\nkey:" + key + ", value:" + bundle.getInt(key));
} else if (key.equals(JPushInterface.EXTRA_CONNECTION_CHANGE)) {
sb.append("\nkey:" + key + ", value:" + bundle.getBoolean(key));
} else if (key.equals(JPushInterface.EXTRA_EXTRA)) {
if (bundle.getString(JPushInterface.EXTRA_EXTRA).isEmpty()) {
TLog.i(TAG, "This message has no Extra data");
continue;
}
try {
JSONObject json = new JSONObject(bundle.getString(JPushInterface.EXTRA_EXTRA));
Iterator<String> it = json.keys();
while (it.hasNext()) {
String myKey = it.next().toString();
sb.append("\nkey:" + key + ", value: [" +
myKey + " - " + json.optString(myKey) + "]");
}
} catch (JSONException e) {
TLog.e(TAG, "Get message extra JSON error!");
}
} else {
sb.append("\nkey:" + key + ", value:" + bundle.getString(key));
}
}
return sb.toString();
}
}
package com.mints.goodmoney.service;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import com.mints.goodmoney.ui.activitys.MainActivity;
import cn.jpush.android.api.CmdMessage;
import cn.jpush.android.api.CustomMessage;
import cn.jpush.android.api.JPushInterface;
import cn.jpush.android.api.JPushMessage;
import cn.jpush.android.api.NotificationMessage;
import cn.jpush.android.service.JPushMessageReceiver;
public class PushMessageReceiver extends JPushMessageReceiver {
private static final String TAG = "PushMessageReceiver";
@Override
public void onMessage(Context context, CustomMessage customMessage) {
Log.e(TAG,"[onMessage] "+customMessage);
processCustomMessage(context,customMessage);
}
@Override
public void onNotifyMessageOpened(Context context, NotificationMessage message) {
Log.e(TAG,"[onNotifyMessageOpened] "+message);
try{
//打开自定义的Activity
Intent i = new Intent(context, MainActivity.class);
Bundle bundle = new Bundle();
bundle.putString(JPushInterface.EXTRA_NOTIFICATION_TITLE,message.notificationTitle);
bundle.putString(JPushInterface.EXTRA_ALERT,message.notificationContent);
i.putExtras(bundle);
//i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP );
context.startActivity(i);
}catch (Throwable throwable){
}
}
@Override
public void onMultiActionClicked(Context context, Intent intent) {
Log.e(TAG, "[onMultiActionClicked] 用户点击了通知栏按钮");
String nActionExtra = intent.getExtras().getString(JPushInterface.EXTRA_NOTIFICATION_ACTION_EXTRA);
//开发者根据不同 Action 携带的 extra 字段来分配不同的动作。
if(nActionExtra==null){
Log.d(TAG,"ACTION_NOTIFICATION_CLICK_ACTION nActionExtra is null");
return;
}
if (nActionExtra.equals("my_extra1")) {
Log.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮一");
} else if (nActionExtra.equals("my_extra2")) {
Log.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮二");
} else if (nActionExtra.equals("my_extra3")) {
Log.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮三");
} else {
Log.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮未定义");
}
}
@Override
public void onNotifyMessageArrived(Context context, NotificationMessage message) {
Log.e(TAG,"[onNotifyMessageArrived] "+message);
}
@Override
public void onNotifyMessageDismiss(Context context, NotificationMessage message) {
Log.e(TAG,"[onNotifyMessageDismiss] "+message);
}
@Override
public void onRegister(Context context, String registrationId) {
Log.e(TAG,"[onRegister] "+registrationId);
}
@Override
public void onConnected(Context context, boolean isConnected) {
Log.e(TAG,"[onConnected] "+isConnected);
}
@Override
public void onCommandResult(Context context, CmdMessage cmdMessage) {
Log.e(TAG,"[onCommandResult] "+cmdMessage);
}
@Override
public void onTagOperatorResult(Context context, JPushMessage jPushMessage) {
super.onTagOperatorResult(context, jPushMessage);
}
@Override
public void onCheckTagOperatorResult(Context context, JPushMessage jPushMessage){
super.onCheckTagOperatorResult(context, jPushMessage);
}
@Override
public void onAliasOperatorResult(Context context, JPushMessage jPushMessage) {
super.onAliasOperatorResult(context, jPushMessage);
}
@Override
public void onMobileNumberOperatorResult(Context context, JPushMessage jPushMessage) {
super.onMobileNumberOperatorResult(context, jPushMessage);
}
//send msg to MainActivity
private void processCustomMessage(Context context, CustomMessage customMessage) {
// if (MainActivity.isForeground) {
// String message = customMessage.message;
// String extras = customMessage.extra;
// Intent msgIntent = new Intent(MainActivity.MESSAGE_RECEIVED_ACTION);
// msgIntent.putExtra(MainActivity.KEY_MESSAGE, message);
// if (!ExampleUtil.isEmpty(extras)) {
// try {
// JSONObject extraJson = new JSONObject(extras);
// if (extraJson.length() > 0) {
// msgIntent.putExtra(MainActivity.KEY_EXTRAS, extras);
// }
// } catch (JSONException e) {
//
// }
//
// }
// LocalBroadcastManager.getInstance(context).sendBroadcast(msgIntent);
// }
}
@Override
public void onNotificationSettingsCheck(Context context, boolean isOn, int source) {
super.onNotificationSettingsCheck(context, isOn, source);
Log.e(TAG,"[onNotificationSettingsCheck] isOn:"+isOn+",source:"+source);
}
}
package com.mints.goodmoney.ui.activitys
import android.text.TextUtils
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat
import com.mints.goodmoney.R
import com.mints.goodmoney.login.LoginApi
import com.mints.goodmoney.login.OnLoginListener
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.DrawcashBean
import com.mints.goodmoney.mvp.model.WXInfo
import com.mints.goodmoney.mvp.presenters.DrawcashPresenter
import com.mints.goodmoney.mvp.views.DrawcashView
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.adapter.DrawcashAdapter
import com.mints.goodmoney.utils.SpanUtils
import com.mints.library.utils.json.JsonUtil
import kotlinx.android.synthetic.main.activity_drawcash.*
import kotlinx.android.synthetic.main.header_activity.*
import net.grandcentrix.tray.AppPreferences
import java.util.*
/**
* 描述:提现
* 作者:孟崔广
* 时间:2020/10/12 14:37
*/
class DrawcashActivity : BaseActivity(),
DrawcashView, View.OnClickListener, DrawcashAdapter.OnItemClickListener, OnLoginListener {
private val drawcashPresenter by lazy { DrawcashPresenter() }
private val ps by lazy { AppPreferences(context) }
private val userManager by lazy { UserManager.getInstance() }
private val loginApi by lazy { LoginApi() }
private lateinit var drawcashAdapter: DrawcashAdapter
private var wxInfo: WXInfo? = null
private var userConfig: DrawcashBean? = null
private var isLoadRvItem: Boolean = true//是否首次加载rv item
override fun getContentViewLayoutID() = R.layout.activity_drawcash
override fun isApplyKitKatTranslucency() = false
override fun initViewsAndEvents() {
tv_activity_title.text = "提现"
drawcashPresenter.attachView(this)
initText()
initRvView()
initListener()
}
private fun initText() {
tvDrawcashExplain.setText(
SpanUtils()
.append("提现说明:")
.append("\n")
.append("1、所有提现金额【无门槛】直接提现!新用户提现秒到账!")
.append("\n")
.append("2、由于提现需要实名制,非实名用户账号无法支持提现,请务必使用实名认证过的账号提现!")
.append("\n")
.append("3、单笔提现金额最低" + 0.3 + "元,最高" + 1000 + "元。")
.append("\n")
.append("4、提现申请将在3-5个工作日审核到账,请耐心等待。")
.append("\n")
.append("5、每日可申请提现一次,若当日限额已满,请次日申请。")
.append("\n")
.append("6、" + 0.3 + "元-" + 50 + "元,是新人专享福利,每个账号仅可享受一次。")
.create())
tvDrawcashHint.text = "* 如您或好友通过刷机等违规操作获取非法收益,平台将视情况扣除违规所得或冻结账号。" +
"\n* 最终解释权归本公司所有。"
}
override fun onResume() {
super.onResume()
drawcashPresenter.getUserTaskMsg()
}
override fun onDestroy() {
super.onDestroy()
loginApi.setOnLoginListener(null)
drawcashPresenter.detachView()
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.tv_activity_back -> finish()
R.id.tvDrawcashWx -> {
val wechat = ShareSDK.getPlatform(Wechat.NAME)
if (!wechat.isClientValid) {
showToast("请先安装微信")
return
}
loginApi.setOnLoginListener(this)
loginApi.setPlatform(Wechat.NAME)
loginApi.login(this)
}
R.id.tvDrawcashNext -> {
// 校验当前金币< 选择金币 =提示 去做任务
// if(userConfig?.coin<)
// 是否登录
if (!userManager.userIsLogin()) {
readyGo(LoginActivity::class.java)
return
}
// 授权判断
if (TextUtils.isEmpty(userConfig?.openid)) {
showToast("微信未授权")
return
}
drawcashPresenter.saveTerminalInfo(ps, 0.0)
}
}
}
override fun getUserTaskMsgSuc(data: DrawcashBean) {
userConfig = data
tvDrawcashGold.text = "${data.getCoin()}"
if (TextUtils.isEmpty(data.openid)) {
tvDrawcashWx.setText("去授权")
} else {
tvDrawcashWx.setText("已授权")
}
if (isLoadRvItem) {
initRvView()
}
}
override fun editUserMsgSuc() {
showToast("微信授权成功")
drawcashPresenter.getUserTaskMsg()
}
override fun onLogin(platform: String?, res: HashMap<String, Any>): Boolean {
try {
wxInfo = WXInfo()
wxInfo?.let {
it.setUnionid(res["unionid"].toString() + "")
it.setOpenid(res["openid"].toString() + "")
it.setProvince(res["province"].toString() + "")
it.setCity(res["city"].toString() + "")
it.setCountry(res["country"].toString() + "")
it.setHeadimgurl(res["headimgurl"].toString() + "")
it.setNickname(res["nickname"].toString() + "")
it.setSex((res["sex"].toString() + "").toInt())
}
if (!isFinishing) {
drawcashPresenter.editUserMsg(JsonUtil.toJson(wxInfo))
}
} catch (e: Exception) {
e.printStackTrace()
}
return false
}
private fun initRvView() {
val gridLayoutManager = GridLayoutManager(this, 3)
rvCash.layoutManager = gridLayoutManager
// vipAdapter = vipList?.let { VipAdapter(it) }!!
drawcashAdapter = DrawcashAdapter(null)
rvCash.adapter = drawcashAdapter
drawcashAdapter.setOnItemClickListener(this)
isLoadRvItem = false
}
private fun initListener() {
tv_activity_back.setOnClickListener(this)
tvDrawcashWx.setOnClickListener(this)
tvDrawcashNext.setOnClickListener(this)
}
override fun onItemClick(position: Int) {
drawcashAdapter.setPosition(position)
drawcashAdapter.notifyDataSetChanged()
}
}
\ No newline at end of file
package com.mints.goodmoney.ui.activitys
import android.animation.AnimatorSet
import android.animation.ObjectAnimator
import android.view.View
import android.widget.ImageView
import androidx.viewpager.widget.ViewPager.OnPageChangeListener
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.adapter.ViewPagerAdapter
import kotlinx.android.synthetic.main.activity_guide.*
import net.grandcentrix.tray.AppPreferences
import java.util.*
class GuideActivity : BaseActivity() {
private val animatorSet by lazy { AnimatorSet() }
private var mImageViews = ArrayList<ImageView>()
private val guideImgs = intArrayOf(R.mipmap.bg_guide1, R.mipmap.bg_guide2, R.mipmap.bg_guide3, R.mipmap.bg_guide4)
override fun getContentViewLayoutID() = R.layout.activity_guide
override fun isApplyKitKatTranslucency() = false
override fun initViewsAndEvents() {
initView()
btn_guide_start.setOnClickListener {
readyGoMain()
}
}
override fun onDestroy() {
super.onDestroy()
animatorSet.cancel()
vp_guide_viewpager.setOnPageChangeListener(null)
}
private fun readyGoMain() {
val instance = AppPreferences(MintsApplication.getContext())
val customVersion: Int = instance.getInt(Constant.CUSTOM_VERSION, 0)
instance.put(Constant.ISFIRSTENTER + customVersion, false)
readyGoThenKill(MainActivity::class.java)
}
private fun initView() {
mImageViews.clear()
for (i in guideImgs.indices) {
val imageView = ImageView(this)
imageView.setBackgroundResource(guideImgs[i])
//把imageView添加到集合中
mImageViews.add(imageView)
}
val viewPagerAdapter = ViewPagerAdapter(mImageViews)
vp_guide_viewpager.setAdapter(viewPagerAdapter)
vp_guide_viewpager.setOnPageChangeListener(mOnPagerChangeListener)
}
/**
* viewpager界面切换监听
*/
private val mOnPagerChangeListener: OnPageChangeListener = object : OnPageChangeListener {
//当界面切换完成的时候调用的方法
override fun onPageSelected(position: Int) {
pageIndicatorView.setSelection(position)
if (position == mImageViews.size - 1) {
val alphaAnimator = ObjectAnimator.ofFloat(btn_guide_start, "alpha", 0f, 1f)
alphaAnimator.repeatCount = 0
animatorSet.play(alphaAnimator)
animatorSet.duration = 1500
animatorSet.start()
btn_guide_start.setVisibility(View.VISIBLE)
} else {
btn_guide_start.setVisibility(View.INVISIBLE)
}
}
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {}
override fun onPageScrollStateChanged(arg0: Int) {}
}
}
\ No newline at end of file
package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.view.View
import com.cmcm.cmgame.*
import com.google.gson.JsonParser
import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.mvp.presenters.GamePresenter
import com.mints.goodmoney.mvp.views.GameView
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.utils.SpanUtils
import com.mints.library.utils.json.JsonUtil
import kotlinx.android.synthetic.main.activity_liebao_game.*
import kotlinx.android.synthetic.main.header_activity.*
import java.util.*
/**
* 描述:猎豹游戏
* 作者:孟崔广
* 时间:2020/10/12 10:09
*/
class LiebaoGameActivity : BaseActivity()
, View.OnClickListener, GameView,
IAppCallback,
IGamePlayTimeCallback,
IGameAdCallback,
IGameExitInfoCallback {
val AIP_GAME_URL = "api/game/add" //退出游戏、游戏关卡回调
val STASTICIS_GAME_URL = "stasticis/game/add" //点击游戏
private val gamePresenter by lazy { GamePresenter() }
private var gameName = ""
private var gameID = ""
override fun getContentViewLayoutID() = R.layout.activity_liebao_game
override fun isApplyKitKatTranslucency() = false
override fun initViewsAndEvents() {
tv_activity_title.text = "游戏推荐"
tvGameHint.setText(SpanUtils()
.append("试玩小游戏").setForegroundColor(resources.getColor(R.color.black_text))
.append("15秒以上可获取金币").setForegroundColor(resources.getColor(R.color.red))
.append(",玩越久赚越多").setForegroundColor(resources.getColor(R.color.black_text))
.create())
gamePresenter.attachView(this)
initListener()
}
override fun onDestroy() {
super.onDestroy()
CmGameSdk.removeGameClickCallback()
CmGameSdk.setMoveView(null)
CmGameSdk.removeGamePlayTimeCallback()
CmGameSdk.removeGameAdCallback()
CmGameSdk.removeGameExitInfoCallback()
gamePresenter.detachView()
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.tv_activity_back -> finish()
}
}
private fun initListener() {
tv_activity_back.setOnClickListener(this)
gvGameLiebao.inflate(this)
// 默认游戏中心页面,点击游戏试,触发回调
CmGameSdk.setGameClickCallback(this)
// 点击游戏右上角或物理返回键,退出游戏时触发回调,并返回游戏时长
CmGameSdk.setGamePlayTimeCallback(this)
// 所有广告类型的展示和点击事件回调,仅供参考,数据以广告后台为准
CmGameSdk.setGameAdCallback(this)
// 返回游戏数据(json格式),如:每玩一关,返回关卡数,分数,如钓钓乐,返回水深,绳子长度,不同游戏不一样
// 该功能使用场景:媒体利用游戏数据,和app的功能结合做运营活动,比如:某每天前50名,得到某些奖励
CmGameSdk.setGameExitInfoCallback(this)
}
override fun gameAddSuc(eventType: String?, data: Any?) {
when (eventType) {
Constant.EVENT_TYPE_TIME -> if (data != null) {
val json = JsonUtil.toJson(data)
val jsonObject = JsonParser().parse(json).asJsonObject
val gameCoin = jsonObject["gameCoin"].asInt
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, gameCoin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_GAME)
readyGo(AwardActivity::class.java, bundle)
}
Constant.EVENT_TYPE_GAMEINFO -> {
}
Constant.EVENT_TYPE_CLICK -> {
}
}
}
/**
* 默认游戏中心页面,点击游戏试,触发回调 finish
*
* @param gameName
* @param gameID
*/
override fun gameClickCallback(gameName: String, gameID: String) {
this.gameName = gameName
this.gameID = gameID
val eventTypeClick: String = Constant.EVENT_TYPE_CLICK
val vo = HashMap<String, Any>()
vo["gameName"] = gameID
vo["gameId"] = gameID
vo["gameSource"] = "liebao"
vo["carrierType"] = Constant.CARRIER_GAME
vo["eventType"] = eventTypeClick
vo["num"] = 1
vo["pkg"] = Constant.MINTS_PKG_NAME
gamePresenter.gameAdd(STASTICIS_GAME_URL, eventTypeClick, vo)
}
/**
* @param playTimeInSeconds 玩游戏时长,单位为秒 finish
*
*
* 点击游戏右上角或物理返回键,退出游戏时触发回调,并返回游戏时长
*/
override fun gamePlayTimeCallback(gameId: String?, playTimeInSeconds: Int) {
val eventTypeTime: String = Constant.EVENT_TYPE_TIME
if (playTimeInSeconds < 15) {
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, 0)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_GAME)
readyGo(AwardActivity::class.java, bundle)
} else {
val vo = HashMap<String, Any>()
vo["gameName"] = gameID
vo["gameId"] = gameID
vo["gameSource"] = "liebao"
vo["carrierType"] = Constant.CARRIER_GAME
vo["eventType"] = eventTypeTime
vo["playtimeinseconds"] = playTimeInSeconds
vo["pkg"] = Constant.MINTS_PKG_NAME
gamePresenter.gameAdd(AIP_GAME_URL, eventTypeTime, vo)
}
}
/**
* 广告曝光/点击回调 finish
*
* @param gameId 游戏Id
* @param adType 广告类型:1:激励视频广告;2:Banner广告;3:原生Banner广告;4:全屏视频广告;
* 5:原生插屏广告;6:开屏大卡广告;7:模板Banner广告;8:模板插屏广告;9:游戏列表信息流广告
* 10:游戏列表模板插屏广告;11:游戏加载模板插屏广告;12:游戏列表信息流模板渲染广告;
* 13:游戏退出推荐弹框信息流自渲染广告;14:游戏退出推荐弹框信息流模板渲染广告
* @param adAction 广告操作:1:曝光;2:点击;3:关闭;4:跳过
* @param adChannel 广告源:穿山甲,优量汇
*/
override fun onGameAdAction(gameId: String?, adType: Int, adAction: Int, adChannel: String) {
if (adAction != 1) {
val vo = HashMap<String, Any>()
vo["gameName"] = gameName
vo["gameId"] = gameID
vo["gameSource"] = "liebao"
vo["carrierType"] = Constant.CARRIER_GAME
var eventTypeView = "VIEW"
when (adAction) {
1 -> eventTypeView = "VIEW"
2 -> eventTypeView = "CLICK"
3 -> eventTypeView = "CLOSE"
4 -> eventTypeView = "JUMP"
}
vo["adType"] = adType
vo["adsource"] = adChannel
vo["eventType"] = eventTypeView
vo["pkg"] = Constant.MINTS_PKG_NAME
gamePresenter.gameAdd(STASTICIS_GAME_URL, Constant.EVENT_TYPE_ADCLICK, vo)
}
}
/**
* 返回游戏数据(json格式),如:每玩一关,返回关卡数,分数,如钓钓乐,返回水深,绳子长度,不同游戏不一样 finish
* 该功能使用场景:媒体利用游戏数据,和app的功能结合做运营活动,比如:某每天前50名,得到某些奖励
*/
override fun gameExitInfoCallback(gameExitInfo: String) {
val vo = HashMap<String, Any>()
vo["gameName"] = gameName
vo["gameId"] = gameID
vo["carrierType"] = Constant.CARRIER_GAME
vo["gameExitInfo"] = gameExitInfo
vo["pkg"] = Constant.MINTS_PKG_NAME
gamePresenter.gameAdd(AIP_GAME_URL, Constant.EVENT_TYPE_GAMEINFO, vo)
}
}
......@@ -3,18 +3,25 @@ package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.text.TextUtils
import android.view.View
import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat
import com.mints.goodmoney.BuildConfig
import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.login.LoginApi
import com.mints.goodmoney.login.OnLoginListener
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.WXInfo
import com.mints.goodmoney.mvp.presenters.LoginPresenter
import com.mints.goodmoney.mvp.views.LoginView
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.utils.BackInputUtil
import com.mints.goodmoney.utils.LogUtil
import com.mints.library.utils.json.JsonUtil
import com.mints.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.activity_login.*
import net.grandcentrix.tray.AppPreferences
import java.util.HashMap
/**
* 描述:登录
......@@ -22,12 +29,14 @@ import net.grandcentrix.tray.AppPreferences
* 时间:2020/9/22 13:55
*/
class LoginActivity : BaseActivity()
, LoginView, View.OnClickListener {
, LoginView, View.OnClickListener, OnLoginListener {
private val loginPresenter by lazy { LoginPresenter() }
private val ps by lazy { AppPreferences(this) }
private val loginApi by lazy { LoginApi() }
private var mobile: String? = null
private var wxInfo: WXInfo? = null
override fun initViewsAndEvents() {
loginPresenter.attachView(this)
......@@ -46,7 +55,7 @@ class LoginActivity : BaseActivity()
override fun onDestroy() {
super.onDestroy()
loginApi.setOnLoginListener(null)
loginPresenter.detachView()
}
......@@ -90,6 +99,17 @@ class LoginActivity : BaseActivity()
loginPresenter.login(mobile, code, ps)
}
R.id.tvLoginWx -> {
val wechat = ShareSDK.getPlatform(Wechat.NAME)
if (!wechat.isClientValid) {
showToast("请先安装微信")
return
}
loginApi.setOnLoginListener(this)
loginApi.setPlatform(Wechat.NAME)
loginApi.login(this)
}
R.id.tvLoginAgreement -> {
val bundle = Bundle()
bundle.putString(WebActivity.WEB_TITLE, getString(R.string.register_name))
......@@ -102,12 +122,6 @@ class LoginActivity : BaseActivity()
bundle.putString(WebActivity.WEB_URL, Constant.PRIVACY_URL)
readyGo(WebActivity::class.java, bundle)
}
R.id.tvLoginVip -> {
val bundle = Bundle()
bundle.putString(WebActivity.WEB_TITLE, getString(R.string.members_name))
bundle.putString(WebActivity.WEB_URL, Constant.MEMBERS_URL)
readyGo(WebActivity::class.java, bundle)
}
}
}
......@@ -119,6 +133,29 @@ class LoginActivity : BaseActivity()
finish()
}
override fun onLogin(platform: String?, res: HashMap<String, Any>): Boolean {
try {
wxInfo = WXInfo()
wxInfo?.let {
it.setUnionid(res["unionid"].toString() + "")
it.setOpenid(res["openid"].toString() + "")
it.setProvince(res["province"].toString() + "")
it.setCity(res["city"].toString() + "")
it.setCountry(res["country"].toString() + "")
it.setHeadimgurl(res["headimgurl"].toString() + "")
it.setNickname(res["nickname"].toString() + "")
it.setSex((res["sex"].toString() + "").toInt())
}
if (!isFinishing) {
loginPresenter.login(ps,JsonUtil.toJson(wxInfo))
}
} catch (e: Exception) {
e.printStackTrace()
}
return false
}
private fun initView() {
BackInputUtil.phoneNumAddSpace(etLoginMobile)
mobile = UserManager.getInstance().getMobile()
......@@ -134,7 +171,7 @@ class LoginActivity : BaseActivity()
tvLoginNext.setOnClickListener(this)
tvLoginAgreement.setOnClickListener(this)
tvLoginPolicy.setOnClickListener(this)
tvLoginVip.setOnClickListener(this)
tvLoginWx.setOnClickListener(this)
}
var num = 0
......
......@@ -31,9 +31,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
private var myFragment: Fragment? = null
private var currentFragment: Fragment? = null
override fun getContentViewLayoutID(): Int {
return R.layout.activity_main
}
override fun getContentViewLayoutID() = R.layout.activity_main
override fun initViewsAndEvents() {
if (mainFragment == null) {
......@@ -56,9 +54,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
tab_rl_my.setOnClickListener(this)
}
override fun isApplyKitKatTranslucency(): Boolean {
return false
}
override fun isApplyKitKatTranslucency() = false
public override fun onDestroy() {
super.onDestroy()
......@@ -90,7 +86,13 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
when (view.id) {
R.id.tab_rl_main -> clickTab1Layout()
R.id.tab_rl_pan -> clickTab2Layout()
R.id.tab_rl_friends -> clickTab3Layout()
R.id.tab_rl_friends -> {
clickTab3Layout()
// readyGo(WalkActivity::class.java)
// readyGo(WaterActivity::class.java)
// readyGo(LoginActivity::class.java)
// readyGo(DrawcashActivity::class.java)
}
R.id.tab_rl_my -> clickTab4Layout()
}
}
......
......@@ -121,8 +121,8 @@ class SettingsActivity : BaseActivity(), View.OnClickListener {
}
R.id.item_userAgree -> {
val bundle = Bundle()
bundle.putString(WebActivity.WEB_TITLE, getString(R.string.members_name))
bundle.putString(WebActivity.WEB_URL, Constant.MEMBERS_URL)
bundle.putString(WebActivity.WEB_TITLE, getString(R.string.register_name))
bundle.putString(WebActivity.WEB_URL, Constant.REGISTER_URL)
readyGo(WebActivity::class.java, bundle)
}
R.id.item_privacyAgree -> {
......
......@@ -5,9 +5,11 @@ import android.view.animation.AlphaAnimation
import android.view.animation.Animation
import android.view.animation.AnimationSet
import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.common.DeviceInfo
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import kotlinx.android.synthetic.main.activity_splash.*
import net.grandcentrix.tray.AppPreferences
/**
* 启动页
......@@ -16,6 +18,7 @@ class SplashActivity : BaseActivity() {
private val mAlph by lazy { AlphaAnimation(1f, 1f) }
private val animationSet by lazy { AnimationSet(true) }
private val ps by lazy { AppPreferences(context) }
override fun isApplyKitKatTranslucency()=false
......@@ -86,8 +89,17 @@ class SplashActivity : BaseActivity() {
override fun onAnimationStart(animation: Animation) {}
override fun onAnimationRepeat(animation: Animation) {}
override fun onAnimationEnd(animation: Animation) {
readyGoThenKill(MainActivity::class.java)
readyGoOtherActivity()
}
}
private fun readyGoOtherActivity() {
val customVersion: Int = ps.getInt(Constant.CUSTOM_VERSION, 0)
val isFirstEnter: Boolean = ps.getBoolean(Constant.ISFIRSTENTER + customVersion, true)
if (isFirstEnter) {
readyGoThenKill(GuideActivity::class.java)
} else {
readyGoThenKill(MainActivity::class.java)
}
}
}
\ No newline at end of file
package com.mints.goodmoney.ui.activitys
import android.view.View
import com.mints.goodmoney.R
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.widgets.WaterView
import kotlinx.android.synthetic.main.activity_walk.*
import kotlinx.android.synthetic.main.activity_water.*
/**
* 描述:走路赚钱
* 作者:孟崔广
* 时间:2020/10/13 11:55
*/
class WalkActivity : BaseActivity(), View.OnClickListener{
override fun getContentViewLayoutID() = R.layout.activity_walk
override fun isApplyKitKatTranslucency() = false
override fun initViewsAndEvents() {
initListener()
}
private fun initListener() {
ivWalkBack.setOnClickListener(this)
}
override fun onClick(v: View) {
when (v.id) {
R.id.ivWalkBack -> {
finish()
}
}
}
}
\ No newline at end of file
package com.mints.goodmoney.ui.activitys
import android.view.View
import com.mints.goodmoney.R
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.widgets.WaterView
import kotlinx.android.synthetic.main.activity_water.*
/**
* 描述:喝水赚钱
* 作者:孟崔广
* 时间:2020/10/13 11:55
*/
class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewListener {
override fun getContentViewLayoutID() = R.layout.activity_water
override fun isApplyKitKatTranslucency() = false
override fun initViewsAndEvents() {
initListener()
}
private fun initListener() {
ivWaterBack.setOnClickListener(this)
// 喝水监听
wvWater.setWaterViewListener(this)
}
override fun onClick(v: View) {
when (v.id) {
R.id.ivWaterBack -> {
finish()
}
}
}
override fun clickWater(water: Int, waterCoin: String) {
}
}
\ No newline at end of file
package com.mints.goodmoney.ui.adapter
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.mints.goodmoney.R
class DrawcashAdapter(val drawcashList: MutableList<String>?) :
RecyclerView.Adapter<DrawcashAdapter.ViewHolder>() {
var myPos: Int = 0
lateinit var context: Context
lateinit var mOnItemClickListener: OnItemClickListener
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val llDrawItem: LinearLayout = view.findViewById(R.id.llDrawItem)
val tvDrawItemCash: TextView = view.findViewById(R.id.tvDrawItemCash)
val tvDrawItemGold: TextView = view.findViewById(R.id.tvDrawItemGold)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
context = parent.context
val view = LayoutInflater.from(context).inflate(R.layout.item_rv_drawcash, parent, false)
val viewHolder = ViewHolder(view)
return viewHolder
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
// val drawcashBean = drawcashList[position]
holder.llDrawItem.setOnClickListener {
mOnItemClickListener?.onItemClick(position)
notifyDataSetChanged()
}
if (getPosition() == position) {
//当前选中
holder.tvDrawItemCash.setTextColor(ContextCompat.getColor(context, R.color.white))
holder.tvDrawItemGold.setTextColor(ContextCompat.getColor(context, R.color.white))
holder.llDrawItem.setBackgroundResource(R.drawable.shape_vip_adapter_none)
} else {
holder.tvDrawItemCash.setTextColor(ContextCompat.getColor(context, R.color.black))
holder.tvDrawItemGold.setTextColor(ContextCompat.getColor(context, R.color.gray))
holder.llDrawItem.setBackgroundResource(R.drawable.shape_vip_adapter)
}
holder.itemView.setTag(position)
}
// override fun getItemCount() = drawcashList!!.size
override fun getItemCount() = 15
interface OnItemClickListener {
fun onItemClick(position: Int)
}
fun setOnItemClickListener(listener: OnItemClickListener) {
mOnItemClickListener = listener
}
fun getPosition() = myPos
fun setPosition(myPos: Int) {
this.myPos = myPos
}
}
\ No newline at end of file
......@@ -7,6 +7,7 @@ import androidx.recyclerview.widget.DividerItemDecoration
import com.mints.goodmoney.R
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.ShumeiManager
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.BannerBean
import com.mints.goodmoney.ui.adapter.BannerAdapter
......@@ -17,6 +18,7 @@ import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.goodmoney.ui.widgets.tablayout.TabLayout
import kotlinx.android.synthetic.main.fragment_main_friends.*
import kotlinx.android.synthetic.main.header_layout.*
import com.mints.goodmoney.utils.LogUtil
/**
* 描述:邀请好友
......
......@@ -31,7 +31,7 @@ import net.grandcentrix.tray.AppPreferences
* 作者:孟崔广
* 时间:2020/10/10 17:30
*/
class MainFragment : BaseFragment(), HomeView, AdVideoCallback {
class MainFragment : BaseFragment(), HomeView, AdVideoCallback, View.OnClickListener {
private val TAG = MainFragment::class.java.simpleName
......@@ -42,6 +42,7 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback {
// 视频相关
private var littleVideoFragment: LittleVideoFragment? = null
private val VEDIO_MAX_COUNT = 12 // 当前缓存视频id最大数
private val vedioIdList by lazy { ArrayList<String>() }//记录播放的视频id
private var isFirstLoadVedio = true // 首次加载视频初始化
private var isClickStop = false // 是否点击一览视频暂停
......@@ -53,11 +54,15 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback {
homePresenter.attachView(this)
// 首次显示权限弹窗
if (ps.getBoolean(Constant.LOAN_PERMISSION_FLAG, true)) {
powerDialog()
}
showPowerDialog()
// 初始化视频
showLittle()
initListener()
}
private fun initListener() {
ivMainBox.setOnClickListener(this)
}
override fun onHiddenChanged(hidden: Boolean) {
......@@ -98,9 +103,19 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback {
override fun onDestroy() {
super.onDestroy()
cdvvYilanTime?.setCountDownVedioListener(null)
littleVideoFragment?.setUserCallBack(null)
homePresenter.detachView()
}
override fun onClick(v: View) {
when (v?.id) {
R.id.ivMainBox -> showToast("ivMainBox")
}
}
override fun onVideoAdPaused(entity: AdEntity?) {
LogUtil.d(TAG, "override onVideoAdPaused")
......@@ -133,6 +148,12 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback {
LogUtil.d(TAG, "override onVideoLoad")
}
private fun showPowerDialog() {
if (ps.getBoolean(Constant.LOAN_PERMISSION_FLAG, true)) {
powerDialog()
}
}
/**
* 一览视频初始化
*/
......@@ -197,10 +218,9 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback {
LogUtil.d(TAG, "addVedioIdList:" + id)
LogUtil.d(TAG, "addVedioId ListItem pre:" + JsonUtil.toJson(vedioIdList))
// 达到12个视频时 删除前10个记录
if (vedioIdList.size >= 12) {
for (i in 0..vedioIdList.size - 3) {
vedioIdList.removeAt(i)
}
if (vedioIdList.size >= VEDIO_MAX_COUNT) {
vedioIdList.subList(0, 10).clear()
LogUtil.d(TAG, "addVedioId ListItem removeAt:" + JsonUtil.toJson(vedioIdList))
}
if (!vedioIdList.contains(id)) vedioIdList.add(id)
LogUtil.d(TAG, "addVedioId ListItem next:" + JsonUtil.toJson(vedioIdList))
......@@ -218,15 +238,18 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback {
*用户主动暂时或网络异常结束后 重新加载倒计时红包
*/
private fun startDownloadTime(id: String) {
LogUtil.d(TAG, "startDownloadTime:" + id)
if (vedioIdList.contains(id)) {
cdvvYilanTime?.pause()
return
}
if (!TextUtils.isEmpty(id)) {
LogUtil.d(TAG, "startDownloadTime cur id:" + id)
LogUtil.d(TAG, "startDownloadTime ListItem:" + JsonUtil.toJson(vedioIdList))
if (vedioIdList.contains(id)) {
cdvvYilanTime?.pause()
return
}
if (isClickStop) {
isClickStop = false
cdvvYilanTime?.resume()
if (isClickStop) {
isClickStop = false
cdvvYilanTime?.resume()
}
}
}
......@@ -253,14 +276,14 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback {
when (v.id) {
R.id.tv_dialogper_agreement -> {
val bundle = Bundle()
bundle.putString(WebActivity.WEB_TITLE, "用户协议")
bundle.putString(WebActivity.WEB_URL, BuildConfig.MainIp + "register.html")
bundle.putString(WebActivity.WEB_TITLE, getString(R.string.register_name))
bundle.putString(WebActivity.WEB_URL, Constant.REGISTER_URL)
readyGo(WebActivity::class.java, bundle)
}
R.id.tv_dialogper_policy -> {
val bundle = Bundle()
bundle.putString(WebActivity.WEB_TITLE, "用户协议")
bundle.putString(WebActivity.WEB_URL, BuildConfig.MainIp + "register.html")
bundle.putString(WebActivity.WEB_TITLE, getString(R.string.privacy_name))
bundle.putString(WebActivity.WEB_URL, Constant.PRIVACY_URL)
readyGo(WebActivity::class.java, bundle)
}
R.id.btn_dialogper_back -> {
......@@ -283,4 +306,5 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback {
})
powerDialog!!.show()
}
}
\ No newline at end of file
package com.mints.goodmoney.ui.widgets.seekbar;
import androidx.annotation.ColorInt;
import androidx.annotation.IntRange;
import static com.mints.goodmoney.ui.widgets.seekbar.BubbleUtils.dp2px;
import static com.mints.goodmoney.ui.widgets.seekbar.BubbleUtils.sp2px;
/**
* config BubbleSeekBar's attributes
* <p/>
* Created by woxingxiao on 2017-03-14.
*/
public class BubbleConfigBuilder {
float min;
float max;
float progress;
boolean floatType;
int trackSize;
int secondTrackSize;
int thumbRadius;
int thumbRadiusOnDragging;
int trackColor;
int secondTrackColor;
int thumbColor;
int sectionCount;
boolean showSectionMark;
boolean autoAdjustSectionMark;
boolean showSectionText;
int sectionTextSize;
int sectionTextColor;
@BubbleSeekBar.TextPosition
int sectionTextPosition;
int sectionTextInterval;
boolean showThumbText;
int thumbTextSize;
int thumbTextColor;
boolean showProgressInFloat;
boolean touchToSeek;
boolean seekBySection;
int bubbleColor;
int bubbleTextSize;
int bubbleTextColor;
boolean alwaysShowBubble;
private BubbleSeekBar mBubbleSeekBar;
BubbleConfigBuilder(BubbleSeekBar bubbleSeekBar) {
mBubbleSeekBar = bubbleSeekBar;
}
public void build() {
mBubbleSeekBar.config(this);
}
public BubbleConfigBuilder min(float min) {
this.min = min;
this.progress = min;
return this;
}
public BubbleConfigBuilder max(float max) {
this.max = max;
return this;
}
public BubbleConfigBuilder progress(float progress) {
this.progress = progress;
return this;
}
public BubbleConfigBuilder floatType() {
this.floatType = true;
return this;
}
public BubbleConfigBuilder trackSize(int dp) {
this.trackSize = dp2px(dp);
return this;
}
public BubbleConfigBuilder secondTrackSize(int dp) {
this.secondTrackSize = dp2px(dp);
return this;
}
public BubbleConfigBuilder thumbRadius(int dp) {
this.thumbRadius = dp2px(dp);
return this;
}
public BubbleConfigBuilder thumbRadiusOnDragging(int dp) {
this.thumbRadiusOnDragging = dp2px(dp);
return this;
}
public BubbleConfigBuilder trackColor(@ColorInt int color) {
this.trackColor = color;
this.sectionTextColor = color;
return this;
}
public BubbleConfigBuilder secondTrackColor(@ColorInt int color) {
this.secondTrackColor = color;
this.thumbColor = color;
this.thumbTextColor = color;
this.bubbleColor = color;
return this;
}
public BubbleConfigBuilder thumbColor(@ColorInt int color) {
this.thumbColor = color;
return this;
}
public BubbleConfigBuilder sectionCount(@IntRange(from = 1) int count) {
this.sectionCount = count;
return this;
}
public BubbleConfigBuilder showSectionMark() {
this.showSectionMark = true;
return this;
}
public BubbleConfigBuilder autoAdjustSectionMark() {
this.autoAdjustSectionMark = true;
return this;
}
public BubbleConfigBuilder showSectionText() {
this.showSectionText = true;
return this;
}
public BubbleConfigBuilder sectionTextSize(int sp) {
this.sectionTextSize = sp2px(sp);
return this;
}
public BubbleConfigBuilder sectionTextColor(@ColorInt int color) {
this.sectionTextColor = color;
return this;
}
public BubbleConfigBuilder sectionTextPosition(@BubbleSeekBar.TextPosition int position) {
this.sectionTextPosition = position;
return this;
}
public BubbleConfigBuilder sectionTextInterval(@IntRange(from = 1) int interval) {
this.sectionTextInterval = interval;
return this;
}
public BubbleConfigBuilder showThumbText() {
this.showThumbText = true;
return this;
}
public BubbleConfigBuilder thumbTextSize(int sp) {
this.thumbTextSize = sp2px(sp);
return this;
}
public BubbleConfigBuilder thumbTextColor(@ColorInt int color) {
thumbTextColor = color;
return this;
}
public BubbleConfigBuilder showProgressInFloat() {
this.showProgressInFloat = true;
return this;
}
public BubbleConfigBuilder touchToSeek() {
this.touchToSeek = true;
return this;
}
public BubbleConfigBuilder seekBySection() {
this.seekBySection = true;
return this;
}
public BubbleConfigBuilder bubbleColor(@ColorInt int color) {
this.bubbleColor = color;
return this;
}
public BubbleConfigBuilder bubbleTextSize(int sp) {
this.bubbleTextSize = sp2px(sp);
return this;
}
public BubbleConfigBuilder bubbleTextColor(@ColorInt int color) {
this.bubbleTextColor = color;
return this;
}
public BubbleConfigBuilder alwaysShowBubble() {
this.alwaysShowBubble = true;
return this;
}
public float getMin() {
return min;
}
public float getMax() {
return max;
}
public float getProgress() {
return progress;
}
public boolean isFloatType() {
return floatType;
}
public int getTrackSize() {
return trackSize;
}
public int getSecondTrackSize() {
return secondTrackSize;
}
public int getThumbRadius() {
return thumbRadius;
}
public int getThumbRadiusOnDragging() {
return thumbRadiusOnDragging;
}
public int getTrackColor() {
return trackColor;
}
public int getSecondTrackColor() {
return secondTrackColor;
}
public int getThumbColor() {
return thumbColor;
}
public int getSectionCount() {
return sectionCount;
}
public boolean isShowSectionMark() {
return showSectionMark;
}
public boolean isAutoAdjustSectionMark() {
return autoAdjustSectionMark;
}
public boolean isShowSectionText() {
return showSectionText;
}
public int getSectionTextSize() {
return sectionTextSize;
}
public int getSectionTextColor() {
return sectionTextColor;
}
public int getSectionTextPosition() {
return sectionTextPosition;
}
public int getSectionTextInterval() {
return sectionTextInterval;
}
public boolean isShowThumbText() {
return showThumbText;
}
public int getThumbTextSize() {
return thumbTextSize;
}
public int getThumbTextColor() {
return thumbTextColor;
}
public boolean isShowProgressInFloat() {
return showProgressInFloat;
}
public boolean isTouchToSeek() {
return touchToSeek;
}
public boolean isSeekBySection() {
return seekBySection;
}
public int getBubbleColor() {
return bubbleColor;
}
public int getBubbleTextSize() {
return bubbleTextSize;
}
public int getBubbleTextColor() {
return bubbleTextColor;
}
public boolean isAlwaysShowBubble() {
return alwaysShowBubble;
}
}
package com.mints.goodmoney.ui.widgets.seekbar;
import android.content.res.Resources;
import android.os.Environment;
import android.util.TypedValue;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
class BubbleUtils {
private static final File BUILD_PROP_FILE = new File(Environment.getRootDirectory(), "build.prop");
private static Properties sBuildProperties;
private static final Object sBuildPropertiesLock = new Object();
private static Properties getBuildProperties() {
synchronized (sBuildPropertiesLock) {
if (sBuildProperties == null) {
sBuildProperties = new Properties();
try {
sBuildProperties.load(new FileInputStream(BUILD_PROP_FILE));
} catch (IOException e) {
e.printStackTrace();
}
}
}
return sBuildProperties;
}
static boolean isMIUI() {
return getBuildProperties().containsKey("ro.miui.ui.version.name");
}
static int dp2px(int dp) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp,
Resources.getSystem().getDisplayMetrics());
}
static int sp2px(int sp) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp,
Resources.getSystem().getDisplayMetrics());
}
}
\ No newline at end of file
......@@ -3,6 +3,6 @@
<!-- Non focused states -->
<item android:color="@color/main_mints" android:state_selected="true" />
<item android:color="@color/grayc" android:state_selected="false" />
<item android:color="@color/color_999" android:state_selected="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充的颜色 -->
<solid android:color="@color/white" />
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners android:radius="40dip" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充的颜色 -->
<solid android:color="@color/color_F5F" />
<!-- 设置按钮的四个角为弧形 -->
<corners android:radius="5dip" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充的颜色 -->
<solid android:color="@color/main_mints" />
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners android:radius="5dip" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充的颜色 -->
<solid android:color="@color/water_color" />
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners android:radius="40dip" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充的颜色 -->
<solid android:color="#FFFFFF" />
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners android:radius="50dip" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/ic_friends_enable" android:state_selected="true" />
<item android:drawable="@mipmap/ic_friends_none" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/icon_home_hl" android:state_selected="true" />
<item android:drawable="@mipmap/icon_home_hl_nor" />
<item android:drawable="@mipmap/ic_main_enable" android:state_selected="true" />
<item android:drawable="@mipmap/ic_main_none" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/icon_my_hl" android:state_selected="true" />
<item android:drawable="@mipmap/icon_my_hl_nor" />
<item android:drawable="@mipmap/ic_my_enable" android:state_selected="true" />
<item android:drawable="@mipmap/ic_my_none" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/icon_pan_hl" android:state_selected="true" />
<item android:drawable="@mipmap/icon_pan_hl_nor" />
<item android:drawable="@mipmap/ic_pan_enable" android:state_selected="true" />
<item android:drawable="@mipmap/ic_pan_none" />
</selector>
\ No newline at end of file
......@@ -77,8 +77,7 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-1pt">
android:layout_height="wrap_content">
<TextView
android:id="@+id/tvAwardBack"
......@@ -93,8 +92,8 @@
<ImageView
android:id="@+id/ivAwardBack"
android:layout_width="50pt"
android:layout_height="50pt"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_centerHorizontal="true"
android:src="@mipmap/ic_drink_cancel"
android:visibility="gone" />
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<include layout="@layout/header_activity" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:drawableLeft="@mipmap/ic_draw_gold"
android:drawablePadding="4dp"
android:gravity="center_vertical"
android:text="我的金币"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tvDrawcashGold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="center_vertical"
android:text="0"
android:textColor="@color/main_mints"
android:textSize="22sp"
android:textStyle="bold" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="@color/gray" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@mipmap/ic_draw_wx"
android:drawablePadding="4dp"
android:gravity="center_vertical"
android:text="微信昵称" />
<TextView
android:id="@+id/tvDrawcashWx"
android:layout_width="80dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:background="@drawable/shape_login_code"
android:gravity="center"
android:text="去授权"
android:textColor="@color/main_mints"
android:textSize="14sp" />
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvCash"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@null"
android:overScrollMode="never" />
<View
android:layout_width="match_parent"
android:layout_height="10dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:background="@color/color_F8F" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="15dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<View
android:layout_width="4dp"
android:layout_height="12dp"
android:background="@drawable/shape_main" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:text="提现规则"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="#E1E1E1" />
<TextView
android:id="@+id/tvDrawcashExplain"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:layout_marginRight="20dp"
android:textColor="@color/black_text"
android:textSize="14sp" />
<TextView
android:id="@+id/tvDrawcashHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
android:textColor="@color/black_text"
android:textSize="14sp" />
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp">
<TextView
android:id="@+id/tv_drawcash_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:text="所需金币:3000"
android:textColor="@color/black_text"
android:textSize="14sp"
android:visibility="gone" />
<TextView
android:id="@+id/tvDrawcashNext"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="@drawable/shape_tv_gold"
android:gravity="center"
android:text="立即提现"
android:textColor="@color/white"
android:textSize="14sp" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:attrs="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<!-- Viewpager -->
......@@ -11,15 +13,34 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageView
android:id="@+id/btn_guide_start"
<com.rd.PageIndicatorView
android:id="@+id/pageIndicatorView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="30dp"
android:scaleType="fitXY"
android:src="@mipmap/bg_guide_btn"
android:layout_marginBottom="10dp"
app:piv_animationType="worm"
app:piv_dynamicCount="true"
app:piv_interactiveAnimation="true"
app:piv_selectedColor="@color/main_mints"
app:piv_unselectedColor="@color/ban_transparent"
app:piv_viewPager="@id/vp_guide_viewpager"
attrs:piv_padding="12dp"
attrs:piv_radius="8dp" />
<TextView
android:id="@+id/btn_guide_start"
android:layout_width="230dp"
android:layout_height="45dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="40dp"
android:background="@drawable/shape_main"
android:gravity="center"
android:text="立即体验"
android:textColor="@color/white"
android:textSize="18sp"
android:visibility="invisible" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<include layout="@layout/header_activity" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:fadingEdge="none"
android:orientation="vertical"
android:overScrollMode="never">
<!--接入时需要拷贝如下的布局,包括GameView外层的LinearLayout-start -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:descendantFocusability="blocksDescendants"
android:orientation="vertical">
<TextView
android:id="@+id/tvGameHint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/my_color_gray"
android:drawableLeft="@mipmap/ic_voice"
android:drawablePadding="10pt"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="5dp"
android:paddingBottom="10dp"
android:textSize="14sp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.cmcm.cmgame.GameView
android:id="@+id/gvGameLiebao"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
app:cmgame_category_title_text_color="#FF222222"
app:cmgame_category_title_text_size="15sp" />
</RelativeLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
......@@ -84,7 +84,7 @@
android:id="@+id/tab_iv_friends"
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/tab_invite_btn" />
android:src="@drawable/tab_friends_btn" />
<TextView
android:id="@+id/tab_tv_friends"
......
......@@ -10,10 +10,13 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="启动页"
android:textSize="30sp"
android:layout_marginBottom="30dp"
android:drawableTop="@mipmap/ic_launcher"
android:drawablePadding="14dp"
android:text="好赚钱—边看边玩边赚钱"
android:textColor="@color/black"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"></TextView>
app:layout_constraintRight_toRightOf="parent"></TextView>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:fadingEdge="none"
android:overScrollMode="never">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="330dp"
android:background="@mipmap/bg_main_top">
<ImageView
android:id="@+id/ivWalkBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:padding="15dp"
android:src="@drawable/yl_mp_ic_back_left"></ImageView>
<com.mints.goodmoney.ui.widgets.StepView
android:id="@+id/svWalk"
android:layout_width="375dp"
android:layout_height="230dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="75dp" />
</FrameLayout>
</LinearLayout>
</ScrollView>
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:fadingEdge="none"
android:overScrollMode="never">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="330dp"
android:background="@mipmap/bg_main_top">
<ImageView
android:id="@+id/ivWaterBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:padding="15dp"
android:src="@drawable/yl_mp_ic_back_left"></ImageView>
<com.mints.goodmoney.ui.widgets.WaterView
android:id="@+id/wvWater"
android:layout_width="375dp"
android:layout_height="230dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="75dp" />
</FrameLayout>
</LinearLayout>
</ScrollView>
......@@ -38,7 +38,7 @@
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:layout_marginRight="16dp"
android:text="本APP需要双方安装并加好友授权同意,APP付费方即可时刻关注对方的位置信息。我们依据最新的法律,向您说明探知软件的隐私政策,特向您推送本提示。请您阅读并充分理解相关条款。"
android:text="我们依据最新的法律,向您说明好赚钱软件的隐私政策,特向您推送本提示。请您阅读并充分理解相关条款。"
android:textColor="@color/black"
android:textSize="14sp" />
......@@ -107,7 +107,7 @@
android:layout_marginTop="16dp"
android:layout_marginRight="16dp"
android:gravity="center_horizontal"
android:text="您点击“同意”,即表示您已阅读并同意更新后的《服务协议》及《隐私政策》"
android:text="您点击“同意”,即表示您已阅读并同意更新后的《用户注册协议》及《隐私政策》"
android:textColor="@color/black"
android:textSize="14sp" />
......@@ -135,7 +135,7 @@
android:paddingTop="6dp"
android:paddingRight="2dp"
android:paddingBottom="6dp"
android:text="用户协议"
android:text="@string/register_name"
android:textColor="@color/main_mints"
android:textSize="12sp" />
......@@ -156,7 +156,7 @@
android:paddingTop="6dp"
android:paddingRight="2dp"
android:paddingBottom="6dp"
android:text="用户隐私声明"
android:text="隐私政策"
android:textColor="@color/main_mints"
android:textSize="12sp" />
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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