Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_street
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_street
Commits
3ee9de0e
Commit
3ee9de0e
authored
Jul 28, 2021
by
张释方
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
隐藏VR、版本升级弹框;添加立即领取登录弹框逻辑;提交新人有利弹框页面
parent
5bfc6b02
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
372 additions
and
51 deletions
+372
-51
MainActivity.kt
app/src/main/java/com/mints/street/main/MainActivity.kt
+8
-8
MyFragment.kt
app/src/main/java/com/mints/street/main/my/MyFragment.kt
+42
-35
OpenvipActivity.kt
...src/main/java/com/mints/street/main/my/OpenvipActivity.kt
+1
-0
DialogUtils.kt
...c/main/java/com/mints/street/widget/dialog/DialogUtils.kt
+11
-1
ShowBenfitDialog.kt
...n/java/com/mints/street/widget/dialog/ShowBenfitDialog.kt
+45
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+3
-3
dialog_showbenfit.xml
app/src/main/res/layout/dialog_showbenfit.xml
+258
-0
dialog_bg_benfit.png
app/src/main/res/mipmap-xhdpi/dialog_bg_benfit.png
+0
-0
dialog_close_benfit.png
app/src/main/res/mipmap-xhdpi/dialog_close_benfit.png
+0
-0
dialog_location_benfit.png
app/src/main/res/mipmap-xhdpi/dialog_location_benfit.png
+0
-0
menu_navigation.xml
library_base/src/main/res/menu/menu_navigation.xml
+4
-4
No files found.
app/src/main/java/com/mints/street/main/MainActivity.kt
View file @
3ee9de0e
...
...
@@ -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))
}
...
...
app/src/main/java/com/mints/street/main/my/MyFragment.kt
View file @
3ee9de0e
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
)
}
}
...
...
app/src/main/java/com/mints/street/main/my/OpenvipActivity.kt
View file @
3ee9de0e
...
...
@@ -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
)
{
...
...
app/src/main/java/com/mints/street/widget/dialog/DialogUtils.kt
View file @
3ee9de0e
...
...
@@ -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
app/src/main/java/com/mints/street/widget/dialog/ShowBenfitDialog.kt
0 → 100644
View file @
3ee9de0e
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
app/src/main/res/layout/activity_main.xml
View file @
3ee9de0e
...
...
@@ -20,7 +20,7 @@
<FrameLayout
android:id=
"@+id/flMainBootom"
android:layout_width=
"
wrap_cont
ent"
android:layout_width=
"
match_par
ent"
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>
-->
...
...
app/src/main/res/layout/dialog_showbenfit.xml
0 → 100644
View file @
3ee9de0e
This diff is collapsed.
Click to expand it.
app/src/main/res/mipmap-xhdpi/dialog_bg_benfit.png
0 → 100644
View file @
3ee9de0e
326 KB
app/src/main/res/mipmap-xhdpi/dialog_close_benfit.png
0 → 100644
View file @
3ee9de0e
3.06 KB
app/src/main/res/mipmap-xhdpi/dialog_location_benfit.png
0 → 100644
View file @
3ee9de0e
2.41 KB
library_base/src/main/res/menu/menu_navigation.xml
View file @
3ee9de0e
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment