Commit 3ee9de0e authored by 张释方's avatar 张释方

隐藏VR、版本升级弹框;添加立即领取登录弹框逻辑;提交新人有利弹框页面

parent 5bfc6b02
...@@ -47,21 +47,21 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() { ...@@ -47,21 +47,21 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
binding.mainBottom.init { binding.mainBottom.init {
when (it) { when (it) {
R.id.menu_home -> binding.mainViewpager.setCurrentItem(0, false) R.id.menu_home -> binding.mainViewpager.setCurrentItem(0, false)
R.id.menu_square -> binding.mainViewpager.setCurrentItem(1, false) // R.id.menu_square -> binding.mainViewpager.setCurrentItem(1, false)
R.id.menu_my -> { R.id.menu_my -> {
binding.mainViewpager.setCurrentItem(2, false) binding.mainViewpager.setCurrentItem(2, false)
// stopAnim() // stopAnim()
} }
} }
} }
//加载本地GIF动图 // //加载本地GIF动图
ImageLoader.ImageBuilder.with(this) // ImageLoader.ImageBuilder.with(this)
.setDrawable(R.mipmap.ic_earth_map) // .setDrawable(R.mipmap.ic_earth_map)
.setTargetView(binding.ivTakephoto).start() // .setTargetView(binding.ivTakephoto).start()
binding.mainBottom.interceptLongClick( binding.mainBottom.interceptLongClick(
R.id.menu_home, R.id.menu_home,
R.id.menu_square, // R.id.menu_square,
R.id.menu_my R.id.menu_my
) )
...@@ -72,8 +72,8 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() { ...@@ -72,8 +72,8 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
.subscribe { .subscribe {
} }
UpdateHelper.processUpdate(this@MainActivity, UpgradeInfo("1","2","3","4", // UpdateHelper.processUpdate(this@MainActivity, UpgradeInfo("1","2","3","4",
"5","6","7",false)) // "5","6","7",false))
} }
......
package com.mints.street.main.my package com.mints.street.main.my
import android.Manifest import android.Manifest
import android.content.Context
import android.graphics.Color import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
...@@ -92,7 +93,34 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList ...@@ -92,7 +93,34 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
RxUtils.onMultiClick(binding.llMyLogin) { RxUtils.onMultiClick(binding.llMyLogin) {
// binding.llMyLogin.setOnClickListener { // binding.llMyLogin.setOnClickListener {
if (!userManager.userIsLogin()) { if (!userManager.userIsLogin()) {
//显示登录弹窗
showlogindialog(context)
}
}
//设置立即领取点击事件
binding.btTry.setOnClickListener {
// startActivity(PermissionsActivity::class.java)
if (userManager.userIsLogin()) {
startActivity(OpenvipActivity::class.java)
} else {
//打开登录弹框
showlogindialog(context)
}
}
RxUtils.onMultiClick(aboutus) {
startActivity(AboutusActivity::class.java)
}
RxUtils.onMultiClick(moresettings) {
startActivity(MoresettingsActivity::class.java)
}
}
/**
* 显示登录弹框
*/
private fun showlogindialog(context: Context?) {
//创建弹窗 //创建弹窗
mBottomSheetDialog = BottomSheetDialog(context!!) mBottomSheetDialog = BottomSheetDialog(context!!)
val view1: View = layoutInflater.inflate(R.layout.layout_popupwindow, null) val view1: View = layoutInflater.inflate(R.layout.layout_popupwindow, null)
...@@ -118,27 +146,6 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList ...@@ -118,27 +146,6 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
ToastUtils.showShort("请先同意用户协议与隐私政策") ToastUtils.showShort("请先同意用户协议与隐私政策")
} }
} }
}
}
//设置立即领取点击事件
binding.btTry.setOnClickListener {
// startActivity(PermissionsActivity::class.java)
if (userManager.userIsLogin()) {
startActivity(OpenvipActivity::class.java)
} else {
ToastUtils.showLong("请先登录!")
}
}
RxUtils.onMultiClick(aboutus) {
startActivity(AboutusActivity::class.java)
}
RxUtils.onMultiClick(moresettings) {
startActivity(MoresettingsActivity::class.java)
}
} }
private fun initView() { private fun initView() {
...@@ -157,7 +164,7 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList ...@@ -157,7 +164,7 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
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_theme_name).text = "享8大特权"
ic_theme.findViewById<TextView>(R.id.tv_me1).text = "无线缩放" 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_me2).text = "国内外街景"
ic_theme.findViewById<TextView>(R.id.tv_me3).text = "VR全景" ic_theme.findViewById<TextView>(R.id.tv_me3).text = "VR全景"
...@@ -246,18 +253,18 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList ...@@ -246,18 +253,18 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
Glide.with(requireContext()).load(userManager.getWxHeader()).into(item_title_avatar) Glide.with(requireContext()).load(userManager.getWxHeader()).into(item_title_avatar)
// 是否会员 // 是否会员
if(userManager.getVipFlag()){ if (userManager.getVipFlag()) {
tv_tips.text = "恭喜您,已经成为全球会员啦~" tv_tips.text = "恭喜您,已经成为全球会员啦~"
bt_try.visibility=View.INVISIBLE bt_try.visibility = View.INVISIBLE
}else{ } else {
tv_tips.text = "恭喜你被全球会员卡砸中~" tv_tips.text = "恭喜你被全球会员卡砸中~"
bt_try.visibility=View.VISIBLE bt_try.visibility = View.VISIBLE
} }
} else { } else {
// 未登录 // 未登录
item_title_id.text = "未登录" item_title_id.text = "未登录"
tv_tips.text = "恭喜你被全球会员卡砸中~" tv_tips.text = "恭喜你被全球会员卡砸中~"
bt_try.visibility=View.VISIBLE bt_try.visibility = View.VISIBLE
item_title_avatar.setImageResource(R.mipmap.ic_my) item_title_avatar.setImageResource(R.mipmap.ic_my)
} }
} }
......
...@@ -251,6 +251,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>() ...@@ -251,6 +251,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
} }
private fun backvipDialog() { private fun backvipDialog() {
DialogUtils.showbackvipDialog(this, object : DialogListener() { DialogUtils.showbackvipDialog(this, object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) { override fun onClick(dialog: Dialog?, v: View?) {
if (dialog != null && dialog.isShowing) { if (dialog != null && dialog.isShowing) {
......
...@@ -5,7 +5,7 @@ import java.lang.ref.WeakReference ...@@ -5,7 +5,7 @@ import java.lang.ref.WeakReference
object DialogUtils{ object DialogUtils{
/** /**
* 公众号请求弹框 * 取消开通Vip弹框
*/ */
fun showbackvipDialog(ctx: Context, dialogListener: DialogListener) { fun showbackvipDialog(ctx: Context, dialogListener: DialogListener) {
val weakReference = WeakReference<Context>(ctx) val weakReference = WeakReference<Context>(ctx)
...@@ -14,4 +14,14 @@ object DialogUtils{ ...@@ -14,4 +14,14 @@ object DialogUtils{
dialogListener.setDialog(bonusDialog) dialogListener.setDialog(bonusDialog)
} }
/**
* 打开展示的限时福利弹框
*/
fun showbennfitsDialog(ctx: Context, dialogListener: DialogListener) {
val weakReference = WeakReference<Context>(ctx)
val bonusDialog = ShowBenfitDialog(weakReference.get()!!, dialogListener)
bonusDialog.show()
dialogListener.setDialog(bonusDialog)
}
} }
\ No newline at end of file
package com.mints.street.widget.dialog
import android.app.Dialog
import android.content.Context
import android.view.Gravity
import android.view.KeyEvent
import android.view.WindowManager
import android.widget.TextView
import com.mints.street.R
class ShowBenfitDialog (context: Context, private val listener: DialogListener) :
Dialog(context, R.style.dialog) {
private val lp: WindowManager.LayoutParams
// private val tv_payment: TextView
// private val tv_close: TextView
init {
setContentView(R.layout.dialog_showbenfit)
// 设置window属性
lp = window!!.attributes
lp.gravity = Gravity.CENTER
lp.width = WindowManager.LayoutParams.WRAP_CONTENT
lp.windowAnimations = R.style.DialogAnimBottom
window!!.attributes = lp
// 设置外部不可关闭
setCancelable(false)
setCanceledOnTouchOutside(false)
setOnKeyListener { _, i, _ ->
i == KeyEvent.KEYCODE_BACK
}
/*// 查找View
tv_payment = findViewById(R.id.tv_payment)
tv_close = findViewById(R.id.tv_close)
tv_payment.setOnClickListener {
listener.onClick(it)
}
tv_close.setOnClickListener {
listener.onClick(it)
}*/
}
}
\ No newline at end of file
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<FrameLayout <FrameLayout
android:id="@+id/flMainBootom" android:id="@+id/flMainBootom"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
tools:ignore="MissingConstraints"> tools:ignore="MissingConstraints">
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
app:menu="@menu/menu_navigation" /> app:menu="@menu/menu_navigation" />
</FrameLayout> </FrameLayout>
<FrameLayout <!--<FrameLayout
android:id="@+id/flTakephoto" android:id="@+id/flTakephoto"
android:layout_width="68dp" android:layout_width="68dp"
android:layout_height="68dp" android:layout_height="68dp"
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
android:layout_height="60dp" android:layout_height="60dp"
android:layout_gravity="center" android:layout_gravity="center"
android:scaleType="fitXY" /> android:scaleType="fitXY" />
</FrameLayout> </FrameLayout>-->
......
This diff is collapsed.
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
android:icon="@drawable/menu_main" android:icon="@drawable/menu_main"
android:title="@string/bottom_name_home" /> android:title="@string/bottom_name_home" />
<item <!-- <item-->
android:id="@+id/menu_square" <!-- android:id="@+id/menu_square"-->
android:icon="@drawable/menu_square" <!-- android:icon="@drawable/menu_square"-->
tools:ignore="MenuTitle" /> <!-- tools:ignore="MenuTitle" />-->
<item <item
......
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