[Modify]首充ui修改

This commit is contained in:
wushaocheng
2023-02-21 18:36:02 +08:00
parent a4b922e360
commit 0065f891a8
22 changed files with 184 additions and 96 deletions

View File

@@ -30,11 +30,11 @@ import com.umeng.commonsdk.statistics.common.DeviceConfig
import com.yizhuan.erban.R
import com.yizhuan.erban.base.BaseViewBindingActivity
import com.yizhuan.erban.databinding.DialogFirstChargeBinding
import com.yizhuan.erban.event.ChargeEvent
import com.yizhuan.erban.ui.pay.BillingManager
import com.yizhuan.erban.ui.setting.ModifyPwdActivity
import com.yizhuan.erban.ui.utils.RVDelegate
import com.yizhuan.erban.ui.webview.CommonWebViewActivity
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil
import com.yizhuan.xchat_android_core.Constants
import com.yizhuan.xchat_android_core.UriProvider
import com.yizhuan.xchat_android_core.pay.PayModel
@@ -44,7 +44,6 @@ import com.yizhuan.xchat_android_core.pay.bean.PayRecordId
import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent
import com.yizhuan.xchat_android_core.utils.net.IgnoreException
import com.yizhuan.xchat_android_core.utils.toast
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
import com.yizhuan.xchat_android_library.utils.AppMetaDataUtil
import com.yizhuan.xchat_android_library.utils.ResUtil
import com.yizhuan.xchat_android_library.utils.SingleToastUtil
@@ -52,7 +51,11 @@ import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
@ActLayoutRes(R.layout.dialog_first_charge)
/**
* author: wushaocheng
* time: 2022/2/21
* desc: 限时首充
*/
class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
BillingManager.BillingUpdatesListener {
@@ -87,6 +90,9 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
binding.rbPlanA.isChecked = true
binding.rbPlanB.isChecked = false
binding.rbPlanC.isChecked = false
binding.ivArrow1.visibility = View.VISIBLE
binding.ivArrow2.visibility = View.INVISIBLE
binding.ivArrow3.visibility = View.INVISIBLE
updateCurrGoods(goodsList?.getOrNull(0))
position = 0
}
@@ -94,6 +100,9 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
binding.rbPlanA.isChecked = false
binding.rbPlanB.isChecked = true
binding.rbPlanC.isChecked = false
binding.ivArrow1.visibility = View.INVISIBLE
binding.ivArrow2.visibility = View.VISIBLE
binding.ivArrow3.visibility = View.INVISIBLE
updateCurrGoods(goodsList?.getOrNull(1))
position = 1
}
@@ -101,6 +110,9 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
binding.rbPlanA.isChecked = false
binding.rbPlanB.isChecked = false
binding.rbPlanC.isChecked = true
binding.ivArrow1.visibility = View.INVISIBLE
binding.ivArrow2.visibility = View.INVISIBLE
binding.ivArrow3.visibility = View.VISIBLE
updateCurrGoods(goodsList?.getOrNull(2))
position = 2
}
@@ -361,7 +373,8 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
}
try {
helpPopupWindow.showAsDropDown(binding.viewAnchor, 0, 0, Gravity.BOTTOM)
helpPopupWindow.showAsDropDown(binding.ivHelp,
UIUtil.dip2px(context, 18.0), UIUtil.dip2px(context, -3.0), Gravity.END)
} catch (e: Exception) {
e.printStackTrace()
}

View File

@@ -20,7 +20,7 @@ class RewardAdapter(private val itemWidth: Int) :
mContext,
item.showPir,
helper.getView(R.id.iv_pic),
R.drawable.default_cover
R.drawable.ic_first_charge_default
)
helper.setText(R.id.tv_name, item.showText)
.setText(R.id.tv_time, item.showTime)

View File

