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
Show 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>() {
...
@@ -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))
}
}
...
...
app/src/main/java/com/mints/street/main/my/MyFragment.kt
View file @
3ee9de0e
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
)
}
}
}
}
...
...
app/src/main/java/com/mints/street/main/my/OpenvipActivity.kt
View file @
3ee9de0e
...
@@ -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
)
{
...
...
app/src/main/java/com/mints/street/widget/dialog/DialogUtils.kt
View file @
3ee9de0e
...
@@ -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
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 @@
...
@@ -20,7 +20,7 @@
<FrameLayout
<FrameLayout
android:id=
"@+id/flMainBootom"
android:id=
"@+id/flMainBootom"
android:layout_width=
"
wrap_cont
ent"
android:layout_width=
"
match_par
ent"
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>
-->
...
...
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 @@
...
@@ -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
...
...
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