Commit 740dab5c authored by mengcuiguang2's avatar mengcuiguang2

Merge branch 'dev_huanleduanju_0815' of...

Merge branch 'dev_huanleduanju_0815' of http://gitlab.mints-id.com/android/android_vedio into dev_huanleduanju_0815
parents 81ff6ba0 458b1523
...@@ -440,7 +440,10 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, ...@@ -440,7 +440,10 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
mainHandler.postDelayed( mainHandler.postDelayed(
{ {
if (vipAdapter.getPosition() == 0) { if (isFinishing) return@postDelayed
val vipBean = vipList!![vipAdapter.getPosition()]
// 0.01
if (vipBean.trial != 0) {
showPayCancelDialog() showPayCancelDialog()
} }
}, },
...@@ -633,8 +636,8 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, ...@@ -633,8 +636,8 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
private fun setBanner(data: List<VedioBean>) { private fun setBanner(data: List<VedioBean>) {
mainHandler.postDelayed({ mainHandler.postDelayed({
// nsv.fullScroll(View.FOCUS_DOWN) val scrollToBottomAnimator =
val scrollToBottomAnimator = ValueAnimator.ofInt(0, nsv.getChildAt(0).height - nsv.height) ValueAnimator.ofInt(0, nsv.getChildAt(0).height - nsv.height)
scrollToBottomAnimator.addUpdateListener { animator -> scrollToBottomAnimator.addUpdateListener { animator ->
val value = animator.animatedValue as Int val value = animator.animatedValue as Int
nsv.scrollTo(0, value) nsv.scrollTo(0, value)
...@@ -644,7 +647,6 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, ...@@ -644,7 +647,6 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
}, 1000) }, 1000)
mainHandler.postDelayed({ mainHandler.postDelayed({
// nsv.fullScroll(View.FOCUS_UP)
val scrollToTopAnimator = ValueAnimator.ofInt(nsv.scrollY, 0) val scrollToTopAnimator = ValueAnimator.ofInt(nsv.scrollY, 0)
scrollToTopAnimator.addUpdateListener { animator -> scrollToTopAnimator.addUpdateListener { animator ->
val value = animator.animatedValue as Int val value = animator.animatedValue as Int
...@@ -652,7 +654,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, ...@@ -652,7 +654,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
} }
scrollToTopAnimator.duration = 2000 scrollToTopAnimator.duration = 2000
scrollToTopAnimator.start() scrollToTopAnimator.start()
}, 2000) }, 3000)
val adapter = VipBannerAdapter(data) val adapter = VipBannerAdapter(data)
// 绑定生命周期 // 绑定生命周期
...@@ -670,14 +672,12 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, ...@@ -670,14 +672,12 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
override fun onPageSelected(position: Int) { override fun onPageSelected(position: Int) {
GlideUtils.loadBlurImageView(mContext, data[position].coverImage, iv_blur) GlideUtils.loadBlurImageView(mContext, data[position].coverImage, iv_blur)
tv_banner_title.text = String.format("《%1s》", data[position].title) tv_banner_title.text = String.format("《%1s》", data[position].title)
tv_banner_info.text = data[position].vedioDesc
} }
override fun onPageScrollStateChanged(state: Int) {} override fun onPageScrollStateChanged(state: Int) {}
}) })
GlideUtils.loadBlurImageView(mContext, data[0].coverImage, iv_blur) GlideUtils.loadBlurImageView(mContext, data[0].coverImage, iv_blur)
tv_banner_title.text = String.format("《%1s》", data[0].title) tv_banner_title.text = String.format("《%1s》", data[0].title)
tv_banner_info.text = data[0].vedioDesc
} }
private fun showPayCancelDialog() { private fun showPayCancelDialog() {
......
package com.duben.happyplaylet.ui.adapter package com.duben.happyplaylet.ui.adapter
import android.content.Context import android.content.Context
import android.graphics.Color
import android.graphics.Paint import android.graphics.Paint
import android.text.TextUtils
import android.view.Gravity import android.view.Gravity
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.ImageView
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.RelativeLayout
import android.widget.TextView import android.widget.TextView
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
...@@ -55,24 +51,13 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) : ...@@ -55,24 +51,13 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
override fun onBindViewHolder(holder: ViewHolder, position: Int) { override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val vipBean = vipList[position] val vipBean = vipList[position]
holder.tvVipItemTitle.text = vipBean.title holder.tvVipItemTitle.text = vipBean.title
// if (TextUtils.isEmpty(vipBean.topTitle)) { if (vipBean.trial != 0) {
// holder.tvVipItemLable.visibility = View.INVISIBLE holder.tvVipItemLable.setPadding(0, 0, 0, 0)
// } else {
// holder.tvVipItemLable.text = vipBean.topTitle
// holder.tvVipItemLable.visibility = View.VISIBLE
// }
if (vipBean.price == 0.01) {
holder.tvVipItemLable.setPadding(0, UIUtils.dp2px(2), 0, UIUtils.dp2px(2))
holder.tvVipItemLable.text = "年卡会员" holder.tvVipItemLable.text = "年卡会员"
holder.tvVipItemLable.gravity = Gravity.CENTER holder.tvVipItemLable.gravity = Gravity.CENTER
holder.tvVipItemLable.setBackgroundResource(R.mipmap.ic_vip_lable) holder.tvVipItemLable.setBackgroundResource(R.mipmap.ic_vip_lable)
} else { } else {
holder.tvVipItemLable.setPadding( holder.tvVipItemLable.setPadding(0, 0, UIUtils.dp2px(10), 0)
0,
UIUtils.dp2px(2),
UIUtils.dp2px(10),
UIUtils.dp2px(2)
)
holder.tvVipItemLable.gravity = Gravity.END or Gravity.CENTER_VERTICAL holder.tvVipItemLable.gravity = Gravity.END or Gravity.CENTER_VERTICAL
holder.tvVipItemLable.text = "可微信支付" holder.tvVipItemLable.text = "可微信支付"
holder.tvVipItemLable.setBackgroundResource(R.mipmap.ic_vip_lable_wx) holder.tvVipItemLable.setBackgroundResource(R.mipmap.ic_vip_lable_wx)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient <gradient
android:centerColor="@color/full_transparent" android:centerColor="@color/half_transparent"
android:centerX="0.5" android:centerX="0.5"
android:centerY="0.5" android:centerY="0.5"
android:endColor="@color/black" android:endColor="@color/black"
......
...@@ -16,108 +16,103 @@ ...@@ -16,108 +16,103 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<FrameLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content">
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="30dp">
<ImageView <ImageView
android:id="@+id/ic_vip_quit" android:id="@+id/iv_blur"
android:layout_width="50dp" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="match_parent"
android:padding="15dp" android:scaleType="fitXY" />
android:src="@mipmap/ic_left_arrow" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:src="@mipmap/ic_vip_label" />
</RelativeLayout> <ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shape_vip_blur" />
<FrameLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView <RelativeLayout
android:id="@+id/iv_blur"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="50dp"
android:scaleType="fitXY" /> android:layout_marginTop="30dp">
<ImageView <ImageView
android:layout_width="match_parent" android:id="@+id/ic_vip_quit"
android:layout_height="match_parent" android:layout_width="50dp"
android:background="@drawable/shape_vip_blur" /> android:layout_height="50dp"
android:padding="15dp"
android:src="@mipmap/ic_left_arrow" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:src="@mipmap/ic_vip_label" />
<LinearLayout </RelativeLayout>
<FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent">
android:elevation="10dp"
android:orientation="vertical">
<com.youth.banner.Banner <LinearLayout
android:id="@+id/vip_banner"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="240dp" />
<TextView
android:id="@+id/tv_banner_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:orientation="vertical">
android:layout_marginTop="10dp"
android:textColor="@color/white"
android:textSize="18sp" />
<TextView <com.youth.banner.Banner
android:id="@+id/tv_banner_info" android:id="@+id/vip_banner"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="70dp" android:layout_height="220dp" />
android:layout_gravity="center"
android:layout_marginStart="30dp"
android:layout_marginTop="6dp"
android:layout_marginEnd="30dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="3"
android:textColor="@color/btn_enabled"
android:textSize="14sp" />
</LinearLayout> <TextView
android:id="@+id/tv_banner_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:textColor="@color/white"
android:textSize="18sp" />
</FrameLayout> </LinearLayout>
<ImageView </FrameLayout>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@mipmap/bg_vip_1" />
<ImageView </LinearLayout>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/bg_vip_2" />
<ImageView </FrameLayout>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/bg_vip_3" /> <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@mipmap/bg_vip_1" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/bg_vip_2" />
</LinearLayout> <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/bg_vip_3" />
</FrameLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
...@@ -125,6 +120,7 @@ ...@@ -125,6 +120,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:scaleType="fitXY"
android:src="@mipmap/ic_vip_arc" /> android:src="@mipmap/ic_vip_arc" />
</FrameLayout> </FrameLayout>
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<TextView <TextView
android:id="@+id/tv_agreement_next" android:id="@+id/tv_agreement_next"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="46dp"
android:layout_marginLeft="40dp" android:layout_marginLeft="40dp"
android:layout_marginRight="40dp" android:layout_marginRight="40dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
android:background="@mipmap/bg_vip_btn" android:background="@mipmap/bg_vip_btn"
android:gravity="center" android:gravity="center"
android:text="同意并继续" android:text="同意并继续"
android:textColor="@color/white" android:textColor="@color/color_2F155E"
android:textSize="18sp" /> android:textSize="18sp" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
<TextView <TextView
android:id="@+id/tv_agreement_next" android:id="@+id/tv_agreement_next"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="46dp"
android:layout_marginLeft="40dp" android:layout_marginLeft="40dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginRight="40dp" android:layout_marginRight="40dp"
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
android:gravity="center" android:gravity="center"
android:text="" android:text=""
android:enabled="false" android:enabled="false"
android:textColor="@color/white" android:textColor="@color/color_2F155E"
android:textSize="18sp" /> android:textSize="18sp" />
<TextView <TextView
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
android:layout_marginTop="124dp" android:layout_marginTop="124dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_marginTop="120dp"
android:layout_marginEnd="15dp"
android:src="@mipmap/ic_vip_back" /> android:src="@mipmap/ic_vip_back" />
<TextView <TextView
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
<TextView <TextView
android:id="@+id/bannerTitle" android:id="@+id/bannerTitle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="26dp" android:layout_height="24dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginStart="40dp" android:layout_marginStart="60dp"
android:background="@mipmap/ic_vip_lable" android:background="@mipmap/ic_vip_lable"
android:ellipsize="marquee" android:ellipsize="marquee"
android:focusable="true" android:focusable="true"
......
...@@ -12,11 +12,9 @@ ...@@ -12,11 +12,9 @@
<TextView <TextView
android:id="@+id/tvVipItemLable" android:id="@+id/tvVipItemLable"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="22dp"
android:background="@mipmap/ic_vip_lable" android:background="@mipmap/ic_vip_lable"
android:gravity="end|center_vertical" android:gravity="end|center_vertical"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:textColor="@color/color_815136" android:textColor="@color/color_815136"
android:textSize="10sp" android:textSize="10sp"
tools:text="包年会员" /> tools:text="包年会员" />
......
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