Commit dcd2fa00 authored by fengruiyu's avatar fengruiyu

Merge branch 'dev_1.0.0' of http://39.97.65.143:81/android/android_street into fry_dev

parents 9b97659d afb2b236
...@@ -28,6 +28,7 @@ import com.mints.street.databinding.FragmentHomeBinding ...@@ -28,6 +28,7 @@ import com.mints.street.databinding.FragmentHomeBinding
import com.mints.street.manager.UmengManager import com.mints.street.manager.UmengManager
import com.mints.street.widget.ScrollLayout import com.mints.street.widget.ScrollLayout
import com.mints.street.widget.dialog.DialogUtils import com.mints.street.widget.dialog.DialogUtils
import com.mints.street.widget.dialog.DialogUtils.showupgradevipDialog
import me.goldze.mvvmhabit.base.AppManager import me.goldze.mvvmhabit.base.AppManager
import me.goldze.mvvmhabit.utils.KLog import me.goldze.mvvmhabit.utils.KLog
import me.goldze.mvvmhabit.utils.RxUtils import me.goldze.mvvmhabit.utils.RxUtils
...@@ -39,7 +40,6 @@ import me.goldze.mvvmhabit.utils.ToastUtils ...@@ -39,7 +40,6 @@ import me.goldze.mvvmhabit.utils.ToastUtils
* 首页页面 * 首页页面
*/ */
class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorEventListener { class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorEventListener {
companion object { companion object {
val IS_FIRST_OPEN: String = "isFirstOpen" val IS_FIRST_OPEN: String = "isFirstOpen"
} }
...@@ -116,6 +116,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE ...@@ -116,6 +116,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
viewModel.authorized("", currentLat.toString(), currentLon.toString(), false) viewModel.authorized("", currentLat.toString(), currentLon.toString(), false)
} }
viewModel.getMapBean() viewModel.getMapBean()
DialogUtils.showupgradevipDialog(requireContext())
} }
override fun initViewObservable() { override fun initViewObservable() {
......
...@@ -20,29 +20,6 @@ class FeaturedExperienceViewModel(application: Application):BaseViewModel(applic ...@@ -20,29 +20,6 @@ class FeaturedExperienceViewModel(application: Application):BaseViewModel(applic
val VrmapBean: MutableLiveData<VrmapBean> = MutableLiveData() val VrmapBean: MutableLiveData<VrmapBean> = MutableLiveData()
val VreperienceBean: MutableLiveData<VreperienceBean> = MutableLiveData() val VreperienceBean: MutableLiveData<VreperienceBean> = MutableLiveData()
fun vrPlaces(){//无参数传递
ApiModel.vrPlaces(lifecycleProvider).safeSubscribe(
object : HttpSubscribeImpl<BaseResponse<VrmapBean>>(
this@FeaturedExperienceViewModel,true){
override fun onBusinessSuccess(response: BaseResponse<VrmapBean>) {
VrmapBean.value=response.result
val a:MutableList<ScenicSpotBean> = ArrayList()
for (item in response.result.internal!!){
a.add(
ScenicSpotBean(name = item.name,url = item.url
,starRating = item.stars,images = item.img)
)
}
}
override fun onError(e: Throwable) {
KLog.e("vrPlaces","请求失败 : $e")
}
}
)
}
fun getChooseExperienceHeadData(){ fun getChooseExperienceHeadData(){
val vo = HashMap<String, Any>() val vo = HashMap<String, Any>()
vo["pageNum"] = 1 vo["pageNum"] = 1
......
...@@ -51,7 +51,7 @@ class FreeZoneFragment : BaseFragment<FragmentFreeZoneBinding, FreeZoneViewModel ...@@ -51,7 +51,7 @@ class FreeZoneFragment : BaseFragment<FragmentFreeZoneBinding, FreeZoneViewModel
//获取VR全景数据 //获取VR全景数据
viewModel.vrPlaces() viewModel.vrPlaces()
} }
viewModel.vrPlaces() // viewModel.vrPlaces()
} }
......
...@@ -22,6 +22,12 @@ object DialogUtils { ...@@ -22,6 +22,12 @@ object DialogUtils {
dialogListener.setDialog(bonusDialog) dialogListener.setDialog(bonusDialog)
} }
fun showupgradevipDialog(ctx: Context){
val weakReference = WeakReference<Context>(ctx)
val bonusDialog = UpgradeVipDialog(weakReference.get()!!)
bonusDialog.show()
}
/** /**
* 权限设置弹框 * 权限设置弹框
......
package com.mints.street.widget.dialog
import android.app.Dialog
import android.content.Context
import android.content.Intent
import android.view.Gravity
import android.view.KeyEvent
import android.view.WindowManager
import android.widget.Button
import android.widget.ImageView
import androidx.fragment.app.FragmentActivity
import com.alibaba.android.vlayout.DelegateAdapter
import com.alibaba.android.vlayout.VirtualLayoutManager
import com.blankj.utilcode.util.ActivityUtils.startActivity
import com.mints.street.R
import com.mints.street.adapter.GridBenfitAdapter
import com.mints.street.main.my.OpenvipActivity
import me.goldze.mvvmhabit.utils.RxUtils
class UpgradeVipDialog(context: Context)
: Dialog(context, R.style.dialog) {
private val lp: WindowManager.LayoutParams
private val iv_close:ImageView
private val bt_upgrade:Button
init {
setContentView(R.layout.layout_upgradevip)
// 设置window属性
lp = window!!.attributes
lp.gravity = Gravity.CENTER
lp.width = WindowManager.LayoutParams.WRAP_CONTENT
lp.windowAnimations = R.style.DialogAnimBottom
window!!.attributes = lp
iv_close=findViewById(R.id.iv_close)
bt_upgrade=findViewById(R.id.bt_upgrade)
// 设置外部不可关闭
setCancelable(false)
setCanceledOnTouchOutside(false)
setOnKeyListener { _, i, _ ->
i == KeyEvent.KEYCODE_BACK
}
initView()
}
private fun initView() {
RxUtils.onMultiClick(iv_close){
dismiss()
}
RxUtils.onMultiClick(bt_upgrade){
startActivity(Intent(context,OpenvipActivity::class.java))
// dismiss()
}
}
}
\ 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_vip_enable" android:state_checked="true" />
<item android:drawable="@mipmap/ic_vip_none" android:state_checked="false" />
<item android:drawable="@mipmap/ic_vip_none" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:radius="20dp" />
<solid android:color="@color/white"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:radius="50dp"/>
<gradient
android:startColor="#FFC107"
android:endColor="#FF5722"
android:angle="90"/>
</shape>
\ No newline at end of file
...@@ -65,8 +65,9 @@ ...@@ -65,8 +65,9 @@
android:padding="10dp"> android:padding="10dp">
<CheckBox <CheckBox
android:layout_marginRight="6dp"
android:id="@+id/cb_checked" android:id="@+id/cb_checked"
style="@style/MyCheckBox" style="@style/CustomCheckboxTheme"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_upgrade_bg">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="30dp"
android:orientation="vertical">
<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_gravity="center"
android:src="@mipmap/iv_upgrade" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="30dp"
android:text="想要继续无限方法又不模糊?"
android:textColor="@color/black"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="30dp"
android:text="升级全球会员,连地面小车也能看清"
android:textColor="#B3000000"
android:textSize="12sp" />
<Button
android:id="@+id/bt_upgrade"
android:layout_width="200dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_marginTop="30dp"
android:background="@drawable/shape_upgrade_btn_bg"
android:text="继续升级"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
<ImageView
android:id="@+id/iv_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|top"
android:src="@mipmap/icon_upgrade_close" />
</FrameLayout>
\ No newline at end of file
...@@ -64,4 +64,7 @@ ...@@ -64,4 +64,7 @@
<item name="android:windowEnterAnimation">@anim/dialog_bottom_in</item> <item name="android:windowEnterAnimation">@anim/dialog_bottom_in</item>
<item name="android:windowExitAnimation">@anim/dialog_bottom_out</item> <item name="android:windowExitAnimation">@anim/dialog_bottom_out</item>
</style> </style>
<style name="CustomCheckboxTheme" parent="@android:style/Widget.CompoundButton.CheckBox">
<item name="android:button">@drawable/checkbox_style</item>
</style>
</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