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
afb2b236
Commit
afb2b236
authored
Aug 05, 2021
by
张释方
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交无限放大开通vip弹窗
parent
ece1c945
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
133 additions
and
2 deletions
+133
-2
HomeFragment.kt
app/src/main/java/com/mints/street/main/home/HomeFragment.kt
+2
-2
DialogUtils.kt
...c/main/java/com/mints/street/widget/dialog/DialogUtils.kt
+6
-0
UpgradeVipDialog.kt
...n/java/com/mints/street/widget/dialog/UpgradeVipDialog.kt
+55
-0
shape_upgrade_bg.xml
app/src/main/res/drawable/shape_upgrade_bg.xml
+6
-0
shape_upgrade_btn_bg.xml
app/src/main/res/drawable/shape_upgrade_btn_bg.xml
+9
-0
layout_upgradevip.xml
app/src/main/res/layout/layout_upgradevip.xml
+55
-0
icon_upgrade_close.png
app/src/main/res/mipmap-xhdpi/icon_upgrade_close.png
+0
-0
iv_upgrade.png
app/src/main/res/mipmap-xhdpi/iv_upgrade.png
+0
-0
No files found.
app/src/main/java/com/mints/street/main/home/HomeFragment.kt
View file @
afb2b236
...
@@ -24,9 +24,9 @@ import com.mints.street.bean.MapBean
...
@@ -24,9 +24,9 @@ import com.mints.street.bean.MapBean
import
com.mints.street.bean.PositioningBean
import
com.mints.street.bean.PositioningBean
import
com.mints.street.databinding.FragmentHomeBinding
import
com.mints.street.databinding.FragmentHomeBinding
import
com.mints.street.manager.UmengManager
import
com.mints.street.manager.UmengManager
import
com.mints.street.utils.GPSConverterUtils
import
com.mints.street.widget.ScrollLayout
import
com.mints.street.widget.ScrollLayout
import
com.mints.street.widget.dialog.DialogUtils
import
com.mints.street.widget.dialog.DialogUtils
import
com.mints.street.widget.dialog.DialogUtils.showupgradevipDialog
import
me.goldze.mvvmhabit.base.AppManager
import
me.goldze.mvvmhabit.base.AppManager
import
me.goldze.mvvmhabit.utils.KLog
import
me.goldze.mvvmhabit.utils.KLog
import
me.goldze.mvvmhabit.utils.RxUtils
import
me.goldze.mvvmhabit.utils.RxUtils
...
@@ -37,7 +37,6 @@ import me.goldze.mvvmhabit.utils.SPUtils
...
@@ -37,7 +37,6 @@ import me.goldze.mvvmhabit.utils.SPUtils
* 首页页面
* 首页页面
*/
*/
class
HomeFragment
:
BaseFragment
<
FragmentHomeBinding
,
HomeViewModel
>(),
SensorEventListener
{
class
HomeFragment
:
BaseFragment
<
FragmentHomeBinding
,
HomeViewModel
>(),
SensorEventListener
{
companion
object
{
companion
object
{
val
IS_FIRST_OPEN
:
String
=
"isFirstOpen"
val
IS_FIRST_OPEN
:
String
=
"isFirstOpen"
}
}
...
@@ -110,6 +109,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
...
@@ -110,6 +109,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
viewModel
.
authorized
(
""
,
currentLat
.
toString
(),
currentLon
.
toString
(),
false
)
viewModel
.
authorized
(
""
,
currentLat
.
toString
(),
currentLon
.
toString
(),
false
)
}
}
viewModel
.
getMapBean
()
viewModel
.
getMapBean
()
DialogUtils
.
showupgradevipDialog
(
requireContext
())
}
}
override
fun
initViewObservable
()
{
override
fun
initViewObservable
()
{
...
...
app/src/main/java/com/mints/street/widget/dialog/DialogUtils.kt
View file @
afb2b236
...
@@ -22,6 +22,12 @@ object DialogUtils {
...
@@ -22,6 +22,12 @@ object DialogUtils {
dialogListener
.
setDialog
(
bonusDialog
)
dialogListener
.
setDialog
(
bonusDialog
)
}
}
fun
showupgradevipDialog
(
ctx
:
Context
){
val
weakReference
=
WeakReference
<
Context
>(
ctx
)
val
bonusDialog
=
UpgradeVipDialog
(
weakReference
.
get
()
!!
)
bonusDialog
.
show
()
}
/**
/**
* 权限设置弹框
* 权限设置弹框
...
...
app/src/main/java/com/mints/street/widget/dialog/UpgradeVipDialog.kt
0 → 100644
View file @
afb2b236
package
com.mints.street.widget.dialog
import
android.app.Dialog
import
android.content.Context
import
android.content.Intent
import
android.view.Gravity
import
android.view.KeyEvent
import
android.view.WindowManager
import
android.widget.Button
import
android.widget.ImageView
import
androidx.fragment.app.FragmentActivity
import
com.alibaba.android.vlayout.DelegateAdapter
import
com.alibaba.android.vlayout.VirtualLayoutManager
import
com.blankj.utilcode.util.ActivityUtils.startActivity
import
com.mints.street.R
import
com.mints.street.adapter.GridBenfitAdapter
import
com.mints.street.main.my.OpenvipActivity
import
me.goldze.mvvmhabit.utils.RxUtils
class
UpgradeVipDialog
(
context
:
Context
)
:
Dialog
(
context
,
R
.
style
.
dialog
)
{
private
val
lp
:
WindowManager
.
LayoutParams
private
val
iv_close
:
ImageView
private
val
bt_upgrade
:
Button
init
{
setContentView
(
R
.
layout
.
layout_upgradevip
)
// 设置window属性
lp
=
window
!!
.
attributes
lp
.
gravity
=
Gravity
.
CENTER
lp
.
width
=
WindowManager
.
LayoutParams
.
WRAP_CONTENT
lp
.
windowAnimations
=
R
.
style
.
DialogAnimBottom
window
!!
.
attributes
=
lp
iv_close
=
findViewById
(
R
.
id
.
iv_close
)
bt_upgrade
=
findViewById
(
R
.
id
.
bt_upgrade
)
// 设置外部不可关闭
setCancelable
(
false
)
setCanceledOnTouchOutside
(
false
)
setOnKeyListener
{
_
,
i
,
_
->
i
==
KeyEvent
.
KEYCODE_BACK
}
initView
()
}
private
fun
initView
()
{
RxUtils
.
onMultiClick
(
iv_close
){
dismiss
()
}
RxUtils
.
onMultiClick
(
bt_upgrade
){
startActivity
(
Intent
(
context
,
OpenvipActivity
::
class
.
java
))
// dismiss()
}
}
}
\ No newline at end of file
app/src/main/res/drawable/shape_upgrade_bg.xml
0 → 100644
View file @
afb2b236
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"20dp"
/>
<solid
android:color=
"@color/white"
/>
</shape>
\ No newline at end of file
app/src/main/res/drawable/shape_upgrade_btn_bg.xml
0 → 100644
View file @
afb2b236
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"50dp"
/>
<gradient
android:startColor=
"#FFC107"
android:endColor=
"#FF5722"
android:angle=
"90"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/layout_upgradevip.xml
0 → 100644
View file @
afb2b236
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/shape_upgrade_bg"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"30dp"
android:orientation=
"vertical"
>
<ImageView
android:layout_width=
"80dp"
android:layout_height=
"80dp"
android:layout_gravity=
"center"
android:src=
"@mipmap/iv_upgrade"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginTop=
"30dp"
android:text=
"想要继续无限方法又不模糊?"
android:textColor=
"@color/black"
android:textSize=
"14sp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginTop=
"30dp"
android:text=
"升级全球会员,连地面小车也能看清"
android:textColor=
"#B3000000"
android:textSize=
"12sp"
/>
<Button
android:id=
"@+id/bt_upgrade"
android:layout_width=
"200dp"
android:layout_height=
"40dp"
android:layout_gravity=
"center"
android:layout_marginTop=
"30dp"
android:background=
"@drawable/shape_upgrade_btn_bg"
android:text=
"继续升级"
android:textColor=
"@color/white"
android:textSize=
"16sp"
/>
</LinearLayout>
<ImageView
android:id=
"@+id/iv_close"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"end|top"
android:src=
"@mipmap/icon_upgrade_close"
/>
</FrameLayout>
\ No newline at end of file
app/src/main/res/mipmap-xhdpi/icon_upgrade_close.png
0 → 100644
View file @
afb2b236
799 Bytes
app/src/main/res/mipmap-xhdpi/iv_upgrade.png
0 → 100644
View file @
afb2b236
17.4 KB
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