Commit 3c4cd3a4 authored by jyx's avatar jyx

新版好友邀请页面

parent 92d381f9
......@@ -131,12 +131,12 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.2.1'
// 网络请求
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:retrofit:2.7.1'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
// 异步
implementation "io.reactivex.rxjava2:rxjava:2.2.6"
......@@ -145,16 +145,16 @@ dependencies {
implementation 'com.readystatesoftware.systembartint:systembartint:1.0.3'
implementation 'com.gyf.immersionbar:immersionbar:2.3.3-beta15'
// okhttp3日志
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0'
implementation 'com.squareup.okhttp3:okhttp:3.14.2'
implementation 'com.orhanobut:logger:2.1.1'
implementation 'com.squareup.okhttp3:logging-interceptor:4.0.0'
implementation 'com.squareup.okhttp3:okhttp:4.1.0'
implementation 'com.orhanobut:logger:2.2.0'
// 权限
implementation 'com.tbruyelle.rxpermissions:rxpermissions:0.9.3@aar'
// 图片加载
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
// 65536
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'androidx.multidex:multidex:2.0.1'
// jsbridge
implementation 'com.github.lzyzsd:jsbridge:1.0.4'
//下拉刷新
......@@ -217,23 +217,22 @@ dependencies {
implementation files("libs/qq_x5.jar")
// 鱼丸盒子
implementation(name: 'xzzq_ywsdk_1.1.0', ext: 'aar')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.41"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.0"
implementation 'com.liulishuo.filedownloader:library:1.7.7'
implementation "org.greenrobot:eventbus:3.1.0-RC"
// 掌阅书城
implementation (name: 'iReader-release-1.0.1', ext: 'aar')
implementation(name: 'iReader-release-1.0.1', ext: 'aar')
implementation 'com.alibaba:fastjson:1.2.11'
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'androidx.core:core:1.0.0'
implementation 'androidx.fragment:fragment:1.0.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.core:core:1.3.2'
implementation 'androidx.fragment:fragment:1.2.5'
// 变现猫
implementation(name: 'bxmsdk-release-3.0.0', ext: 'aar')
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
......@@ -38,17 +38,17 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:requestLegacyExternalStorage="true"
android:supportsRtl="true"
android:theme="@style/CustomAppTheme"
android:usesCleartextTraffic="true"
android:requestLegacyExternalStorage="true"
tools:ignore="GoogleAppIndexingWarning">
<!-- 适配小米(xiaomi)刘海屏 -->
<meta-data
android:name="android.max_aspect"
android:value="2.4"
tools:replace="android:value"/>
tools:replace="android:value" />
<meta-data
android:name="android.notch_support"
android:value="true" />
......@@ -121,22 +121,30 @@
android:name=".ui.activitys.AboutusActivity"
android:screenOrientation="portrait" />
<activity android:name=".ui.activitys.GuideActivity" />
<activity android:name=".ui.activitys.LiebaoGameActivity"
android:screenOrientation="portrait"/>
<activity android:name=".ui.activitys.DrawcashActivity"
android:screenOrientation="portrait"/>
<activity android:name=".ui.activitys.WaterActivity"
android:screenOrientation="portrait"/>
<activity android:name=".ui.activitys.WalkActivity"
android:screenOrientation="portrait"/>
<activity android:name=".ui.activitys.EraseActivity"
android:screenOrientation="portrait"/>
<activity android:name=".ui.activitys.DrawcashRecordActivity"
android:screenOrientation="portrait"/>
<activity android:name=".ui.activitys.CoinRecordActivity"
android:screenOrientation="portrait"/>
<activity android:name=".ui.activitys.SplashADActivity"
android:screenOrientation="portrait"/>
<activity
android:name=".ui.activitys.LiebaoGameActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.DrawcashActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.WaterActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.WalkActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.EraseActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.DrawcashRecordActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.CoinRecordActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.SplashADActivity"
android:screenOrientation="portrait" />
<service
android:name=".service.UpdateService"
......@@ -262,6 +270,16 @@
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="landscape" />
<!-- 变现猫 -->
<!-- <provider-->
<!-- android:name="android.support.v4.content.FileProvider"-->
<!-- android:authorities="${applicationId}.fileprovider"-->
<!-- android:exported="false"-->
<!-- android:grantUriPermissions="true">-->
<!-- <meta-data-->
<!-- android:name="android.support.FILE_PROVIDER_PATHS"-->
<!-- android:resource="@xml/new_app_file_paths" />-->
<!-- </provider>-->
</application>
</manifest>
\ No newline at end of file
......@@ -31,9 +31,13 @@ class InitAppService : IntentService("InitializeService") {
* 开启intentService
*/
fun start(context: Context) {
val intent = Intent(context, InitAppService::class.java)
intent.action = ACTION_INIT
context.startService(intent)
try {
val intent = Intent(context, InitAppService::class.java)
intent.action = ACTION_INIT
context.startService(intent)
} catch (e: IllegalStateException) {
e.printStackTrace()
}
}
}
......@@ -101,6 +105,7 @@ class InitAppService : IntentService("InitializeService") {
* 参数5:Push推送业务的secret,需要集成Push功能时必须传入Push的secret,否则传空。
*/
UMConfigure.init(context, CommonUtils.getAppMetaData(MintsApplication.getContext(), "UMENG_KEY"), CommonUtils.getAppMetaData(context, "CHANNEL_NAME"), UMConfigure.DEVICE_TYPE_PHONE, "")
UMConfigure.setLogEnabled(true)
}
/**
......
......@@ -6,7 +6,6 @@ import android.os.Build;
import android.text.TextUtils;
import android.webkit.WebView;
import androidx.annotation.NonNull;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.multidex.MultiDex;
import androidx.multidex.MultiDexApplication;
......@@ -32,8 +31,6 @@ import com.yilan.sdk.ui.configs.CommentConfig;
import com.yilan.sdk.ui.configs.FeedConfig;
import com.yilan.sdk.ui.configs.YLUIConfig;
import org.jetbrains.annotations.NotNull;
import rx.Scheduler;
import rx.schedulers.Schedulers;
......@@ -134,12 +131,7 @@ public class MintsApplication extends MultiDexApplication {
// BxmManager.INSTANCE.initBxm(this);
}
private MiitHelper.AppIdsUpdater appIdsUpdater = new MiitHelper.AppIdsUpdater() {
@Override
public void OnIdsAvalid(@NonNull String ids) {
OAID = ids;
}
};
private MiitHelper.AppIdsUpdater appIdsUpdater = ids -> OAID = ids;
/**
* 移动安装联盟 获取OAID等设备标识符
......@@ -159,12 +151,7 @@ public class MintsApplication extends MultiDexApplication {
*/
private void initOaid() {
try {
new OaidManager(new OaidManager.AppIdsUpdater() {
@Override
public void OnIdsAvalid(@NotNull String ids) {
OAID = ids;
}
}).InitSdk(this);
new OaidManager(ids -> OAID = ids).InitSdk(this);
} catch (Exception e) {
e.printStackTrace();
LogUtil.e(e);
......@@ -252,8 +239,8 @@ public class MintsApplication extends MultiDexApplication {
userID = "0";
}
String appid = "";
String appSecret = "";
String appid;
String appSecret;
if (BuildConfig.DEBUG) {
appid = "1725";
appSecret = "0yzizbqwyjt104gsdukmto53qclo9ljs";
......
package com.mints.goodmoney.mvp.model;
import java.io.Serializable;
import java.util.List;
public class FriendHallMsgBean implements Serializable {
/**
* titleMsg : 6元
* button :
* rate : 1:?
* contribution_yesterday : 0.18
* periods : 第20201113期
* cashMsg : 未达目标,今日加油
* list : [{"id":6,"sid":2031418094401000000,"date":"2020-11-14","level":2,"contribution":0.2,"status":0,"name":"186****1558","head":null}]
* contribution_today : 0.2
* cash : 0
* status : 1
*/
private String titleMsg;
private String button;
private String rate;
private double contribution_yesterday;
private String periods;
private String cashMsg;
private double contribution_today;
private String cash;
private int status;
private List<ListBean> list;
public String getTitleMsg() {
return titleMsg;
}
public void setTitleMsg(String titleMsg) {
this.titleMsg = titleMsg;
}
public String getButton() {
return button;
}
public void setButton(String button) {
this.button = button;
}
public String getRate() {
return rate;
}
public void setRate(String rate) {
this.rate = rate;
}
public double getContribution_yesterday() {
return contribution_yesterday;
}
public void setContribution_yesterday(double contribution_yesterday) {
this.contribution_yesterday = contribution_yesterday;
}
public String getPeriods() {
return periods;
}
public void setPeriods(String periods) {
this.periods = periods;
}
public String getCashMsg() {
return cashMsg;
}
public void setCashMsg(String cashMsg) {
this.cashMsg = cashMsg;
}
public double getContribution_today() {
return contribution_today;
}
public void setContribution_today(double contribution_today) {
this.contribution_today = contribution_today;
}
public String getCash() {
return cash;
}
public void setCash(String cash) {
this.cash = cash;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public List<ListBean> getList() {
return list;
}
public void setList(List<ListBean> list) {
this.list = list;
}
public static class ListBean implements Serializable {
/**
* id : 6
* sid : 2031418094401000000
* date : 2020-11-14
* level : 2
* contribution : 0.2
* status : 0
* name : 186****1558
* head : null
*/
private int id;
private long sid;
private String date;
private int level;
private double contribution;
private int status;
private String name;
private String head = null;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public long getSid() {
return sid;
}
public void setSid(long sid) {
this.sid = sid;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
public double getContribution() {
return contribution;
}
public void setContribution(double contribution) {
this.contribution = contribution;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getHead() {
return head;
}
public void setHead(String head) {
this.head = head;
}
}
}
......@@ -3,7 +3,6 @@ package com.mints.goodmoney.mvp.presenters;
import android.text.TextUtils;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.common.DeviceInfo;
import com.mints.goodmoney.manager.AppHttpManager;
import com.mints.goodmoney.manager.ShumeiManager;
......@@ -16,8 +15,6 @@ import com.mints.goodmoney.utils.DeviceUuidFactory;
import com.mints.library.net.neterror.BaseSubscriber;
import com.mints.library.net.neterror.Throwable;
import net.grandcentrix.tray.AppPreferences;
import java.util.HashMap;
public class DrawcashPresenter extends BasePresenter<DrawcashView> {
......
package com.mints.goodmoney.mvp.presenters
import com.mints.goodmoney.common.Constant
import com.google.gson.JsonObject
import com.mints.goodmoney.manager.AppHttpManager
import com.mints.goodmoney.mvp.model.BaseResponse
import com.mints.goodmoney.mvp.model.FriendsTaskBean
import com.mints.goodmoney.mvp.model.FriendHallMsgBean
import com.mints.goodmoney.mvp.views.FriendsView
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
import java.util.HashMap
class FriendsPresenter : BasePresenter<FriendsView>() {
/**
* 世界人民排名
*/
fun getLeaders() {
// fun getLeaders() {
// AppHttpManager.getInstance(loanApplication)
// .call(loanService.leaders, object : BaseSubscriber<BaseResponse<FriendsTaskBean.FriendsBean>>() {
// override fun onCompleted() {
// if (isLinkView) return
// }
//
// override fun onError(e: Throwable) {
// if (isLinkView) return
// }
//
// override fun onNext(baseResponse: BaseResponse<FriendsTaskBean.FriendsBean>) {
// if (isLinkView) return
// when (baseResponse.status) {
// 200 -> view.getWorldRankSuc(baseResponse.data)
// }
// }
// })
// }
/**
* 好友任务
*/
// fun getFriendsMsg() {
// AppHttpManager.getInstance(loanApplication)
// .call(loanService.friendsMsg, object : BaseSubscriber<BaseResponse<FriendsTaskBean>>() {
// override fun onCompleted() {
// if (isLinkView) return
// }
//
// override fun onError(e: Throwable) {
// if (isLinkView) return
// }
//
// override fun onNext(baseResponse: BaseResponse<FriendsTaskBean>) {
// if (isLinkView) return
// when (baseResponse.status) {
// 200 -> {
// view.getFriendsRankSuc(baseResponse.data)
// }
// }
// }
// })
// }
/**
* 分红奖励信息
*/
fun getFriendHallMsg() {
view.showLoading("加载中...")
AppHttpManager.getInstance(loanApplication)
.call(loanService.leaders, object : BaseSubscriber<BaseResponse<FriendsTaskBean.FriendsBean>>() {
.call(loanService.friendHallMsg(), object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<FriendsTaskBean.FriendsBean>) {
override fun onNext(baseResponse: BaseResponse<FriendHallMsgBean>) {
if (isLinkView) return
view.hideLoading()
when (baseResponse.status) {
200 -> view.getWorldRankSuc(baseResponse.data)
200 -> {
view.getFriendsHallMsgSuc(baseResponse.data)
}
else -> {
view.showToast("网络出小差儿了")
}
}
}
})
}
/**
* 好友任务
* 贡献榜单数据
*/
fun getFriendsMsg() {
fun getContributionLeaders() {
view.showLoading("加载中...")
AppHttpManager.getInstance(loanApplication)
.call(loanService.friendsMsg, object : BaseSubscriber<BaseResponse<FriendsTaskBean>>() {
.call(loanService.contributionLeaders(), object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<FriendsTaskBean>) {
override fun onNext(baseResponse: BaseResponse<FriendHallMsgBean>) {
if (isLinkView) return
view.hideLoading()
when (baseResponse.status) {
200 -> {
view.getFriendsRankSuc(baseResponse.data)
view.getContributionLeadersSuc(baseResponse.data)
}
else -> {
view.showToast(baseResponse.message)
}
}
}
......@@ -60,31 +125,64 @@ class FriendsPresenter : BasePresenter<FriendsView>() {
}
/**
* 设置邀请成功
*
* 贡献榜单数据
*/
fun cmtShareStatus() {
val vo = HashMap<String, Any>()
vo["carrierType"] = Constant.CHALLENGE_SHAREFRIEND
vo["value"] = "1"
fun getContributionOutToCash() {
view.showLoading("加载中...")
AppHttpManager.getInstance(loanApplication)
.call(loanService.setStatusInOneDayByCarrierType(vo), object : BaseSubscriber<BaseResponse<Any>>() {
.call(loanService.contributionOutToCash(), object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<Any>) {
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return
view.hideLoading()
when (baseResponse.status) {
// 200 -> baseMsg()
200 -> {
view.getContributionOutToCashSuc()
}
else -> {
view.showToast(baseResponse.message)
}
}
}
})
}
/**
* 设置邀请成功
*
*/
// fun cmtShareStatus() {
// val vo = HashMap<String, Any>()
// vo["carrierType"] = Constant.CHALLENGE_SHAREFRIEND
// vo["value"] = "1"
// AppHttpManager.getInstance(loanApplication)
// .call(loanService.setStatusInOneDayByCarrierType(vo), object : BaseSubscriber<BaseResponse<Any>>() {
// override fun onCompleted() {
// if (isLinkView) return
// }
//
// override fun onError(e: Throwable) {
// if (isLinkView) return
// }
//
// override fun onNext(baseResponse: BaseResponse<Any>) {
// if (isLinkView) return
// when (baseResponse.status) {
// 200 -> baseMsg()
// }
// }
// })
// }
}
\ No newline at end of file
package com.mints.goodmoney.mvp.views
import com.mints.goodmoney.mvp.model.FriendsTaskBean
import com.mints.goodmoney.mvp.model.FriendHallMsgBean
interface FriendsView : BaseView {
fun getWorldRankSuc(data: FriendsTaskBean.FriendsBean)
// fun getWorldRankSuc(data: FriendsTaskBean.FriendsBean)
//
// fun getFriendsRankSuc(data: FriendsTaskBean)
fun getFriendsRankSuc(data: FriendsTaskBean)
fun getFriendsHallMsgSuc(data: FriendHallMsgBean)
// fun getFriendsHallMsgFail()
fun getContributionLeadersSuc(data: FriendHallMsgBean)
// fun getContributionLeadersFail()
fun getContributionOutToCashSuc()
// fun getContributionOutToCash()
}
......@@ -8,6 +8,7 @@ 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.DrawcashRecordBean;
import com.mints.goodmoney.mvp.model.FriendHallMsgBean;
import com.mints.goodmoney.mvp.model.FriendsTaskBean;
import com.mints.goodmoney.mvp.model.GoldRecordBean;
import com.mints.goodmoney.mvp.model.MainVedioMsgBean;
......@@ -344,6 +345,30 @@ public interface LoanService {
@POST("api/game/baseMsg")
Observable<BaseResponse<JsonObject>> getGameInfo();
/**
* 分红奖励数据
*
* @return
*/
@POST("api/friendHallMsg")
Observable<BaseResponse<FriendHallMsgBean>> friendHallMsg();
/**
* 贡献榜单
*
* @return
*/
@POST("api/contributionLeaders")
Observable<BaseResponse<FriendHallMsgBean>> contributionLeaders();
/**
* 收益榜单
*
* @return
*/
@POST("api/contributionOutToCash")
Observable<BaseResponse<JsonObject>> contributionOutToCash();
/**
* 默认http工厂
......
package com.mints.goodmoney.ui.adapter
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager.widget.PagerAdapter
class FriendsPagerAdapter(recyList: MutableList<RecyclerView>)
: PagerAdapter() {
private val mRecyList: MutableList<RecyclerView> = recyList
override fun getItemPosition(`object`: Any): Int {
// 处理notify方法失效
return POSITION_NONE
}
override fun getCount() = 2
override fun isViewFromObject(view: View, `object`: Any): Boolean {
return view === `object`
}
override fun instantiateItem(container: ViewGroup, position: Int): Any {
val recyclerView = mRecyList[position]
container.addView(mRecyList[position])
return recyclerView
}
override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
container.removeView(`object` as View?)
}
override fun getPageTitle(position: Int): CharSequence? {
return if (position == 0) {
"贡献榜"
} else {
"收益榜"
}
}
}
\ No newline at end of file
......@@ -8,11 +8,11 @@ import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mints.goodmoney.R
import com.mints.goodmoney.mvp.model.FriendsTaskBean
import com.mints.goodmoney.mvp.model.FriendHallMsgBean
import com.mints.goodmoney.ui.adapter.listener.OnItemClickListener
import com.mints.library.utils.GlideUtils
class InvitedAdapter(context: Context, invitedData: MutableList<FriendsTaskBean.FriendsBean.ListBeanX>) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
class InvitedAdapter(context: Context, invitedData: MutableList<FriendHallMsgBean.ListBean>) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
companion object {
const val HOLDER_TYPE_EMPTY = 0
......@@ -20,7 +20,7 @@ class InvitedAdapter(context: Context, invitedData: MutableList<FriendsTaskBean.
}
private var mContext: Context = context
private var invitedData: List<FriendsTaskBean.FriendsBean.ListBeanX> = invitedData
private var invitedData: List<FriendHallMsgBean.ListBean> = invitedData
private var mOnItemClickListener: OnItemClickListener? = null
......@@ -80,13 +80,13 @@ class InvitedAdapter(context: Context, invitedData: MutableList<FriendsTaskBean.
}
val data = invitedData[position]
GlideUtils.loadCircleImageView(mContext, data.head, holder.ivAvatar, R.mipmap.ic_avatar_ph, R.mipmap.ic_avatar_ph)
if (data.nickName != null) {
holder.tvName.text = data.nickName.substring(0, data.nickName.length - 1) + "*"
if (data.name != null) {
holder.tvName.text = data.name.substring(0, data.name.length - 1) + "*"
} else {
holder.tvName.text = data.mobile
holder.tvName.text = data.name
}
holder.tvCoin.text = "" + data.sumCoin
holder.tvCoin.text = "" + data.contribution
holder.itemView.setOnClickListener {
mOnItemClickListener?.onItemClick(holder.itemView, position)
......
......@@ -3,6 +3,7 @@ package com.mints.goodmoney.ui.fragment
import android.os.Bundle
import android.text.TextUtils
import android.view.View
import android.widget.ImageView
import androidx.fragment.app.FragmentTransaction
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.VedioAdingManager
......@@ -17,12 +18,10 @@ import com.mints.goodmoney.mvp.views.HomeView
import com.mints.goodmoney.ui.activitys.AwardActivity
import com.mints.goodmoney.ui.activitys.WebActivity
import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.goodmoney.ui.widgets.CountDownVedioView
import com.mints.goodmoney.ui.widgets.DialogListener
import com.mints.goodmoney.ui.widgets.PowerDialog
import com.mints.goodmoney.utils.LogUtil
import com.mints.library.utils.json.JsonUtil
import com.yilan.sdk.player.UserCallback
import com.yilan.sdk.ui.littlevideo.LittleVideoFragment
import kotlinx.android.synthetic.main.fragment_main_first.*
import net.grandcentrix.tray.AppPreferences
......@@ -54,6 +53,9 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
// 广告权重相关
private var vedioAdingManager: VedioAdingManager? = null
// 是否是第一次观看完视频
private var isFristWacthVideo = true
override fun getContentViewLayoutID() = R.layout.fragment_main_first
override fun initViewsAndEvents() {
......@@ -89,7 +91,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
override fun onResume() {
super.onResume()
if (AppConfig.fragmentClickFlag === Constant.FRAGMENT_CLICK_MAIN) {
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_MAIN) {
// 打开激活
uploadDeviceInfo()
......@@ -135,7 +137,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
override fun getHallBaseMsgSuc(data: UserTaskMsgBean) {
if (activity == null || activity!!.isFinishing) {
if (activity == null || requireActivity().isFinishing) {
return
}
......@@ -176,7 +178,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
override fun getHomeVedioMsgSuc(data: MainVedioMsgBean) {
if (activity == null || activity!!.isFinishing) {
if (activity == null || requireActivity().isFinishing) {
return
}
......@@ -231,7 +233,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
littleVideoFragment = LittleVideoFragment.newInstance()
transaction.add(R.id.yilan_fragment_frame_container, littleVideoFragment!!, LittleVideoFragment::class.java.simpleName)
// 设置点击的item播放状态,callback返回true标识用户已经处理了event,返回false,标识使用播放器内部逻辑处理event。
littleVideoFragment!!.setUserCallBack(UserCallback { type, data, playerHash -> //播放状态 type
littleVideoFragment!!.setUserCallBack { type, data, _ -> //播放状态 type
//播放的数据,可能为null data
//哪个播放器ß playerHash
when (type) {
......@@ -264,7 +266,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
}
false
})
}
} else {
transaction.show(littleVideoFragment!!)
}
......@@ -300,8 +302,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
*/
private fun resumeDownloadTime(id: String) {
if (!TextUtils.isEmpty(id)) {
// LogUtil.d(TAG, "resumeDownloadTime cur id:" + id)
// LogUtil.d(TAG, "resumeDownloadTime ListItem:" + JsonUtil.toJson(vedioIdList))
LogUtil.d(TAG, "resumeDownloadTime cur id:$id")
LogUtil.d(TAG, "resumeDownloadTime ListItem:" + JsonUtil.toJson(vedioIdList))
if (vedioIdList.contains(id)) {
cdvvYilanTime?.pause()
return
......@@ -327,15 +329,23 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
* 红包倒计时初始化
*/
private fun initTimeview() {
cdvvYilanTime.setCountDownVedioListener(object : CountDownVedioView.CountDownVedioListener {
override fun finish() {
cdvvYilanTime?.showRedbox()
stopDownloadTime()
homePresenter.requestAddHomeVedioReward()
cdvvYilanTime.setCountDownVedioListener {
if (isFristWacthVideo) {
val vs = vs_tips.inflate()
val ivTipsClose = vs.findViewById<ImageView>(R.id.iv_tips_close)
ivTipsClose.setOnClickListener {
vs.visibility = View.GONE
}
isFristWacthVideo = false
}
})
var vedioTime = 60
cdvvYilanTime?.showRedbox()
stopDownloadTime()
homePresenter.requestAddHomeVedioReward()
}
val vedioTime = 60
cdvvYilanTime.setTime(vedioTime)
cdvvYilanTime.start()
}
......@@ -360,15 +370,15 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
readyGo(WebActivity::class.java, bundle)
}
R.id.btn_dialogper_back -> {
if (activity != null && !activity!!.isFinishing() &&
powerDialog != null && powerDialog!!.isShowing()
if (activity != null && !activity!!.isFinishing &&
powerDialog != null && powerDialog!!.isShowing
) {
showToast("请您同意授权,否则将无法使用APP功能")
}
}
R.id.btn_dialogper_next -> {
if (activity != null && !activity!!.isFinishing() &&
powerDialog != null && powerDialog!!.isShowing()
if (activity != null && !activity!!.isFinishing &&
powerDialog != null && powerDialog!!.isShowing
) {
powerDialog!!.dismiss()
ps.put(Constant.LOAN_PERMISSION_FLAG, false)
......
......@@ -8,7 +8,6 @@ import android.content.Context
import android.os.Bundle
import android.text.TextUtils
import android.view.View
import android.view.ViewGroup
import android.widget.AdapterView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DividerItemDecoration
......@@ -22,7 +21,6 @@ import com.mints.goodmoney.R
import com.mints.goodmoney.ad.VedioAdingManager
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.BxmManager
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.*
import com.mints.goodmoney.mvp.presenters.MyPresenter
......@@ -32,7 +30,6 @@ import com.mints.goodmoney.ui.adapter.GvMyAdapter
import com.mints.goodmoney.ui.adapter.MainMyAdapter
import com.mints.goodmoney.ui.adapter.listener.OnItemChildClickListener
import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.goodmoney.utils.ForegroundOrBackground
import com.mints.goodmoney.utils.ImageUtil
import com.mints.goodmoney.utils.SpanUtils
import com.mints.library.net.netstatus.NetUtils
......@@ -177,14 +174,14 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
}
override fun getMyHotActivitySuc(data: BannerBean?) {
if (activity != null && !activity!!.isFinishing) {
if (activity != null && !requireActivity().isFinishing) {
// item_promotions_egv.visibility = View.GONE
if (!bannerFlag) {
bannerFlag = true
data?.let {
item_promotions_egv.visibility = View.VISIBLE
hotList = it.list
item_promotions_egv.adapter = GvMyAdapter(mContext, activity!!, hotList)
item_promotions_egv.adapter = GvMyAdapter(mContext, requireActivity(), hotList)
}
}
}
......@@ -308,7 +305,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
val finalSignStatus = signStatus
item_clock_signview.setSignViewListener { day ->
if (nowDate == day) {
RxPermissions(activity!!)
RxPermissions(requireActivity())
.request(Manifest.permission.READ_PHONE_STATE, Manifest.permission.READ_EXTERNAL_STORAGE)
.subscribe { granted: Boolean ->
if (granted) {
......@@ -462,7 +459,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
wechatSp.shareType = Platform.SHARE_WEBPAGE
wechatSp.title = Constant.SHARE_TITLE
wechatSp.text = Constant.SHARE_CONTENT
wechatSp.imageData = ImageUtil.drawableToBitmap(ContextCompat.getDrawable(context!!, R.mipmap.ic_launcher))
wechatSp.imageData = ImageUtil.drawableToBitmap(ContextCompat.getDrawable(requireContext(), R.mipmap.ic_launcher))
wechatSp.url = Constant.SHARE_URL
val wechat = ShareSDK.getPlatform(Wechat.NAME)
if (wechat.isClientValid) {
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/color_FFC7C7" />
<corners android:radius="100dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="10dp" />
<solid android:color="@color/white_transparent" />
</shape>
\ No newline at end of file
......@@ -12,14 +12,22 @@
</RelativeLayout>
<FrameLayout
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="8dp"
android:layout_alignParentBottom="true">
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="8dp"
android:orientation="horizontal">
<ViewStub
android:id="@+id/vs_tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout="@layout/layout_watchvideo_tips" />
<LinearLayout
android:layout_marginTop="30dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
......@@ -27,11 +35,11 @@
<ImageView
android:id="@+id/ivMainBox"
android:layout_width="wrap_content"
android:visibility="gone"
android:layout_gravity="center_horizontal"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="20dp"
android:src="@mipmap/ic_main_box" />
android:src="@mipmap/ic_main_box"
android:visibility="gone" />
<com.mints.goodmoney.ui.widgets.CountDownVedioView
android:id="@+id/cdvvYilanTime"
......@@ -39,5 +47,5 @@
android:layout_height="wrap_content"
android:layout_marginBottom="245dp" />
</LinearLayout>
</FrameLayout>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/recy_friends"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_tips"
android:orientation="vertical"
android:padding="2dp">
<ImageView
android:id="@+id/iv_tips_close"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@mipmap/ic_close" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:text="点击红包可以领取金币哦~"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
\ No newline at end of file
......@@ -124,4 +124,12 @@
<color name="color_00895B">#00895B</color>
<color name="color_8F6D21">#8F6D21</color>
<color name="color_FFDD0C">#FFDD0C</color>
<color name="color_CF7E7E">#CF7E7E</color>
<color name="color_FF4A4A">#FF4A4A</color>
<color name="color_AF6F36">#AF6F36</color>
<color name="color_912C36">#912C36</color>
<color name="color_E72C2B">#E72C2B</color>
<color name="color_FFC7C7">#FFC7C7</color>
<color name="color_FF7C00">#FF7C00</color>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">好赚钱</string>
<string name="dot">--</string>
<string name="netfail">网络异常,请检查网络</string>
<string name="notifyTitle">提示</string>
<string name="notifyMsg">当前应用缺少必要权限。\n\n请点击\"设置\"-\"权限\"-打开所需权限。</string>
......
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