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

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

parent 5bfc6b02
......@@ -47,21 +47,21 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
binding.mainBottom.init {
when (it) {
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 -> {
binding.mainViewpager.setCurrentItem(2, false)
// stopAnim()
}
}
}
//加载本地GIF动图
ImageLoader.ImageBuilder.with(this)
.setDrawable(R.mipmap.ic_earth_map)
.setTargetView(binding.ivTakephoto).start()
// //加载本地GIF动图
// ImageLoader.ImageBuilder.with(this)
// .setDrawable(R.mipmap.ic_earth_map)
// .setTargetView(binding.ivTakephoto).start()
binding.mainBottom.interceptLongClick(
R.id.menu_home,
R.id.menu_square,
// R.id.menu_square,
R.id.menu_my
)
......@@ -72,8 +72,8 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
.subscribe {
}
UpdateHelper.processUpdate(this@MainActivity, UpgradeInfo("1","2","3","4",
"5","6","7",false))
// UpdateHelper.processUpdate(this@MainActivity, UpgradeInfo("1","2","3","4",
// "5","6","7",false))
}
......
package com.mints.street.main.my
import android.Manifest
import android.content.Context
import android.graphics.Color
import android.os.Bundle
import android.view.LayoutInflater
......@@ -92,43 +93,18 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
RxUtils.onMultiClick(binding.llMyLogin) {
// binding.llMyLogin.setOnClickListener {
if (!userManager.userIsLogin()) {
//创建弹窗
mBottomSheetDialog = BottomSheetDialog(context!!)
val view1: View = layoutInflater.inflate(R.layout.layout_popupwindow, null)
mBottomSheetDialog!!.setContentView(view1)
mBottomSheetDialog!!.window!!.findViewById<View>(R.id.design_bottom_sheet).setBackgroundColor(Color.TRANSPARENT)
mBottomSheetDialog!!.show()
iv_weixin = view1.findViewById(R.id.iv_weixin)
ly_phone = view1.findViewById(R.id.ly_phone)
cb_checked = view1.findViewById(R.id.cb_checked)
tv_private = view1.findViewById(R.id.tv_private)
tv_regist = view1.findViewById(R.id.tv_regist)
tv_regist?.setOnClickListener(this)
tv_private?.setOnClickListener(this)
iv_weixin?.setOnClickListener(this)
// ly_phone?.setOnClickListener(this)
RxUtils.onMultiClick(ly_phone) {
if (cb_checked!!.isChecked) {
startActivity(LoginActivity::class.java)
mBottomSheetDialog!!.dismiss()
} else {
ToastUtils.showShort("请先同意用户协议与隐私政策")
}
}
//显示登录弹窗
showlogindialog(context)
}
}
//设置立即领取点击事件
binding.btTry.setOnClickListener {
// startActivity(PermissionsActivity::class.java)
if (userManager.userIsLogin()) {
startActivity(OpenvipActivity::class.java)
} else {
ToastUtils.showLong("请先登录!")
//打开登录弹框
showlogindialog(context)
}
}
......@@ -141,6 +117,37 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
}
}
/**
* 显示登录弹框
*/
private fun showlogindialog(context: Context?) {
//创建弹窗
mBottomSheetDialog = BottomSheetDialog(context!!)
val view1: View = layoutInflater.inflate(R.layout.layout_popupwindow, null)
mBottomSheetDialog!!.setContentView(view1)
mBottomSheetDialog!!.window!!.findViewById<View>(R.id.design_bottom_sheet).setBackgroundColor(Color.TRANSPARENT)
mBottomSheetDialog!!.show()
iv_weixin = view1.findViewById(R.id.iv_weixin)
ly_phone = view1.findViewById(R.id.ly_phone)
cb_checked = view1.findViewById(R.id.cb_checked)
tv_private = view1.findViewById(R.id.tv_private)
tv_regist = view1.findViewById(R.id.tv_regist)
tv_regist?.setOnClickListener(this)
tv_private?.setOnClickListener(this)
iv_weixin?.setOnClickListener(this)
// ly_phone?.setOnClickListener(this)
RxUtils.onMultiClick(ly_phone) {
if (cb_checked!!.isChecked) {
startActivity(LoginActivity::class.java)
mBottomSheetDialog!!.dismiss()
} else {
ToastUtils.showShort("请先同意用户协议与隐私政策")
}
}
}
private fun initView() {
aboutus.findViewById<TextView>(R.id.tv_title).text = "关于我们"
val userAgree = ContextCompat.getDrawable(context!!, R.mipmap.iv_about_us)
......@@ -157,7 +164,7 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
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_me2).text = "国内外街景"
ic_theme.findViewById<TextView>(R.id.tv_me3).text = "VR全景"
......@@ -246,18 +253,18 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
Glide.with(requireContext()).load(userManager.getWxHeader()).into(item_title_avatar)
// 是否会员
if(userManager.getVipFlag()){
if (userManager.getVipFlag()) {
tv_tips.text = "恭喜您,已经成为全球会员啦~"
bt_try.visibility=View.INVISIBLE
}else{
bt_try.visibility = View.INVISIBLE
} else {
tv_tips.text = "恭喜你被全球会员卡砸中~"
bt_try.visibility=View.VISIBLE
bt_try.visibility = View.VISIBLE
}
} else {
// 未登录
item_title_id.text = "未登录"
tv_tips.text = "恭喜你被全球会员卡砸中~"
bt_try.visibility=View.VISIBLE
bt_try.visibility = View.VISIBLE
item_title_avatar.setImageResource(R.mipmap.ic_my)
}
}
......
......@@ -251,6 +251,7 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
}
private fun backvipDialog() {
DialogUtils.showbackvipDialog(this, object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
if (dialog != null && dialog.isShowing) {
......
......@@ -5,7 +5,7 @@ import java.lang.ref.WeakReference
object DialogUtils{
/**
* 公众号请求弹框
* 取消开通Vip弹框
*/
fun showbackvipDialog(ctx: Context, dialogListener: DialogListener) {
val weakReference = WeakReference<Context>(ctx)
......@@ -14,4 +14,14 @@ object DialogUtils{
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 @@
<FrameLayout
android:id="@+id/flMainBootom"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
tools:ignore="MissingConstraints">
......@@ -35,7 +35,7 @@
app:menu="@menu/menu_navigation" />
</FrameLayout>
<FrameLayout
<!--<FrameLayout
android:id="@+id/flTakephoto"
android:layout_width="68dp"
android:layout_height="68dp"
......@@ -50,7 +50,7 @@
android:layout_height="60dp"
android:layout_gravity="center"
android:scaleType="fitXY" />
</FrameLayout>
</FrameLayout>-->
......
This diff is collapsed.
......@@ -7,10 +7,10 @@
android:icon="@drawable/menu_main"
android:title="@string/bottom_name_home" />
<item
android:id="@+id/menu_square"
android:icon="@drawable/menu_square"
tools:ignore="MenuTitle" />
<!-- <item-->
<!-- android:id="@+id/menu_square"-->
<!-- android:icon="@drawable/menu_square"-->
<!-- tools:ignore="MenuTitle" />-->
<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