Commit d6f4d297 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 82b81677
...@@ -45,6 +45,33 @@ public class TrackPresenter extends BaseTrackPresenter { ...@@ -45,6 +45,33 @@ public class TrackPresenter extends BaseTrackPresenter {
}); });
} }
public void getMyInfo() {
HashMap<String, Object> vo = new HashMap<>();
vo.put("os", "android");
AppHttpManager.getInstance(loanApplication)
.call(loanService.getMyInfo(vo),
new BaseSubscriber<BaseResponse<UserBean>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(BaseResponse<UserBean> baseResponse) {
switch (baseResponse.getStatus()) {
case 200: {
UserManager.getInstance().saveUserInfo(baseResponse.getData());
}
}
}
});
}
public void saveTerminalInfo() { public void saveTerminalInfo() {
HashMap<String, Object> vo = new HashMap<>(); HashMap<String, Object> vo = new HashMap<>();
DeviceInfo deviceInfo = DeviceInfo.Companion.getInstance(); DeviceInfo deviceInfo = DeviceInfo.Companion.getInstance();
...@@ -69,10 +96,17 @@ public class TrackPresenter extends BaseTrackPresenter { ...@@ -69,10 +96,17 @@ public class TrackPresenter extends BaseTrackPresenter {
@Override @Override
public void onError(Throwable e) { public void onError(Throwable e) {
} }
@Override @Override
public void onNext(BaseResponse<Object> baseResponse) { public void onNext(BaseResponse<Object> baseResponse) {
switch (baseResponse.getStatus()) {
case 200: {
getMyInfo();
}
}
} }
}); });
} }
......
...@@ -100,7 +100,8 @@ public class OkHttpInterceptor implements Interceptor { ...@@ -100,7 +100,8 @@ public class OkHttpInterceptor implements Interceptor {
return request.newBuilder(). return request.newBuilder().
addHeader("version", DeviceInfo.Companion.getInstance().getVersionName()). addHeader("version", DeviceInfo.Companion.getInstance().getVersionName()).
addHeader("token", tokenID). addHeader("token", tokenID).
addHeader("pkgName", Constant.MINTS_PKG_NAME). // addHeader("pkgName", Constant.MINTS_PKG_NAME).
addHeader("pkgName", "com.xinfu.helivideo").
addHeader("channel", channel). addHeader("channel", channel).
addHeader("new-session", MD5.GetMD5Code(String.valueOf(time))). addHeader("new-session", MD5.GetMD5Code(String.valueOf(time))).
addHeader("last-session", Base64.encode(String.valueOf(time).getBytes("UTF-8"))). addHeader("last-session", Base64.encode(String.valueOf(time).getBytes("UTF-8"))).
......
...@@ -15,6 +15,7 @@ import com.mints.wisdomclean.ui.widgets.countdowntimer.OnCountDownTimerListener ...@@ -15,6 +15,7 @@ import com.mints.wisdomclean.ui.widgets.countdowntimer.OnCountDownTimerListener
import com.mints.wisdomclean.utils.AppPreferencesManager import com.mints.wisdomclean.utils.AppPreferencesManager
import com.mints.wisdomclean.utils.LogUtil import com.mints.wisdomclean.utils.LogUtil
import kotlinx.android.synthetic.main.activity_gromore.* import kotlinx.android.synthetic.main.activity_gromore.*
import java.util.HashMap
/** /**
* 描述:gromore广告 * 描述:gromore广告
...@@ -54,7 +55,7 @@ class SplashAdActivity : BaseActivity() { ...@@ -54,7 +55,7 @@ class SplashAdActivity : BaseActivity() {
goToMainActivity() goToMainActivity()
} }
override fun adClose() { override fun adClose(vo: HashMap<String, Any>?) {
goToMainActivity() goToMainActivity()
} }
}) })
......
...@@ -82,14 +82,13 @@ class MyFragment : BaseFragment(), MyView, View.OnClickListener { ...@@ -82,14 +82,13 @@ class MyFragment : BaseFragment(), MyView, View.OnClickListener {
R.id.ll_my_setting -> { R.id.ll_my_setting -> {
readyGo(SettingsActivity::class.java) readyGo(SettingsActivity::class.java)
} }
R.id.tv_my_account ,R.id.ll_my_login-> { R.id.tv_my_account, R.id.ll_my_login -> {
if (!userManager.userIsLogin()) { if (!userManager.userIsLogin()) {
readyGo(MobileLoginActivity::class.java) readyGo(MobileLoginActivity::class.java)
} }
} }
R.id.ll_my_record -> { R.id.ll_my_record -> {
readyGo(WatchRecordActivity::class.java) readyGo(WatchRecordActivity::class.java)
} }
R.id.ll_my_feed -> { R.id.ll_my_feed -> {
readyGo(FeedbackActivity::class.java) readyGo(FeedbackActivity::class.java)
...@@ -108,7 +107,24 @@ class MyFragment : BaseFragment(), MyView, View.OnClickListener { ...@@ -108,7 +107,24 @@ class MyFragment : BaseFragment(), MyView, View.OnClickListener {
} }
private fun loginStatus(consumer: UserBean) { private fun loginStatus(consumer: UserBean) {
// 1-登录 // 1-匹配用户
if (consumer.activiteFlag == 0) {
// 未匹配
ll_my_vip.visibility = View.GONE
ll_my_payrecord.visibility = View.GONE
ll_contactus.visibility = View.GONE
line_my_payrecord.visibility = View.GONE
line_my_contactus.visibility = View.GONE
} else {
// 匹配
ll_my_vip.visibility = View.VISIBLE
ll_my_payrecord.visibility = View.VISIBLE
ll_contactus.visibility = View.VISIBLE
line_my_payrecord.visibility = View.VISIBLE
line_my_contactus.visibility = View.VISIBLE
}
// 2-登录
if (userManager.userIsLogin()) { if (userManager.userIsLogin()) {
tv_my_account.text = "用户ID:" + consumer.idcode tv_my_account.text = "用户ID:" + consumer.idcode
iv_my_bind.visibility = View.GONE iv_my_bind.visibility = View.GONE
...@@ -118,7 +134,7 @@ class MyFragment : BaseFragment(), MyView, View.OnClickListener { ...@@ -118,7 +134,7 @@ class MyFragment : BaseFragment(), MyView, View.OnClickListener {
iv_my_bind.visibility = View.VISIBLE iv_my_bind.visibility = View.VISIBLE
} }
// 2-是否vip // 3-vip
if (consumer.expireTime > 0) { if (consumer.expireTime > 0) {
tv_my_vip.text = "VIP会员" tv_my_vip.text = "VIP会员"
tv_my_btn.visibility = View.GONE tv_my_btn.visibility = View.GONE
......
...@@ -15,7 +15,7 @@ import Decoder.BASE64Encoder; ...@@ -15,7 +15,7 @@ import Decoder.BASE64Encoder;
public class AESUtils { public class AESUtils {
private static final String vis = MD5.GetMD5Code("bcurd_2022").substring(8, 24); private static final String vis = MD5.GetMD5Code("helivideo_2023").substring(8, 24);
public static String CIPHER_ALGORITHM = "AES/CBC/PKCS5Padding"; // optional value AES/DES/DESede public static String CIPHER_ALGORITHM = "AES/CBC/PKCS5Padding"; // optional value AES/DES/DESede
private static SecretKeySpec getKey(String strKey) throws Exception { private static SecretKeySpec getKey(String strKey) throws Exception {
......
...@@ -331,7 +331,6 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic ...@@ -331,7 +331,6 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
"", "",
object : AdStatusListener { object : AdStatusListener {
override fun adSuccess() { override fun adSuccess() {
<<<<<<< Updated upstream
} }
...@@ -339,22 +338,6 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic ...@@ -339,22 +338,6 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
} }
override fun adClose(vo : HashMap<String, Any>?) { override fun adClose(vo : HashMap<String, Any>?) {
val hasUnlockList: MutableList<Int> =
mHasUnlockIndexMap[drama.id] ?: mutableListOf()
hasUnlockList.add(widget.currentDramaIndex)
mHasUnlockIndexMap[drama.id] = hasUnlockList
blockView?.visibility = View.GONE
callback?.onDramaRewardArrived() // 解锁当前集
}
=======
}
override fun adFail() {
}
override fun adClose() {
val hasUnlockList: MutableList<Int> = val hasUnlockList: MutableList<Int> =
mHasUnlockIndexMap[drama.id] ?: mutableListOf() mHasUnlockIndexMap[drama.id] ?: mutableListOf()
hasUnlockList.add(widget.currentDramaIndex) hasUnlockList.add(widget.currentDramaIndex)
...@@ -363,7 +346,6 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic ...@@ -363,7 +346,6 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
callback?.onDramaRewardArrived() // 解锁当前集 callback?.onDramaRewardArrived() // 解锁当前集
} }
>>>>>>> Stashed changes
}) })
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#F5F9FC" android:background="#F5F9FC"
android:orientation="vertical"> android:orientation="vertical">
<com.mints.wisdomclean.ui.widgets.ElasticScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadingEdge="none"
android:overScrollMode="never">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F5F9FC"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#F5F9FC"
android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="220dp" android:layout_height="220dp"
...@@ -32,9 +14,9 @@ ...@@ -32,9 +14,9 @@
<LinearLayout <LinearLayout
android:id="@+id/ll_my_login" android:id="@+id/ll_my_login"
android:layout_marginTop="56dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="56dp"
android:orientation="horizontal"> android:orientation="horizontal">
<com.mints.wisdomclean.ui.widgets.CircleImageView <com.mints.wisdomclean.ui.widgets.CircleImageView
...@@ -56,10 +38,10 @@ ...@@ -56,10 +38,10 @@
<ImageView <ImageView
android:id="@+id/iv_my_bind" android:id="@+id/iv_my_bind"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:src="@mipmap/ic_my_bind"></ImageView> android:src="@mipmap/ic_my_bind"></ImageView>
...@@ -69,20 +51,28 @@ ...@@ -69,20 +51,28 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_marginTop="-70dp" android:layout_height="wrap_content"
android:layout_marginTop="150dp"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_my_vip"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:paddingLeft="24dp" android:layout_marginBottom="20dp"
android:background="@mipmap/bg_my_vip" android:background="@mipmap/bg_my_vip"
android:orientation="vertical"> android:orientation="vertical"
android:paddingLeft="24dp"
android:visibility="gone">
<TextView <TextView
android:id="@+id/tv_my_vip" android:id="@+id/tv_my_vip"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="开通VIP会员"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:text="开通VIP会员"
android:textColor="#5B1500" android:textColor="#5B1500"
android:textSize="22sp" android:textSize="22sp"
android:textStyle="bold" /> android:textStyle="bold" />
...@@ -107,13 +97,11 @@ ...@@ -107,13 +97,11 @@
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout> </LinearLayout>
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="14dp" android:layout_marginStart="14dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="14dp" android:layout_marginEnd="14dp"
android:background="@drawable/shape_bg_mobile" android:background="@drawable/shape_bg_mobile"
android:orientation="vertical"> android:orientation="vertical">
...@@ -149,7 +137,6 @@ ...@@ -149,7 +137,6 @@
android:background="@color/my_color_gray" /> android:background="@color/my_color_gray" />
<LinearLayout <LinearLayout
android:id="@+id/ll_my_feed" android:id="@+id/ll_my_feed"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -187,7 +174,8 @@ ...@@ -187,7 +174,8 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="20dp" android:paddingStart="20dp"
android:paddingEnd="20dp"> android:paddingEnd="20dp"
android:visibility="gone">
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
...@@ -206,9 +194,11 @@ ...@@ -206,9 +194,11 @@
</LinearLayout> </LinearLayout>
<View <View
android:id="@+id/line_my_payrecord"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:background="@color/my_color_gray" /> android:background="@color/my_color_gray"
android:visibility="gone" />
<LinearLayout <LinearLayout
android:id="@+id/ll_contactus" android:id="@+id/ll_contactus"
...@@ -217,7 +207,8 @@ ...@@ -217,7 +207,8 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="20dp" android:paddingStart="20dp"
android:paddingEnd="20dp"> android:paddingEnd="20dp"
android:visibility="gone">
<TextView <TextView
android:id="@+id/tv_contact" android:id="@+id/tv_contact"
...@@ -236,9 +227,11 @@ ...@@ -236,9 +227,11 @@
</LinearLayout> </LinearLayout>
<View <View
android:id="@+id/line_my_contactus"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:background="@color/my_color_gray" /> android:background="@color/my_color_gray"
android:visibility="gone" />
<LinearLayout <LinearLayout
android:id="@+id/ll_my_setting" android:id="@+id/ll_my_setting"
...@@ -266,11 +259,7 @@ ...@@ -266,11 +259,7 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="20dp" />
</LinearLayout> </LinearLayout>
</com.mints.wisdomclean.ui.widgets.ElasticScrollView>
</RelativeLayout> </FrameLayout>
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