Commit b1810cca authored by 张释方's avatar 张释方

提交首页、个人中心、开通会员和沉浸式状态栏优化代码

parent 1ea0bdb7
package com.mints.street.adapter package com.mints.street.adapter
import android.content.Context import android.content.Context
import android.view.View
import com.alibaba.android.vlayout.layout.GridLayoutHelper import com.alibaba.android.vlayout.layout.GridLayoutHelper
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.fry.base.adapter.AbstractVLayoutBaseAdapter import com.fry.base.adapter.AbstractVLayoutBaseAdapter
......
...@@ -20,7 +20,6 @@ class GridPaymentAdapter(val context: Context, val list: List<VipBean.ListBean>) ...@@ -20,7 +20,6 @@ class GridPaymentAdapter(val context: Context, val list: List<VipBean.ListBean>)
private var first: Int = 1 private var first: Int = 1
private var datalist: List<VipBean.ListBean>? = list private var datalist: List<VipBean.ListBean>? = list
private var mposition: Int = -1 private var mposition: Int = -1
override fun onBindViewHolder(holder: BindingViewHolder<ItemGridPaymentAdpaterBinding>, position: Int) { override fun onBindViewHolder(holder: BindingViewHolder<ItemGridPaymentAdpaterBinding>, position: Int) {
holder.binding.tvOldprice.paint.flags = Paint.STRIKE_THRU_TEXT_FLAG holder.binding.tvOldprice.paint.flags = Paint.STRIKE_THRU_TEXT_FLAG
......
...@@ -43,7 +43,7 @@ interface MainApi { ...@@ -43,7 +43,7 @@ interface MainApi {
* 开通vip * 开通vip
*/ */
@POST("api/getVipProductsByType") @POST("api/getVipProductsByType")
fun getVipProductsByType(): Observable<Response<BaseResponse<VipBean>>> fun getVipProductsByType(@Body vo: @JvmSuppressWildcards Map<String, Int>): Observable<Response<BaseResponse<VipBean>>>
/** /**
* 获取vip支付渠道 * 获取vip支付渠道
......
...@@ -7,7 +7,7 @@ class VipBean : Serializable { ...@@ -7,7 +7,7 @@ class VipBean : Serializable {
inner class ListBean : Serializable{ inner class ListBean : Serializable{
var id: Int = 0 // 1 var id: Int = 0 // 1
var price: Int = 0// 78 var price: Double = 0.0// 78
var days: Int = 0 // 365 var days: Int = 0 // 365
var remarks: String = "" // 看更多地图 var remarks: String = "" // 看更多地图
var title: String = ""// 包年会员 var title: String = ""// 包年会员
......
...@@ -10,13 +10,18 @@ import com.mints.street.R ...@@ -10,13 +10,18 @@ import com.mints.street.R
import com.mints.street.webview.MintsWebViewActivity import com.mints.street.webview.MintsWebViewActivity
import kotlinx.android.synthetic.main.activity_aboutus.* import kotlinx.android.synthetic.main.activity_aboutus.*
import kotlinx.android.synthetic.main.include_header.* import kotlinx.android.synthetic.main.include_header.*
import me.goldze.mvvmhabit.utils.systembar.StatusBarUtil
class AboutusActivity : BaseActivity<ActivityAboutusBinding, AboutusViewModel>(), View.OnClickListener { class AboutusActivity : BaseActivity<ActivityAboutusBinding, AboutusViewModel>(), View.OnClickListener {
override fun initVariableId() = BR.viewModel override fun initVariableId() = BR.viewModel
override fun initContentView(savedInstanceState: Bundle?) = R.layout.activity_aboutus override fun initContentView(savedInstanceState: Bundle?) = R.layout.activity_aboutus
override fun getStatusBarHeightView(): View? {
return null
}
override fun initData() { override fun initData() {
super.initData() super.initData()
StatusBarUtil.setHeightAndPadding(this, binding.tvText)
initView() initView()
initListener() initListener()
} }
......
...@@ -19,6 +19,7 @@ import kotlinx.android.synthetic.main.include_header.* ...@@ -19,6 +19,7 @@ import kotlinx.android.synthetic.main.include_header.*
import me.goldze.mvvmhabit.utils.KLog import me.goldze.mvvmhabit.utils.KLog
import me.goldze.mvvmhabit.utils.RxUtils import me.goldze.mvvmhabit.utils.RxUtils
import me.goldze.mvvmhabit.utils.ToastUtils import me.goldze.mvvmhabit.utils.ToastUtils
import me.goldze.mvvmhabit.utils.systembar.StatusBarUtil
import org.w3c.dom.Text import org.w3c.dom.Text
class MoresettingsActivity : BaseActivity<ActivityMoresettingsBinding, MoresettingsViewModel>(), View.OnClickListener { class MoresettingsActivity : BaseActivity<ActivityMoresettingsBinding, MoresettingsViewModel>(), View.OnClickListener {
...@@ -27,8 +28,12 @@ class MoresettingsActivity : BaseActivity<ActivityMoresettingsBinding, Moresetti ...@@ -27,8 +28,12 @@ class MoresettingsActivity : BaseActivity<ActivityMoresettingsBinding, Moresetti
override fun initVariableId() = BR.viewModel override fun initVariableId() = BR.viewModel
override fun initContentView(savedInstanceState: Bundle?) = R.layout.activity_moresettings override fun initContentView(savedInstanceState: Bundle?) = R.layout.activity_moresettings
override fun getStatusBarHeightView(): View? {
return null
}
override fun initData() { override fun initData() {
super.initData() super.initData()
StatusBarUtil.setHeightAndPadding(this, binding.lyLinear)
initView() initView()
initListener() initListener()
......
...@@ -159,6 +159,27 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList ...@@ -159,6 +159,27 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
moresettings.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(privacyAgree, null, null, null) moresettings.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(privacyAgree, null, null, null)
moresettings.findViewById<TextView>(R.id.tv_right).visibility = View.GONE moresettings.findViewById<TextView>(R.id.tv_right).visibility = View.GONE
moresettings.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE moresettings.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE
ic_theme.findViewById<TextView>(R.id.tv_theme_name).text="享8大特权"
ic_theme.findViewById<TextView>(R.id.tv_me1).text = "无线缩放"
ic_theme.findViewById<TextView>(R.id.tv_me2).text = "国内外街景"
ic_theme.findViewById<TextView>(R.id.tv_me3).text = "VR全景"
ic_theme.findViewById<TextView>(R.id.tv_me4).text = "3D地图"
ic_theme.findViewById<TextView>(R.id.tv_me5).text = "国外搜索"
ic_theme.findViewById<TextView>(R.id.tv_me6).text = "高清地图"
ic_theme.findViewById<TextView>(R.id.tv_me7).text = "历史影像"
ic_theme.findViewById<TextView>(R.id.tv_me8).text = "景点推荐"
ic_theme.findViewById<ImageView>(R.id.iv_decorate1).setImageResource(R.mipmap.icon_me_tiao)
ic_theme.findViewById<ImageView>(R.id.iv_decorate2).setImageResource(R.mipmap.icon_me_tiao)
ic_theme.findViewById<ImageView>(R.id.iv_me1).setImageResource(R.mipmap.icon_me1)
ic_theme.findViewById<ImageView>(R.id.iv_me2).setImageResource(R.mipmap.icon_me2)
ic_theme.findViewById<ImageView>(R.id.iv_me3).setImageResource(R.mipmap.icon_me3)
ic_theme.findViewById<ImageView>(R.id.iv_me4).setImageResource(R.mipmap.icon_me4)
ic_theme.findViewById<ImageView>(R.id.iv_me5).setImageResource(R.mipmap.icon_me5)
ic_theme.findViewById<ImageView>(R.id.iv_me6).setImageResource(R.mipmap.icon_me6)
ic_theme.findViewById<ImageView>(R.id.iv_me7).setImageResource(R.mipmap.icon_me7)
ic_theme.findViewById<ImageView>(R.id.iv_me8).setImageResource(R.mipmap.icon_me8)
} }
...@@ -201,7 +222,6 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList ...@@ -201,7 +222,6 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
} }
R.id.tv_private -> { R.id.tv_private -> {
MintsWebViewActivity.startWebView(name = "隐私协议", url = "http://test.mints-id.com/map-api/map/privacy.html") MintsWebViewActivity.startWebView(name = "隐私协议", url = "http://test.mints-id.com/map-api/map/privacy.html")
} }
} }
} }
......
...@@ -4,6 +4,8 @@ import android.app.Dialog ...@@ -4,6 +4,8 @@ import android.app.Dialog
import android.graphics.Color import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import com.alibaba.android.vlayout.DelegateAdapter import com.alibaba.android.vlayout.DelegateAdapter
import com.alibaba.android.vlayout.VirtualLayoutManager import com.alibaba.android.vlayout.VirtualLayoutManager
...@@ -21,6 +23,8 @@ import com.mints.street.manager.UserManager ...@@ -21,6 +23,8 @@ import com.mints.street.manager.UserManager
import com.mints.street.widget.dialog.DialogListener import com.mints.street.widget.dialog.DialogListener
import com.mints.street.widget.dialog.DialogUtils import com.mints.street.widget.dialog.DialogUtils
import kotlinx.android.synthetic.main.activity_openvip.* import kotlinx.android.synthetic.main.activity_openvip.*
import kotlinx.android.synthetic.main.activity_openvip.bt_try
import kotlinx.android.synthetic.main.fragment_my.*
import kotlinx.android.synthetic.main.include_header.* import kotlinx.android.synthetic.main.include_header.*
import me.goldze.mvvmhabit.base.AppManager import me.goldze.mvvmhabit.base.AppManager
import me.goldze.mvvmhabit.utils.AppUtils import me.goldze.mvvmhabit.utils.AppUtils
...@@ -41,6 +45,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>() ...@@ -41,6 +45,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
override fun getStatusBarHeightView(): View? { override fun getStatusBarHeightView(): View? {
return null return null
} }
override fun initData() { override fun initData() {
super.initData() super.initData()
StatusBarUtil.setHeightAndPadding(this, binding.viewBg) StatusBarUtil.setHeightAndPadding(this, binding.viewBg)
...@@ -95,14 +100,46 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>() ...@@ -95,14 +100,46 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
iv_left_icon.visibility = View.VISIBLE iv_left_icon.visibility = View.VISIBLE
header_line.visibility = View.GONE header_line.visibility = View.GONE
//设置特权推荐
privilege.findViewById<TextView>(R.id.tv_theme_name).text = "享8大特权"
privilege.findViewById<TextView>(R.id.tv_me1).text = "高清地图"
privilege.findViewById<TextView>(R.id.tv_me2).text = "国内外街景"
privilege.findViewById<TextView>(R.id.tv_me3).text = "3D地图"
privilege.findViewById<TextView>(R.id.tv_me4).text = "VR全景"
privilege.findViewById<TextView>(R.id.tv_me5).text = "无限缩放"
privilege.findViewById<TextView>(R.id.tv_me6).text = "历史影像"
privilege.findViewById<TextView>(R.id.tv_me7).text = "国内外搜索"
privilege.findViewById<TextView>(R.id.tv_me8).text = "景点推荐"
privilege.findViewById<ImageView>(R.id.iv_decorate1).setImageResource(R.mipmap.icon_privilege_tiao2)
privilege.findViewById<ImageView>(R.id.iv_decorate1).layoutParams.width = AppUtils.dp2Px(this, 100F)
privilege.findViewById<ImageView>(R.id.iv_decorate1).layoutParams.height = AppUtils.dp2Px(this, 50F)
privilege.findViewById<ImageView>(R.id.iv_decorate1).setPadding(0, 0, AppUtils.dp2Px(this, 50F), 0)
privilege.findViewById<ImageView>(R.id.iv_decorate2).setImageResource(R.mipmap.icon_privilege_tiao1)
privilege.findViewById<ImageView>(R.id.iv_decorate2).layoutParams.width = AppUtils.dp2Px(this, 100F)
privilege.findViewById<ImageView>(R.id.iv_decorate2).layoutParams.height = AppUtils.dp2Px(this, 50F)
privilege.findViewById<ImageView>(R.id.iv_decorate2).setPadding(AppUtils.dp2Px(this, 50F), 0, 0, 0)
privilege.findViewById<ImageView>(R.id.iv_me1).setImageResource(R.mipmap.icon_privilege1)
privilege.findViewById<ImageView>(R.id.iv_me2).setImageResource(R.mipmap.icon_privilege2)
privilege.findViewById<ImageView>(R.id.iv_me3).setImageResource(R.mipmap.icon_privilege3)
privilege.findViewById<ImageView>(R.id.iv_me4).setImageResource(R.mipmap.icon_privilege4)
privilege.findViewById<ImageView>(R.id.iv_me5).setImageResource(R.mipmap.icon_privilege5)
privilege.findViewById<ImageView>(R.id.iv_me6).setImageResource(R.mipmap.icon_privilege6)
privilege.findViewById<ImageView>(R.id.iv_me7).setImageResource(R.mipmap.icon_privilege7)
privilege.findViewById<ImageView>(R.id.iv_me8).setImageResource(R.mipmap.icon_privilege8)
//套餐推荐
imageView.setImageResource(R.mipmap.icon_privilege_tiao2)
imageView.layoutParams.width = AppUtils.dp2Px(this, 80F)
imageView.setPadding(0, 0, AppUtils.dp2Px(this, 20F), 0)
imageView2.setImageResource(R.mipmap.icon_privilege_tiao1)
imageView2.layoutParams.width = AppUtils.dp2Px(this, 80F)
imageView2.setPadding(AppUtils.dp2Px(this, 20F), 0, 0, 0)
//recycleView管理(展示套餐推荐) //recycleView管理(展示套餐推荐)
vLayout = VirtualLayoutManager(this) vLayout = VirtualLayoutManager(this)
mAdapter = DelegateAdapter(vLayout, false) mAdapter = DelegateAdapter(vLayout, false)
binding.listview.adapter = mAdapter binding.listview.adapter = mAdapter
binding.listview.layoutManager = vLayout binding.listview.layoutManager = vLayout
} }
override fun initViewObservable() { override fun initViewObservable() {
...@@ -154,7 +191,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>() ...@@ -154,7 +191,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
} }
R.id.ly_alipay -> {//支付宝支付 R.id.ly_alipay -> {//支付宝支付
//设置选中样式 //设置选中样式
pw_flag=2 pw_flag = 2
setOnChecked(pw_flag) setOnChecked(pw_flag)
} }
R.id.bt_try -> {//点击开通全球会员按钮 R.id.bt_try -> {//点击开通全球会员按钮
......
...@@ -23,8 +23,10 @@ class OpenvipViewModel(application: Application) : BaseViewModel(application) { ...@@ -23,8 +23,10 @@ class OpenvipViewModel(application: Application) : BaseViewModel(application) {
* @param mobile * @param mobile
*/ */
fun openvipInfo() { fun openvipInfo() {
val vo = HashMap<String, Int>()
vo["type"] = 1
ApiModel.openvip(lifecycleProvider).safeSubscribe( ApiModel.openvip(lifecycleProvider, vo).safeSubscribe(
object : HttpSubscribeImpl<BaseResponse<VipBean>>( object : HttpSubscribeImpl<BaseResponse<VipBean>>(
this@OpenvipViewModel, true) { this@OpenvipViewModel, true) {
override fun onBusinessSuccess(response: BaseResponse<VipBean>) { override fun onBusinessSuccess(response: BaseResponse<VipBean>) {
...@@ -33,7 +35,7 @@ class OpenvipViewModel(application: Application) : BaseViewModel(application) { ...@@ -33,7 +35,7 @@ class OpenvipViewModel(application: Application) : BaseViewModel(application) {
} }
override fun onError(e: Throwable) { override fun onError(e: Throwable) {
KLog.e("openvip", "发送验证码错误") KLog.e("openvip", "请求错误:$e")
} }
}) })
} }
......
...@@ -41,9 +41,9 @@ object ApiModel { ...@@ -41,9 +41,9 @@ object ApiModel {
/** /**
* 开通会员 * 开通会员
*/ */
fun openvip(lifecycleProvider: LifecycleProvider<Any>?): Observable<Response<BaseResponse<VipBean>>> { fun openvip(lifecycleProvider: LifecycleProvider<Any>?, map: Map<String, Int>): Observable<Response<BaseResponse<VipBean>>> {
return HttpManager.getInstance() return HttpManager.getInstance()
.execute(lifecycleProvider, MainApi.newInstance().getVipProductsByType()) .execute(lifecycleProvider, MainApi.newInstance().getVipProductsByType(map))
} }
/** /**
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
android:id="@+id/header" android:id="@+id/header"
layout="@layout/include_header" /> layout="@layout/include_header" />
<TextView <TextView
android:id="@+id/tv_text"
android:layout_below="@+id/header" android:layout_below="@+id/header"
android:paddingTop="30dp" android:paddingTop="30dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<include layout="@layout/include_header" /> <include layout="@layout/include_header" />
<com.mints.street.widget.ElasticScrollView <com.mints.street.widget.ElasticScrollView
android:id="@+id/ly_linear"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:overScrollMode="never"> android:overScrollMode="never">
......
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<include layout="@layout/include_header" /> <include
layout="@layout/include_header" />
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -52,7 +53,9 @@ ...@@ -52,7 +53,9 @@
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
</com.mints.street.widget.CoverFlowViewPager> </com.mints.street.widget.CoverFlowViewPager>
<include layout="@layout/include_privilege_show" /> <include
android:id="@+id/privilege"
layout="@layout/include_privilege_show" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -64,9 +67,7 @@ ...@@ -64,9 +67,7 @@
<ImageView <ImageView
android:id="@+id/imageView" android:id="@+id/imageView"
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="3dp"/>
android:layout_marginRight="10dp"
android:src="@mipmap/icon_me_tiao" />
<TextView <TextView
android:id="@+id/textView7" android:id="@+id/textView7"
...@@ -79,9 +80,7 @@ ...@@ -79,9 +80,7 @@
<ImageView <ImageView
android:id="@+id/imageView2" android:id="@+id/imageView2"
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="3dp" />
android:layout_marginLeft="10dp"
android:src="@mipmap/icon_me_tiao" />
</LinearLayout> </LinearLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
......
...@@ -105,7 +105,9 @@ ...@@ -105,7 +105,9 @@
android:textSize="12sp" /> android:textSize="12sp" />
</RelativeLayout> </RelativeLayout>
<include layout="@layout/include_privilege_show" /> <include
android:id="@+id/ic_theme"
layout="@layout/include_privilege_show" />
</LinearLayout> </LinearLayout>
......
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/main_color" android:state_checked="true"/> <item android:color="@color/main_blue_lower" android:state_checked="true"/>
<item android:color="@color/main_color" android:state_pressed="true"/> <item android:color="@color/main_blue_lower" android:state_pressed="true"/>
<item android:color="@color/main_blue_color"/> <item android:color="@color/main_blue_color"/>
</selector> </selector>
\ No newline at end of file
...@@ -24,4 +24,5 @@ ...@@ -24,4 +24,5 @@
<color name="color_BEC2CC">#BEC2CC</color> <color name="color_BEC2CC">#BEC2CC</color>
<color name="color_555">#555555</color> <color name="color_555">#555555</color>
<color name="color_8F6D21">#8F6D21</color> <color name="color_8F6D21">#8F6D21</color>
<color name="main_blue_lower">#2196F3</color>
</resources> </resources>
\ No newline at end of file
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