Commit 03b6befb authored by jyx's avatar jyx

代码优化

parent 447910b6
......@@ -33,11 +33,11 @@ class MusicFragment : LazyLoadBaseFragment() {
if (DPSdk.isStartSuccess()) {
//初始化draw组件
initDrawWidget()
mDrawFragment = mIDPWidget?.getFragment()
mDrawFragment = mIDPWidget?.fragment
getSupportFragmentManager().beginTransaction()
supportFragmentManager.beginTransaction()
.replace(R.id.draw_style1_frame, mDrawFragment!!)
.commitAllowingStateLoss();
.commitAllowingStateLoss()
}
}
......@@ -78,13 +78,15 @@ class MusicFragment : LazyLoadBaseFragment() {
.hideClose(true, null)
.listener(object : IDPDrawListener() {
override fun onDPRefreshFinish() {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPRefreshFinish"
)
}
override fun onDPPageChange(position: Int) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPPageChange: $position"
)
}
......@@ -94,7 +96,8 @@ class MusicFragment : LazyLoadBaseFragment() {
return
}
mPos = position
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPPageChange: $position, map = $map"
)
}
......@@ -102,7 +105,8 @@ class MusicFragment : LazyLoadBaseFragment() {
override fun onCreateQuizView(container: ViewGroup): View {
val quizView: View = LayoutInflater.from(container.context)
.inflate(R.layout.media_layout_quiz, container, false)
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onCreateQuizView"
)
return quizView
......@@ -158,49 +162,57 @@ class MusicFragment : LazyLoadBaseFragment() {
}
override fun onDPVideoPlay(map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPVideoPlay map = $map"
)
}
override fun onDPVideoOver(map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPVideoOver map = $map"
)
}
override fun onDPVideoCompletion(map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPVideoCompletion map = $map"
)
}
override fun onDPClose() {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPClose"
)
}
override fun onDPReportResult(isSucceed: Boolean) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPReportResult isSucceed = $isSucceed"
)
}
override fun onDPPageStateChanged(pageState: DPPageState) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPPageStateChanged pageState = $pageState"
)
}
override fun onDPReportResult(isSucceed: Boolean, map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPReportResult isSucceed = $isSucceed, map = $map"
)
}
override fun onDPRequestStart(@Nullable map: Map<String, Any>?) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPRequestStart"
)
}
......@@ -210,7 +222,8 @@ class MusicFragment : LazyLoadBaseFragment() {
return
}
for (i in list.indices) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPRequestSuccess i = " + i + ", map = " + list[i].toString()
)
}
......@@ -222,114 +235,137 @@ class MusicFragment : LazyLoadBaseFragment() {
@Nullable map: Map<String, Any>?
) {
if (map == null) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPRequestFail code = $code, msg = $msg"
)
return
}
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPRequestFail code = $code, msg = $msg, map = $map"
)
}
override fun onDPClickAuthorName(map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPClickAuthorName map = $map"
)
}
override fun onDPClickAvatar(map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPClickAvatar map = $map"
)
}
override fun onDPClickComment(map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPClickComment map = $map"
)
}
override fun onDPClickLike(isLike: Boolean, map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPClickLike isLike = $isLike, map = $map"
)
}
override fun onDPVideoPause(map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPVideoPause map = $map"
)
}
override fun onDPVideoContinue(map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPVideoContinue map = $map"
)
}
override fun onDPClickShare(map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPClickShare map = $map"
)
}
}).adListener(object : IDPAdListener() {
override fun onDPAdRequest(map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPAdRequest map = $map"
)
}
override fun onDPAdRequestSuccess(map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPAdRequestSuccess map = $map"
)
}
override fun onDPAdRequestFail(code: Int, msg: String, map: Map<String, Any>) {
LogUtil.d(TAG,
override fun onDPAdRequestFail(
code: Int,
msg: String,
map: Map<String, Any>
) {
LogUtil.d(
TAG,
"onDPAdRequestFail map = $map"
)
}
override fun onDPAdFillFail(map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPAdFillFail map = $map"
)
}
override fun onDPAdShow(map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPAdShow map = $map"
)
}
override fun onDPAdPlayStart(map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPAdPlayStart map = $map"
)
}
override fun onDPAdPlayPause(map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPAdPlayPause map = $map"
)
}
override fun onDPAdPlayContinue(map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPAdPlayContinue map = $map"
)
}
override fun onDPAdPlayComplete(map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPAdPlayComplete map = $map"
)
}
override fun onDPAdClicked(map: Map<String, Any>) {
LogUtil.d(TAG,
LogUtil.d(
TAG,
"onDPAdClicked map = $map"
)
}
......
......@@ -9,8 +9,11 @@ import com.mints.helivideo.manager.UserManager
import com.mints.helivideo.mvp.model.UserBean
import com.mints.helivideo.mvp.presenters.MyPresenter
import com.mints.helivideo.mvp.views.MyView
import com.mints.helivideo.ui.activitys.SettingsActivity
import com.mints.helivideo.ui.adapter.TasksAdapter
import com.mints.helivideo.ui.fragment.base.LazyLoadBaseFragment
import com.mints.helivideo.ui.fragment.draw.DrawCashDialog
import com.mints.helivideo.utils.SpanUtils
import com.mints.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.fragment_main_my.*
......@@ -25,6 +28,8 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
private val userManager by lazy { UserManager.getInstance() }
private var tasksAdapter: TasksAdapter? = null
private var drawCashDialog: DrawCashDialog? = null
override fun getContentViewLayoutID() = R.layout.fragment_main_my
override fun initViewsAndEvents() {
......@@ -68,11 +73,18 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
override fun onClick(v: View?) {
if (AntiShake.check(v?.id)) return
// when (v?.id) {
// R.id.tv_my_btn -> {
// }
// }
when (v?.id) {
R.id.civ_my -> { // 跳转设置页
readyGo(SettingsActivity::class.java)
}
R.id.btn_my_draw -> { // 提现
showDrawCashDialog()
}
R.id.btn_task -> { // 任务,领金元宝
}
R.id.tv_my_explain -> { // 收益说明
}
}
}
override fun getUserSuc(data: UserBean) {
......@@ -80,52 +92,44 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
}
private fun loginStatus(consumer: UserBean) {
// // 1-匹配用户
// if (consumer.activiteFlag == 1) {
// // 匹配
// 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
// } else {
// // 未匹配
// 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
// }
//
// // 2-是否有手机号
// if (!TextUtils.isEmpty(userManager.mobile)) {
// tv_my_account.text = "手机号:" + consumer.mobile.substring(0,3)+"****"+consumer.mobile.substring(consumer.mobile.length-4)
// iv_my_bind.visibility = View.GONE
// } else {
// tv_my_account.text = "绑定手机号"
// iv_my_bind.visibility = View.VISIBLE
// }
// tv_my_id.text = "用户ID:"+consumer.idcode
//
// // 3-vip
// if (consumer.expireTime > 0) {
// tv_my_vip.text = "VIP会员"
// tv_my_btn.visibility = View.GONE
// if (consumer.isForever) {
// tv_my_status.text = "有效期: 永久有效"
// } else {
// tv_my_status.text =
// "到期时间 ${TimeRender.formatDate(consumer.expireTime, TimeRender.ALL_FORMAT_LINE)}"
// }
// } else {
// tv_my_vip.text = "开通VIP会员"
// tv_my_status.text = "解锁全部短剧"
// tv_my_btn.visibility = View.VISIBLE
// tv_my_btn.text = "立即开通"
// }
}
private fun initListener() {
btn_my_draw.setOnClickListener(this)
btn_task.setOnClickListener(this)
tv_my_explain.setOnClickListener(this)
civ_my.setOnClickListener(this)
rg_my_income.setOnCheckedChangeListener { group, checkedId ->
if (checkedId == R.id.rb_my_cash) {
tv_my_title.text = "红包余额(元)"
tv_my_money.text = SpanUtils()
.setFontSize(30, true)
.append(" ")
.setFontSize(14, true)
.append(" ≈ ")
.create()
} else {
tv_my_title.text = "金元宝余额(个)"
tv_my_money.text = SpanUtils()
.setFontSize(30, true)
.append(" ")
.setFontSize(14, true)
.append(" ≈ ")
.create()
}
}
}
private fun showDrawCashDialog() {
drawCashDialog = DrawCashDialog()
drawCashDialog?.let {
if (!it.isAdded && !it.isVisible && !it.isRemoving) {
it.show(supportFragmentManager, this.javaClass.simpleName)
} else {
supportFragmentManager.beginTransaction().show(it)
}
}
}
}
\ No newline at end of file
......@@ -8,6 +8,10 @@ class RedpkgFragment : LazyLoadBaseFragment() {
override fun getContentViewLayoutID() = R.layout.fragment_redpkg
override fun initViewsAndEvents() {
}
}
\ No newline at end of file
package com.mints.helivideo.ui.fragment.draw
import android.graphics.Typeface
import android.os.Bundle
import android.util.TypedValue
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager2.widget.ViewPager2
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayout.OnTabSelectedListener
import com.google.android.material.tabs.TabLayoutMediator
import com.mints.helivideo.R
import com.mints.helivideo.ui.widgets.bottomsheet.BaseBottomSheetDialog
/**
*
* @desc 提现弹框
*/
class DrawCashDialog : BaseBottomSheetDialog() {
private lateinit var tabLayout: TabLayout
private lateinit var vp2: ViewPager2
private val tabsData = mutableListOf<Int>()
private var vpAdapter: DrawPageAdapter? = null
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val rootView = inflater.inflate(R.layout.dialog_drawcash, container)
initView(rootView)
return rootView
}
private fun initView(rootView: View) {
tabsData.add(DrawCashFragment.DRAW_TYPE_CASH)
tabsData.add(DrawCashFragment.DRAW_TYPE_GOLD)
tabLayout = rootView.findViewById(R.id.tab_draw)
vp2 = rootView.findViewById(R.id.vp2_draw)
vpAdapter = DrawPageAdapter(tabsData, this)
vp2.adapter = vpAdapter
// 处理嵌套滑动冲突
(vp2.getChildAt(0) as RecyclerView).isNestedScrollingEnabled = false
TabLayoutMediator(tabLayout, vp2) { tab, position ->
// 初始化Tab
tab.id = position
if (tabsData.size > 0) {
tab.customView = getTabView(tabsData[position])
}
}.attach()
tabLayout.addOnTabSelectedListener(object : OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab?) {
updateTab(tab, true)
}
override fun onTabUnselected(tab: TabLayout.Tab?) {
updateTab(tab, false)
}
override fun onTabReselected(tab: TabLayout.Tab?) {
}
})
}
private fun updateTab(tab: TabLayout.Tab?, isSelected: Boolean) {
tab?.customView?.let {
val text = it.findViewById<TextView>(R.id.item_tv)
val indicator = it.findViewById<View>(R.id.item_indicator)
if (isSelected) {
indicator.visibility = View.VISIBLE
text.typeface = Typeface.defaultFromStyle(Typeface.BOLD)
text.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18f)
text.setTextColor(ContextCompat.getColor(requireContext(), R.color.black_text))
} else {
indicator.visibility = View.INVISIBLE
text.typeface = Typeface.defaultFromStyle(Typeface.NORMAL)
text.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16f)
text.setTextColor(ContextCompat.getColor(requireContext(), R.color.color_8D8F90))
}
}
}
private fun getTabView(type: Int): View {
val view = LayoutInflater.from(requireContext()).inflate(R.layout.item_draw_tab, null)
if (type == DrawCashFragment.DRAW_TYPE_CASH) {
view.findViewById<View>(R.id.item_indicator).visibility = View.VISIBLE
view.findViewById<TextView>(R.id.item_tv).text = "红包提现"
} else {
view.findViewById<View>(R.id.item_indicator).visibility = View.INVISIBLE
view.findViewById<TextView>(R.id.item_tv).text = "金元宝提现"
}
return view
}
// 提现
private fun drawCash() {
// if (rbWechat.isChecked) wechatDrawCash()
// else alipayDrawCash()
}
// 微信提现
private fun wechatDrawCash() {
}
// 支付宝提现
private fun alipayDrawCash() {
}
}
\ No newline at end of file
package com.mints.helivideo.ui.fragment.draw
import android.os.Bundle
import androidx.fragment.app.Fragment
import com.mints.helivideo.R
import com.mints.helivideo.ui.fragment.base.BaseFragment
import com.mints.helivideo.utils.SpanUtils
import kotlinx.android.synthetic.main.fragment_draw.*
class DrawCashFragment : BaseFragment() {
companion object {
const val DRAW_TYPE = "DRAW_TYPE"
const val DRAW_TYPE_CASH = 0x001
const val DRAW_TYPE_GOLD = 0x002
fun newInstance(type: Int): Fragment {
val args = Bundle()
args.putInt(DRAW_TYPE, type)
val fragment = DrawCashFragment()
fragment.arguments = args
return fragment
}
}
private var drawType = DRAW_TYPE_CASH
override fun initViewsAndEvents() {
arguments?.let {
drawType = it.getInt(DRAW_TYPE, DRAW_TYPE_CASH)
}
if (drawType == DRAW_TYPE_CASH) {
tv_title.text = "红包余额(元)"
tv_cash.text = SpanUtils()
.append("90.00")
.setFontSize(30, true)
.append("≈ 900000个")
.setFontSize(16, true)
.create()
} else {
tv_title.text = "金元宝余额(个)"
tv_cash.text = SpanUtils()
.append("90.00")
.setFontSize(30, true)
.append("≈ 0.00元")
.setFontSize(16, true)
.create()
}
}
override fun getContentViewLayoutID() = R.layout.fragment_draw
}
\ No newline at end of file
package com.mints.helivideo.ui.fragment.draw
import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
class DrawPageAdapter(
private val data: List<Int>,
fragment: Fragment
) :
FragmentStateAdapter(fragment) {
private val fragments = mutableMapOf<Int, Fragment>()
override fun getItemId(position: Int): Long {
return data[position].toLong()
}
override fun getItemCount() = data.size
override fun createFragment(position: Int): Fragment {
val newFragment = DrawCashFragment.newInstance(data[position])
fragments[position] = newFragment
return newFragment
}
override fun containsItem(itemId: Long): Boolean {
data.forEach {
if (it.toLong() == itemId) {
return true
}
}
return false
}
fun getFragments(): MutableMap<Int, Fragment> {
return fragments
}
}
\ No newline at end of file
package com.mints.helivideo.ui.widgets.bottomsheet
import android.widget.FrameLayout
import androidx.coordinatorlayout.widget.CoordinatorLayout
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.mints.helivideo.R
open class BaseBottomSheetDialog : BottomSheetDialogFragment() {
private var bottomSheet: FrameLayout? = null
private var behavior: BottomSheetBehavior<FrameLayout>? = null
override fun onStart() {
super.onStart()
val dialog = dialog as BottomSheetDialog?
bottomSheet = dialog!!.delegate.findViewById(com.google.android.material.R.id.design_bottom_sheet)
if (bottomSheet != null) {
val layoutParams = bottomSheet!!.layoutParams as CoordinatorLayout.LayoutParams
layoutParams.height = CoordinatorLayout.LayoutParams.WRAP_CONTENT
bottomSheet!!.layoutParams = layoutParams
behavior = BottomSheetBehavior.from(bottomSheet!!)
behavior!!.peekHeight = getHeight()
// 初始为展开状态
behavior!!.state = BottomSheetBehavior.STATE_EXPANDED
}
}
override fun getTheme(): Int {
return R.style.BottomDialog
}
protected open fun getHeight(): Int {
return resources.displayMetrics.heightPixels
}
}
\ 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"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_tab_friends"
android:orientation="vertical"
android:padding="@dimen/dp_10">
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_draw"
android:layout_width="match_parent"
android:layout_height="40dp"
app:tabBackground="@null"
app:tabIndicatorColor="@color/color_F61F03"
app:tabIndicatorHeight="0dp"
app:tabMode="fixed"
app:tabRippleColor="@null"
app:tabSelectedTextColor="@color/black"
app:tabTextColor="@color/gray" />
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/vp2_draw"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="红包余额(元)" />
<TextView
android:id="@+id/tv_cash"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="90.00 ≈ 900000个"
android:textColor="@color/black"
android:textSize="20sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/ry_draw"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dp_10" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="提现方式"
android:textColor="@color/black" />
<RadioGroup
android:id="@+id/rg_draw"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:padding="10dp">
<RadioButton
android:id="@+id/rb_wechat"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:button="@null"
android:gravity="center"
android:text="微信" />
<RadioButton
android:id="@+id/rb_alipay"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:button="@null"
android:gravity="center"
android:text="支付宝" />
</RadioGroup>
<Button
android:id="@+id/btn_draw"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_10"
android:text="去提现" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:clipChildren="false">
<FrameLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="220dp"
android:layout_height="wrap_content"
android:background="@mipmap/bg_my"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_my_login"
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/ll_my_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="56dp"
android:orientation="horizontal">
android:layout_marginTop="50dp">
<com.mints.helivideo.ui.widgets.CircleImageView
android:id="@+id/civ_my"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginStart="20dp"
android:src="@mipmap/ic_my_avat" />
android:src="@mipmap/ic_my_avat"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
<TextView
android:id="@+id/tv_my_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical">
android:layout_marginStart="10dp"
android:layout_toEndOf="@id/civ_my"
android:text="昵称:游客"
android:textColor="@color/black_text"
android:textSize="16sp"
app:layout_constraintBottom_toTopOf="@id/tv_my_id"
app:layout_constraintStart_toEndOf="@id/civ_my"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_my_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:text="用户ID:"
android:textColor="@color/black_text"
android:textSize="16sp" />
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/civ_my"
app:layout_constraintTop_toBottomOf="@id/tv_my_name" />
<LinearLayout
<TextView
android:id="@+id/tv_my_explain"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:paddingStart="@dimen/dp_10"
android:paddingTop="6dp"
android:paddingEnd="@dimen/dp_10"
android:paddingBottom="6dp"
android:text="收益说明"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<RadioGroup
android:id="@+id/rg_my_income"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginTop="20dp"
android:background="@color/red"
android:orientation="horizontal">
<RadioButton
android:id="@+id/rb_my_cash"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_gravity="bottom"
android:layout_weight="1"
android:background="@mipmap/ic_launcher_main"
android:button="@null"
android:gravity="center"
android:text="红包券收益" />
<RadioButton
android:id="@+id/rb_my_gold"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_gravity="bottom"
android:layout_weight="1"
android:button="@null"
android:gravity="center"
android:text="金元宝收益" />
</RadioGroup>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_10">
<TextView
android:id="@+id/tv_my_account"
android:id="@+id/tv_my_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:text="绑定手机号"
android:textColor="#000000"
android:textSize="18sp"
android:textStyle="bold" />
android:text="红包余额(元)"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_my_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_my_title" />
<Button
android:id="@+id/btn_my_draw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="提现"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_10">
<ImageView
android:id="@+id/iv_my_bind"
android:id="@+id/iv_task_icon"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@mipmap/ic_launcher_main"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_task_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:src="@mipmap/ic_my_bind"></ImageView>
</LinearLayout>
</LinearLayout>
android:layout_marginStart="@dimen/dp_10"
android:text="观看视频得金元宝"
android:textColor="@color/black_text"
android:textSize="16sp"
app:layout_constraintStart_toEndOf="@id/iv_task_icon"
app:layout_constraintTop_toTopOf="parent" />
</LinearLayout>
<TextView
android:id="@+id/tv_task_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_10"
android:text="无门槛秒到账"
app:layout_constraintStart_toEndOf="@id/iv_task_icon"
app:layout_constraintTop_toBottomOf="@id/tv_task_title" />
<ProgressBar
android:id="@+id/pb_task"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="150dp"
android:layout_height="10dp"
android:layout_marginStart="@dimen/dp_10"
android:progressDrawable="@drawable/progressbar_versus_changevedio_bg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/iv_task_icon"
app:layout_constraintTop_toBottomOf="@id/tv_task_label" />
<Button
android:id="@+id/btn_task"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="领金元宝"
app:layout_constraintBottom_toTopOf="@id/tv_task_count"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</LinearLayout>
<TextView
android:id="@+id/tv_task_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="今日剩余10次"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/btn_task"
app:layout_constraintStart_toStartOf="@id/btn_task"
app:layout_constraintTop_toBottomOf="@id/btn_task" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recy_tasks"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/item_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="6dp"
android:paddingBottom="6dp"
android:textColor="@color/color_8D8F90"
android:textSize="16sp"
android:textStyle="bold" />
<View
android:id="@+id/item_indicator"
android:layout_width="30dp"
android:layout_height="2dp"
android:background="@color/red"
android:visibility="invisible" />
</LinearLayout>
\ No newline at end of file
......@@ -77,5 +77,18 @@
<item name="android:button">@drawable/checkbox_style</item>
</style>
<style name="BottomDialog" parent="@android:style/Theme.Dialog">
<item name="android:windowTitleStyle">@null</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowAnimationStyle">@style/BottomDialog.AnimationStyle</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
</style>
<style name="BottomDialog.AnimationStyle" parent="android:Animation">
<item name="android:windowEnterAnimation">@anim/push_bottom_in</item>
<item name="android:windowExitAnimation">@anim/push_bottom_out</item>
</style>
</resources>
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