Commit 5f85fbc8 authored by jyx's avatar jyx

Merge branch 'master' of http://39.97.65.143:81/android/android_youyou

# Conflicts:
#	app/src/main/java/com/wenshu/youyou/WenshuApplication.java
parents b6a20b29 0d667b6b
...@@ -179,6 +179,8 @@ dependencies { ...@@ -179,6 +179,8 @@ dependencies {
implementation 'com.mindorks.android:prdownloader:0.6.0' implementation 'com.mindorks.android:prdownloader:0.6.0'
// 圆角库 // 圆角库
implementation 'com.github.SheHuan:NiceImageView:1.0.5' implementation 'com.github.SheHuan:NiceImageView:1.0.5'
// 跑马灯
implementation 'com.sunfusheng:marqueeview:1.2.0'
// 工具类 // 工具类
// gson // gson
......
...@@ -129,7 +129,7 @@ public class WenshuApplication extends MultiDexApplication { ...@@ -129,7 +129,7 @@ public class WenshuApplication extends MultiDexApplication {
YlVideoManager.INSTANCE.init(this); YlVideoManager.INSTANCE.init(this);
// 瑞狮新闻 // 瑞狮新闻
RsNewsManager.INSTANCE.initX5Environment(this); RsNewsManager.INSTANCE.init(this);
// 喜马拉雅 // 喜马拉雅
// initXmly(); // initXmly();
......
...@@ -2,6 +2,7 @@ package com.wenshu.youyou.manager ...@@ -2,6 +2,7 @@ package com.wenshu.youyou.manager
import android.app.Application import android.app.Application
import com.tencent.smtt.sdk.QbSdk import com.tencent.smtt.sdk.QbSdk
import com.wenshu.youyou.BuildConfig
import com.xr.xrsdk.XRNewsManager import com.xr.xrsdk.XRNewsManager
/** /**
...@@ -12,18 +13,17 @@ object RsNewsManager { ...@@ -12,18 +13,17 @@ object RsNewsManager {
private const val APP_ID = "" private const val APP_ID = ""
private const val WX_APP_ID = "" private const val WX_APP_ID = ""
private const val APP_ID_TEST = ""
/** /**
* 初始化 * 初始化
*/ */
fun init(application: Application) { fun init(application: Application) {
// XRNewsManager.getInstance()
// .init(application, APP_ID, UserManager.getInstance().userID, WX_APP_ID)
}
fun initX5Environment(application: Application) {
QbSdk.initX5Environment(application, null) QbSdk.initX5Environment(application, null)
// XRNewsManager.getInstance() if (BuildConfig.DEBUG) {
// .init(application, APP_ID, UserManager.getInstance().userID, WX_APP_ID) XRNewsManager.getInstance().init(application, APP_ID_TEST, WX_APP_ID)
} else {
XRNewsManager.getInstance().init(application, APP_ID, WX_APP_ID)
}
} }
} }
package com.wenshu.youyou.mvp.model;
import java.io.Serializable;
public class ClickTurnBean implements Serializable {
/**
* config : {"count":250,"type":"coin","key":"t5","index":5,"title":"250金币"}
* sumCoin : 7580
* coinKey : 2108214495303800003
* turntableKey : 2108214495303800003
*/
private ConfigBean config;
private int sumCoin;
private String coinKey;
private String turntableKey;
public ConfigBean getConfig() {
return config;
}
public void setConfig(ConfigBean config) {
this.config = config;
}
public int getSumCoin() {
return sumCoin;
}
public void setSumCoin(int sumCoin) {
this.sumCoin = sumCoin;
}
public String getCoinKey() {
return coinKey;
}
public void setCoinKey(String coinKey) {
this.coinKey = coinKey;
}
public String getTurntableKey() {
return turntableKey;
}
public void setTurntableKey(String turntableKey) {
this.turntableKey = turntableKey;
}
public class ConfigBean implements Serializable{
/**
* count : 250
* type : coin
* key : t5
* index : 5
* title : 250金币
*/
private int count;
private String type;
private String key;
private int index;
private String title;
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
}
package com.wenshu.youyou.mvp.model;
import java.io.Serializable;
import java.util.List;
public class TurnBean implements Serializable {
/**
* configs : [{"count":150,"type":"coin","key":"t1","index":0,"title":"150金币"},{"count":10,"type":"cash","key":"t2","index":1,"title":"现金10元"},{"count":200,"type":"coin","key":"t8","index":2,"title":"200金币"},{"count":100,"type":"coin","key":"t3","index":3,"title":"100金币"},{"count":300,"type":"coin","key":"t4","index":4,"title":"300金币"},{"count":250,"type":"coin","key":"t5","index":5,"title":"250金币"},{"count":350,"type":"coin","key":"t6","index":6,"title":"350金币"},{"count":40,"type":"cash","key":"t7","index":7,"title":"现金40元"}]
* max : 30
*/
private List<ConfigsBean> configs;
private int max;
private String titleMsg;
private int surplus;
private List<BottomsBean> bottoms;
public List<ConfigsBean> getConfigs() {
return configs;
}
public String getTitleMsg() {
return titleMsg;
}
public void setTitleMsg(String titleMsg) {
this.titleMsg = titleMsg;
}
public int getSurplus() {
return surplus;
}
public void setSurplus(int surplus) {
this.surplus = surplus;
}
public void setConfigs(List<ConfigsBean> configs) {
this.configs = configs;
}
public int getMax() {
return max;
}
public void setMax(int max) {
this.max = max;
}
public List<BottomsBean> getBottoms() {
return bottoms;
}
public void setBottoms(List<BottomsBean> bottoms) {
this.bottoms = bottoms;
}
public class BottomsBean implements Serializable {
/**
* title : 高额赚
* icon : https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg_goodmoney/img/readnews.png
* toOtherKey : 1
* rewardTitle : 抽奖 +1
*/
private String title;
private String icon;
private String toOtherKey;
private String rewardTitle;
private ParamsBean params;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getToOtherKey() {
return toOtherKey;
}
public void setToOtherKey(String toOtherKey) {
this.toOtherKey = toOtherKey;
}
public String getRewardTitle() {
return rewardTitle;
}
public void setRewardTitle(String rewardTitle) {
this.rewardTitle = rewardTitle;
}
public class ParamsBean implements Serializable {
private int max;
private int complete;
private int coin;
public int getMax() {
return max;
}
public int getComplete() {
return complete;
}
public int getCoin() {
return coin;
}
}
}
public class ConfigsBean implements Serializable {
/**
* count : 150
* type : coin
* key : t1
* index : 0
* title : 150金币
*/
private int count;
private String type;
private String key;
private int index;
private String title;
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
}
package com.wenshu.youyou.mvp.presenters
import android.text.TextUtils
import com.google.gson.Gson
import com.google.gson.JsonObject
import com.google.gson.reflect.TypeToken
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.common.DeviceInfo
import com.wenshu.youyou.manager.AppHttpManager
import com.wenshu.youyou.manager.ShumeiManager
import com.wenshu.youyou.manager.UserManager
import com.wenshu.youyou.mvp.model.BaseResponse
import com.wenshu.youyou.mvp.model.ClickTurnBean
import com.wenshu.youyou.mvp.model.TurnBean
import com.wenshu.youyou.mvp.model.UserBean
import com.wenshu.youyou.mvp.views.TurnTableView
import com.wenshu.youyou.utils.DeviceUuidFactory
import com.wenshu.library.net.neterror.BaseSubscriber
import com.wenshu.library.net.neterror.Throwable
import java.util.*
class TurnTablePresenter : BasePresenter<TurnTableView>() {
fun getTurnMsg() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.getTurnMsg(),
object : BaseSubscriber<BaseResponse<TurnBean>>() {
override fun onCompleted() {
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.showToast(e.message)
}
override fun onNext(baseResponse: BaseResponse<TurnBean>) {
if (isLinkView) return
val code = baseResponse.getStatus()
val message = baseResponse.getMessage()
when (code) {
200 -> {
view.getTurnTableSuc(baseResponse.data)
}
else -> view.showToast(message)
}
}
})
}
fun addTurnToOtherMsg(toOtherKey: String) {
val vo = HashMap<String, Any>()
vo["toOther"] = toOtherKey
AppHttpManager.getInstance(loanApplication)
.call(loanService.addTurnToOtherMsg(vo),
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.showToast(e.message)
}
override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return
val code = baseResponse.getStatus()
val message = baseResponse.getMessage()
when (code) {
200 -> {
}
else -> view.showToast(message)
}
}
})
}
fun cashoutLeaders() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.cashoutLeaders(),
object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() {
}
override fun onError(e: Throwable) {
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return
val code = baseResponse.getStatus()
val message = baseResponse.getMessage()
when (code) {
200 -> {
val data = baseResponse.data
if (data.get("list") != null) {
val listArray = Gson().fromJson(data.get("list"),
object : TypeToken<ArrayList<String>>() {}.type) as ArrayList<String>
view.cashoutLeadersSuc(listArray)
}
}
else -> view.showToast(message)
}
}
})
}
fun clickForTurn() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.clickForTurn(),
object : BaseSubscriber<BaseResponse<ClickTurnBean>>() {
override fun onCompleted() {
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.showToast(e.message)
}
override fun onNext(baseResponse: BaseResponse<ClickTurnBean>) {
if (isLinkView) return
val code = baseResponse.getStatus()
val message = baseResponse.getMessage()
when (code) {
200 -> {
view.clickForTurnSuc(baseResponse.data)
}
else -> view.showToast(message)
}
}
})
}
/**
* 游客登录
*/
fun userLogin() {
val vo = HashMap<String, Any>()
vo["device"] = DeviceUuidFactory().deviceUuid.toString()
vo["shumeiId"] = ShumeiManager.getInstance().shumeiDeviceId
AppHttpManager.getInstance(loanApplication)
.call(loanService.visitorlogin(vo),
object : BaseSubscriber<BaseResponse<UserBean>>() {
override fun onCompleted() {
}
override fun onError(e: Throwable) {
}
override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
val code = baseResponse.getStatus()
val message = baseResponse.getMessage()
val data: UserBean? = baseResponse.getData()
when (code) {
200 -> if (data != null) {
UserManager.getInstance().saveUserInfo(data)
saveTerminalInfo()
}
else -> view.showToast(message)
}
}
})
}
/**
* 提交设备信息
*
* @param context
*/
fun saveTerminalInfo() {
val vo = HashMap<String, Any>()
val deviceInfo: DeviceInfo = DeviceInfo.instance
val macAddress: String = deviceInfo.getMacAddress()
val mac = macAddress.replace(":", "")
vo["mac"] = mac
vo["mac1"] = macAddress
vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI
if (!TextUtils.isEmpty(WenshuApplication.OAID)) {
vo["oaid"] = WenshuApplication.OAID
}
vo["os"] = "android"
vo["model"] = deviceInfo.newModel
vo["uuid"] = DeviceUuidFactory().deviceUuid
vo["osversion"] = deviceInfo.oSVersion
vo["appversion"] = deviceInfo.versionName
vo["shumeiId"] = ShumeiManager.getInstance().getShumeiDeviceId()
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(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
val code = baseResponse.status
when (code) {
200 -> {
getTurnMsg()
}
}
}
})
}
}
\ No newline at end of file
package com.wenshu.youyou.mvp.views
import com.wenshu.youyou.mvp.model.ClickTurnBean
import com.wenshu.youyou.mvp.model.TurnBean
interface TurnTableView : BaseView {
fun getTurnTableSuc(data: TurnBean)
fun cashoutLeadersSuc(data:ArrayList<String>)
fun clickForTurnSuc(data: ClickTurnBean)
}
\ No newline at end of file
...@@ -8,6 +8,7 @@ import com.wenshu.youyou.mvp.model.AccountMsgBean; ...@@ -8,6 +8,7 @@ import com.wenshu.youyou.mvp.model.AccountMsgBean;
import com.wenshu.youyou.mvp.model.BannerBean; import com.wenshu.youyou.mvp.model.BannerBean;
import com.wenshu.youyou.mvp.model.BaseResponse; import com.wenshu.youyou.mvp.model.BaseResponse;
import com.wenshu.youyou.mvp.model.CashoutChallengeBean; import com.wenshu.youyou.mvp.model.CashoutChallengeBean;
import com.wenshu.youyou.mvp.model.ClickTurnBean;
import com.wenshu.youyou.mvp.model.CommonParamBean; import com.wenshu.youyou.mvp.model.CommonParamBean;
import com.wenshu.youyou.mvp.model.DrawcashBean; import com.wenshu.youyou.mvp.model.DrawcashBean;
import com.wenshu.youyou.mvp.model.DrawcashRecordBean; import com.wenshu.youyou.mvp.model.DrawcashRecordBean;
...@@ -22,6 +23,7 @@ import com.wenshu.youyou.mvp.model.MyInfo; ...@@ -22,6 +23,7 @@ import com.wenshu.youyou.mvp.model.MyInfo;
import com.wenshu.youyou.mvp.model.ServerAdBean; import com.wenshu.youyou.mvp.model.ServerAdBean;
import com.wenshu.youyou.mvp.model.SignCardBean; import com.wenshu.youyou.mvp.model.SignCardBean;
import com.wenshu.youyou.mvp.model.TaskCpdBean; import com.wenshu.youyou.mvp.model.TaskCpdBean;
import com.wenshu.youyou.mvp.model.TurnBean;
import com.wenshu.youyou.mvp.model.UserBean; import com.wenshu.youyou.mvp.model.UserBean;
import com.wenshu.youyou.mvp.model.UserTaskMsgBean; import com.wenshu.youyou.mvp.model.UserTaskMsgBean;
import com.wenshu.youyou.mvp.model.Version; import com.wenshu.youyou.mvp.model.Version;
...@@ -594,6 +596,38 @@ public interface LoanService { ...@@ -594,6 +596,38 @@ public interface LoanService {
@POST("api/sonCashoutChallengeMsg") @POST("api/sonCashoutChallengeMsg")
Observable<BaseResponse<CashoutChallengeBean>> sonCashoutChallengeMsg(); Observable<BaseResponse<CashoutChallengeBean>> sonCashoutChallengeMsg();
/**
* 获取大转盘信息
*
* @return
*/
@POST("api/turn/getTurnMsg")
Observable<BaseResponse<TurnBean>> getTurnMsg();
/**
* 点击获取转盘信息
*
* @return
*/
@POST("api/turn/clickForTurn")
Observable<BaseResponse<ClickTurnBean>> clickForTurn();
/**
* 提现列表展示
*
* @return
*/
@POST("common/cashoutLeadersForApp")
Observable<BaseResponse<JsonObject>> cashoutLeaders();
/**
* 大转盘点击入口
*
* @return
*/
@POST("api/turn/addTurnToOtherMsg")
Observable<BaseResponse<Object>> addTurnToOtherMsg(@Body Map<String, Object> vo);
/** /**
* 默认http工厂 * 默认http工厂
*/ */
......
...@@ -4,9 +4,9 @@ import android.annotation.SuppressLint ...@@ -4,9 +4,9 @@ import android.annotation.SuppressLint
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import com.wenshu.library.utils.GlideUtils
import com.wenshu.youyou.R import com.wenshu.youyou.R
import com.wenshu.youyou.common.Constant import com.wenshu.youyou.common.Constant
import com.wenshu.youyou.manager.RsNewsManager
import com.wenshu.youyou.mvp.model.AccountMsgBean import com.wenshu.youyou.mvp.model.AccountMsgBean
import com.wenshu.youyou.mvp.presenters.AccountMergePresenter import com.wenshu.youyou.mvp.presenters.AccountMergePresenter
import com.wenshu.youyou.mvp.views.AccountMergeView import com.wenshu.youyou.mvp.views.AccountMergeView
...@@ -14,7 +14,6 @@ import com.wenshu.youyou.ui.activitys.base.BaseActivity ...@@ -14,7 +14,6 @@ import com.wenshu.youyou.ui.activitys.base.BaseActivity
import com.wenshu.youyou.ui.widgets.CustomDialogAsApple import com.wenshu.youyou.ui.widgets.CustomDialogAsApple
import com.wenshu.youyou.ui.widgets.DialogListener import com.wenshu.youyou.ui.widgets.DialogListener
import com.wenshu.youyou.utils.SpanUtils import com.wenshu.youyou.utils.SpanUtils
import com.wenshu.library.utils.GlideUtils
import kotlinx.android.synthetic.main.activity_account_merge.* import kotlinx.android.synthetic.main.activity_account_merge.*
import kotlinx.android.synthetic.main.header_layout.* import kotlinx.android.synthetic.main.header_layout.*
...@@ -144,10 +143,6 @@ class AccountMergeActivity : BaseActivity(), View.OnClickListener, AccountMergeV ...@@ -144,10 +143,6 @@ class AccountMergeActivity : BaseActivity(), View.OnClickListener, AccountMergeV
override fun toKeepAccountSuc() { override fun toKeepAccountSuc() {
showToast("账号合并成功!") showToast("账号合并成功!")
// SceneManager.signIn(this)
RsNewsManager.init(baseApplication)
readyGoThenKill(MainActivity::class.java) readyGoThenKill(MainActivity::class.java)
} }
......
...@@ -30,7 +30,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -30,7 +30,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
// 底部标签切换的Fragment // 底部标签切换的Fragment
private var moneyFragment: Fragment? = null private var moneyFragment: Fragment? = null
private var panFragment: Fragment? = null private var turnTableFragment: Fragment? = null
private var friendsFragment: Fragment? = null private var friendsFragment: Fragment? = null
private var myFragment: Fragment? = null private var myFragment: Fragment? = null
...@@ -239,10 +239,10 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -239,10 +239,10 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
*/ */
private fun clickTab3Layout() { private fun clickTab3Layout() {
AppConfig.fragmentClickFlag = Constant.FRAGMENT_CLICK_THREE AppConfig.fragmentClickFlag = Constant.FRAGMENT_CLICK_THREE
if (panFragment == null) { if (turnTableFragment == null) {
panFragment = PanFragment() turnTableFragment = TurnTableFragment()
} }
addOrShowFragment(supportFragmentManager, panFragment!!, Constant.FRAGMENT_TAG_THREE) addOrShowFragment(supportFragmentManager, turnTableFragment!!, Constant.FRAGMENT_TAG_THREE)
tab_iv_one.isSelected = false tab_iv_one.isSelected = false
tab_tv_one.isSelected = false tab_tv_one.isSelected = false
tab_iv_two.isSelected = false tab_iv_two.isSelected = false
......
...@@ -3,15 +3,16 @@ package com.wenshu.youyou.ui.activitys ...@@ -3,15 +3,16 @@ package com.wenshu.youyou.ui.activitys
import android.Manifest import android.Manifest
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import com.tbruyelle.rxpermissions.RxPermissions
import com.wenshu.library.utils.nodoubleclick.AntiShake
import com.wenshu.youyou.R import com.wenshu.youyou.R
import com.wenshu.youyou.manager.* import com.wenshu.youyou.manager.TrackManager
import com.wenshu.youyou.manager.UserManager
import com.wenshu.youyou.mvp.presenters.LoginPresenter import com.wenshu.youyou.mvp.presenters.LoginPresenter
import com.wenshu.youyou.mvp.views.LoginView import com.wenshu.youyou.mvp.views.LoginView
import com.wenshu.youyou.ui.activitys.base.BaseActivity import com.wenshu.youyou.ui.activitys.base.BaseActivity
import com.wenshu.youyou.utils.BackInputUtil import com.wenshu.youyou.utils.BackInputUtil
import com.wenshu.youyou.utils.LogUtil import com.wenshu.youyou.utils.LogUtil
import com.wenshu.library.utils.nodoubleclick.AntiShake
import com.tbruyelle.rxpermissions.RxPermissions
import kotlinx.android.synthetic.main.activity_bind_mobile.* import kotlinx.android.synthetic.main.activity_bind_mobile.*
import kotlinx.android.synthetic.main.header_layout.* import kotlinx.android.synthetic.main.header_layout.*
...@@ -100,7 +101,6 @@ class MobileLoginActivity : BaseActivity(), LoginView, View.OnClickListener { ...@@ -100,7 +101,6 @@ class MobileLoginActivity : BaseActivity(), LoginView, View.OnClickListener {
TrackManager.getInstance().innerApp() TrackManager.getInstance().innerApp()
// SceneManager.signIn(this) // SceneManager.signIn(this)
RsNewsManager.init(baseApplication)
// false-登录 true-绑定手机号 // false-登录 true-绑定手机号
showToast("登录成功") showToast("登录成功")
......
...@@ -7,6 +7,7 @@ import com.wenshu.youyou.R ...@@ -7,6 +7,7 @@ import com.wenshu.youyou.R
import com.wenshu.youyou.common.Constant import com.wenshu.youyou.common.Constant
import com.wenshu.youyou.ui.activitys.base.BaseActivity import com.wenshu.youyou.ui.activitys.base.BaseActivity
import com.wenshu.youyou.ui.fragment.* import com.wenshu.youyou.ui.fragment.*
import com.wenshu.youyou.ui.widgets.seekbar.BubbleUtils
import kotlinx.android.synthetic.main.activity_wrapper.* import kotlinx.android.synthetic.main.activity_wrapper.*
import kotlinx.android.synthetic.main.header_layout.* import kotlinx.android.synthetic.main.header_layout.*
...@@ -48,6 +49,9 @@ class WrapperActivity : BaseActivity(), View.OnClickListener { ...@@ -48,6 +49,9 @@ class WrapperActivity : BaseActivity(), View.OnClickListener {
var currentFragment: Fragment? = null var currentFragment: Fragment? = null
when (wrapperType) { when (wrapperType) {
Constant.WRAPPER_TYPE_NEWS -> { Constant.WRAPPER_TYPE_NEWS -> {
layoutWrapper.visibility = View.INVISIBLE
val layoutParams = layoutWrapper.layoutParams
layoutParams.height = BubbleUtils.dp2px(30)
tv_title.text = "新闻" tv_title.text = "新闻"
currentFragment = RsNewsFragment() currentFragment = RsNewsFragment()
} }
......
...@@ -9,22 +9,21 @@ import android.view.KeyEvent ...@@ -9,22 +9,21 @@ import android.view.KeyEvent
import android.view.View import android.view.View
import cn.sharesdk.framework.ShareSDK import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat import cn.sharesdk.wechat.friends.Wechat
import com.wenshu.youyou.WenshuApplication import com.tbruyelle.rxpermissions.RxPermissions
import com.wenshu.library.utils.CommonUtils
import com.wenshu.library.utils.json.JsonUtil
import com.wenshu.library.utils.nodoubleclick.AntiShake
import com.wenshu.youyou.R import com.wenshu.youyou.R
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.common.Constant import com.wenshu.youyou.common.Constant
import com.wenshu.youyou.login.LoginApi import com.wenshu.youyou.login.LoginApi
import com.wenshu.youyou.login.OnLoginListener import com.wenshu.youyou.login.OnLoginListener
import com.wenshu.youyou.manager.RsNewsManager
import com.wenshu.youyou.manager.TrackManager import com.wenshu.youyou.manager.TrackManager
import com.wenshu.youyou.mvp.model.WXInfo import com.wenshu.youyou.mvp.model.WXInfo
import com.wenshu.youyou.mvp.presenters.LoginPresenter import com.wenshu.youyou.mvp.presenters.LoginPresenter
import com.wenshu.youyou.mvp.views.LoginView import com.wenshu.youyou.mvp.views.LoginView
import com.wenshu.youyou.ui.activitys.base.BaseActivity import com.wenshu.youyou.ui.activitys.base.BaseActivity
import com.wenshu.youyou.utils.SpanUtils import com.wenshu.youyou.utils.SpanUtils
import com.wenshu.library.utils.CommonUtils
import com.wenshu.library.utils.json.JsonUtil
import com.wenshu.library.utils.nodoubleclick.AntiShake
import com.tbruyelle.rxpermissions.RxPermissions
import kotlinx.android.synthetic.main.activity_wx_login.* import kotlinx.android.synthetic.main.activity_wx_login.*
import java.util.* import java.util.*
...@@ -123,7 +122,6 @@ class WxLoginActivity : BaseActivity() ...@@ -123,7 +122,6 @@ class WxLoginActivity : BaseActivity()
// 每日任务是否刷新任务数 // 每日任务是否刷新任务数
TrackManager.getInstance().innerApp() TrackManager.getInstance().innerApp()
RsNewsManager.init(baseApplication)
showToast("登录成功") showToast("登录成功")
progressDialog?.dismiss() progressDialog?.dismiss()
......
package com.wenshu.youyou.ui.adapter;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.daimajia.androidanimations.library.Techniques;
import com.daimajia.androidanimations.library.YoYo;
import com.wenshu.library.utils.GlideUtils;
import com.wenshu.youyou.R;
import com.wenshu.youyou.mvp.model.TurnBean;
import com.wenshu.youyou.utils.rxutil.CommonRxTask;
import com.wenshu.youyou.utils.rxutil.RxjavaUtil;
import java.util.List;
public class TurnTableAdapter extends BaseAdapter {
private List<TurnBean.BottomsBean> orders;
private Activity activity;
private YoYo.AnimationComposer rope;
public TurnTableAdapter(Activity activity, List<TurnBean.BottomsBean> orders) {
this.orders = orders;
this.activity = activity;
rope = YoYo.with(Techniques.Pulse).duration(1000).repeat(0);
}
@Override
public int getCount() {
return orders == null ? 0 : orders.size();
}
@Override
public Object getItem(int position) {
return orders.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@SuppressLint("WrongViewCast")
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder;
if (convertView == null) {
LayoutInflater inflater = LayoutInflater.from(activity);
convertView = inflater.inflate(R.layout.item_list_turn, null);
viewHolder = new ViewHolder();
viewHolder.ic_turn_icon = convertView.findViewById(R.id.ic_turn_icon);
viewHolder.tv_turn_top = convertView.findViewById(R.id.tv_turn_top);
viewHolder.tv_turn_bottom = convertView.findViewById(R.id.tv_turn_bottom);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
TurnBean.BottomsBean data = orders.get(position);
if (data != null) {
GlideUtils.loadImageView(activity, data.getIcon(), viewHolder.ic_turn_icon);
viewHolder.tv_turn_top.setText(TextUtils.isEmpty(data.getRewardTitle()) ? "" : data.getRewardTitle());
viewHolder.tv_turn_bottom.setText(data.getTitle());
if (!TextUtils.isEmpty(data.getRewardTitle())) {
RxjavaUtil.executeRxTask(new CommonRxTask<String>("") {
@Override
public void doInIOThread() {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
@Override
public void doInUIThread() {
rope.playOn(viewHolder.ic_turn_icon);
}
});
}
}
return convertView;
}
class ViewHolder {
public ImageView ic_turn_icon;
public TextView tv_turn_top;
public TextView tv_turn_bottom;
}
}
...@@ -15,7 +15,6 @@ import com.daimajia.androidanimations.library.YoYo.YoYoString ...@@ -15,7 +15,6 @@ import com.daimajia.androidanimations.library.YoYo.YoYoString
import com.wenshu.youyou.WenshuApplication import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R import com.wenshu.youyou.R
import com.wenshu.youyou.ad.express.PreLoadExpressManager import com.wenshu.youyou.ad.express.PreLoadExpressManager
import com.wenshu.youyou.ad.express.TTPreLoadExpressXmlyManager
import com.wenshu.youyou.ad.video.VideoAdingManager import com.wenshu.youyou.ad.video.VideoAdingManager
import com.wenshu.youyou.common.AppConfig import com.wenshu.youyou.common.AppConfig
import com.wenshu.youyou.common.Constant import com.wenshu.youyou.common.Constant
......
package com.wenshu.youyou.ui.fragment package com.wenshu.youyou.ui.fragment
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.* import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Bundle import android.os.Bundle
import android.text.TextUtils import android.text.TextUtils
import android.view.Gravity import android.view.Gravity
...@@ -12,6 +15,13 @@ import android.widget.GridView ...@@ -12,6 +15,13 @@ import android.widget.GridView
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.DividerItemDecoration
import androidx.viewpager.widget.ViewPager import androidx.viewpager.widget.ViewPager
import com.rd.animation.type.AnimationType
import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import com.wenshu.library.net.netstatus.NetUtils
import com.wenshu.library.utils.CommonUtils
import com.wenshu.library.utils.GlideUtils
import com.wenshu.library.utils.nodoubleclick.AntiShake
import com.wenshu.youyou.BuildConfig import com.wenshu.youyou.BuildConfig
import com.wenshu.youyou.R import com.wenshu.youyou.R
import com.wenshu.youyou.ad.banner.BannerManager import com.wenshu.youyou.ad.banner.BannerManager
...@@ -39,13 +49,6 @@ import com.wenshu.youyou.utils.AppUtil ...@@ -39,13 +49,6 @@ import com.wenshu.youyou.utils.AppUtil
import com.wenshu.youyou.utils.LogUtil import com.wenshu.youyou.utils.LogUtil
import com.wenshu.youyou.utils.QQJumpUtil import com.wenshu.youyou.utils.QQJumpUtil
import com.wenshu.youyou.utils.SpanUtils import com.wenshu.youyou.utils.SpanUtils
import com.wenshu.library.net.netstatus.NetUtils
import com.wenshu.library.utils.CommonUtils
import com.wenshu.library.utils.GlideUtils
import com.wenshu.library.utils.nodoubleclick.AntiShake
import com.rd.animation.type.AnimationType
import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import kotlinx.android.synthetic.main.fragment_main_my.* import kotlinx.android.synthetic.main.fragment_main_my.*
import kotlinx.android.synthetic.main.header_layout.* import kotlinx.android.synthetic.main.header_layout.*
import kotlinx.android.synthetic.main.item_fragment_main_my_clock.* import kotlinx.android.synthetic.main.item_fragment_main_my_clock.*
...@@ -290,8 +293,6 @@ class MyFragment : BaseFragment(), ...@@ -290,8 +293,6 @@ class MyFragment : BaseFragment(),
} }
override fun userLoginSuc() { override fun userLoginSuc() {
RsNewsManager.init(baseApplication)
myPresenter.getAutoUserHallBaseMsg() myPresenter.getAutoUserHallBaseMsg()
myPresenter.getHallBaseMsg() myPresenter.getHallBaseMsg()
} }
......
...@@ -3,6 +3,7 @@ package com.wenshu.youyou.ui.fragment ...@@ -3,6 +3,7 @@ package com.wenshu.youyou.ui.fragment
import android.os.Bundle import android.os.Bundle
import com.wenshu.youyou.R import com.wenshu.youyou.R
import com.wenshu.youyou.common.Constant import com.wenshu.youyou.common.Constant
import com.wenshu.youyou.manager.UserManager
import com.wenshu.youyou.mvp.presenters.RsNewsPresenter import com.wenshu.youyou.mvp.presenters.RsNewsPresenter
import com.wenshu.youyou.mvp.views.RsNewsView import com.wenshu.youyou.mvp.views.RsNewsView
import com.wenshu.youyou.ui.activitys.AwardActivity import com.wenshu.youyou.ui.activitys.AwardActivity
...@@ -25,7 +26,7 @@ class RsNewsFragment : LazyLoadBaseFragment(), RsNewsView, FinishReadNewsCallBac ...@@ -25,7 +26,7 @@ class RsNewsFragment : LazyLoadBaseFragment(), RsNewsView, FinishReadNewsCallBac
override fun onFragmentFirstVisible() { override fun onFragmentFirstVisible() {
rsNewsPresenter.attachView(this) rsNewsPresenter.attachView(this)
// XRNewsManager.getInstance().addNewsFragment(supportFragmentManager, R.id.flMainRsNews, Constant.FRAGMENT_TAG_RSNEWS, this) XRNewsManager.getInstance().addNewsFragment(supportFragmentManager, R.id.flMainRsNews, Constant.FRAGMENT_TAG_RSNEWS, UserManager.getInstance().userID, this)
} }
override fun onDestroy() { override fun onDestroy() {
......
package com.wenshu.youyou.ui.widgets.wheelsruf.listener;
import android.animation.ValueAnimator;
import android.widget.ImageView;
/**
* Created by cretin on 2017/12/27.
* 用于回调动画过程和结果
*/
public interface RotateListener {
/**
* 动画结束 返回当前位置 注意 位置是最上面是1 然后依次逆时针递增
*
* @param position
* @param des 所指分区文字描述
*/
void rotateEnd(int position, String des);
/**
* 动画进行中 返回动画中间量
*
* @param valueAnimator
*/
void rotating(ValueAnimator valueAnimator);
/**
* 点击了按钮 但是没有旋转 调用者可以在这里处理一些逻辑 比如弹出对话框确定用户是否要抽奖
*
* @param goImg
*/
void rotateBefore(ImageView goImg);
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充的颜色 -->
<solid android:color="#50ffffff" />
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners android:radius="10dip" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:wheelSurfView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/bg_turn"
android:overScrollMode="never">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginTop="40dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="6dp"
android:src="@mipmap/ic_voice" />
<com.sunfusheng.marqueeview.MarqueeView
android:id="@+id/marqueeView"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
app:mvAnimDuration="1000"
app:mvInterval="4000"
app:mvSingleLine="true"
app:mvTextColor="@color/color_cb4a39"
app:mvTextSize="15sp" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:src="@mipmap/bg_turn_font" />
<TextView
android:id="@+id/tvHintTurnTable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:textColor="@color/red"
android:textSize="18sp"
tools:text="每日0点重置抽奖次数" />
<com.wenshu.youyou.ui.widgets.wheelsruf.view.WheelSurfView
android:id="@+id/turnTableView"
android:layout_width="330dp"
android:layout_height="330dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
wheelSurfView:typenum="-1" />
<include layout="@layout/layout_turn_btn" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
\ 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="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical">
<TextView
android:id="@+id/tv_turn_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="6dp"
tools:text="抽奖+1"
android:textColor="@color/red"
android:textSize="14sp" />
<ImageView
android:id="@+id/ic_turn_icon"
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_gravity="center_horizontal"
android:scaleType="fitXY"
tools:src="@mipmap/ic_launcher_main" />
<TextView
android:id="@+id/tv_turn_bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
tools:text="搜索赚"
android:textColor="@color/red"
android:textSize="14sp" />
</LinearLayout>
\ 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="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@drawable/shape_turn_btn"
android:elevation="18dp"
android:orientation="vertical"
android:paddingTop="4dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/tvTurnTimes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textColor="@color/black"
android:layout_marginBottom="6dp"
android:textSize="12sp" />
<com.wenshu.youyou.ui.widgets.ExpandableGridView
android:id="@+id/gvTurnTable"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnWidth="80dp"
android:divider="@null"
android:dividerHeight="10pt"
android:elevation="6dip"
android:listSelector="#00000000"
android:numColumns="4"
android:scrollbars="none"
android:stretchMode="spacingWidthUniform" />
<TextView
android:id="@+id/tvTurnMore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:drawableTop="@mipmap/ic_arrow_down"
android:drawablePadding="4dp"
android:text="点击获取更多奖励"
android:textColor="@color/red"
android:textSize="14sp"></TextView>
</LinearLayout>
\ No newline at end of file
...@@ -180,4 +180,31 @@ ...@@ -180,4 +180,31 @@
<attr name="text" format="string" /> <attr name="text" format="string" />
<attr name="radius" format="integer" /> <attr name="radius" format="integer" />
</declare-styleable> </declare-styleable>
<declare-styleable name="wheelSurfView">
<!--类型 根据类型来加载资源 1 默认类型 用户需要提供文字和图片 2 暴力模式 用户只需要提供一张圆形的用来旋转的图片-->
<attr name="type" format="integer"/>
<!--最低圈数 默认值3 也就是说每次旋转都会最少转3圈-->
<attr name="minTimes" format="integer"/>
<!--扇形的数量 也就是奖品的份数-->
<attr name="typenum" format="integer"/>
<!--每一个扇形旋转消耗的时间-->
<attr name="vartime" format="integer"/>
<!--类型为1的时候 需要提供每个扇形上面的文字描述 长度必须和typenum一致-->
<attr name="deses" format="reference"/>
<!--类型为1的时候 需要提供每个扇形上面的图片展示 长度必须和typenum一致-->
<attr name="icons" format="reference"/>
<!--类型为1的时候 需要提供每个扇形背景颜色 长度必须和typenum一致-->
<attr name="colors" format="reference"/>
<!--中间图片的引用 有默认值 不填则使用默认值-->
<attr name="goImg" format="reference"/>
<!--圆环的图片引用 有默认值 不填则使用默认值-->
<attr name="huanImg" format="reference"/>
<!--如果类型为2 此值必填-->
<attr name="mainImg" format="reference"/>
<!--文字大小-->
<attr name="textSize" format="dimension"/>
<!--文字颜色-->
<attr name="textColor" format="reference|color"/>
</declare-styleable>
</resources> </resources>
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<color name="white">#FFFFFF</color> <color name="white">#FFFFFF</color>
<color name="black">#000000</color> <color name="black">#000000</color>
<color name="gray">#808080</color> <color name="gray">#808080</color>
<color name="red">#FF0000</color>
<color name="color_3D5AFE">#3D5AFE</color> <color name="color_3D5AFE">#3D5AFE</color>
<color name="color_cb4a39">#cb4a39</color> <color name="color_cb4a39">#cb4a39</color>
<color name="color_0000FF">#0000FF</color> <color name="color_0000FF">#0000FF</color>
......
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