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>-->
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00FFFFFF"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="319dp"
android:layout_height="390dp"
android:background="@mipmap/dialog_bg_benfit">
<ImageView
android:id="@+id/imageView7"
android:layout_width="66dp"
android:layout_height="66dp"
app:layout_constraintBottom_toTopOf="@+id/guideline13"
app:layout_constraintEnd_toStartOf="@+id/guideline14"
app:layout_constraintStart_toStartOf="@+id/guideline18"
app:layout_constraintTop_toTopOf="@+id/guideline12"
app:srcCompat="@mipmap/ic_launcher_main" />
<ImageView
android:id="@+id/imageView20"
android:layout_width="66dp"
android:layout_height="66dp"
app:layout_constraintBottom_toTopOf="@+id/guideline17"
app:layout_constraintEnd_toStartOf="@+id/guideline19"
app:layout_constraintStart_toStartOf="@+id/guideline15"
app:layout_constraintTop_toTopOf="@+id/guideline13"
app:srcCompat="@mipmap/ic_launcher_main" />
<ImageView
android:id="@+id/imageView21"
android:layout_width="66dp"
android:layout_height="66dp"
app:layout_constraintBottom_toTopOf="@+id/guideline17"
app:layout_constraintEnd_toStartOf="@+id/guideline14"
app:layout_constraintStart_toStartOf="@+id/guideline18"
app:layout_constraintTop_toTopOf="@+id/guideline13"
app:srcCompat="@mipmap/ic_launcher_main" />
<ImageView
android:id="@+id/imageView22"
android:layout_width="66dp"
android:layout_height="66dp"
app:layout_constraintBottom_toTopOf="@+id/guideline13"
app:layout_constraintEnd_toStartOf="@+id/guideline19"
app:layout_constraintStart_toStartOf="@+id/guideline15"
app:layout_constraintTop_toTopOf="@+id/guideline12"
app:srcCompat="@mipmap/ic_launcher_main" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="北京故宫"
android:textColor="@color/black"
app:layout_constraintBottom_toTopOf="@+id/guideline13"
app:layout_constraintEnd_toStartOf="@+id/guideline14"
app:layout_constraintStart_toStartOf="@+id/guideline18"
app:layout_constraintTop_toBottomOf="@+id/imageView7" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="北京故宫"
android:textColor="@color/black"
app:layout_constraintBottom_toTopOf="@+id/guideline17"
app:layout_constraintEnd_toStartOf="@+id/guideline14"
app:layout_constraintStart_toStartOf="@+id/guideline18"
app:layout_constraintTop_toBottomOf="@+id/imageView21" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="北京故宫"
android:textColor="@color/black"
app:layout_constraintBottom_toTopOf="@+id/guideline17"
app:layout_constraintEnd_toStartOf="@+id/guideline19"
app:layout_constraintStart_toStartOf="@+id/guideline15"
app:layout_constraintTop_toBottomOf="@+id/imageView20" />
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="北京故宫"
android:textColor="@color/black"
app:layout_constraintBottom_toTopOf="@+id/guideline17"
app:layout_constraintEnd_toStartOf="@+id/guideline15"
app:layout_constraintStart_toStartOf="@+id/guideline14"
app:layout_constraintTop_toBottomOf="@+id/imageView5" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="北京故宫"
android:textColor="@color/black"
app:layout_constraintBottom_toTopOf="@+id/guideline13"
app:layout_constraintEnd_toStartOf="@+id/guideline19"
app:layout_constraintStart_toStartOf="@+id/guideline15"
app:layout_constraintTop_toBottomOf="@+id/imageView22" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="北京故宫"
android:textColor="@color/black"
app:layout_constraintBottom_toTopOf="@+id/guideline13"
app:layout_constraintEnd_toStartOf="@+id/guideline15"
app:layout_constraintStart_toStartOf="@+id/guideline14"
app:layout_constraintTop_toBottomOf="@+id/imageView23" />
<ImageView
android:id="@+id/imageView23"
android:layout_width="66dp"
android:layout_height="66dp"
app:layout_constraintBottom_toTopOf="@+id/guideline13"
app:layout_constraintEnd_toStartOf="@+id/guideline15"
app:layout_constraintStart_toStartOf="@+id/guideline14"
app:layout_constraintTop_toTopOf="@+id/guideline12"
app:srcCompat="@mipmap/ic_launcher_main" />
<ImageView
android:id="@+id/imageView12"
android:layout_width="16dp"
android:layout_height="16dp"
app:layout_constraintBottom_toBottomOf="@+id/imageView7"
app:layout_constraintEnd_toEndOf="@+id/imageView7"
app:layout_constraintStart_toStartOf="@+id/imageView7"
app:layout_constraintTop_toTopOf="@+id/imageView7"
app:srcCompat="@mipmap/dialog_location_benfit" />
<ImageView
android:id="@+id/imageView24"
android:layout_width="16dp"
android:layout_height="16dp"
app:layout_constraintBottom_toBottomOf="@+id/imageView20"
app:layout_constraintEnd_toEndOf="@+id/imageView20"
app:layout_constraintStart_toStartOf="@+id/imageView20"
app:layout_constraintTop_toTopOf="@+id/imageView20"
app:srcCompat="@mipmap/dialog_location_benfit" />
<ImageView
android:id="@+id/imageView25"
android:layout_width="16dp"
android:layout_height="16dp"
app:layout_constraintBottom_toBottomOf="@+id/imageView22"
app:layout_constraintEnd_toEndOf="@+id/imageView22"
app:layout_constraintStart_toStartOf="@+id/imageView22"
app:layout_constraintTop_toTopOf="@+id/imageView22"
app:srcCompat="@mipmap/dialog_location_benfit" />
<ImageView
android:id="@+id/imageView26"
android:layout_width="16dp"
android:layout_height="16dp"
app:layout_constraintBottom_toBottomOf="@+id/imageView23"
app:layout_constraintEnd_toEndOf="@+id/imageView23"
app:layout_constraintStart_toStartOf="@+id/imageView23"
app:layout_constraintTop_toTopOf="@+id/imageView23"
app:srcCompat="@mipmap/dialog_location_benfit" />
<ImageView
android:id="@+id/imageView27"
android:layout_width="16dp"
android:layout_height="16dp"
app:layout_constraintBottom_toBottomOf="@+id/imageView21"
app:layout_constraintEnd_toEndOf="@+id/imageView21"
app:layout_constraintStart_toStartOf="@+id/imageView21"
app:layout_constraintTop_toTopOf="@+id/imageView21"
app:srcCompat="@mipmap/dialog_location_benfit" />
<ImageView
android:id="@+id/imageView5"
android:layout_width="66dp"
android:layout_height="66dp"
app:layout_constraintBottom_toTopOf="@+id/guideline17"
app:layout_constraintEnd_toStartOf="@+id/guideline15"
app:layout_constraintStart_toStartOf="@+id/guideline14"
app:layout_constraintTop_toTopOf="@+id/guideline13"
app:srcCompat="@mipmap/ic_launcher_main" />
<ImageView
android:id="@+id/imageView6"
android:layout_width="16dp"
android:layout_height="16dp"
app:layout_constraintBottom_toBottomOf="@+id/imageView5"
app:layout_constraintEnd_toEndOf="@+id/imageView5"
app:layout_constraintStart_toStartOf="@+id/imageView5"
app:layout_constraintTop_toTopOf="@+id/imageView5"
app:srcCompat="@mipmap/dialog_location_benfit" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.35" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.65" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline17"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.95" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.36" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.08" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline19"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.92" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.64" />
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_gravity="center"
android:layout_marginTop="26dp"
android:src="@mipmap/dialog_close_benfit" />
</LinearLayout>
\ No newline at end of file
...@@ -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