Commit a839dedc authored by jyx's avatar jyx

天卓下载试玩任务

parent 0f3db08e
...@@ -32,7 +32,8 @@ android { ...@@ -32,7 +32,8 @@ android {
JPUSH_CHANNEL : "goodmoney", JPUSH_CHANNEL : "goodmoney",
UMENG_KEY : RELEASE_UMENG_KEY, UMENG_KEY : RELEASE_UMENG_KEY,
SHARE_KEY : RELEASE_SHARESDK_KEY, SHARE_KEY : RELEASE_SHARESDK_KEY,
SHARE_SECRET : RELEASE_SHARESDK_SECRET] SHARE_SECRET : RELEASE_SHARESDK_SECRET,
"APPLICATION_ID": applicationId]
} }
...@@ -263,6 +264,20 @@ dependencies { ...@@ -263,6 +264,20 @@ dependencies {
// 微转阅读 // 微转阅读
implementation (name:'articlesdk-v1.0.6.202012121917-x',ext:'aar') implementation (name:'articlesdk-v1.0.6.202012121917-x',ext:'aar')
//快手SDK 2.6.5之后的版本,SDK有依赖appcompat-v7
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation(name: 'adapt-1.3.3', ext: 'aar')
implementation(name: 'commonbase-1.0.2', ext: 'aar')
implementation(name: 'discovery-2.0.17', ext: 'aar')
implementation(name: 'shanhuAD-1.3.1', ext: 'aar')
implementation(name: 'tzsdk_core-3.0.0-20200807130815-release', ext: 'aar')
//天卓SDK的珊瑚2.1组件
implementation(name: 'tzsdk_coral-2.1.0-20200807130815-release', ext: 'aar')
implementation(name: 'tzsdk_reporter-3.0.0-20200807130815-release', ext: 'aar')
// testImplementation 'junit:junit:4.13' // testImplementation 'junit:junit:4.13'
// androidTestImplementation 'androidx.test.ext:junit:1.1.2' // androidTestImplementation 'androidx.test.ext:junit:1.1.2'
......
...@@ -59,14 +59,6 @@ ...@@ -59,14 +59,6 @@
android:name="org.apache.http.legacy" android:name="org.apache.http.legacy"
android:required="false" /> android:required="false" />
<meta-data
android:name="app_key"
android:value="ff71a11162f20808f9f349452dd9e141" />
<meta-data
android:name="pack_id"
android:value="com.mints.goodmoney" />
<!-- 适配小米(xiaomi)刘海屏 --> <!-- 适配小米(xiaomi)刘海屏 -->
<meta-data <meta-data
android:name="android.max_aspect" android:name="android.max_aspect"
...@@ -217,6 +209,9 @@ ...@@ -217,6 +209,9 @@
<activity <activity
android:name=".ui.activitys.XmlyPlayActivity" android:name=".ui.activitys.XmlyPlayActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.TaskActivity"
android:screenOrientation="portrait" />
<activity <activity
android:name=".ui.activitys.KylVedioActivity" android:name=".ui.activitys.KylVedioActivity"
android:configChanges="orientation|screenSize|keyboardHidden" android:configChanges="orientation|screenSize|keyboardHidden"
...@@ -360,7 +355,6 @@ ...@@ -360,7 +355,6 @@
android:screenOrientation="landscape" android:screenOrientation="landscape"
tools:replace="android:screenOrientation" /> tools:replace="android:screenOrientation" />
<!-- 闪电盒子广告 --> <!-- 闪电盒子广告 -->
<provider <provider
android:name="com.wannuosili.sdk.ad.component.WNFileProvider" android:name="com.wannuosili.sdk.ad.component.WNFileProvider"
......
...@@ -53,6 +53,9 @@ class InitAppService : IntentService("InitializeService") { ...@@ -53,6 +53,9 @@ class InitAppService : IntentService("InitializeService") {
* 子线程进行初始化SDK操作 * 子线程进行初始化SDK操作
*/ */
private fun initApplication() { private fun initApplication() {
// 微转分享
initWzShare()
// 初始化ShareSDK // 初始化ShareSDK
MobSDK.init(this) MobSDK.init(this)
...@@ -61,9 +64,6 @@ class InitAppService : IntentService("InitializeService") { ...@@ -61,9 +64,6 @@ class InitAppService : IntentService("InitializeService") {
// 变现猫 // 变现猫
initBxm(this.application) initBxm(this.application)
// 微转分享
initWzShare()
} }
private fun initWzShare() { private fun initWzShare() {
......
...@@ -21,6 +21,7 @@ import com.mints.goodmoney.manager.MhManager; ...@@ -21,6 +21,7 @@ import com.mints.goodmoney.manager.MhManager;
import com.mints.goodmoney.manager.MiitHelper; import com.mints.goodmoney.manager.MiitHelper;
import com.mints.goodmoney.manager.RsNewsManager; import com.mints.goodmoney.manager.RsNewsManager;
import com.mints.goodmoney.manager.TtCsjAdManager; import com.mints.goodmoney.manager.TtCsjAdManager;
import com.mints.goodmoney.manager.TzManager;
import com.mints.goodmoney.manager.WnManager; import com.mints.goodmoney.manager.WnManager;
import com.mints.goodmoney.manager.YlVideoManager; import com.mints.goodmoney.manager.YlVideoManager;
import com.mints.goodmoney.manager.YlhAdManager; import com.mints.goodmoney.manager.YlhAdManager;
...@@ -161,8 +162,15 @@ public class MintsApplication extends MultiDexApplication { ...@@ -161,8 +162,15 @@ public class MintsApplication extends MultiDexApplication {
// PR下载附件 // PR下载附件
initPRDownloader(); initPRDownloader();
// 天卓
TzManager.INSTANCE.initTz(this);
} }
/**
* 初始化喜马拉雅
*/
private void initXmly() { private void initXmly() {
XmPlayerConfig.getInstance(this).setDefualtNotificationNickNameAndInfo(Constant.MINTS_APP_NAME, Constant.MINTS_APP_NAME); XmPlayerConfig.getInstance(this).setDefualtNotificationNickNameAndInfo(Constant.MINTS_APP_NAME, Constant.MINTS_APP_NAME);
if (BaseUtil.isMainProcess(this)) { if (BaseUtil.isMainProcess(this)) {
......
package com.mints.goodmoney.ad.tz_ad;
public enum ADType {
CoralCard(102, "卡券", 1),
CoralDownload(103, "下载", 2),
CoralDownloadGdt(134, "下载", 3),
CoralRewardVideo(104, "视频", 4),
CoralRewardVideoGdt(131, "视频", 5),
CoralRewardVideoKs(132, "视频", 6),
CoralSplashImage(125, "开屏", 7),
CoralBanner(130, "横幅", 8),
CoralInfoFeed(128, "信息流", 9),
CoralFullScreenVideo(137, "全屏", 10),
CoralVideoFeed(138, "联盟", 11);
private int mTaskType;
private String mName;
private int mColumnIndex;
ADType(int taskType, String name, int columnIndex) {
mTaskType = taskType;
mName = name;
mColumnIndex = columnIndex;
}
static ADType of(int taskType) {
for (ADType adType : values()) {
if (adType.mTaskType == taskType) {
return adType;
}
}
return null;
}
public int getTaskType() {
return mTaskType;
}
public String getName() {
return mName;
}
public int getColumnIndex() {
return mColumnIndex;
}
public String getCombinedName() {
return mName + (mTaskType != 0 ? mTaskType : "");
}
}
\ No newline at end of file
package com.mints.goodmoney.ad.tz_ad;
import android.content.Context;
import androidx.annotation.Nullable;
import com.mints.goodmoney.manager.UserManager;
import com.tz.sdk.coral.ad.CoralAD;
import com.tz.sdk.coral.callback.CoralADListener;
import com.tz.sdk.coral.callback.h5.DownloadProcess;
import com.tz.sdk.coral.task.RewardTask;
import com.tz.sdk.core.ad.ADError;
import com.tz.sdk.core.ad.ADSource;
import com.tz.sdk.core.ad.ADType;
import com.tz.sdk.core.loader.ADLoader;
import java.util.HashMap;
import java.util.List;
/**
* 下载
*/
public final class CoralDownload {
private Context mContext;
private int mTaskType;
public CoralDownload(Context context, int taskType) {
mContext = context;
mTaskType = taskType;
}
// public boolean i = true;
/**
* i用于判断如果已经在下载了,那就在download回调里return false,不进行重复的下载
*
* @return
*/
public com.mints.goodmoney.ad.tz_ad.ADType getADType() {
return com.mints.goodmoney.ad.tz_ad.ADType.CoralDownload;
}
public void pull() {
new ADLoader(mContext)
.get(ADType.APP_DOWNLOAD)
.from(ADSource.CORAL)
.count(1)
.reward(true)
.with(new HashMap<String, Object>() {
{
put(CoralAD.Key.TASK_TYPE, mTaskType);
put(CoralAD.Key.ACCOUNT_ID, UserManager.getInstance().getUserID());
put(CoralAD.Key.LOGIN_KEY, UserManager.getInstance().getTokenID());
}
})
.load(new CoralADListener() {
@Override
public boolean onTaskAvailable(RewardTask rewardTask) {
return super.onTaskAvailable(rewardTask);
}
@Override
public boolean onTaskNotAvailable(int taskType, ADError adError) {
return super.onTaskNotAvailable(taskType, adError);
}
@Override
public boolean openH5(CoralAD ad, String h5Url) {
return super.openH5(ad, h5Url);
}
@Override
public boolean download(DownloadProcess downloadProcess) {
// if (!i) {
// return false;
// }
if (mOnAdLoadListener != null) {
mOnAdLoadListener.onGetDownloadProcess(downloadProcess);
}
// downloadProcess.reportDownloadStart();
return false;
}
@Override
public void onAdFailed(ADError adError) {
super.onAdFailed(adError);
if (mOnAdLoadListener != null) {
mOnAdLoadListener.onLoadFail();
}
}
@Override
public void onAdLoaded(List<CoralAD> adList) {
if (adList != null && adList.size() > 0) {
if (mOnAdLoadListener != null) {
mOnAdLoadListener.onLoadSuccess(adList);
}
} else {
if (mOnAdLoadListener != null) {
mOnAdLoadListener.onLoadFail();
}
}
}
@Override
public boolean onAdShow(@Nullable CoralAD ad) {
return false;
}
@Override
public boolean onAdClicked(@Nullable CoralAD ad) {
return false;
}
@Override
public boolean onAppDownloading(@Nullable CoralAD ad, @Nullable String downloadUrl) {
// i = false;
return false;
}
@Override
public boolean onAppDownloaded(@Nullable CoralAD ad, @Nullable String downloadUrl, @Nullable String localFile) {
// i = true;
return false;
}
@Override
public boolean onAppInstalled(@Nullable CoralAD ad, @Nullable String downloadUrl, @Nullable String localFile) {
return false;
}
@Override
public boolean onAppActivated(CoralAD ad, String downloadUrl, String localFile) {
return super.onAppActivated(ad, downloadUrl, localFile);
}
});
}
private OnAdLoadListener mOnAdLoadListener;
public CoralDownload setOnAdLoadListener(OnAdLoadListener onAdLoadListener) {
mOnAdLoadListener = onAdLoadListener;
return this;
}
public interface OnAdLoadListener {
void onLoadSuccess(List<CoralAD> dataList);
void onLoadFail();
void onGetDownloadProcess(DownloadProcess downloadProcess);
}
}
...@@ -129,6 +129,7 @@ object Constant { ...@@ -129,6 +129,7 @@ object Constant {
const val CARRIER_KUYINYUE_VEDIO = "KUYINYUE_VEDIO" //酷音乐视频 const val CARRIER_KUYINYUE_VEDIO = "KUYINYUE_VEDIO" //酷音乐视频
const val CARRIER_HIGH_ACTIVITY = "HIGH_ACTIVITY" //高额任务 const val CARRIER_HIGH_ACTIVITY = "HIGH_ACTIVITY" //高额任务
const val CARRIER_SHARE_NEWS = "SHARE_NEWS" //分享新闻 const val CARRIER_SHARE_NEWS = "SHARE_NEWS" //分享新闻
const val CARRIER_CPD = "CPD" //珊瑚CPD下载试玩任务
const val CHALLENGE_SHAREFRIEND = "CHALLENGE_SHAREFRIEND" //邀请好友 const val CHALLENGE_SHAREFRIEND = "CHALLENGE_SHAREFRIEND" //邀请好友
......
package com.mints.goodmoney.manager package com.mints.goodmoney.manager
import android.content.Context
import android.view.View
import com.mints.goodmoney.MintsApplication import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R
import com.mints.goodmoney.ui.widgets.CustomDialogAsApple
import com.mints.goodmoney.ui.widgets.DialogListener
import com.mints.goodmoney.utils.AppUtil import com.mints.goodmoney.utils.AppUtil
/** /**
...@@ -12,9 +17,40 @@ object AppTryPlayManager { ...@@ -12,9 +17,40 @@ object AppTryPlayManager {
AppUtil.openThirdApp(MintsApplication.getContext(), pkg) AppUtil.openThirdApp(MintsApplication.getContext(), pkg)
} }
fun getTryPlayIsOK(pkg: String): Boolean { fun getTryPlayIsOK(pkg: String, useTime :Int): Boolean {
val timePkgUsed = AppUtil.getTimePkgUsed(MintsApplication.getContext(), pkg) val timePkgUsed = AppUtil.getTimePkgUsed(MintsApplication.getContext(), pkg)
return timePkgUsed >= 30 return timePkgUsed >= useTime
}
private var cdaa: CustomDialogAsApple? = null
/**
* 打开应用使用记录授权弹框
*/
fun openAppUsageStats(context: Context) {
cdaa = CustomDialogAsApple(context, object : DialogListener() {
override fun onClick(v: View) {
if (cdaa != null && cdaa!!.isShowing) {
cdaa!!.dismiss()
}
when (v.id) {
R.id.dialog_btn_left -> {
cdaa!!.dismiss()
}
R.id.dialog_btn_right -> {
cdaa!!.dismiss()
AppUtil.openUsageStats(context)
}
}
}
})
cdaa?.let {
it.setTitle("提示")
it.setContent("该任务需要【应用使用记录】权限")
it.setLeft("取消")
it.setRight("打开授权")
it.show()
}
} }
} }
\ No newline at end of file
...@@ -26,9 +26,10 @@ import java.io.File ...@@ -26,9 +26,10 @@ import java.io.File
object DownloadApkManager { object DownloadApkManager {
private var downloadProgressDialog: DownloadProgressDialog? = null private var downloadProgressDialog: DownloadProgressDialog? = null
private var mDownloadListener: OnMyDownloadListener? = null
private var apkName = "" private var apkName = ""
private var cachePath = "" private var cachePath = MintsApplication.getContext().externalCacheDir?.path + "/Download/"
private var canOnceInstallApk = false//8.0以上系统 防止首次授权时 未安装apk调用 private var canOnceInstallApk = false//8.0以上系统 防止首次授权时 未安装apk调用
/** /**
...@@ -38,6 +39,8 @@ object DownloadApkManager { ...@@ -38,6 +39,8 @@ object DownloadApkManager {
*/ */
fun downloadApk(url: String) { fun downloadApk(url: String) {
apkName = MD5.GetMD5Code(System.currentTimeMillis().toString() + UserManager.getInstance().userID) + ".apk" apkName = MD5.GetMD5Code(System.currentTimeMillis().toString() + UserManager.getInstance().userID) + ".apk"
mDownloadListener?.onDownloadStart()
this.download(url) this.download(url)
} }
...@@ -48,10 +51,22 @@ object DownloadApkManager { ...@@ -48,10 +51,22 @@ object DownloadApkManager {
* name:应用名称 * name:应用名称
*/ */
fun downloadApk(url: String, name: String) { fun downloadApk(url: String, name: String) {
this.apkName = apkName // 判断apk是否存在
if (isFileExist("$name.apk")) {
installApk()
return
}
this.apkName = "$name.apk"
mDownloadListener?.onDownloadStart()
this.download(url) this.download(url)
} }
private fun isFileExist(apkName: String): Boolean {
val file = File(cachePath + apkName)
return file.exists()
}
/** /**
* 防止首次授权未知来源权限时 未安装apk调用 * 防止首次授权未知来源权限时 未安装apk调用
*/ */
...@@ -75,7 +90,7 @@ object DownloadApkManager { ...@@ -75,7 +90,7 @@ object DownloadApkManager {
downloadProgressDialog!!.show() downloadProgressDialog!!.show()
val context = MintsApplication.getContext() val context = MintsApplication.getContext()
cachePath = context.cacheDir.path + "/" // cachePath = context.externalCacheDir?.path + "/Download/"
PRDownloader.download(url, cachePath, apkName) PRDownloader.download(url, cachePath, apkName)
.build() .build()
.setOnProgressListener { progress -> .setOnProgressListener { progress ->
...@@ -85,6 +100,8 @@ object DownloadApkManager { ...@@ -85,6 +100,8 @@ object DownloadApkManager {
override fun onDownloadComplete() { override fun onDownloadComplete() {
downloadProgressDialog?.dismiss() downloadProgressDialog?.dismiss()
try { try {
mDownloadListener?.onDownloadSuccess(cachePath + apkName)
preInstallApk() preInstallApk()
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
...@@ -164,4 +181,13 @@ object DownloadApkManager { ...@@ -164,4 +181,13 @@ object DownloadApkManager {
} }
context.startActivity(intent) context.startActivity(intent)
} }
fun setOnMyDownloadListener(onMyDownloadListener: OnMyDownloadListener) {
this.mDownloadListener = onMyDownloadListener
}
interface OnMyDownloadListener {
fun onDownloadStart()
fun onDownloadSuccess(path: String)
}
} }
\ No newline at end of file
...@@ -65,6 +65,15 @@ public class TrackManager { ...@@ -65,6 +65,15 @@ public class TrackManager {
} }
} }
/**
* 每日任务是否刷新任务数
*/
public void innerApp() {
if (trackPresenter != null) {
trackPresenter.innerApp();
}
}
/** /**
* 提现看视频 * 提现看视频
......
package com.mints.goodmoney.manager
import android.app.Application
import com.mints.goodmoney.MintsApplication
import com.mints.library.utils.CommonUtils
import com.tz.sdk.core.engine.ADEngine
import com.tz.sdk.core.engine.ADEngineConfig
import com.tz.sdk.core.engine.IADEngineState
/**
* 描述:天卓激励视频
*/
object TzManager {
/**
* 初始化
*/
fun initTz(application: Application) {
val td_channel_id = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
ADEngine.getInstance(application)
.start(ADEngineConfig.Builder(application)
.appKey("547ffff6446c5a8acd4175fb7a71a0d1")
.appSecret("1c00e59f2257bdfdd4ad9363b41621b5")
.appChannel(td_channel_id)
.forTest(true)
.build(),
object : IADEngineState {
override fun onIdle() {}
override fun onStarting() {}
override fun onStarted() {}
override fun onFailed(p0: Int, p1: String?) {}
})
}
}
\ No newline at end of file
...@@ -203,6 +203,15 @@ public class MyInfo implements Serializable { ...@@ -203,6 +203,15 @@ public class MyInfo implements Serializable {
private int status = 0; private int status = 0;
private int coin; private int coin;
private int readCoin; private int readCoin;
private int needSeconds;
public int getNeedSeconds() {
return needSeconds;
}
public void setNeedSeconds(int needSeconds) {
this.needSeconds = needSeconds;
}
public int getReadCoin() { public int getReadCoin() {
return readCoin; return readCoin;
......
package com.mints.goodmoney.mvp.model;
public class TzTaskBean {
private String icon;
private String title;
public int getCoin() {
return coin;
}
public void setCoin(int coin) {
this.coin = coin;
}
private int coin;
private int state;
private String currentPkgName;
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public TzTaskBean(String icon, String title, int coin, int state, String currentPkgName) {
this.icon = icon;
this.title = title;
this.coin = coin;
this.state = state;
this.currentPkgName = currentPkgName;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public int getState() {
return state;
}
public void setState(int state) {
this.state = state;
}
public String getCurrentPkgName() {
return currentPkgName;
}
public void setCurrentPkgName(String currentPkgName) {
this.currentPkgName = currentPkgName;
}
}
package com.mints.goodmoney.mvp.presenters; package com.mints.goodmoney.mvp.presenters;
import com.google.gson.JsonObject;
import com.mints.goodmoney.common.Constant; import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.manager.AppHttpManager; import com.mints.goodmoney.manager.AppHttpManager;
import com.mints.goodmoney.mvp.model.BaseResponse; import com.mints.goodmoney.mvp.model.BaseResponse;
...@@ -130,4 +129,26 @@ public class TrackPresenter extends BaseTrackPresenter { ...@@ -130,4 +129,26 @@ public class TrackPresenter extends BaseTrackPresenter {
}); });
} }
/**
* 每日任务是否刷新任务数
*/
public void innerApp() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.innerApp(),
new BaseSubscriber<BaseResponse<Object>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(BaseResponse<Object> baseResponse) {
}
});
}
} }
...@@ -518,6 +518,14 @@ public interface LoanService { ...@@ -518,6 +518,14 @@ public interface LoanService {
@POST("api/reportClickAdEvent") @POST("api/reportClickAdEvent")
Observable<BaseResponse<JsonObject>> reportClickAdEvent(); Observable<BaseResponse<JsonObject>> reportClickAdEvent();
/**
* 每日任务是否刷新任务数
*
* @return
*/
@POST("api/innerApp")
Observable<BaseResponse<JsonObject>> innerApp();
/** /**
* 默认http工厂 * 默认http工厂
*/ */
......
...@@ -257,7 +257,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -257,7 +257,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
} }
tvAwardNext.setText("我知道了") tvAwardNext.setText("我知道了")
} }
Constant.CARRIER_HIGH_ACTIVITY -> { Constant.CARRIER_HIGH_ACTIVITY, Constant.CARRIER_CPD -> {
if (curCoin > 0) { if (curCoin > 0) {
tvAwardContent.setText("试玩奖励${curCoin}金币") tvAwardContent.setText("试玩奖励${curCoin}金币")
tvAwardNext.setText("领取金币") tvAwardNext.setText("领取金币")
...@@ -265,7 +265,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -265,7 +265,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
vo["carrierType"] = carrierType vo["carrierType"] = carrierType
awardPresenter.reportAddCoinMsg(vo) awardPresenter.reportAddCoinMsg(vo)
} else { } else {
tvAwardContent.setText("很遗憾,试玩不足30秒") tvAwardContent.setText("很遗憾,试玩时间不足")
tvAwardNext.setText("我知道了") tvAwardNext.setText("我知道了")
} }
} }
......
...@@ -20,8 +20,7 @@ import kotlinx.android.synthetic.main.header_layout.* ...@@ -20,8 +20,7 @@ import kotlinx.android.synthetic.main.header_layout.*
* 作者:孟崔广 * 作者:孟崔广
* 时间:2020/12/2 14:21 * 时间:2020/12/2 14:21
*/ */
class MobileLoginActivity : BaseActivity() class MobileLoginActivity : BaseActivity(), LoginView, View.OnClickListener {
, LoginView, View.OnClickListener {
private val loginPresenter by lazy { LoginPresenter() } private val loginPresenter by lazy { LoginPresenter() }
...@@ -97,6 +96,9 @@ class MobileLoginActivity : BaseActivity() ...@@ -97,6 +96,9 @@ class MobileLoginActivity : BaseActivity()
} catch (e: Exception) { } catch (e: Exception) {
} }
// 每日任务是否刷新任务数
TrackManager.getInstance().innerApp()
SceneManager.signIn(this) SceneManager.signIn(this)
RsNewsManager.init(baseApplication) RsNewsManager.init(baseApplication)
BxmManager.bindUserData() BxmManager.bindUserData()
......
package com.mints.goodmoney.ui.activitys package com.mints.goodmoney.ui.activitys
import android.annotation.SuppressLint
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
...@@ -8,6 +9,7 @@ import android.widget.EditText ...@@ -8,6 +9,7 @@ import android.widget.EditText
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import androidx.core.content.ContextCompat
import cn.sharesdk.framework.ShareSDK import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat import cn.sharesdk.wechat.friends.Wechat
import com.mints.goodmoney.R import com.mints.goodmoney.R
...@@ -23,8 +25,8 @@ import com.mints.goodmoney.ui.activitys.base.BaseActivity ...@@ -23,8 +25,8 @@ import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.widgets.CustomDialogAsApple import com.mints.goodmoney.ui.widgets.CustomDialogAsApple
import com.mints.goodmoney.ui.widgets.DialogListener import com.mints.goodmoney.ui.widgets.DialogListener
import com.mints.goodmoney.utils.CacheUtil import com.mints.goodmoney.utils.CacheUtil
import com.mints.goodmoney.utils.AppUtil
import com.mints.library.utils.json.JsonUtil import com.mints.library.utils.json.JsonUtil
import com.mints.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.activity_settings.* import kotlinx.android.synthetic.main.activity_settings.*
import kotlinx.android.synthetic.main.header_layout.* import kotlinx.android.synthetic.main.header_layout.*
import java.util.* import java.util.*
...@@ -45,8 +47,6 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener, ...@@ -45,8 +47,6 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
AppUtil.getAppUseTime(this@SettingsActivity, "com.dangdang.reader")
if (userManager.mobile.isNotEmpty()) { if (userManager.mobile.isNotEmpty()) {
item_phone.findViewById<TextView>(R.id.tv_right).text = userManager.mobile item_phone.findViewById<TextView>(R.id.tv_right).text = userManager.mobile
...@@ -61,6 +61,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener, ...@@ -61,6 +61,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
} }
} }
@SuppressLint("CutPasteId")
private fun initLayout() { private fun initLayout() {
if (!userManager.userIsLogin()) { if (!userManager.userIsLogin()) {
btn_switch.visibility = View.GONE btn_switch.visibility = View.GONE
...@@ -82,8 +83,8 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener, ...@@ -82,8 +83,8 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
btn_switch.setOnClickListener(this) btn_switch.setOnClickListener(this)
item_phone.findViewById<TextView>(R.id.tv_title).text = "手机号" item_phone.findViewById<TextView>(R.id.tv_title).text = "手机号"
val phone = resources.getDrawable(R.mipmap.icon_settings_tel) val phone = ContextCompat.getDrawable(this,R.mipmap.icon_settings_tel)
phone.setBounds(0, 0, 56, 56) phone?.setBounds(0, 0, 56, 56)
item_phone.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(phone, null, null, null) item_phone.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(phone, null, null, null)
item_phone.findViewById<TextView>(R.id.tv_right).visibility = View.VISIBLE item_phone.findViewById<TextView>(R.id.tv_right).visibility = View.VISIBLE
item_phone.findViewById<ImageView>(R.id.iv_right).visibility = View.GONE item_phone.findViewById<ImageView>(R.id.iv_right).visibility = View.GONE
...@@ -94,8 +95,8 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener, ...@@ -94,8 +95,8 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
} }
item_wechat.findViewById<TextView>(R.id.tv_title).text = "微信昵称" item_wechat.findViewById<TextView>(R.id.tv_title).text = "微信昵称"
val wechat = resources.getDrawable(R.mipmap.icon_settings_wechat) val wechat = ContextCompat.getDrawable(this, R.mipmap.icon_settings_wechat)
wechat.setBounds(0, 0, 56, 56) wechat?.setBounds(0, 0, 56, 56)
item_wechat.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(wechat, null, null, null) item_wechat.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(wechat, null, null, null)
item_wechat.findViewById<TextView>(R.id.tv_right).visibility = View.VISIBLE item_wechat.findViewById<TextView>(R.id.tv_right).visibility = View.VISIBLE
item_wechat.findViewById<ImageView>(R.id.iv_right).visibility = View.GONE item_wechat.findViewById<ImageView>(R.id.iv_right).visibility = View.GONE
...@@ -114,37 +115,37 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener, ...@@ -114,37 +115,37 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
// item_invitedCode.findViewById<TextView>(R.id.tv_right).text = "填写邀请码 海量金币等你拿" // item_invitedCode.findViewById<TextView>(R.id.tv_right).text = "填写邀请码 海量金币等你拿"
item_cleanCache.findViewById<TextView>(R.id.tv_title).text = "清理缓存" item_cleanCache.findViewById<TextView>(R.id.tv_title).text = "清理缓存"
val cleanCache = resources.getDrawable(R.mipmap.icon_settings_clean) val cleanCache = ContextCompat.getDrawable(this,R.mipmap.icon_settings_clean)
cleanCache.setBounds(0, 0, 56, 56) cleanCache?.setBounds(0, 0, 56, 56)
item_cleanCache.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(cleanCache, null, null, null) item_cleanCache.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(cleanCache, null, null, null)
item_cleanCache.findViewById<TextView>(R.id.tv_right).visibility = View.VISIBLE item_cleanCache.findViewById<TextView>(R.id.tv_right).visibility = View.VISIBLE
item_cleanCache.findViewById<ImageView>(R.id.iv_right).visibility = View.GONE item_cleanCache.findViewById<ImageView>(R.id.iv_right).visibility = View.GONE
item_cleanCache.findViewById<TextView>(R.id.tv_right).text = CacheUtil.getTotalCacheSize(this) item_cleanCache.findViewById<TextView>(R.id.tv_right).text = CacheUtil.getTotalCacheSize(this)
item_userAgree.findViewById<TextView>(R.id.tv_title).text = "服务协议" item_userAgree.findViewById<TextView>(R.id.tv_title).text = "服务协议"
val userAgree = resources.getDrawable(R.mipmap.icon_settings_user) val userAgree = ContextCompat.getDrawable(this,R.mipmap.icon_settings_user)
userAgree.setBounds(0, 0, 56, 56) userAgree?.setBounds(0, 0, 56, 56)
item_userAgree.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(userAgree, null, null, null) item_userAgree.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(userAgree, null, null, null)
item_userAgree.findViewById<TextView>(R.id.tv_right).visibility = View.GONE item_userAgree.findViewById<TextView>(R.id.tv_right).visibility = View.GONE
item_userAgree.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE item_userAgree.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE
item_privacyAgree.findViewById<TextView>(R.id.tv_title).text = "隐私协议" item_privacyAgree.findViewById<TextView>(R.id.tv_title).text = "隐私协议"
val privacyAgree = resources.getDrawable(R.mipmap.icon_settings_privacy) val privacyAgree = ContextCompat.getDrawable(this,R.mipmap.icon_settings_privacy)
privacyAgree.setBounds(0, 0, 56, 56) privacyAgree?.setBounds(0, 0, 56, 56)
item_privacyAgree.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(privacyAgree, null, null, null) item_privacyAgree.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(privacyAgree, null, null, null)
item_privacyAgree.findViewById<TextView>(R.id.tv_right).visibility = View.GONE item_privacyAgree.findViewById<TextView>(R.id.tv_right).visibility = View.GONE
item_privacyAgree.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE item_privacyAgree.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE
item_aboutUs.findViewById<TextView>(R.id.tv_title).text = "关于我们" item_aboutUs.findViewById<TextView>(R.id.tv_title).text = "关于我们"
val aboutUs = resources.getDrawable(R.mipmap.icon_settings_about) val aboutUs = ContextCompat.getDrawable(this,R.mipmap.icon_settings_about)
aboutUs.setBounds(0, 0, 56, 56) aboutUs?.setBounds(0, 0, 56, 56)
item_aboutUs.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(aboutUs, null, null, null) item_aboutUs.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(aboutUs, null, null, null)
item_aboutUs.findViewById<TextView>(R.id.tv_right).visibility = View.GONE item_aboutUs.findViewById<TextView>(R.id.tv_right).visibility = View.GONE
item_aboutUs.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE item_aboutUs.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE
item_feedBack.findViewById<TextView>(R.id.tv_title).text = "问题反馈" item_feedBack.findViewById<TextView>(R.id.tv_title).text = "问题反馈"
val feedBack = resources.getDrawable(R.mipmap.icon_settings_feedback) val feedBack = ContextCompat.getDrawable(this,R.mipmap.icon_settings_feedback)
feedBack.setBounds(0, 0, 56, 56) feedBack?.setBounds(0, 0, 56, 56)
item_feedBack.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(feedBack, null, null, null) item_feedBack.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(feedBack, null, null, null)
item_feedBack.findViewById<TextView>(R.id.tv_right).visibility = View.GONE item_feedBack.findViewById<TextView>(R.id.tv_right).visibility = View.GONE
item_feedBack.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE item_feedBack.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE
...@@ -155,6 +156,8 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener, ...@@ -155,6 +156,8 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
override fun isApplyKitKatTranslucency() = false override fun isApplyKitKatTranslucency() = false
override fun onClick(v: View?) { override fun onClick(v: View?) {
if (AntiShake.check(v?.id)) return
when (v?.id) { when (v?.id) {
R.id.item_phone -> { R.id.item_phone -> {
if (!userManager.userIsLogin()) { if (!userManager.userIsLogin()) {
......
package com.mints.goodmoney.ui.activitys
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Bundle
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.tz_ad.CoralDownload
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.AppTryPlayManager
import com.mints.goodmoney.manager.DownloadApkManager
import com.mints.goodmoney.mvp.model.TzTaskBean
import com.mints.goodmoney.service.AppInstallService
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.adapter.TaskAdapter
import com.mints.goodmoney.ui.adapter.listener.OnItemChildClickListener
import com.mints.goodmoney.ui.adapter.listener.OnItemClickListener
import com.mints.goodmoney.ui.widgets.CustomDialogAsApple
import com.mints.goodmoney.ui.widgets.DialogListener
import com.mints.goodmoney.ui.widgets.TaskDialog
import com.mints.goodmoney.utils.AppUtil
import com.mints.goodmoney.utils.SpacesItemDecoration
import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import com.tz.sdk.coral.ad.CoralAD
import com.tz.sdk.coral.callback.h5.DownloadProcess
import kotlinx.android.synthetic.main.activity_task.*
import kotlinx.android.synthetic.main.header_layout.*
/**
*
* 描述:试玩任务
*/
class TaskActivity : BaseActivity(), OnItemClickListener, OnRefreshListener, CoralDownload.OnAdLoadListener, OnItemChildClickListener, View.OnClickListener, DownloadApkManager.OnMyDownloadListener {
private var mTaskAdapter: TaskAdapter? = null
private val mTaskList: MutableList<CoralAD> = arrayListOf()
private val mFakeTaskList: MutableList<TzTaskBean> = arrayListOf()
// 任务弹框
private var taskDialog: TaskDialog? = null
private lateinit var cdaa: CustomDialogAsApple
// 天卓下载广告请求
private var mCoralDownload: CoralDownload? = null
private var mDownloadProcess: DownloadProcess? = null
// APP下载回调广播
private var mReceiverBroadcastReceiver: BroadcastReceiver? = null
// 是否刷新按钮状态
private var isRefreshState = false
companion object {
const val TASK_COIN = "task_coin"
const val TASK_USE_TIME = "task_use_time"
}
private var mCoin = 0
private var needUseTime = 0
override fun getBundleExtras(extras: Bundle) {
super.getBundleExtras(extras)
mCoin = extras.getInt(TASK_COIN)
needUseTime = extras.getInt(TASK_USE_TIME)
}
override fun getContentViewLayoutID() = R.layout.activity_task
override fun initViewsAndEvents() {
tv_title.text = "下载试玩任务"
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
mCoralDownload = CoralDownload(this, 103).setOnAdLoadListener(this)
initView()
initListener()
loadData()
}
private fun initView() {
val gridLayoutManager = GridLayoutManager(this, 2)
recy_task.layoutManager = gridLayoutManager
recy_task.addItemDecoration(SpacesItemDecoration(2, SpacesItemDecoration.px2dp(10f)))
mTaskAdapter = TaskAdapter(mFakeTaskList, this)
recy_task.adapter = mTaskAdapter
recy_task.setItemViewCacheSize(20)
mTaskAdapter?.setOnItemClickListener(this)
mTaskAdapter?.setOnItemChildClickListener(this)
iv_left_icon.setOnClickListener(this)
}
private fun initListener() {
srl_task.setOnRefreshListener(this)
}
override fun onResume() {
super.onResume()
refreshDemoTask()
}
/**
* 刷新高额任务
*/
private fun refreshDemoTask() {
if (isRefreshState) {
isRefreshState = !isRefreshState
return
}
mTaskAdapter?.let {
if (mFakeTaskList.size == 0) return
val currentPkgName = mFakeTaskList[it.getPosition()].currentPkgName
if (currentPkgName != null) {
if (AppTryPlayManager.getTryPlayIsOK(currentPkgName, needUseTime)) {
// 完成试玩任务
mFakeTaskList[it.getPosition()].state = 2
it.notifyItemChanged(it.getPosition())
// 上报激活完成
mDownloadProcess?.reportAppActivated()
} else {
// 试玩时间不足
mFakeTaskList[it.getPosition()].state = 0
it.notifyItemChanged(it.getPosition())
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, 0)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_CPD)
readyGo(AwardActivity::class.java, bundle)
}
}
}
}
private fun loadData() {
showLoading("加载中...")
mCoralDownload?.pull()
}
override fun isApplyKitKatTranslucency() = false
override fun onItemClick(view: View?, position: Int) {
}
private fun clickDialog(position: Int) {
taskDialog = TaskDialog(this)
taskDialog?.setData(mTaskList[position], needUseTime, mCoin)
taskDialog?.show()
}
override fun onRefresh(refreshLayout: RefreshLayout) {
loadData()
}
override fun onLoadSuccess(dataList: MutableList<CoralAD>?) {
hideLoading()
srl_task.finishRefresh()
dataList?.let {
mFakeTaskList.clear()
for (coralAD in it) {
mFakeTaskList.add(TzTaskBean(coralAD.icon, coralAD.description, mCoin, 0, null))
}
mTaskList.clear()
mTaskList.addAll(it)
mTaskAdapter?.notifyDataSetChanged()
}
}
override fun onLoadFail() {
showToast("加载失败,请刷新重试")
hideLoading()
srl_task.finishRefresh(false)
}
override fun onGetDownloadProcess(downloadProcess: DownloadProcess?) {
// 点击之后回调下载数据
isRefreshState = false
mDownloadProcess = downloadProcess
// 跳转去下载
val downloadUrl = downloadProcess!!.downloadUrl
val packageName = downloadProcess.packageName
DownloadApkManager.setOnMyDownloadListener(this)
DownloadApkManager.downloadApk(downloadUrl, packageName)
}
override fun onDestroy() {
super.onDestroy()
if (mReceiverBroadcastReceiver != null) {
mContext.stopService(Intent(context, AppInstallService::class.java))
mContext.unregisterReceiver(mReceiverBroadcastReceiver)
}
}
override fun onBackPressed() {
// super.onBackPressed()
backDialog()
}
/**
* 注册试玩任务监听
*/
private fun registerBroad() {
if (mReceiverBroadcastReceiver != null) return
mContext.startService(Intent(context, AppInstallService::class.java))
mReceiverBroadcastReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
if (intent == null) return
try {
val pkg = intent.getStringExtra("pkg")
mTaskAdapter?.let {
mFakeTaskList[it.getPosition()].currentPkgName = pkg
mFakeTaskList[it.getPosition()].state = 1
it.notifyItemChanged(it.getPosition())
// 上报安装完成
mDownloadProcess?.reportInstallSuccess(false)
isRefreshState = true
}
} catch (e: Exception) {
e.printStackTrace()
}
}
}
val intentFilter = IntentFilter()
intentFilter.addAction(AppInstallService.APP_INSTALL_ACTION)
mContext.registerReceiver(this.mReceiverBroadcastReceiver, intentFilter)
}
override fun onItemChildClick(view: View?, position: Int) {
when (mFakeTaskList[position].state) {
// 0 立即下载, 1 去试玩, 2 领取奖励
0 -> {
if (AppUtil.isOpenUsageStats()) {
clickDialog(position)
} else {
AppTryPlayManager.openAppUsageStats(this)
}
}
1 -> {
mTaskAdapter?.let {
val currentPkgName = mFakeTaskList[it.getPosition()].currentPkgName
if (currentPkgName == null) {
showToast("任务异常,请重试~")
mFakeTaskList[it.getPosition()].state = 0
it.notifyItemChanged(it.getPosition())
} else {
if (AppUtil.checkPackInfo(mContext, currentPkgName)) {
showToast("跳转去试玩")
AppTryPlayManager.toTryPlay(currentPkgName)
} else {
showToast("未找到当前APP、可能被卸载,请重试~")
// 重置当前列表状态
mFakeTaskList[it.getPosition()].state = 0
it.notifyItemChanged(it.getPosition())
}
}
}
}
2 -> {
isRefreshState = true
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, mCoin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_CPD)
readyGo(AwardActivity::class.java, bundle)
// 重置当前列表状态
mTaskAdapter?.let {
mFakeTaskList[it.getPosition()].state = 3
it.notifyItemChanged(it.getPosition())
}
}
3 -> {
showToast("当前任务已完成,试试其他任务吧!")
}
}
}
private fun backDialog() {
cdaa = CustomDialogAsApple(context, object : DialogListener() {
override fun onClick(v: View) {
if (cdaa.isShowing) {
cdaa.dismiss()
}
when (v.id) {
R.id.dialog_btn_right -> {
finish()
}
}
}
})
cdaa.setTitle("提示")
cdaa.setContent("退出当前页面将会重置当前任务状态")
cdaa.setLeft("取消")
cdaa.setRight("确定")
cdaa.show()
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.iv_left_icon -> {
backDialog()
}
}
}
/**
* 开始下载
*/
override fun onDownloadStart() {
taskDialog?.dismiss()
// 上报开始下载
mDownloadProcess?.reportDownloadStart(false)
registerBroad()
}
/**
* 下载成功
*/
override fun onDownloadSuccess(path: String) {
// 上报下载成功
mDownloadProcess?.reportDownloadSuccess(path, false)
}
}
\ No newline at end of file
...@@ -17,6 +17,7 @@ import com.mints.goodmoney.login.OnLoginListener ...@@ -17,6 +17,7 @@ import com.mints.goodmoney.login.OnLoginListener
import com.mints.goodmoney.manager.BxmManager import com.mints.goodmoney.manager.BxmManager
import com.mints.goodmoney.manager.RsNewsManager import com.mints.goodmoney.manager.RsNewsManager
import com.mints.goodmoney.manager.SceneManager import com.mints.goodmoney.manager.SceneManager
import com.mints.goodmoney.manager.TrackManager
import com.mints.goodmoney.manager.YwhzManager import com.mints.goodmoney.manager.YwhzManager
import com.mints.goodmoney.mvp.model.WXInfo import com.mints.goodmoney.mvp.model.WXInfo
import com.mints.goodmoney.mvp.presenters.LoginPresenter import com.mints.goodmoney.mvp.presenters.LoginPresenter
...@@ -122,6 +123,9 @@ class WxLoginActivity : BaseActivity() ...@@ -122,6 +123,9 @@ class WxLoginActivity : BaseActivity()
} catch (e: Exception) { } catch (e: Exception) {
} }
// 每日任务是否刷新任务数
TrackManager.getInstance().innerApp()
SceneManager.signIn(this) SceneManager.signIn(this)
RsNewsManager.init(baseApplication) RsNewsManager.init(baseApplication)
BxmManager.bindUserData() BxmManager.bindUserData()
......
...@@ -17,6 +17,7 @@ import com.mints.goodmoney.ui.activitys.base.BaseActivity ...@@ -17,6 +17,7 @@ import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.adapter.XmlyPlayAdapter import com.mints.goodmoney.ui.adapter.XmlyPlayAdapter
import com.mints.goodmoney.utils.LogUtil import com.mints.goodmoney.utils.LogUtil
import com.mints.goodmoney.utils.ToolUtil import com.mints.goodmoney.utils.ToolUtil
import com.mints.goodmoney.utils.Utils
import com.mints.library.utils.GlideUtils import com.mints.library.utils.GlideUtils
import com.mints.library.utils.nodoubleclick.AntiShake import com.mints.library.utils.nodoubleclick.AntiShake
import com.scwang.smartrefresh.layout.api.RefreshLayout import com.scwang.smartrefresh.layout.api.RefreshLayout
...@@ -142,12 +143,16 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O ...@@ -142,12 +143,16 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O
vo[DTransferConstants.PAGE_SIZE] = PAGE_SIZE.toString() vo[DTransferConstants.PAGE_SIZE] = PAGE_SIZE.toString()
CommonRequest.getTracks(vo, object : IDataCallBack<TrackList> { CommonRequest.getTracks(vo, object : IDataCallBack<TrackList> {
override fun onSuccess(p0: TrackList?) { override fun onSuccess(p0: TrackList?) {
// 判断activity是否已被销毁
if (Utils.isDestroy(this@XmlyPlayActivity)) return
if (p0 != null && p0.tracks != null && p0.tracks.size != 0) { if (p0 != null && p0.tracks != null && p0.tracks.size != 0) {
runOnUiThread { runOnUiThread {
if (xmlyPage == 1) { if (xmlyPage == 1) {
message.text = p0.tracks[0].trackTitle message.text = p0.tracks[0].trackTitle
time.text = "[00.00/" + ToolUtil.formatTime(p0.tracks[0].duration.toLong()).toString() + "]" time.text = "[00.00/" + ToolUtil.formatTime(p0.tracks[0].duration.toLong()).toString() + "]"
tv_title.text = p0.albumTitle tv_title.text = p0.albumTitle
GlideUtils.loadImageView(this@XmlyPlayActivity, p0.coverUrlMiddle, sound_cover) GlideUtils.loadImageView(this@XmlyPlayActivity, p0.coverUrlMiddle, sound_cover)
} }
control_bar.visibility = View.VISIBLE control_bar.visibility = View.VISIBLE
......
...@@ -16,6 +16,9 @@ import com.mints.goodmoney.ui.adapter.listener.OnItemClickListener ...@@ -16,6 +16,9 @@ import com.mints.goodmoney.ui.adapter.listener.OnItemClickListener
class MainMyAdapter(context: Context, taskData: MutableList<MyInfo.AutoListBean>) : RecyclerView.Adapter<RecyclerView.ViewHolder>() { class MainMyAdapter(context: Context, taskData: MutableList<MyInfo.AutoListBean>) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
companion object { companion object {
// 珊瑚CPD下载试玩任务
const val TO_CPD = "TO_CPD"
// 分享文章 // 分享文章
const val TO_SHARE_NEWS = "TO_SHARE_NEWS" const val TO_SHARE_NEWS = "TO_SHARE_NEWS"
......
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.Button
import android.widget.ImageView
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.mints.goodmoney.R
import com.mints.goodmoney.mvp.model.TzTaskBean
import com.mints.goodmoney.ui.adapter.listener.OnItemChildClickListener
import com.mints.goodmoney.ui.adapter.listener.OnItemClickListener
import com.mints.library.utils.GlideUtils
class TaskAdapter(val dataList: List<TzTaskBean>, val context: Context) : RecyclerView.Adapter<TaskAdapter.ViewHolder>() {
private var mCurrentPosition = 0
lateinit var mOnItemClickListener: OnItemClickListener
lateinit var mOnItemChildClickListener: OnItemChildClickListener
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val ivAvatar: ImageView = view.findViewById(R.id.item_iv_avatar)
val tvTitle: TextView = view.findViewById(R.id.item_tv_title)
val tvCoin: TextView = view.findViewById(R.id.item_tv_coin)
val tvText: TextView = view.findViewById(R.id.item_tv_text)
val btnSubmit: Button = view.findViewById(R.id.item_btn_submit)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(context).inflate(R.layout.item_task_recy, parent, false)
return ViewHolder(view)
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val data = dataList[position]
GlideUtils.loadImageView(context, data.icon, holder.ivAvatar)
holder.tvTitle.text = data.title
holder.tvCoin.text = "+" + data.coin + "金币"
when (data.state) {
0 -> holder.btnSubmit.text = "立即下载"
1 -> holder.btnSubmit.text = "去试玩"
2 -> holder.btnSubmit.text = "立即领取"
3 -> holder.btnSubmit.text = "已完成"
}
//当前选中
if (getPosition() == position) {
holder.tvTitle.setTextColor(ContextCompat.getColor(context, R.color.white))
holder.tvCoin.setTextColor(ContextCompat.getColor(context, R.color.white))
holder.tvText.setTextColor(ContextCompat.getColor(context, R.color.white))
holder.itemView.setBackgroundResource(R.drawable.shape_vip_adapter_none)
holder.btnSubmit.setBackgroundResource(R.drawable.shape_my_red)
} else {
holder.tvTitle.setTextColor(ContextCompat.getColor(context, R.color.black))
holder.tvCoin.setTextColor(ContextCompat.getColor(context, R.color.color_FF9837))
holder.tvText.setTextColor(ContextCompat.getColor(context, R.color.gray))
holder.itemView.setBackgroundResource(R.drawable.shape_dialog_bg)
holder.btnSubmit.setBackgroundResource(R.drawable.shape_btn_switch)
}
if (::mOnItemClickListener.isInitialized) {
holder.itemView.setOnClickListener {
setPosition(position)
mOnItemClickListener.onItemClick(it, position)
}
}
if (::mOnItemChildClickListener.isInitialized) {
holder.btnSubmit.setOnClickListener {
setPosition(position)
mOnItemChildClickListener.onItemChildClick(it, position)
}
}
}
fun getPosition() = mCurrentPosition
private fun setPosition(currentPosition: Int) {
this.mCurrentPosition = currentPosition
notifyDataSetChanged()
}
fun setOnItemClickListener(listener: OnItemClickListener) {
mOnItemClickListener = listener
}
fun setOnItemChildClickListener(listener: OnItemChildClickListener) {
mOnItemChildClickListener = listener
}
override fun getItemCount() = dataList.size
}
\ No newline at end of file
...@@ -45,6 +45,8 @@ import kotlinx.android.synthetic.main.layout_red_bag.* ...@@ -45,6 +45,8 @@ import kotlinx.android.synthetic.main.layout_red_bag.*
import kotlinx.android.synthetic.main.layout_red_box.* import kotlinx.android.synthetic.main.layout_red_box.*
import net.grandcentrix.tray.AppPreferences import net.grandcentrix.tray.AppPreferences
private val TAG = MainFragment::class.java.simpleName
/** /**
* 描述:首页 * 描述:首页
* 作者:孟崔广 * 作者:孟崔广
...@@ -52,8 +54,6 @@ import net.grandcentrix.tray.AppPreferences ...@@ -52,8 +54,6 @@ import net.grandcentrix.tray.AppPreferences
*/ */
class MainFragment : BaseFragment(), HomeView, View.OnClickListener { class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
private val TAG = MainFragment::class.java.simpleName
private val homePresenter by lazy { HomePresenter() } private val homePresenter by lazy { HomePresenter() }
private val userManager by lazy { UserManager.getInstance() } private val userManager by lazy { UserManager.getInstance() }
private val ps by lazy { AppPreferences(context) } private val ps by lazy { AppPreferences(context) }
...@@ -105,7 +105,14 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -105,7 +105,14 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
// 打开激活 // 打开激活
uploadDeviceInfo() uploadDeviceInfo()
// 每日任务是否刷新任务数
innerApp()
}
private fun innerApp() {
if (userManager.userIsLogin()) {
TrackManager.getInstance().innerApp()
}
} }
override fun onHiddenChanged(hidden: Boolean) { override fun onHiddenChanged(hidden: Boolean) {
...@@ -485,9 +492,9 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -485,9 +492,9 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
cdvvYilanTime?.setCountDownVedioListener { cdvvYilanTime?.setCountDownVedioListener {
if (isFirstWatchVideo) { if (isFirstWatchVideo) {
// 第一次观看完视频提醒用户 // 第一次观看完视频提醒用户
vs_tips.visibility = View.VISIBLE vs_tips?.visibility = View.VISIBLE
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
vs_tips.visibility = View.GONE vs_tips?.visibility = View.GONE
}, 3000) }, 3000)
isFirstWatchVideo = false isFirstWatchVideo = false
} }
...@@ -622,14 +629,14 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -622,14 +629,14 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
mRedBoxTimer?.setOnCountDownTimerListener(object : OnCountDownTimerListener { mRedBoxTimer?.setOnCountDownTimerListener(object : OnCountDownTimerListener {
override fun onTick(millisUntilFinished: Long) { override fun onTick(millisUntilFinished: Long) {
if (!requireActivity().isFinishing) { if (isAdded && !requireActivity().isFinishing) {
stopRedbox() stopRedbox()
tv_fragment_main_redbox.text = TimeRender.ms2MS(millisUntilFinished.toInt()) tv_fragment_main_redbox.text = TimeRender.ms2MS(millisUntilFinished.toInt())
} }
} }
override fun onFinish() { override fun onFinish() {
if (!requireActivity().isFinishing) { if (isAdded && !requireActivity().isFinishing) {
tv_fragment_main_redbox.text = "可拆开" tv_fragment_main_redbox.text = "可拆开"
rl_fragment_main_redbox.isClickable = true rl_fragment_main_redbox.isClickable = true
showRedbox(rl_fragment_main_redbox) showRedbox(rl_fragment_main_redbox)
......
...@@ -148,7 +148,7 @@ class MyFragment : BaseFragment(), ...@@ -148,7 +148,7 @@ class MyFragment : BaseFragment(),
*/ */
private fun refreshHighTask() { private fun refreshHighTask() {
if (AppConfig.isHighTask && mCurrentPkg != null) { if (AppConfig.isHighTask && mCurrentPkg != null) {
if (AppTryPlayManager.getTryPlayIsOK(mCurrentPkg!!)) { if (AppTryPlayManager.getTryPlayIsOK(mCurrentPkg!!, 30)) {
myPresenter.setHighTaskType("1") myPresenter.setHighTaskType("1")
} else { } else {
val bundle = Bundle() val bundle = Bundle()
...@@ -450,6 +450,20 @@ class MyFragment : BaseFragment(), ...@@ -450,6 +450,20 @@ class MyFragment : BaseFragment(),
R.id.item_task_click -> { R.id.item_task_click -> {
val taskBean = dataList[position] val taskBean = dataList[position]
when (taskBean.baseConfig.taskId) { when (taskBean.baseConfig.taskId) {
// 跳转珊瑚CPD下载试玩任务
MainMyAdapter.TO_CPD -> {
if (!UserManager.getInstance().userIsLogin()) {
readyGo(WxLoginActivity::class.java)
return
}
carrierType = ""
val bundle = Bundle()
bundle.putInt(TaskActivity.TASK_COIN, taskBean.otherConfig.coin)
bundle.putInt(TaskActivity.TASK_USE_TIME, taskBean.otherConfig.needSeconds)
readyGo(TaskActivity::class.java, bundle)
}
// 跳转高额视频 // 跳转高额视频
MainMyAdapter.APP_HiGH_ACTIVITY -> { MainMyAdapter.APP_HiGH_ACTIVITY -> {
if (!UserManager.getInstance().userIsLogin()) { if (!UserManager.getInstance().userIsLogin()) {
......
package com.mints.goodmoney.ui.widgets
import android.app.Dialog
import android.content.Context
import android.view.Gravity
import android.view.WindowManager
import android.widget.ImageView
import android.widget.TextView
import com.mints.goodmoney.R
import com.mints.library.utils.GlideUtils
import com.tz.sdk.coral.ad.CoralAD
import com.tz.sdk.core.ui.ADContainer
/**
* 提示弹框
*/
class TaskDialog(context: Context) :
Dialog(context, R.style.dialog) {
private val lp: WindowManager.LayoutParams
private val tvTitle: TextView
private val tvText1: TextView
private val tvText2: TextView
private val tvInfo: TextView
private val ivAvatar: ImageView
private val textView: TextView
private val adContainer: ADContainer
init {
setContentView(R.layout.dialog_task)
// 设置window属性
lp = window!!.attributes
lp.gravity = Gravity.CENTER
lp.width = WindowManager.LayoutParams.WRAP_CONTENT
lp.windowAnimations = R.style.DialogAnimBottom
window!!.attributes = lp
// 设置外部不可关闭
// setCancelable(false)
// setCanceledOnTouchOutside(false)
// setOnKeyListener { _, i, _ ->
// i == KeyEvent.KEYCODE_BACK
// }
// 查找View
tvTitle = findViewById(R.id.dialog_tv_title)
tvText1 = findViewById(R.id.dialog_tv_text1)
tvText2 = findViewById(R.id.dialog_tv_text2)
ivAvatar = findViewById(R.id.dialog_iv_avatar)
tvInfo = findViewById(R.id.dialog_tv_info)
textView = findViewById(R.id.dialog_btn_download)
adContainer = findViewById(R.id.ad_container)
// tvTitle.setOnClickListener(listener)
// tvInfo.setOnClickListener(listener)
// btnDownload.setOnClickListener(listener)
}
fun setData(data: CoralAD, seconds: Int, coin: Int) {
tvText1.text = "下载并试玩$seconds" + "秒"
tvText2.text = "+$coin" + "金币"
tvTitle.text = data.description
GlideUtils.loadImageView(context, data.icon, ivAvatar)
tvInfo.text = data.title
adContainer.setAdModel(data)
}
}
\ No newline at end of file
...@@ -2,6 +2,7 @@ package com.mints.goodmoney.ui.widgets.countdowntimer; ...@@ -2,6 +2,7 @@ package com.mints.goodmoney.ui.widgets.countdowntimer;
import android.os.CountDownTimer; import android.os.CountDownTimer;
import android.os.Handler; import android.os.Handler;
import android.os.Looper;
import java.util.Timer; import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
...@@ -31,7 +32,7 @@ public class CountDownTimerSupport implements ITimerSupport { ...@@ -31,7 +32,7 @@ public class CountDownTimerSupport implements ITimerSupport {
@Deprecated @Deprecated
public CountDownTimerSupport() { public CountDownTimerSupport() {
this.mHandler = new Handler(); this.mHandler = new Handler(Looper.getMainLooper());
} }
public CountDownTimerSupport(long millisInFuture, long countDownInterval) { public CountDownTimerSupport(long millisInFuture, long countDownInterval) {
......
package com.mints.goodmoney.utils;
import android.content.res.Resources;
import android.graphics.Rect;
import android.view.View;
import androidx.recyclerview.widget.RecyclerView;
public class SpacesItemDecoration extends RecyclerView.ItemDecoration {
private final int column;
private final int space;
public SpacesItemDecoration(int column, int space) {
this.column = column;
this.space = space;
}
@Override
public void getItemOffsets(Rect outRect, View view,
RecyclerView parent, RecyclerView.State state) {
// outRect.left = space;
// outRect.bottom = space;
// if (parent.getChildLayoutPosition(view) % column == 0) {
// outRect.left = 0;
// }
// int pos = parent.getChildAdapterPosition(view);
// int mod = pos % column;
// LogUtil.v("getItemOffsets", "pos:" + pos + ", mod:" + mod + ", space:" + space);
// outRect.left = -space * mod;
outRect.left = space;
outRect.right = space;
outRect.top = space;
if (parent.getChildLayoutPosition(view) % column == 0) {
outRect.right = 0;
}
}
public static int px2dp(float dpValue) {
return (int) (0.5f + dpValue * Resources.getSystem().getDisplayMetrics().density);
}
}
\ No newline at end of file
...@@ -128,4 +128,16 @@ public final class Utils { ...@@ -128,4 +128,16 @@ public final class Utils {
} }
return false; return false;
} }
/**
* 判断Activity是否Destroy
*
* @return
*/
public static boolean isDestroy(Activity activity) {
if (activity == null || activity.isFinishing() || activity.isDestroyed()) {
return true;
} else {
return false;
}
}
} }
...@@ -156,7 +156,12 @@ public abstract class BaseAppFragment extends TransitionFragment { ...@@ -156,7 +156,12 @@ public abstract class BaseAppFragment extends TransitionFragment {
* @param bundle * @param bundle
*/ */
protected void readyGo(Class<?> clazz, Bundle bundle) { protected void readyGo(Class<?> clazz, Bundle bundle) {
Intent intent = new Intent(getActivity(), clazz); Intent intent;
if (getActivity() != null) {
intent = new Intent(getActivity(), clazz);
} else {
intent = new Intent(mContext, clazz);
}
if (null != bundle) { if (null != bundle) {
intent.putExtras(bundle); intent.putExtras(bundle);
} }
...@@ -170,7 +175,13 @@ public abstract class BaseAppFragment extends TransitionFragment { ...@@ -170,7 +175,13 @@ public abstract class BaseAppFragment extends TransitionFragment {
* @param requestCode * @param requestCode
*/ */
protected void readyGoForResult(Class<?> clazz, int requestCode) { protected void readyGoForResult(Class<?> clazz, int requestCode) {
Intent intent = new Intent(getActivity(), clazz); // Intent intent = new Intent(getActivity(), clazz);
Intent intent;
if (getActivity() != null) {
intent = new Intent(getActivity(), clazz);
} else {
intent = new Intent(mContext, clazz);
}
startActivityForResult(intent, requestCode); startActivityForResult(intent, requestCode);
} }
...@@ -182,7 +193,13 @@ public abstract class BaseAppFragment extends TransitionFragment { ...@@ -182,7 +193,13 @@ public abstract class BaseAppFragment extends TransitionFragment {
* @param bundle * @param bundle
*/ */
protected void readyGoForResult(Class<?> clazz, int requestCode, Bundle bundle) { protected void readyGoForResult(Class<?> clazz, int requestCode, Bundle bundle) {
Intent intent = new Intent(getActivity(), clazz); // Intent intent = new Intent(getActivity(), clazz);
Intent intent;
if (getActivity() != null) {
intent = new Intent(getActivity(), clazz);
} else {
intent = new Intent(mContext, clazz);
}
if (null != bundle) { if (null != bundle) {
intent.putExtras(bundle); intent.putExtras(bundle);
} }
......
...@@ -5,6 +5,6 @@ ...@@ -5,6 +5,6 @@
<solid android:color="@color/color_FF2326" /> <solid android:color="@color/color_FF2326" />
<!-- 设置按钮的四个角为弧形 --> <!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 --> <!-- android:radius 弧形的半径 -->
<corners android:radius="14dip" /> <corners android:radius="25dp" />
</shape> </shape>
\ 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:orientation="vertical">
<include layout="@layout/header_layout" />
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/srl_task"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_F8F"
app:srlAccentColor="@color/gray"
app:srlPrimaryColor="@color/color_50E8E8E8">
<com.scwang.smartrefresh.layout.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recy_task"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<com.tz.sdk.core.ui.ADContainer xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ad_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shape_gold_card"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingStart="30dp"
android:paddingTop="30dp"
android:paddingEnd="30dp"
android:paddingBottom="20dp">
<TextView
android:id="@+id/dialog_tv_text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/dialog_tv_text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="@color/color_FF2326"
android:textSize="18sp" />
<LinearLayout
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@drawable/shape_vip_adapter"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="10dp">
<ImageView
android:id="@+id/dialog_iv_avatar"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="10dp" />
<TextView
android:id="@+id/dialog_tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center_horizontal"
android:textColor="@color/black" />
<TextView
android:id="@+id/dialog_tv_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="10dp"
android:gravity="center_horizontal" />
</LinearLayout>
<TextView
android:id="@+id/dialog_btn_download"
android:layout_width="120dp"
android:layout_height="40dp"
android:layout_marginTop="20dp"
android:background="@drawable/shape_btn_switch"
android:gravity="center"
android:text="立即下载"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
</com.tz.sdk.core.ui.ADContainer>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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="wrap_content"
android:background="@drawable/shape_dialog_bg">
<ImageView
android:id="@+id/item_iv_avatar"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:src="@mipmap/ic_launcher_main"
app:layout_constraintEnd_toStartOf="@+id/item_tv_title"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/item_tv_title"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginEnd="10dp"
android:layout_toEndOf="@id/item_iv_avatar"
android:ellipsize="end"
android:gravity="center_vertical"
android:lines="2"
android:maxLines="2"
app:layout_constraintBottom_toBottomOf="@+id/item_iv_avatar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/item_iv_avatar"
app:layout_constraintTop_toTopOf="@+id/item_iv_avatar" />
<TextView
android:id="@+id/item_tv_coin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="+300金币"
android:textColor="@color/color_FF9837"
app:layout_constraintEnd_toStartOf="@+id/item_tv_text"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/item_iv_avatar" />
<TextView
android:id="@+id/item_tv_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/item_iv_avatar"
android:layout_marginStart="5dp"
android:layout_toEndOf="@id/item_tv_coin"
android:text="剩余99+份"
android:textColor="@color/color_ccc"
app:layout_constraintBottom_toBottomOf="@+id/item_tv_coin"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/item_tv_coin"
app:layout_constraintTop_toTopOf="@+id/item_tv_coin" />
<Button
android:id="@+id/item_btn_submit"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/item_tv_coin" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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