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)
......
package com.mints.goodmoney.ui.fragment
import android.graphics.Typeface
import android.os.Bundle
import android.text.TextUtils
import android.view.View
import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager.widget.ViewPager
import cn.sharesdk.framework.Platform
import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat
import com.mints.goodmoney.R
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.FriendsTaskBean
import com.mints.goodmoney.mvp.model.FriendHallMsgBean
import com.mints.goodmoney.mvp.presenters.FriendsPresenter
import com.mints.goodmoney.mvp.views.FriendsView
import com.mints.goodmoney.ui.activitys.AwardActivity
import com.mints.goodmoney.ui.adapter.BannerBaseAdapter
import com.mints.goodmoney.ui.adapter.BannerTaskAdapter
import com.mints.goodmoney.ui.adapter.FriendsPagerAdapter
import com.mints.goodmoney.ui.adapter.InvitedAdapter
import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.goodmoney.ui.widgets.tablayout.TabLayout
import com.mints.goodmoney.utils.ImageUtil
import com.mints.goodmoney.utils.SpanUtils
import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import kotlinx.android.synthetic.main.banner_view.*
import kotlinx.android.synthetic.main.fragment_main_friends.*
import kotlinx.android.synthetic.main.header_layout.*
......@@ -35,16 +27,23 @@ import kotlinx.android.synthetic.main.header_layout.*
* 作者:孟崔广
* 时间:2020/9/20 17:30
*/
class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener {
class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnClickListener {
private val friendsPresenter by lazy { FriendsPresenter() }
private val userManager by lazy { UserManager.getInstance() }
private var bvTaskData: MutableList<FriendsTaskBean.ChallengeBean.ListBean> = mutableListOf()
private var invitedData: MutableList<FriendsTaskBean.FriendsBean.ListBeanX> = mutableListOf()
private var bannerTaskAdapter: BannerTaskAdapter? = null
private var invitedAdapter: InvitedAdapter? = null
private var viewPagerAdapter: FriendsPagerAdapter? = null
private var friendsData: MutableList<FriendHallMsgBean.ListBean> = mutableListOf()
private var worldData: MutableList<FriendHallMsgBean.ListBean> = mutableListOf()
private val recyList: MutableList<RecyclerView> = mutableListOf()
private var friendsAdapter: InvitedAdapter? = null
private var worldAdapter: InvitedAdapter? = null
private var mFriendsHallMsgBean: FriendHallMsgBean? = null
override fun getContentViewLayoutID() = R.layout.fragment_main_friends
......@@ -54,95 +53,58 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener {
initView()
initRecy()
initBanner()
friendsPresenter.getFriendsMsg()
friendsPresenter.getFriendHallMsg()
}
private fun initView() {
tv_title.text = "邀请好友"
view_title1.findViewById<TextView>(R.id.view_title).text = "邀好友 做任务 赚现金"
img_invite.setOnClickListener {
invitedFriends()
}
tv_right_subtitle.visibility = View.VISIBLE
tv_right_subtitle.text = "玩法规则"
tv_right_subtitle.setTextColor(resources.getColor(R.color.main_bg_text))
tv_right_subtitle.setOnClickListener { }
tv_title.text = "分红福利"
iv_question.setOnClickListener(this)
btn_get_bonus.setOnClickListener(this)
tv_right_subtitle.setOnClickListener(this)
}
private fun initRecy() {
tab_friends.addTab(tab_friends.newTab().setText("我的好友").setTag("my_friends"))
tab_friends.addTab(tab_friends.newTab().setText("世界人民").setTag("world_person"))
tab_friends.setOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabReselected(tab: TabLayout.Tab) {}
override fun onTabUnselected(tab: TabLayout.Tab) {
val title =
((tab_friends.getChildAt(0) as LinearLayout).getChildAt(tab.position) as LinearLayout).getChildAt(
1
) as TextView
title.apply {
// setTextAppearance(context, R.style.TabLayoutTextSize)
typeface = Typeface.defaultFromStyle(Typeface.NORMAL)
}
}
val recyFriends = View.inflate(mContext, R.layout.item_friends_recy, null) as RecyclerView
val recyWorld = View.inflate(mContext, R.layout.item_friends_recy, null) as RecyclerView
recyFriends.addItemDecoration(DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL))
recyWorld.addItemDecoration(DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL))
override fun onTabSelected(tab: TabLayout.Tab) {
val title =
((tab_friends.getChildAt(0) as LinearLayout).getChildAt(tab.position) as LinearLayout).getChildAt(
1
) as TextView
title.apply {
// setTextAppearance(context, R.style.BigTabLayoutTextStyle)
typeface = Typeface.defaultFromStyle(Typeface.BOLD)
}
friendsAdapter = InvitedAdapter(mContext, friendsData)
worldAdapter = InvitedAdapter(mContext, worldData)
tab.let {
if (it.tag == "my_friends") {
friendsPresenter.getFriendsMsg()
} else {
friendsPresenter.getLeaders()
}
}
}
recyFriends.adapter = friendsAdapter
recyWorld.adapter = worldAdapter
})
recyList.add(recyFriends)
recyList.add(recyWorld)
recy_friends.addItemDecoration(DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL))
invitedAdapter = InvitedAdapter(mContext, invitedData)
recy_friends.adapter = invitedAdapter
}
viewPagerAdapter = FriendsPagerAdapter(recyList)
view_pager_friends.adapter = viewPagerAdapter
view_pager_friends.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
}
private fun initBanner() {
bannerTaskAdapter = BannerTaskAdapter(mContext)
bannerTaskAdapter?.setOnPageTouchListener(object : BannerBaseAdapter.OnPageTouchListener<FriendsTaskBean.ChallengeBean.ListBean> {
override fun onPageClick(position: Int, t: FriendsTaskBean.ChallengeBean.ListBean) {
if (t.status == 0) {
invitedFriends()
override fun onPageSelected(position: Int) {
if (position == 1) {
friendsPresenter.getContributionLeaders()
} else {
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, t.rewardCoin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, t.carrierType)
readyGo(AwardActivity::class.java, bundle)
friendsPresenter.getFriendHallMsg()
}
}
override fun onPageDown() {}
override fun onPageUp() {}
})
// 滚动到边缘无阴影
bv_friends_task.viewPager.overScrollMode = View.OVER_SCROLL_NEVER
pageIndicatorView.setViewPager(bv_friends_task.viewPager)
bv_friends_task.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {}
override fun onPageSelected(position: Int) {
pageIndicatorView.selection = position
override fun onPageScrollStateChanged(state: Int) {
}
override fun onPageScrollStateChanged(state: Int) {}
})
bv_friends_task.setAdapter(bannerTaskAdapter)
tab_friends.setupWithViewPager(view_pager_friends)
}
override fun onHiddenChanged(hidden: Boolean) {
......@@ -157,15 +119,16 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener {
override fun onResume() {
super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FRIENDS) {
// if (!TextUtils.isEmpty(userManager?.userID)) {
// friendsPresenter.getFriendsMsg()
// }
if (!TextUtils.isEmpty(userManager?.userID)) {
if (view_pager_friends.currentItem == 0) {
friendsPresenter.getFriendHallMsg()
} else {
friendsPresenter.getContributionLeaders()
}
}
}
// bv_friends_task.startAutoScroll()
}
override fun onDestroy() {
super.onDestroy()
friendsPresenter.detachView()
......@@ -173,63 +136,95 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener {
override fun onRefresh(refreshLayout: RefreshLayout) {
if (userManager.userID.isNotEmpty()) {
friendsPresenter.getFriendsMsg()
if (view_pager_friends.currentItem == 0) {
friendsPresenter.getFriendHallMsg()
} else {
friendsPresenter.getContributionLeaders()
}
// view_pager_friends.currentItem = 0
}
}
private fun invitedFriends() {
val wechat = ShareSDK.getPlatform(Wechat.NAME)
if (wechat.isClientValid) {
private fun generateData(data: FriendHallMsgBean) {
if (data.button != null) {
btn_get_bonus.text = data.button
}
tv_bonus_date.text = "分红福利奖池-" + data.periods
tv_bonus_sum.text = SpanUtils()
.append("预计总分红 ").setFontSize(32).setForegroundColor(resources.getColor(R.color.black))
.append(data.titleMsg).setFontSize(52).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append(" 元").setFontSize(32).setForegroundColor(resources.getColor(R.color.black))
.create()
tv_yesterday_bonus.text = SpanUtils()
.append(data.contribution_yesterday.toString()).setForegroundColor(resources.getColor(R.color.color_FF7C00))
.create()
tv_today_bonus.text = SpanUtils()
.append(data.contribution_today.toString()).setForegroundColor(resources.getColor(R.color.color_FF7C00))
.create()
tv_bonus_money.text = SpanUtils()
.append(data.cash.toString()).setFontSize(50).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append("元").setFontSize(30).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.create()
tv_bonus_rate.text = SpanUtils()
.append("昨日汇率:").setFontSize(32).setForegroundColor(resources.getColor(R.color.black))
.append(data.rate).setFontSize(32).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.create()
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.iv_question -> {
// 收益提示
val wechatSp = Platform.ShareParams()
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.url = Constant.SHARE_URL
}
R.id.tv_right_subtitle -> {
// 玩法规则
// 执行图文分享
wechat.share(wechatSp)
}
R.id.btn_get_bonus -> {
// 领取收益
mFriendsHallMsgBean?.let {
if (it.cash.toInt() > 0 && it.status == 0) {
// 去提现
friendsPresenter.getContributionOutToCash()
} else {
showToast("您的贡献值未达到提现要求")
}
}
} else {
showToast("请先安装微信")
}
}
}
override fun getWorldRankSuc(data: FriendsTaskBean.FriendsBean) {
override fun getFriendsHallMsgSuc(data: FriendHallMsgBean) {
srl_my.finishRefresh(true)
invitedData.clear()
invitedData.addAll(data.list)
invitedAdapter?.notifyDataSetChanged()
}
mFriendsHallMsgBean = data
override fun getFriendsRankSuc(data: FriendsTaskBean) {
srl_my.finishRefresh(true)
friendsData.clear()
friendsData.addAll(data.list)
friendsAdapter?.notifyDataSetChanged()
bvTaskData = data.challenge.list
bannerTaskAdapter?.setData(bvTaskData)
generateData(data)
}
pageIndicatorView.count = bvTaskData.size
override fun getContributionLeadersSuc(data: FriendHallMsgBean) {
srl_my.finishRefresh(true)
// 跳转当前完成的页面
var currentPosition = 0
for (i in 0 until bvTaskData.size) {
if (i == bvTaskData.size - 1 && bvTaskData[i].status == 1) {
currentPosition = i
}
if (bvTaskData[i].status == 1 && i + 1 < bvTaskData.size && bvTaskData[i + 1].status == 0) {
currentPosition = i
break
}
}
bv_friends_task.setCurrentIndex(currentPosition)
worldData.clear()
worldData.addAll(data.list)
worldAdapter?.notifyDataSetChanged()
}
if (tab_friends.selectedTabPosition == 0) {
invitedData.clear()
invitedData.addAll(data.friends.list)
invitedAdapter?.notifyDataSetChanged()
}
// 提现成功
override fun getContributionOutToCashSuc() {
showToast("提现成功")
}
}
\ No newline at end of file
......@@ -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"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:attrs="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
......@@ -32,92 +31,242 @@
android:id="@+id/collapsingToolbarLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed">
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@mipmap/bg_invite_friends" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
android:id="@+id/view_title1"
layout="@layout/view_title" />
<com.mints.goodmoney.ui.widgets.BannerView
android:id="@+id/bv_friends_task"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginTop="10dp"
app:bannerAnimDuration="1500"
app:bannerAnimScroll="false"
app:bannerAutoScroll="false"
app:bannerPageAlpha="0"
app:bannerPageMargin="8dp"
app:bannerPagePercent="0.9"
app:bannerPageScale="1"
app:bannerScrollDuration="4000" />
<com.rd.PageIndicatorView
android:id="@+id/pageIndicatorView"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/img_invite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@mipmap/bg_invite_friends" />
<ImageView
android:id="@+id/img_yellow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/img_invite"
android:layout_centerHorizontal="true"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="-50dp"
android:scaleType="fitXY"
android:src="@mipmap/bg_invite_friends_yellow" />
<ImageView
android:id="@+id/img_red"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/img_yellow"
android:layout_centerHorizontal="true"
android:scaleType="centerCrop"
android:src="@mipmap/bg_invite_friends_red" />
<TextView
android:id="@+id/tv_bonus_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/img_yellow"
android:layout_centerHorizontal="true"
android:layout_marginTop="4dp"
android:text="@string/dot"
android:textColor="@color/white" />
<TextView
android:id="@+id/tv_bonus_sum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/img_red"
android:layout_centerHorizontal="true"
android:layout_marginTop="12dp"
android:text="@string/dot" />
</RelativeLayout>
<TextView
android:id="@+id/tv_bonus_rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
app:piv_animationType="worm"
app:piv_dynamicCount="true"
app:piv_interactiveAnimation="true"
app:piv_selectedColor="@color/main_mints"
app:piv_unselectedColor="@color/ban_transparent"
app:piv_viewPager="@id/bv_friends_task"
attrs:piv_padding="10dp"
attrs:piv_radius="8dp" />
<include layout="@layout/item_divider_gray" />
<ImageView
android:id="@+id/img_invite"
android:layout_marginStart="20dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:text="@string/dot" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:scaleType="centerCrop"
android:src="@mipmap/bg_friends" />
android:layout_gravity="center_horizontal"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:layout_weight="1"
android:background="@mipmap/bg_invite_friends_left"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="6dp"
android:gravity="center"
android:text="昨日贡献值"
android:textColor="@color/color_AF6F36"
android:textSize="12sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center"
android:text="今日贡献值"
android:textColor="@color/color_912C36"
android:textSize="12sp" />
</LinearLayout>
<include layout="@layout/item_divider_gray" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tv_yesterday_bonus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/dot"
android:textSize="20sp" />
<TextView
android:id="@+id/tv_today_bonus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/dot"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_weight="1"
android:background="@mipmap/bg_invite_friends_right">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="15dp"
android:text="分红收益"
android:textColor="@color/color_CF7E7E" />
<TextView
android:id="@+id/tv_bonus_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="40dp"
android:text="@string/dot" />
<Button
android:id="@+id/btn_get_bonus"
android:layout_width="50dp"
android:layout_height="28dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginStart="20dp"
android:layout_marginEnd="5dp"
android:background="@drawable/shape_btn_friends"
android:text="提现"
android:textColor="@color/color_E72C2B"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="20dp"
android:background="@color/my_color_gray3" />
</LinearLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout>
<com.mints.goodmoney.ui.widgets.tablayout.TabLayout
android:id="@+id/tab_friends"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_gravity="center_horizontal"
app:indicatorEndColor="#e73820"
app:indicatorMarginEnd="24dp"
app:indicatorMarginStart="24dp"
app:indicatorStartColor="#d6694e"
app:tabIndicatorHeight="4dp"
app:tabMode="scrollable"
app:tabSelectedTextColor="@color/my_color_orange"
app:tabTextAppearance="@style/TabLayoutTextSize"
app:tabTextColor="@color/main_bg_text" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.androidkun.xtablayout.XTabLayout
android:id="@+id/tab_friends"
android:layout_width="220dp"
android:layout_height="50dp"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
app:xTabDisplayNum="2"
app:xTabIndicatorColor="#FB560C"
app:xTabIndicatorHeight="3dp"
app:xTabIndicatorWidth="30dp"
app:xTabMode="fixed"
app:xTabSelectedTextColor="#FB560C"
app:xTabSelectedTextSize="18sp"
app:xTabTextColor="#666666"
app:xTabTextSize="15sp" />
<ImageView
android:id="@+id/iv_question"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/tab_friends"
android:src="@mipmap/ic_question" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/my_color_gray" />
android:background="@color/my_color_gray3" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recy_friends"
<androidx.viewpager.widget.ViewPager
android:id="@+id/view_pager_friends"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:overScrollMode="never"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
......
<?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