Commit 463c34c7 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent a9b6d4d9
......@@ -17,6 +17,7 @@ object Constant {
const val IS_FIRST_AGREE_BTN = "is_first_agree_btn"
const val IS_FIRST_VIP_BTN = "is_first_agree_btn"
const val IS_FIRST_VEDIO = "is_first_vedio"
const val IS_FIRST_VEDIO_NEWFLAG = "is_first_vedio_newflag"
const val TAG_NAME = "SUN"
const val MINTS_APP_NAME = "爱短剧"
const val MINTS_PKG_NAME = "com.duben.loveplaylet"
......
......@@ -23,10 +23,7 @@ import com.duben.loveplaylet.mvp.views.LoginView
import com.duben.loveplaylet.ui.activitys.base.BaseActivity
import com.duben.loveplaylet.ui.widgets.CustomDialogAsApple
import com.duben.loveplaylet.ui.widgets.DialogListener
import com.duben.loveplaylet.utils.BackInputUtil
import com.duben.loveplaylet.utils.LogUtil
import com.duben.loveplaylet.utils.SpanUtils
import com.duben.loveplaylet.utils.ToastUtil
import com.duben.loveplaylet.utils.*
import kotlinx.android.synthetic.main.activity_mobile_login.*
import kotlinx.android.synthetic.main.header_layout.*
......@@ -260,13 +257,24 @@ class MobileLoginActivity : BaseActivity(), LoginView, View.OnClickListener {
dialog?.dismiss()
when (v?.id) {
R.id.dialog_btn_left -> {
val flag = AppPreferencesManager.get()
.getBoolean(Constant.IS_FIRST_VEDIO_NEWFLAG, false)
if (flag) {
// 匹配用户看短剧
AppPreferencesManager.get().put(Constant.IS_FIRST_VEDIO_NEWFLAG, false)
finish()
} else {
readyGo(MainActivity::class.java)
val activity =
ActivityPageManager.getInstance().getActivity(MainActivity::class.java)
ActivityPageManager.getInstance()
.getActivity(MainActivity::class.java)
if (activity != null && activity is MainActivity) {
activity.clickTab4Layout()
}
}
}
R.id.dialog_btn_right -> {
}
......
......@@ -336,6 +336,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
val firstVedio = AppPreferencesManager.get().getBoolean(Constant.IS_FIRST_VEDIO, true)
if (data != null && data.vedioMsg != null && firstVedio) {
AppPreferencesManager.get().put(Constant.IS_FIRST_VEDIO, false)
AppPreferencesManager.get().put(Constant.IS_FIRST_VEDIO_NEWFLAG, true)
LocalVedioManager.startVedioDetailActivityForType(requireActivity(), data.vedioMsg)
} else {
if (UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) {
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充的颜色 -->
<solid android:color="#000000" />
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners android:radius="15dip" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="@color/black"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/shape_bg_black3"
android:gravity="center"
android:orientation="vertical">
<FrameLayout
android:layout_width="wrap_content"
android:layout_marginTop="20dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@mipmap/bg_detail_top2"></FrameLayout>
<FrameLayout
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
......@@ -42,17 +46,17 @@
android:layout_width="280dp"
android:layout_height="46dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="10dp"
android:layout_marginBottom="20dp"
android:background="@mipmap/bg_detail_bottom"
android:textColor="@color/color_815136" />
<ImageView
android:visibility="gone"
android:id="@+id/iv_detail_quit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:src="@mipmap/ic_quit_yuan"></ImageView>
android:src="@mipmap/ic_quit_yuan"
android:visibility="gone"></ImageView>
</LinearLayout>
</RelativeLayout>
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