Commit 5911b696 authored by jyx's avatar jyx

代码优化

parent b12a66e6
...@@ -18,7 +18,6 @@ object Constant { ...@@ -18,7 +18,6 @@ object Constant {
const val MINTS_APP_NAME = "每日小短剧" const val MINTS_APP_NAME = "每日小短剧"
const val MINTS_PKG_NAME = "com.duben.dayplaylet" const val MINTS_PKG_NAME = "com.duben.dayplaylet"
const val ACTION_EXIT_APP = "package.exit" const val ACTION_EXIT_APP = "package.exit"
const val LUCKY_FLAG = "LUCKY_FLAG"
const val CARRIERTYPE_CSJ_VEDIO = "VEDIO_UNLOCK" const val CARRIERTYPE_CSJ_VEDIO = "VEDIO_UNLOCK"
...@@ -29,6 +28,11 @@ object Constant { ...@@ -29,6 +28,11 @@ object Constant {
const val CARRIERTYPE_SIGN_7 = "FORCASH_SIGN_AFTER7" //签到7天后的视频 const val CARRIERTYPE_SIGN_7 = "FORCASH_SIGN_AFTER7" //签到7天后的视频
const val CARRIERTYPE_SONG_CLICK = "REWARD_GUESS_SONG_CLICK" //不看视频点击答题 的入参
const val CARRIERTYPE_SONG_MORE = "REWARD_GUESS_SONG_MORE" //翻倍 的入参
const val CARRIERTYPE_SONG_ALL = "REWARD_GUESS_SONG_ALL" //画着红包直接看视频的入参
const val FRAGMENT_CLICK_ONE = 0 const val FRAGMENT_CLICK_ONE = 0
const val FRAGMENT_CLICK_TWO = 1 const val FRAGMENT_CLICK_TWO = 1
const val FRAGMENT_CLICK_THREE = 2 const val FRAGMENT_CLICK_THREE = 2
......
...@@ -6,6 +6,7 @@ import com.duben.dayplaylet.mvp.model.MusicBean ...@@ -6,6 +6,7 @@ import com.duben.dayplaylet.mvp.model.MusicBean
import com.duben.dayplaylet.mvp.views.MusicView import com.duben.dayplaylet.mvp.views.MusicView
import com.duben.library.net.neterror.BaseSubscriber import com.duben.library.net.neterror.BaseSubscriber
import com.duben.library.net.neterror.Throwable import com.duben.library.net.neterror.Throwable
import com.google.gson.JsonObject
class MusicPresenter : BasePresenter<MusicView>() { class MusicPresenter : BasePresenter<MusicView>() {
...@@ -40,4 +41,38 @@ class MusicPresenter : BasePresenter<MusicView>() { ...@@ -40,4 +41,38 @@ class MusicPresenter : BasePresenter<MusicView>() {
} }
}) })
} }
// 添加金币
fun reportAddCoinMsg(carrierType: String) {
val vo = HashMap<String, Any>()
vo["carrierType"] = carrierType
AppHttpManager.getInstance(loanApplication)
.call(loanService.reportAddCoinMsg(vo),
object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.showToast(e.message)
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> {
view.reportAddCoinMsgSuc()
}
else -> {
view.showToast(message)
}
}
}
})
}
} }
\ No newline at end of file
...@@ -4,4 +4,5 @@ import com.duben.dayplaylet.mvp.model.MusicBean ...@@ -4,4 +4,5 @@ import com.duben.dayplaylet.mvp.model.MusicBean
interface MusicView : BaseView { interface MusicView : BaseView {
fun rdSongMsgSuc(data: MusicBean) fun rdSongMsgSuc(data: MusicBean)
fun reportAddCoinMsgSuc()
} }
\ No newline at end of file
...@@ -97,8 +97,8 @@ public class OkHttpInterceptor implements Interceptor { ...@@ -97,8 +97,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.mints.helivideo"). // addHeader("pkgName", "com.mints.bcurd").
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"))).
......
...@@ -13,7 +13,6 @@ import com.duben.dayplaylet.ui.activitys.SettingsActivity ...@@ -13,7 +13,6 @@ import com.duben.dayplaylet.ui.activitys.SettingsActivity
import com.duben.dayplaylet.ui.adapter.TasksAdapter import com.duben.dayplaylet.ui.adapter.TasksAdapter
import com.duben.dayplaylet.ui.fragment.base.LazyLoadBaseFragment import com.duben.dayplaylet.ui.fragment.base.LazyLoadBaseFragment
import com.duben.dayplaylet.ui.fragment.draw.DrawCashDialog import com.duben.dayplaylet.ui.fragment.draw.DrawCashDialog
import com.duben.dayplaylet.utils.BubbleUtils
import com.duben.dayplaylet.utils.SpanUtils import com.duben.dayplaylet.utils.SpanUtils
import com.duben.library.utils.nodoubleclick.AntiShake import com.duben.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.fragment_main_my.* import kotlinx.android.synthetic.main.fragment_main_my.*
......
package com.duben.dayplaylet.ui.fragment.draw package com.duben.dayplaylet.ui.fragment.draw
import android.os.Bundle import android.os.Bundle
import android.text.Spannable
import android.text.style.ImageSpan
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.duben.dayplaylet.R import com.duben.dayplaylet.R
import com.duben.dayplaylet.ui.fragment.base.BaseFragment import com.duben.dayplaylet.ui.fragment.base.BaseFragment
import com.duben.dayplaylet.utils.SpanUtils import com.duben.dayplaylet.utils.SpanUtils
import com.duben.dayplaylet.utils.SpanUtils.ALIGN_BASELINE
import kotlinx.android.synthetic.main.fragment_draw.* import kotlinx.android.synthetic.main.fragment_draw.*
/** /**
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:radius="8dp" />
<solid android:color="#BBFF0000" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:radius="8dp" />
<solid android:color="#BB00FF00" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/ic_agree_selected" android:state_checked="true" />
<item android:drawable="@mipmap/ic_agree_unselected" android:state_checked="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android">
android:shape="rectangle">
<corners <corners android:radius="30dp" />
android:radius="8dp" /> <solid android:color="@color/color_30_trans" />
<solid android:color="#55F5F5F5" />
</shape> </shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
...@@ -37,7 +36,7 @@ ...@@ -37,7 +36,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="14dp"
android:text="提现方式" android:text="提现方式"
android:textColor="@color/black" /> android:textColor="@color/black" />
...@@ -56,19 +55,29 @@ ...@@ -56,19 +55,29 @@
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/shape_draw_adapter_none" android:background="@drawable/shape_draw_adapter_none"
android:button="@null" android:button="@null"
android:gravity="center" android:checked="true"
android:text="微信" /> android:drawableStart="@mipmap/withdraw_wx"
android:drawableEnd="@drawable/selector_withdraw"
android:gravity="start|center_vertical"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:text=" 微信" />
<RadioButton <RadioButton
android:id="@+id/rb_alipay" android:id="@+id/rb_alipay"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="@dimen/dp_10" android:layout_marginEnd="@dimen/dp_10"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/shape_draw_adapter_none" android:background="@drawable/shape_draw_adapter_none"
android:button="@null" android:button="@null"
android:gravity="center" android:checked="false"
android:text="支付宝" /> android:drawableStart="@mipmap/withdraw_zfb"
android:drawableEnd="@drawable/selector_withdraw"
android:gravity="start|center_vertical"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:text=" 支付宝" />
</RadioGroup> </RadioGroup>
......
...@@ -11,22 +11,4 @@ ...@@ -11,22 +11,4 @@
<include layout="@layout/layout_draw_header" /> <include layout="@layout/layout_draw_header" />
<Button
android:id="@+id/btn1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="100dp"
android:background="@mipmap/ic_launcher_main" />
<Button
android:id="@+id/btn2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="100dp"
android:background="@mipmap/ic_launcher_main" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout 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:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingLeft="48dp"
android:paddingRight="48dp"
tools:background="@color/black"> tools:background="@color/black">
<Button <ImageView
android:id="@+id/quiz_option0" android:id="@+id/quiz_iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<TextView
android:id="@+id/quiz_tv_qus"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_above="@+id/quiz_option1" android:layout_above="@id/fl_option0"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp" android:layout_marginStart="48dp"
android:background="@drawable/selector_quzi_button_default" android:layout_marginEnd="48dp"
tools:text="A.心太软" /> android:layout_marginBottom="80dp"
android:background="@drawable/shape_mild_trans"
android:gravity="center"
android:padding="@dimen/dp_10"
android:text="背景音乐是什么歌 _ _ _ _ ?"
android:textColor="@color/white" />
<Button <FrameLayout
android:id="@+id/quiz_option1" android:id="@+id/fl_option0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/fl_option1"
android:layout_centerHorizontal="true"
android:layout_marginStart="48dp"
android:layout_marginEnd="48dp"
android:layout_marginBottom="20dp">
<TextView
android:id="@+id/quiz_option0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/icon_quiz_button_bg"
android:gravity="center"
android:paddingBottom="5dp"
android:textColor="@color/main_mints"
android:textStyle="bold"
tools:text="心太软" />
<ImageView
android:id="@+id/quiz_iv_redbox0"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="50dp"
android:paddingBottom="5dp"
android:src="@mipmap/ic_redpkg"
android:visibility="gone" />
<ImageView
android:id="@+id/quiz_iv_option0"
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="20dp"
android:paddingBottom="5dp"
android:visibility="gone" />
</FrameLayout>
<FrameLayout
android:id="@+id/fl_option1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginBottom="50dp" android:layout_marginStart="48dp"
android:background="@drawable/selector_quzi_button_default" android:layout_marginEnd="48dp"
tools:text="B.伤心太平洋" /> android:layout_marginBottom="50dp">
<TextView
android:id="@+id/quiz_option1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/icon_quiz_button_bg"
android:gravity="center"
android:paddingBottom="5dp"
android:textColor="@color/main_mints"
android:textStyle="bold"
tools:text="伤心太平洋" />
<ImageView
android:id="@+id/quiz_iv_redbox1"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="50dp"
android:paddingBottom="5dp"
android:src="@mipmap/ic_redpkg"
android:visibility="gone" />
<ImageView
android:id="@+id/quiz_iv_option1"
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="20dp"
android:paddingBottom="5dp"
android:visibility="gone" />
</FrameLayout>
<TextView
android:id="@+id/quiz_tv_pop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@id/quiz_ll_pop"
android:layout_alignTop="@id/quiz_ll_pop"
android:layout_alignEnd="@id/quiz_ll_pop"
android:layout_marginStart="26dp"
android:layout_marginTop="-30dp"
android:layout_marginEnd="26dp"
android:background="@drawable/shape_red"
android:gravity="center"
android:paddingStart="10dp"
android:paddingTop="2dp"
android:paddingEnd="10dp"
android:paddingBottom="2dp"
android:text="8s后消失"
android:textColor="@color/white"
android:textSize="12sp"
android:visibility="gone" />
<LinearLayout
android:id="@+id/quiz_ll_pop"
android:layout_width="128dp"
android:layout_height="wrap_content"
android:layout_alignTop="@id/fl_option0"
android:layout_alignParentEnd="true"
android:layout_marginTop="-30dp"
android:layout_marginEnd="30dp"
android:background="@drawable/bg_jlfb"
android:orientation="vertical"
android:visibility="visible">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:drawablePadding="2dp"
android:text="奖励翻倍"
android:textStyle="bold"
app:drawableStartCompat="@drawable/ic_envelope_video" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="2dp"
android:layout_marginEnd="6dp"
android:drawablePadding="2dp"
android:text="最高可得10元"
android:textSize="12sp" />
</LinearLayout>
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/finger_view"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_alignTop="@id/fl_option1"
android:layout_alignParentEnd="true"
android:layout_marginTop="26dp"
android:layout_marginEnd="48dp" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<color name="full_transparent">#00000000</color> <color name="full_transparent">#00000000</color>
<color name="half_transparent">#80000000</color> <color name="half_transparent">#80000000</color>
<color name="color_20000000">#10000000</color> <color name="color_20000000">#10000000</color>
<color name="color_30_trans">#4D000000</color>
<color name="title_bg">#2B3238</color> <color name="title_bg">#2B3238</color>
<color name="btn_enabled">#F1F2F8</color> <color name="btn_enabled">#F1F2F8</color>
<color name="black_text">#333333</color> <color name="black_text">#333333</color>
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
<string name="bottom_tab_my">提现</string> <string name="bottom_tab_my">提现</string>
<string name="draw_cash">提现</string> <string name="draw_cash">提现</string>
<string name="str_wechat">微信</string>
<string name="str_alipay">支付宝</string>
<!--内存页--> <!--内存页-->
......
...@@ -22,8 +22,8 @@ android.nonTransitiveRClass=true ...@@ -22,8 +22,8 @@ android.nonTransitiveRClass=true
# org.gradle.parallel=true # org.gradle.parallel=true
#DEBUG_URL="https://test.mints-id.com/camera-api/" #DEBUG_URL="https://test.mints-id.com/camera-api/"
#DEBUG_URL="http://cui.mints-id.com/" DEBUG_URL="https://api.mints-tech.cn/vcash-api/"
DEBUG_URL="https://api.mints-tech.cn/camera-api/" #DEBUG_URL="https://api.mints-tech.cn/camera-api/"
RELEASE_URL="https://api.mints-tech.cn/camera-api/" RELEASE_URL="https://api.mints-tech.cn/camera-api/"
RELEASE_KEY_PASSWORD=mintsdayplaylet RELEASE_KEY_PASSWORD=mintsdayplaylet
......
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