@@ -37,7 +37,6 @@ import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import java.io.Serializable
/**
* author: wushaocheng
* time: 2022/2/16

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 KiB

After

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1006 B

View File

@@ -2,10 +2,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FFFCE9FC"/>
<corners
android:bottomLeftRadius="15dp"
android:bottomRightRadius="15dp"
android:topLeftRadius="0dp"
android:topRightRadius="0dp" />
<solid android:color="@color/color_white"/>
<corners android:radius="@dimen/dp_16"/>
</shape>

View File

@@ -1,7 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FFE0B4FF" />
<corners
android:radius="8dp" />
</shape>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="@dimen/dp_6" />
<gradient
android:angle="180"
android:endColor="#F8D6FF"
android:startColor="#F0BEFF"
android:type="linear"
android:useLevel="true" />
</shape>
</item>
<item
android:bottom="2dp"
android:left="2dp"
android:right="2dp"
android:top="2dp">
<shape android:shape="rectangle">
<corners android:radius="@dimen/dp_6" />
<gradient
android:angle="180"
android:endColor="#F8E9FD"
android:startColor="#F4D2FF"
android:type="linear"
android:useLevel="true" />
</shape>
</item>
</layer-list>

View File

@@ -4,8 +4,13 @@
<item>
<shape android:shape="rectangle">
<size android:height="5dp" />
<solid android:color="@color/transparent" />
<stroke android:width="1dp" android:color="#80ffffff" />
<solid android:color="#4dffffff" />
<corners
android:topLeftRadius="8dp"
android:topRightRadius="8dp"
android:bottomLeftRadius="8dp"
android:bottomRightRadius="8dp" />
</shape>
</item>
</selector>

View File

@@ -3,67 +3,115 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
android:layout_height="match_parent">
<View
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/view_bg"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/bg_first_charge"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_35"
android:layout_marginEnd="@dimen/dp_35"
android:adjustViewBounds="true"
android:src="@drawable/bg_first_charge"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="750:886"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
app:layout_constraintTop_toTopOf="parent" />
</View>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/dp_0"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="@+id/view_bg"
app:layout_constraintEnd_toEndOf="@+id/view_bg"
app:layout_constraintBottom_toTopOf="@+id/csGift">
<FrameLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp"
android:layout_marginBottom="18dp"
android:background="@drawable/bg_first_charge_list"
app:layout_constraintBottom_toTopOf="@id/tv_charge"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/ll_plan"
app:layout_constraintWidth_percent="0.66">
<TextView
android:id="@+id/tv_title"
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ivArrow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="27dp"
android:textColor="#FF845DFF"
android:textSize="14sp"
android:layout_marginEnd="40dp"
android:src="@drawable/ic_first_charge_arrow"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toStartOf="@+id/ivArrow2"
app:layout_constraintStart_toStartOf="parent"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ivArrow2"
android:src="@drawable/ic_first_charge_arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_40"
android:visibility="invisible"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toStartOf="@+id/ivArrow3"
app:layout_constraintStart_toEndOf="@+id/ivArrow1"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ivArrow3"
android:src="@drawable/ic_first_charge_arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_10"
android:visibility="invisible"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@+id/ivArrow2"
app:layout_constraintEnd_toEndOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/csGift"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginEnd="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_8"
android:background="@drawable/bg_first_charge_list"
app:layout_constraintBottom_toTopOf="@+id/tv_charge"
app:layout_constraintEnd_toEndOf="@+id/view_bg"
app:layout_constraintStart_toStartOf="@+id/view_bg"
app:layout_constraintTop_toBottomOf="@+id/ll_plan">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_title"
android:layout_width="0dp"
android:layout_height="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_14"
android:gravity="center"
android:textColor="@color/color_BE5AF6"
android:textSize="@dimen/sp_12"
android:background="@drawable/bg_first_charge_tip"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="@string/layout_dialog_first_charge_01" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="57dp" />
android:layout_marginTop="@dimen/dp_10"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_title" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/ll_plan"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_gravity="center_horizontal"
android:background="@drawable/bg_first_charge_ll_product"
android:layout_marginStart="@dimen/dp_15"
android:layout_marginEnd="@dimen/dp_15"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@id/view_bg"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="@+id/view_bg"
app:layout_constraintStart_toStartOf="@+id/view_bg"
app:layout_constraintTop_toTopOf="@id/view_bg"
app:layout_constraintVertical_bias="0.25"
app:layout_constraintWidth_percent="0.66">
app:layout_constraintVertical_bias="0.33">
<CheckBox
android:id="@+id/rb_plan_a"
@@ -75,7 +123,7 @@
android:checked="true"
android:gravity="center"
android:includeFontPadding="false"
android:textColor="@color/color_selector_white_false_845dff"
android:textColor="@color/color_white"
android:textSize="14sp"
tools:text="@string/layout_dialog_first_charge_02" />
@@ -83,12 +131,13 @@
android:id="@+id/rb_plan_b"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_marginStart="@dimen/dp_12"
android:layout_weight="1"
android:background="@drawable/bg_first_charge_selector_rb_plan_a"
android:button="@null"
android:gravity="center"
android:includeFontPadding="false"
android:textColor="@color/color_selector_white_false_845dff"
android:textColor="@color/color_white"
android:textSize="14sp"
tools:text="@string/layout_dialog_first_charge_03" />
@@ -96,49 +145,42 @@
android:id="@+id/rb_plan_c"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_marginStart="@dimen/dp_12"
android:layout_weight="1"
android:background="@drawable/bg_first_charge_selector_rb_plan_a"
android:button="@null"
android:gravity="center"
android:includeFontPadding="false"
android:textColor="@color/color_selector_white_false_845dff"
android:textColor="@color/color_white"
android:textSize="14sp"
tools:text="@string/layout_dialog_first_charge_04" />
</LinearLayout>
<ImageView
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_help"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginBottom="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="125dp"
android:layout_marginEnd="@dimen/dp_14"
android:src="@drawable/ic_first_charge_help"
app:layout_constraintBottom_toTopOf="@id/ll_plan"
app:layout_constraintStart_toStartOf="@id/ll_plan" />
<View
android:id="@+id/view_anchor"
android:layout_width="15dp"
android:layout_height="1px"
app:layout_constraintEnd_toStartOf="@id/iv_help"
app:layout_constraintBottom_toBottomOf="@id/iv_help" />
app:layout_constraintEnd_toEndOf="@+id/view_bg"
app:layout_constraintTop_toTopOf="@+id/view_bg" />
<TextView
android:id="@+id/tv_charge"
android:layout_width="185dp"
android:layout_height="45dp"
android:layout_gravity="center_horizontal|bottom"
android:layout_marginBottom="13dp"
android:layout_width="wrap_content"
android:layout_height="54dp"
android:background="@drawable/bg_first_charge_charge_btn"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:text="@string/layout_dialog_first_charge_05"
android:textColor="#ffd67900"
android:textSize="14sp"
android:textColor="@color/color_white"
android:textSize="@dimen/sp_18"
app:layout_constraintBottom_toBottomOf="@id/view_bg"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintEnd_toEndOf="@+id/view_bg"
app:layout_constraintStart_toStartOf="@+id/view_bg"
app:layout_constraintTop_toBottomOf="@+id/view_bg" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -29,7 +29,7 @@
app:layout_constraintEnd_toEndOf="@id/view_bg"
app:layout_constraintStart_toStartOf="@id/view_bg"
app:layout_constraintTop_toTopOf="@id/view_bg"
tools:src="@drawable/default_cover" />
tools:src="@drawable/ic_first_charge_default" />
<com.coorchice.library.SuperTextView
android:id="@+id/tv_time"
@@ -39,18 +39,20 @@
android:paddingEnd="2dp"
android:text="@string/layout_item_first_charge_reward_01"
android:textColor="@color/white"
android:textSize="10sp"
android:textSize="@dimen/sp_11"
app:corner="4dp"
app:layout_constraintEnd_toEndOf="@id/view_bg"
android:layout_marginStart="@dimen/dp_2"
android:layout_marginTop="2dp"
app:layout_constraintStart_toStartOf="@id/view_bg"
app:layout_constraintTop_toTopOf="@id/view_bg"
app:left_bottom_corner="true"
app:left_top_corner="false"
app:right_bottom_corner="false"
app:right_top_corner="true"
app:left_bottom_corner="false"
app:left_top_corner="true"
app:right_bottom_corner="true"
app:right_top_corner="false"
app:shaderEnable="true"
app:shaderEndColor="#FE581E"
app:shaderEndColor="#E98EF4"
app:shaderMode="leftToRight"
app:shaderStartColor="#FFB556" />
app:shaderStartColor="#E669F7" />
<TextView
android:id="@+id/tv_name"
@@ -59,8 +61,8 @@
android:layout_marginTop="4dp"
android:ellipsize="end"
android:lines="1"
android:textColor="#FF845DFF"
android:textSize="10sp"
android:textColor="#7E26B0"
android:textSize="@dimen/sp_11"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/view_bg"

View File

@@ -5,9 +5,8 @@
<TextView
android:id="@+id/tv_content"
android:layout_width="145dp"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:background="@drawable/bg_first_charge_help"
android:paddingStart="15dp"
android:paddingTop="20dp"
@@ -15,6 +14,6 @@
android:paddingBottom="15dp"
android:text="@string/first_charge_help"
android:textColor="@color/color_333333"
android:textSize="10dp" />
android:textSize="@dimen/sp_12" />
</FrameLayout>

View File

@@ -650,5 +650,6 @@
<color name="color_3AD5F8">#3AD5F8</color>
<color name="color_00C4EA">#00C4EA</color>
<color name="color_E1FAFF">#E1FAFF</color>
<color name="color_BE5AF6">#BE5AF6</color>
</resources>