Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_vedio
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_vedio
Commits
cf61dca8
Commit
cf61dca8
authored
Oct 12, 2023
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
bf3dea77
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
220 additions
and
147 deletions
+220
-147
AppConfig.java
...rc/main/java/com/duben/happyplaylet/common/AppConfig.java
+1
-0
HomePresenter.kt
...va/com/duben/happyplaylet/mvp/presenters/HomePresenter.kt
+2
-0
MyPresenter.kt
...java/com/duben/happyplaylet/mvp/presenters/MyPresenter.kt
+39
-0
MyView.kt
.../src/main/java/com/duben/happyplaylet/mvp/views/MyView.kt
+2
-0
AboutusActivity.kt
...va/com/duben/happyplaylet/ui/activitys/AboutusActivity.kt
+1
-1
GetGiftActivity.kt
...va/com/duben/happyplaylet/ui/activitys/GetGiftActivity.kt
+1
-1
GiftActivity.kt
.../java/com/duben/happyplaylet/ui/activitys/GiftActivity.kt
+13
-18
MyFragment.kt
...ain/java/com/duben/happyplaylet/ui/fragment/MyFragment.kt
+14
-0
activity_gift.xml
video/app/src/main/res/layout/activity_gift.xml
+147
-127
No files found.
video/app/src/main/java/com/duben/happyplaylet/common/AppConfig.java
View file @
cf61dca8
...
...
@@ -25,4 +25,5 @@ public class AppConfig {
public
static
boolean
enterAlipay
=
false
;
public
static
long
splashTime
=
0L
;
public
static
String
jtcText
=
"123123123123123123123123123123123123123123123123123123123123123123123123"
;
}
video/app/src/main/java/com/duben/happyplaylet/mvp/presenters/HomePresenter.kt
View file @
cf61dca8
package
com.duben.happyplaylet.mvp.presenters
import
com.duben.happyplaylet.MintsApplication
import
com.duben.happyplaylet.common.AppConfig
import
com.duben.happyplaylet.common.Constant
import
com.duben.happyplaylet.common.DeviceInfo
import
com.duben.happyplaylet.manager.AppHttpManager
...
...
@@ -302,6 +303,7 @@ class HomePresenter : BasePresenter<HomeView>() {
try
{
val
jsonObject
=
baseResponse
.
data
val
flag
=
jsonObject
[
"showReceiveJtcCoupons"
].
asBoolean
AppConfig
.
jtcText
=
jsonObject
[
"rule"
].
asString
view
.
giftSuc
(
flag
)
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
...
...
video/app/src/main/java/com/duben/happyplaylet/mvp/presenters/MyPresenter.kt
View file @
cf61dca8
package
com.duben.happyplaylet.mvp.presenters
import
com.duben.happyplaylet.MintsApplication
import
com.duben.happyplaylet.common.AppConfig
import
com.duben.happyplaylet.common.DeviceInfo
import
com.duben.happyplaylet.manager.AppHttpManager
import
com.duben.happyplaylet.manager.UserManager
...
...
@@ -9,6 +10,7 @@ import com.duben.happyplaylet.mvp.views.MyView
import
com.duben.happyplaylet.utils.DeviceUuidFactory
import
com.duben.library.net.neterror.BaseSubscriber
import
com.duben.library.net.neterror.Throwable
import
com.google.gson.JsonObject
class
MyPresenter
:
BasePresenter
<
MyView
>()
{
...
...
@@ -266,4 +268,41 @@ class MyPresenter : BasePresenter<MyView>() {
})
}
fun
getGift
()
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getGift
(),
object
:
BaseSubscriber
<
BaseResponse
<
JsonObject
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
}
override
fun
onError
(
e
:
Throwable
)
{
if
(
isLinkView
)
return
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
JsonObject
>)
{
if
(
isLinkView
)
return
val
code
=
baseResponse
.
status
val
message
=
baseResponse
.
message
when
(
code
)
{
200
->
{
try
{
val
jsonObject
=
baseResponse
.
data
val
flag
=
jsonObject
[
"showReceiveJtcCoupons"
].
asBoolean
AppConfig
.
jtcText
=
jsonObject
[
"rule"
].
asString
view
.
giftSuc
(
flag
)
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
}
else
->
{
view
.
showToast
(
message
)
}
}
}
})
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/happyplaylet/mvp/views/MyView.kt
View file @
cf61dca8
...
...
@@ -10,4 +10,6 @@ interface MyView : BaseView {
fun
getTurnIphoneMsgSuc
(
data
:
NineListBean
)
fun
toTurnSuc
(
data
:
NineListBean
.
NineBean
)
fun
unlockSuc
()
fun
giftSuc
(
data
:
Boolean
)
}
video/app/src/main/java/com/duben/happyplaylet/ui/activitys/AboutusActivity.kt
View file @
cf61dca8
...
...
@@ -62,7 +62,7 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
// object : TTMediationTestTool.ImageCallBack {
// override fun loadImage(imageView: ImageView?, s: String?) {}
// })
readyGo
(
GiftActivity
::
class
.
java
)
readyGo
(
G
etG
iftActivity
::
class
.
java
)
// VoiceRedEnvelopeManager.load(23,23)
true
}
...
...
video/app/src/main/java/com/duben/happyplaylet/ui/activitys/GetGiftActivity.kt
View file @
cf61dca8
...
...
@@ -39,7 +39,7 @@ class GetGiftActivity : BaseActivity(), View.OnClickListener {
override
fun
finish
()
{
super
.
finish
()
//关闭窗体动画显示
overridePendingTransition
(
0
,
R
.
anim
.
push_bottom
_out
)
overridePendingTransition
(
0
,
R
.
anim
.
fade
_out
)
}
override
fun
onClick
(
v
:
View
?)
{
...
...
video/app/src/main/java/com/duben/happyplaylet/ui/activitys/GiftActivity.kt
View file @
cf61dca8
...
...
@@ -5,15 +5,20 @@ import android.os.Looper
import
android.text.TextUtils
import
android.view.KeyEvent
import
android.view.View
import
com.duben.happyplaylet.BuildConfig
import
com.duben.library.utils.nodoubleclick.AntiShake
import
com.duben.happyplaylet.R
import
com.duben.happyplaylet.common.AppConfig
import
com.duben.happyplaylet.manager.UserManager
import
com.duben.happyplaylet.mvp.presenters.GiftPresenter
import
com.duben.happyplaylet.mvp.views.GiftView
import
com.duben.happyplaylet.ui.activitys.base.BaseActivity
import
com.duben.happyplaylet.utils.BackInputUtil
import
com.duben.happyplaylet.utils.LogUtil
import
com.duben.library.utils.ConstantUtil
import
kotlinx.android.synthetic.main.activity_aboutus.*
import
kotlinx.android.synthetic.main.activity_gift.*
import
kotlinx.android.synthetic.main.header_layout.*
/**
...
...
@@ -28,16 +33,20 @@ class GiftActivity : BaseActivity(), GiftView, View.OnClickListener {
private
var
mobile
:
String
?
=
null
override
fun
initViewsAndEvents
()
{
tv_title
.
text
=
"停车代金券"
iv_left_icon
.
visibility
=
View
.
VISIBLE
iv_left_icon
.
setImageResource
(
R
.
mipmap
.
ic_arrow_back
)
giftPresenter
.
attachView
(
this
)
initView
()
initListener
()
tv_gift_text
.
text
=
AppConfig
.
jtcText
}
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_gift
override
fun
toggleOverridePendingTransition
()
=
true
override
fun
getOverridePendingTransitionMode
()
=
TransitionMode
.
FADE
override
fun
isApplyKitKatTranslucency
()
=
false
...
...
@@ -46,21 +55,6 @@ class GiftActivity : BaseActivity(), GiftView, View.OnClickListener {
giftPresenter
.
detachView
()
}
override
fun
onKeyDown
(
keyCode
:
Int
,
event
:
KeyEvent
):
Boolean
{
return
if
(
keyCode
==
KeyEvent
.
KEYCODE_BACK
)
{
true
}
else
super
.
onKeyDown
(
keyCode
,
event
)
}
override
fun
finish
()
{
super
.
finish
()
//关闭窗体动画显示
overridePendingTransition
(
0
,
R
.
anim
.
push_bottom_out
)
}
override
fun
onClick
(
v
:
View
?)
{
if
(
AntiShake
.
check
(
v
?.
id
))
return
...
...
@@ -121,6 +115,7 @@ class GiftActivity : BaseActivity(), GiftView, View.OnClickListener {
}
private
fun
initListener
()
{
iv_left_icon
.
setOnClickListener
(
this
)
tvLoginSendcode
.
setOnClickListener
(
this
)
tvLoginNext
.
setOnClickListener
(
this
)
}
...
...
video/app/src/main/java/com/duben/happyplaylet/ui/fragment/MyFragment.kt
View file @
cf61dca8
...
...
@@ -52,6 +52,7 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
private
var
yoyo
:
YoYo
.
YoYoString
?
=
null
private
var
isInitLuckyData
=
false
private
var
isTurnLuckyPage
=
false
private
var
isShowGiftAct
=
false
private
var
nineShowBean
:
NineShowBean
?
=
null
var
carrierType
=
Constant
.
CARRIERTYPE_NINE
...
...
@@ -104,6 +105,7 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
if
(!
TextUtils
.
isEmpty
(
userManager
?.
userID
))
{
myPresenter
.
showTurn
()
myPresenter
.
getMyInfo
()
myPresenter
.
getGift
()
}
else
{
myPresenter
.
userLogin
()
}
...
...
@@ -158,6 +160,18 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
loginStatus
(
data
)
}
override
fun
giftSuc
(
showGiftflag
:
Boolean
)
{
if
(
showGiftflag
&&
!
isShowGiftAct
&&
userManager
.
vipFlag
)
{
isShowGiftAct
=
true
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
if
(
requireActivity
().
isFinishing
)
return
@postDelayed
readyGo
(
GiftActivity
::
class
.
java
)
},
500
)
}
}
private
fun
loginStatus
(
consumer
:
UserBean
)
{
// 1-匹配用户
if
(
consumer
.
activiteFlag
==
1
)
{
...
...
video/app/src/main/res/layout/activity_gift.xml
View file @
cf61dca8
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
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=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:orientation=
"vertical"
>
<include
layout=
"@layout/header_layout"
/>
<ScrollView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#FECEAB"
...
...
@@ -15,9 +22,20 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"10dp"
android:background=
"@drawable/shape_gift1"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"20dp"
android:layout_marginBottom=
"12dp"
android:text=
"请输入手机号"
android:textColor=
"@color/black"
android:textSize=
"20sp"
></TextView>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
...
...
@@ -34,7 +52,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
app:layout_constraintGuide_percent=
"0.05
"
/>
app:layout_constraintGuide_begin=
"19dp
"
/>
<LinearLayout
android:id=
"@+id/ly_mobile"
...
...
@@ -76,16 +94,15 @@
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:layout_marginBottom=
"30dp"
android:background=
"@drawable/shape_bg_mobile"
android:layout_marginBottom=
"20dp"
android:background=
"@drawable/shape_bg_mobile"
android:elevation=
"5dp"
android:orientation=
"horizontal"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@+id/guideline22"
app:layout_constraintStart_toStartOf=
"@+id/guideline21"
app:layout_constraintTop_toBottomOf=
"@+id/ly_mobile"
tools:ignore=
"MissingConstraints"
>
app:layout_constraintTop_toBottomOf=
"@+id/ly_mobile"
>
<TextView
android:layout_width=
"wrap_content"
...
...
@@ -137,11 +154,11 @@
android:layout_height=
"50dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"40dp"
android:layout_marginTop=
"20dp"
android:layout_marginRight=
"40dp"
android:background=
"@drawable/shape_gift1"
android:layout_marginBottom=
"20dp"
android:background=
"@drawable/shape_gift2"
android:gravity=
"center"
android:text=
"绑定手机号
"
android:text=
"一键领取
"
android:textColor=
"@color/white"
android:textSize=
"20sp"
/>
</LinearLayout>
...
...
@@ -150,19 +167,22 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"20dp"
android:layout_marginBottom=
"20dp"
android:src=
"@mipmap/ic_gift_text"
></ImageView>
<RelativeLayout
android:layout_margin=
"20dp"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"10dp"
android:background=
"@drawable/shape_gift1"
android:padding=
"20dp"
android:layout_height=
"wrap_content"
>
android:padding=
"10dp"
>
<TextView
android:id=
"@+id/tv_gift_text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
></TextView>
android:layout_height=
"wrap_content"
android:textColor=
"@color/black"
android:textSize=
"15sp"
></TextView>
</RelativeLayout>
</LinearLayout>
</ScrollView>
\ No newline at end of file
</ScrollView>
</LinearLayout>
\ No newline at end of file
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