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
517c8dcb
Commit
517c8dcb
authored
Sep 21, 2023
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加红包聊天功能
parent
89a4ccba
Changes
39
Hide whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
1360 additions
and
20 deletions
+1360
-20
build.gradle
video/app/build.gradle
+3
-0
AndroidManifest.xml
video/app/src/main/AndroidManifest.xml
+2
-1
MsgBean.kt
...p/src/main/java/com/duben/dayplaylet/mvp/model/MsgBean.kt
+14
-0
MsgMultiItemEntity.kt
...java/com/duben/dayplaylet/mvp/model/MsgMultiItemEntity.kt
+11
-0
RedpkgPresenter.kt
...va/com/duben/dayplaylet/mvp/presenters/RedpkgPresenter.kt
+49
-0
RedpkgView.kt
...rc/main/java/com/duben/dayplaylet/mvp/views/RedpkgView.kt
+5
-0
MainActivity.kt
...in/java/com/duben/dayplaylet/ui/activitys/MainActivity.kt
+18
-3
SongAwardActivity.kt
...va/com/duben/dayplaylet/ui/activitys/SongAwardActivity.kt
+34
-0
BaseActivity.java
.../com/duben/dayplaylet/ui/activitys/base/BaseActivity.java
+8
-0
MsgAdapter.kt
...c/main/java/com/duben/dayplaylet/ui/adapter/MsgAdapter.kt
+158
-0
RedpkgFragment.kt
...n/java/com/duben/dayplaylet/ui/fragment/RedpkgFragment.kt
+297
-1
RedPkgAwardDialog.kt
...java/com/duben/dayplaylet/ui/widgets/RedPkgAwardDialog.kt
+83
-0
WindowInsetsFrameLayout.java
.../duben/dayplaylet/ui/widgets/WindowInsetsFrameLayout.java
+49
-0
WithDrawSucDialog.kt
...java/com/duben/dayplaylet/ui/widgets/WithDrawSucDialog.kt
+98
-0
GlideUtils.kt
...o/app/src/main/java/com/duben/library/utils/GlideUtils.kt
+16
-5
shape_bg_blue_send.xml
video/app/src/main/res/drawable/shape_bg_blue_send.xml
+10
-0
shape_bg_blue_withdraw.xml
video/app/src/main/res/drawable/shape_bg_blue_withdraw.xml
+10
-0
shape_gradient_redpkg.xml
video/app/src/main/res/drawable/shape_gradient_redpkg.xml
+9
-0
shape_msg_left.xml
video/app/src/main/res/drawable/shape_msg_left.xml
+10
-0
shape_msg_right.xml
video/app/src/main/res/drawable/shape_msg_right.xml
+9
-0
shape_scrollbar_thumb.xml
video/app/src/main/res/drawable/shape_scrollbar_thumb.xml
+7
-0
shape_withdraw_main.xml
video/app/src/main/res/drawable/shape_withdraw_main.xml
+11
-0
shape_withdraw_num.xml
video/app/src/main/res/drawable/shape_withdraw_num.xml
+7
-0
activity_main.xml
video/app/src/main/res/layout/activity_main.xml
+2
-3
activity_song_award.xml
video/app/src/main/res/layout/activity_song_award.xml
+7
-0
dialog_redpkg_award.xml
video/app/src/main/res/layout/dialog_redpkg_award.xml
+87
-0
dialog_withdraw_suc.xml
video/app/src/main/res/layout/dialog_withdraw_suc.xml
+116
-0
fragment_redpkg.xml
video/app/src/main/res/layout/fragment_redpkg.xml
+95
-7
item_msg_pic.xml
video/app/src/main/res/layout/item_msg_pic.xml
+70
-0
item_msg_text.xml
video/app/src/main/res/layout/item_msg_text.xml
+60
-0
bg_withdraw_suc.png
video/app/src/main/res/mipmap-xhdpi/bg_withdraw_suc.png
+0
-0
hongbao.png
video/app/src/main/res/mipmap-xhdpi/hongbao.png
+0
-0
ic_loadding.png
video/app/src/main/res/mipmap-xhdpi/ic_loadding.png
+0
-0
ic_red_envelope_coupon_bg.png
...p/src/main/res/mipmap-xhdpi/ic_red_envelope_coupon_bg.png
+0
-0
ic_red_envelope_coupon_draw_top.png
...main/res/mipmap-xhdpi/ic_red_envelope_coupon_draw_top.png
+0
-0
ic_red_envelope_coupon_top.png
.../src/main/res/mipmap-xhdpi/ic_red_envelope_coupon_top.png
+0
-0
ic_redpkg_withdraw.png
video/app/src/main/res/mipmap-xhdpi/ic_redpkg_withdraw.png
+0
-0
icon_reward_play.png
video/app/src/main/res/mipmap-xhdpi/icon_reward_play.png
+0
-0
colors.xml
video/app/src/main/res/values/colors.xml
+5
-0
No files found.
video/app/build.gradle
View file @
517c8dcb
...
...
@@ -253,6 +253,9 @@ dependencies {
exclude
group:
'com.tencent.mm.opensdk'
,
module:
'wechat-sdk-android'
}
// 软键盘监听状态
implementation
'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:3.0.0-RC3'
// 穿山甲聚合 接入【穿山甲、快手】
implementation
"com.pangle.cn:mediation-sdk:5.6.0.8"
...
...
video/app/src/main/AndroidManifest.xml
View file @
517c8dcb
...
...
@@ -108,7 +108,8 @@
android:exported=
"false"
android:launchMode=
"singleTask"
android:screenOrientation=
"portrait"
android:theme=
"@style/AppTheme.NoneTranslucent"
>
android:theme=
"@style/AppTheme.NoneTranslucent"
android:windowSoftInputMode=
"adjustResize"
>
</activity>
<activity
...
...
video/app/src/main/java/com/duben/dayplaylet/mvp/model/MsgBean.kt
0 → 100644
View file @
517c8dcb
package
com.duben.dayplaylet.mvp.model
/**
* hxg 2021/9/13 16:28 qq:929842234
*/
class
MsgBean
(
var
type
:
Int
,
// 消息类型
var
isReceive
:
Boolean
,
// 判断消息方向,是否是接收到的消息
var
name
:
String
?
=
""
,
// 名字
var
content
:
String
?
=
""
,
// 内容
var
avatarImg
:
Any
?
=
null
,
// 头像图片地址
var
contentImg
:
Any
?
=
null
,
// 图片地址
var
showFinger
:
Boolean
=
false
,
// 图片地址
)
\ No newline at end of file
video/app/src/main/java/com/duben/dayplaylet/mvp/model/MsgMultiItemEntity.kt
0 → 100644
View file @
517c8dcb
package
com.duben.dayplaylet.mvp.model
import
com.chad.library.adapter.base.entity.MultiItemEntity
const
val
MSG_MULTI_ITEM_1
=
1
const
val
MSG_MULTI_ITEM_2
=
2
data class
MSGMultiItemEntity
(
override
val
itemType
:
Int
,
var
data
:
MsgBean
,
)
:
MultiItemEntity
,
java
.
io
.
Serializable
\ No newline at end of file
video/app/src/main/java/com/duben/dayplaylet/mvp/presenters/RedpkgPresenter.kt
0 → 100644
View file @
517c8dcb
package
com.duben.dayplaylet.mvp.presenters
import
com.duben.dayplaylet.manager.AppHttpManager
import
com.duben.dayplaylet.mvp.model.BaseResponse
import
com.duben.dayplaylet.mvp.views.RedpkgView
import
com.duben.library.net.neterror.BaseSubscriber
import
com.duben.library.net.neterror.Throwable
import
com.google.gson.JsonObject
class
RedpkgPresenter
:
BasePresenter
<
RedpkgView
>()
{
// 添加金币
fun
reportAddCoinMsg
(
carrierType
:
String
,
ecpmId
:
String
=
""
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"ecpmId"
]
=
ecpmId
vo
[
"carrierType"
]
=
carrierType
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
reportAddCoinMsg
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
JsonObject
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
}
override
fun
onError
(
e
:
Throwable
)
{
if
(
isLinkView
)
return
view
.
showToast
(
e
.
message
)
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
JsonObject
>)
{
if
(
isLinkView
)
return
val
code
=
baseResponse
.
status
val
message
=
baseResponse
.
message
when
(
code
)
{
200
->
{
val
data
=
baseResponse
.
data
if
(
data
!=
null
)
{
view
.
reportAddCoinMsgSuc
(
data
[
"coin"
].
asInt
,
data
[
"di"
].
asInt
)
}
}
else
->
{
view
.
showToast
(
message
)
}
}
}
})
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/dayplaylet/mvp/views/RedpkgView.kt
0 → 100644
View file @
517c8dcb
package
com.duben.dayplaylet.mvp.views
interface
RedpkgView
:
BaseView
{
fun
reportAddCoinMsgSuc
(
coin
:
Int
,
di
:
Int
)
}
\ No newline at end of file
video/app/src/main/java/com/duben/dayplaylet/ui/activitys/MainActivity.kt
View file @
517c8dcb
...
...
@@ -5,6 +5,7 @@ import android.media.AudioManager
import
android.os.Bundle
import
android.view.KeyEvent
import
android.view.View
import
android.widget.RelativeLayout
import
androidx.fragment.app.Fragment
import
androidx.fragment.app.FragmentTransaction
import
com.duben.dayplaylet.MintsApplication
...
...
@@ -13,6 +14,7 @@ import com.duben.dayplaylet.common.AppConfig
import
com.duben.dayplaylet.common.Constant
import
com.duben.dayplaylet.ui.activitys.base.BaseActivity
import
com.duben.dayplaylet.ui.fragment.*
import
com.duben.dayplaylet.utils.UIUtils
import
com.duben.dayplaylet.video.csj.DPHolderManager
import
kotlinx.android.synthetic.main.activity_main.*
...
...
@@ -35,7 +37,7 @@ class MainActivity : BaseActivity(), View.OnClickListener {
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_main
override
fun
initViewsAndEvents
()
{
DPHolderManager
.
initDpSdk
(
MintsApplication
.
getContext
())
;
DPHolderManager
.
initDpSdk
(
MintsApplication
.
getContext
())
audioManager
=
getSystemService
(
Context
.
AUDIO_SERVICE
)
as
AudioManager
...
...
@@ -215,7 +217,20 @@ class MainActivity : BaseActivity(), View.OnClickListener {
currentFragment
=
fragment
}
fun
dismissDrawDialog
(){
(
myFragment
as
MyFragment
).
dismissDrawCashDialog
()
fun
dismissDrawDialog
()
{
(
myFragment
as
MyFragment
).
dismissDrawCashDialog
()
}
fun
hideTabView
()
{
val
ls
=
content_layout
.
layoutParams
as
RelativeLayout
.
LayoutParams
ls
.
bottomMargin
=
0
content_layout
.
layoutParams
=
ls
}
fun
showTabView
()
{
val
ls
=
content_layout
.
layoutParams
as
RelativeLayout
.
LayoutParams
ls
.
bottomMargin
=
UIUtils
.
dp2px
(
this
,
50f
)
content_layout
.
layoutParams
=
ls
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/dayplaylet/ui/activitys/SongAwardActivity.kt
View file @
517c8dcb
...
...
@@ -4,8 +4,13 @@ import android.content.Intent
import
android.os.Bundle
import
android.view.KeyEvent
import
android.view.View
import
android.widget.FrameLayout
import
com.duben.dayplaylet.R
import
com.duben.dayplaylet.ad.express.ExpressAdCallback
import
com.duben.dayplaylet.ad.express.ExpressManager
import
com.duben.dayplaylet.ad.express.MyExpressManager
import
com.duben.dayplaylet.ui.activitys.base.BaseActivity
import
com.duben.dayplaylet.utils.UIUtils
import
com.duben.library.utils.nodoubleclick.AntiShake
import
kotlinx.android.synthetic.main.activity_song_award.*
...
...
@@ -45,6 +50,8 @@ class SongAwardActivity : BaseActivity(), View.OnClickListener {
tv_award_yuanbao
.
text
=
"+"
+
yuanbao
initListener
()
showAdView
()
}
private
fun
initListener
()
{
...
...
@@ -83,4 +90,31 @@ class SongAwardActivity : BaseActivity(), View.OnClickListener {
}
}
}
private
fun
showAdView
()
{
MyExpressManager
.
instance
.
getAdView
(
object
:
ExpressAdCallback
{
override
fun
loadSuccess
(
adView
:
FrameLayout
?)
{
adView
?.
let
{
UIUtils
.
removeFromParent
(
it
)
fl_ad
.
removeAllViews
()
fl_ad
.
addView
(
it
)
}
}
override
fun
renderSuccess
(
adView
:
FrameLayout
?):
Boolean
{
adView
?.
let
{
UIUtils
.
removeFromParent
(
it
)
fl_ad
.
removeAllViews
()
fl_ad
.
addView
(
it
)
}
ExpressManager
.
instance
.
preLoadAd
()
return
false
}
override
fun
loadFail
()
{
}
})
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/dayplaylet/ui/activitys/base/BaseActivity.java
View file @
517c8dcb
...
...
@@ -97,6 +97,14 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
}
public
void
hideKeyboard
()
{
View
v
=
getCurrentFocus
();
if
(
v
!=
null
)
{
InputMethodManager
imm
=
(
InputMethodManager
)
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
);
imm
.
hideSoftInputFromWindow
(
v
.
getWindowToken
(),
InputMethodManager
.
HIDE_NOT_ALWAYS
);
}
}
// 根据EditText所在坐标和用户点击的坐标相对比,来判断是否隐藏键盘
private
boolean
HideKeyboard
(
View
view
,
MotionEvent
event
)
{
if
(
view
!=
null
&&
(
view
instanceof
EditText
))
{
...
...
video/app/src/main/java/com/duben/dayplaylet/ui/adapter/MsgAdapter.kt
0 → 100644
View file @
517c8dcb
package
com.duben.dayplaylet.ui.adapter
import
android.graphics.Color
import
android.view.Gravity
import
android.view.View
import
android.widget.*
import
com.airbnb.lottie.LottieAnimationView
import
com.airbnb.lottie.LottieComposition
import
com.airbnb.lottie.LottieCompositionFactory
import
com.airbnb.lottie.LottieDrawable
import
com.chad.library.adapter.base.BaseMultiItemQuickAdapter
import
com.chad.library.adapter.base.module.UpFetchModule
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
import
com.duben.dayplaylet.R
import
com.duben.dayplaylet.mvp.model.*
import
com.duben.library.utils.GlideUtils
/**
* 消息
* hxg 2020.9.13 qq:929842234
*/
class
MsgAdapter
:
BaseMultiItemQuickAdapter
<
MSGMultiItemEntity
,
BaseViewHolder
>(),
UpFetchModule
{
init
{
addItemType
(
MSG_MULTI_ITEM_1
,
R
.
layout
.
item_msg_text
)
addItemType
(
MSG_MULTI_ITEM_2
,
R
.
layout
.
item_msg_pic
)
}
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
MSGMultiItemEntity
)
{
when
(
holder
.
itemViewType
)
{
MSG_MULTI_ITEM_1
->
{
initTextHolder
(
holder
,
item
.
data
)
}
MSG_MULTI_ITEM_2
->
{
initPicHolder
(
holder
,
item
.
data
)
}
}
}
private
fun
initTextHolder
(
holder
:
BaseViewHolder
,
msgBean
:
MsgBean
)
{
val
ivHeadLeft
=
holder
.
getView
<
ImageView
>(
R
.
id
.
iv_head_left
)
val
ivHeadRight
=
holder
.
getView
<
ImageView
>(
R
.
id
.
iv_head_right
)
val
llContent
=
holder
.
getView
<
LinearLayout
>(
R
.
id
.
ll_content
)
val
tvName
=
holder
.
getView
<
TextView
>(
R
.
id
.
tv_name
)
val
tvContent
=
holder
.
getView
<
TextView
>(
R
.
id
.
tv_content
)
ivHeadLeft
.
visibility
=
if
(
msgBean
.
isReceive
)
View
.
VISIBLE
else
View
.
GONE
ivHeadRight
.
visibility
=
if
(
msgBean
.
isReceive
)
View
.
GONE
else
View
.
VISIBLE
val
avatarImg
=
if
(
msgBean
.
avatarImg
==
null
)
{
R
.
mipmap
.
ic_my_avat
}
else
{
msgBean
.
avatarImg
}
if
(
msgBean
.
isReceive
)
{
// 左
GlideUtils
.
loadCircleImageView
(
context
,
avatarImg
,
ivHeadLeft
)
setGravity
(
llContent
,
Gravity
.
START
)
setGravityLL
(
tvName
,
Gravity
.
START
)
tvContent
.
setTextColor
(
Color
.
BLACK
)
tvContent
.
setBackgroundResource
(
R
.
drawable
.
shape_msg_left
)
}
else
{
// 右
GlideUtils
.
loadCircleImageView
(
context
,
avatarImg
,
ivHeadRight
)
setGravity
(
llContent
,
Gravity
.
END
)
setGravityLL
(
tvName
,
Gravity
.
END
)
tvContent
.
setTextColor
(
Color
.
WHITE
)
tvContent
.
setBackgroundResource
(
R
.
drawable
.
shape_msg_right
)
}
tvName
.
text
=
msgBean
.
name
tvContent
.
text
=
msgBean
.
content
}
private
fun
initPicHolder
(
holder
:
BaseViewHolder
,
msgBean
:
MsgBean
)
{
val
ivHeadLeft
=
holder
.
getView
<
ImageView
>(
R
.
id
.
iv_head_left
)
val
ivHeadRight
=
holder
.
getView
<
ImageView
>(
R
.
id
.
iv_head_right
)
val
llContent
=
holder
.
getView
<
LinearLayout
>(
R
.
id
.
ll_content
)
val
tvName
=
holder
.
getView
<
TextView
>(
R
.
id
.
tv_name
)
val
ivContent
=
holder
.
getView
<
ImageView
>(
R
.
id
.
iv_content
)
val
finger
=
holder
.
getView
<
LottieAnimationView
>(
R
.
id
.
finger_view
)
ivHeadLeft
.
visibility
=
if
(
msgBean
.
isReceive
)
View
.
VISIBLE
else
View
.
GONE
ivHeadRight
.
visibility
=
if
(
msgBean
.
isReceive
)
View
.
GONE
else
View
.
VISIBLE
val
avatarImg
=
if
(
msgBean
.
avatarImg
==
null
)
{
R
.
mipmap
.
ic_my_avat
}
else
{
msgBean
.
avatarImg
}
if
(
msgBean
.
isReceive
)
{
// 左
GlideUtils
.
loadCircleImageView
(
context
,
avatarImg
,
ivHeadLeft
)
setGravity
(
llContent
,
Gravity
.
START
)
setGravityLL
(
tvName
,
Gravity
.
START
)
}
else
{
// 右
GlideUtils
.
loadCircleImageView
(
context
,
avatarImg
,
ivHeadRight
)
setGravity
(
llContent
,
Gravity
.
END
)
setGravityLL
(
tvName
,
Gravity
.
END
)
}
if
(
msgBean
.
contentImg
==
null
)
{
GlideUtils
.
loadImageView
(
context
,
R
.
mipmap
.
hongbao
,
ivContent
)
}
else
{
GlideUtils
.
loadImageView
(
context
,
msgBean
.
contentImg
,
ivContent
)
}
ivContent
.
setOnClickListener
{
mOnCustomChildClickListener
?.
onCustomChildClick
(
it
)
}
tvName
.
text
=
msgBean
.
name
if
(
msgBean
.
showFinger
)
{
finger
.
visibility
=
View
.
VISIBLE
playFingerAnim
(
finger
)
}
else
{
finger
.
visibility
=
View
.
GONE
}
}
private
fun
playFingerAnim
(
view
:
LottieAnimationView
)
{
view
.
visibility
=
View
.
VISIBLE
val
lottieDrawable
=
LottieDrawable
()
LottieCompositionFactory
.
fromAsset
(
context
,
"home_shouzhi.json"
)
.
addListener
{
result
:
LottieComposition
?
->
lottieDrawable
.
setImagesAssetsFolder
(
"home_shouzhi/"
)
lottieDrawable
.
composition
=
result
lottieDrawable
.
loop
(
true
)
lottieDrawable
.
playAnimation
()
}
view
.
setImageDrawable
(
lottieDrawable
)
}
// 设置FrameLayout子控件的gravity参数
private
fun
setGravity
(
view
:
View
,
gravity
:
Int
)
{
val
params
=
view
.
layoutParams
as
FrameLayout
.
LayoutParams
params
.
gravity
=
gravity
}
// 设置LinearLayout子控件的gravity参数
private
fun
setGravityLL
(
view
:
View
,
gravity
:
Int
)
{
val
params
=
view
.
layoutParams
as
LinearLayout
.
LayoutParams
params
.
gravity
=
gravity
}
private
var
mOnCustomChildClickListener
:
OnCustomChildClickListener
?
=
null
fun
setOnCustomChildClickListener
(
onCustomChildClickListener
:
OnCustomChildClickListener
)
{
this
.
mOnCustomChildClickListener
=
onCustomChildClickListener
}
interface
OnCustomChildClickListener
{
fun
onCustomChildClick
(
view
:
View
)
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/dayplaylet/ui/fragment/RedpkgFragment.kt
View file @
517c8dcb
package
com.duben.dayplaylet.ui.fragment
import
android.animation.Animator
import
android.animation.ObjectAnimator
import
android.app.Dialog
import
android.os.Handler
import
android.os.Looper
import
android.text.TextUtils
import
android.view.View
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.SimpleItemAnimator
import
com.duben.dayplaylet.R
import
com.duben.dayplaylet.ad.AdManager
import
com.duben.dayplaylet.ad.AdStatusListener
import
com.duben.dayplaylet.ad.NoPreAdManager
import
com.duben.dayplaylet.ad.half.HalfScreenManagerNoPre
import
com.duben.dayplaylet.common.Constant
import
com.duben.dayplaylet.mvp.model.MSGMultiItemEntity
import
com.duben.dayplaylet.mvp.model.MsgBean
import
com.duben.dayplaylet.mvp.presenters.RedpkgPresenter
import
com.duben.dayplaylet.mvp.views.RedpkgView
import
com.duben.dayplaylet.ui.activitys.MainActivity
import
com.duben.dayplaylet.ui.adapter.MsgAdapter
import
com.duben.dayplaylet.ui.fragment.base.LazyLoadBaseFragment
import
com.duben.dayplaylet.ui.widgets.DialogListener
import
com.duben.dayplaylet.ui.widgets.RedPkgAwardDialog
import
com.duben.dayplaylet.ui.widgets.WithDrawSucDialog
import
com.duben.dayplaylet.utils.UIUtils
import
com.duben.library.utils.nodoubleclick.AntiShake
import
kotlinx.android.synthetic.main.fragment_redpkg.*
import
net.yslibrary.android.keyboardvisibilityevent.KeyboardVisibilityEvent
import
net.yslibrary.android.keyboardvisibilityevent.Unregistrar
import
kotlin.random.Random
class
RedpkgFragment
:
LazyLoadBaseFragment
()
{
class
RedpkgFragment
:
LazyLoadBaseFragment
(),
View
.
OnClickListener
,
RedpkgView
{
private
var
unregistrar
:
Unregistrar
?
=
null
private
var
mMsgAdapter
:
MsgAdapter
?
=
null
private
var
mMsgList
:
MutableList
<
MSGMultiItemEntity
>
=
mutableListOf
()
private
var
mMsgList2
:
MutableList
<
MSGMultiItemEntity
>
=
mutableListOf
()
private
var
mRedPkgAwardDialog
:
RedPkgAwardDialog
?
=
null
private
var
mWithDrawSucDialog
:
WithDrawSucDialog
?
=
null
private
val
redpkgPresenter
by
lazy
{
RedpkgPresenter
()
}
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_redpkg
override
fun
initViewsAndEvents
()
{
redpkgPresenter
.
attachView
(
this
)
initView
()
initMsgRy
()
initKeyboard
()
}
private
fun
initView
()
{
tv_title
.
text
=
"北京市同城红包群(${(Random.nextInt(1500) + 1500)})"
btn_send
.
setOnClickListener
(
this
)
iv_refresh
.
setOnClickListener
(
this
)
}
private
fun
initMsgRy
()
{
val
msgBean
=
MsgBean
(
1
,
true
,
"AA"
,
"你好"
)
val
msgBean2
=
MsgBean
(
1
,
false
,
"BB"
,
"塑料袋口福利费"
)
val
msgBean3
=
MsgBean
(
1
,
true
,
"CC"
,
"发我女弄啥嘞"
)
val
msgBean4
=
MsgBean
(
1
,
true
,
"DD"
,
"多少了国家说了"
)
val
msgBean5
=
MsgBean
(
1
,
false
,
"EE"
,
"司法送你纯牛奶反搜发快递是"
)
val
msgBean6
=
MsgBean
(
1
,
false
,
"FF"
,
"是欧萨肥肉哦 拉分单身快乐你欧尼"
)
val
msgBean7
=
MsgBean
(
1
,
true
,
"GG"
,
"发我女弄啥嘞"
)
val
msgBean8
=
MsgBean
(
2
,
true
,
"HH"
,
""
)
val
msgBean9
=
MsgBean
(
2
,
true
,
"II"
,
""
,
""
,
null
,
true
)
mMsgList
.
add
(
MSGMultiItemEntity
(
msgBean
.
type
,
msgBean
))
mMsgList
.
add
(
MSGMultiItemEntity
(
msgBean
.
type
,
msgBean2
))
mMsgList
.
add
(
MSGMultiItemEntity
(
msgBean
.
type
,
msgBean3
))
mMsgList
.
add
(
MSGMultiItemEntity
(
msgBean
.
type
,
msgBean4
))
mMsgList
.
add
(
MSGMultiItemEntity
(
msgBean
.
type
,
msgBean5
))
mMsgList
.
add
(
MSGMultiItemEntity
(
msgBean
.
type
,
msgBean6
))
mMsgList
.
add
(
MSGMultiItemEntity
(
msgBean
.
type
,
msgBean7
))
mMsgList
.
add
(
MSGMultiItemEntity
(
msgBean8
.
type
,
msgBean8
))
mMsgList
.
add
(
MSGMultiItemEntity
(
msgBean9
.
type
,
msgBean9
))
mMsgList2
.
add
(
MSGMultiItemEntity
(
msgBean8
.
type
,
msgBean2
))
mMsgList2
.
add
(
MSGMultiItemEntity
(
msgBean8
.
type
,
msgBean2
))
mMsgList2
.
add
(
MSGMultiItemEntity
(
msgBean8
.
type
,
msgBean2
))
mMsgList2
.
add
(
MSGMultiItemEntity
(
msgBean8
.
type
,
msgBean2
))
mMsgList2
.
add
(
MSGMultiItemEntity
(
msgBean8
.
type
,
msgBean2
))
mMsgList2
.
add
(
MSGMultiItemEntity
(
msgBean8
.
type
,
msgBean2
))
// 去除刷新动画
(
ry_redpkg
.
itemAnimator
as
SimpleItemAnimator
).
supportsChangeAnimations
=
false
(
ry_redpkg
.
itemAnimator
as
SimpleItemAnimator
).
changeDuration
=
0
ry_redpkg
.
layoutManager
=
LinearLayoutManager
(
requireContext
(),
LinearLayoutManager
.
VERTICAL
,
false
)
mMsgAdapter
=
MsgAdapter
()
ry_redpkg
.
adapter
=
mMsgAdapter
mMsgAdapter
?.
let
{
// 下拉加载更多
it
.
upFetchModule
.
isUpFetchEnable
=
true
it
.
upFetchModule
.
isUpFetching
=
true
it
.
upFetchModule
.
setOnUpFetchListener
{
it
.
upFetchModule
.
isUpFetching
=
true
showMsgLoading
(
true
)
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
it
.
addData
(
0
,
mMsgList2
)
showMsgLoading
(
false
)
mMsgAdapter
?.
upFetchModule
?.
isUpFetching
=
false
},
3000
)
}
it
.
setOnCustomChildClickListener
(
object
:
MsgAdapter
.
OnCustomChildClickListener
{
override
fun
onCustomChildClick
(
view
:
View
)
{
if
(
AntiShake
.
check
(
view
.
id
))
return
if
(
view
.
id
==
R
.
id
.
iv_content
)
{
awardVideo
(
Constant
.
CARRIERTYPE_VEDIO
)
}
}
})
}
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
mMsgAdapter
?.
setNewInstance
(
mMsgList
)
scrollBottom
()
showMsgLoading
(
false
)
mMsgAdapter
?.
upFetchModule
?.
isUpFetching
=
false
},
1000
)
}
private
fun
showMsgLoading
(
show
:
Boolean
)
{
if
(
show
)
{
startLoadingAnim
(
true
)
}
else
{
startLoadingAnim
(
false
)
}
}
private
fun
initKeyboard
()
{
// 监听键盘状态
unregistrar
=
KeyboardVisibilityEvent
.
registerEventListener
(
activity
)
{
isOpen
->
if
(
isOpen
)
{
(
requireActivity
()
as
MainActivity
).
hideTabView
()
scrollBottom
()
et_input
?.
requestFocus
()
}
else
{
(
requireActivity
()
as
MainActivity
).
showTabView
()
scrollBottom
()
et_input
?.
requestFocus
()
}
}
}
private
fun
scrollBottom
()
{
ry_redpkg
.
scrollToPosition
(
mMsgList
.
size
-
1
)
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
unregistrar
?.
unregister
()
}
override
fun
onClick
(
v
:
View
?)
{
if
(
AntiShake
.
check
(
v
?.
id
))
return
when
(
v
?.
id
)
{
R
.
id
.
iv_refresh
->
{
// mMsgAdapter?.setNewInstance(mutableListOf())
// showRedPkgAwardDialog()
showWithdrawSucDialog
()
}
R
.
id
.
btn_send
->
{
val
inputStr
=
et_input
.
text
.
toString
()
if
(
TextUtils
.
isEmpty
(
inputStr
))
{
showToast
(
"请输入内容"
)
return
}
(
activity
as
MainActivity
).
hideKeyboard
()
val
msg
=
MsgBean
(
1
,
false
,
""
,
inputStr
)
val
msgMultiItemEntity
=
MSGMultiItemEntity
(
msg
.
type
,
msg
)
mMsgList
.
add
(
msgMultiItemEntity
)
mMsgAdapter
?.
addData
(
msgMultiItemEntity
)
scrollBottom
()
et_input
.
setText
(
""
)
}
else
->
{}
}
}
private
fun
awardVideo
(
carrierType
:
String
)
{
AdManager
.
instance
.
showAd
(
requireActivity
(),
carrierType
,
object
:
AdStatusListener
{
var
canFail
=
false
override
fun
adSuccess
()
{
canFail
=
true
}
override
fun
adFail
()
{
if
(
canFail
)
return
showLoading
(
"正在获取视频"
,
false
)
NoPreAdManager
.
loadVideoAd
(
requireActivity
(),
carrierType
,
object
:
AdStatusListener
{
override
fun
adFail
()
{
hideLoading
()
showToast
(
"广告太火爆了,请稍候再试"
)
}
override
fun
adSuccess
()
{
hideLoading
()
}
override
fun
adClose
(
vo
:
HashMap
<
String
,
Any
>?)
{
hideLoading
()
redpkgPresenter
.
reportAddCoinMsg
(
carrierType
,
vo
?.
get
(
"ecpmId"
)
as
String
)
}
})
}
override
fun
adClose
(
vo
:
HashMap
<
String
,
Any
>?)
{
redpkgPresenter
.
reportAddCoinMsg
(
carrierType
,
vo
?.
get
(
"ecpmId"
)
as
String
)
}
})
}
override
fun
reportAddCoinMsgSuc
(
coin
:
Int
,
di
:
Int
)
{
}
private
fun
startLoadingAnim
(
show
:
Boolean
)
{
val
height
=
UIUtils
.
dp2px
(
40
)
val
animator
=
if
(
show
)
{
ObjectAnimator
.
ofFloat
(
clpb
,
"translationY"
,
0f
,
height
.
toFloat
())
.
setDuration
(
600
)
}
else
{
ObjectAnimator
.
ofFloat
(
clpb
,
"translationY"
,
0f
,
-
height
.
toFloat
())
.
setDuration
(
600
)
}
animator
.
addListener
(
object
:
Animator
.
AnimatorListener
{
override
fun
onAnimationStart
(
animation
:
Animator
?)
{
if
(
show
)
{
clpb
.
show
()
}
}
override
fun
onAnimationEnd
(
animation
:
Animator
?)
{
if
(!
show
)
{
clpb
.
hide
()
}
}
override
fun
onAnimationCancel
(
animation
:
Animator
?)
{
}
override
fun
onAnimationRepeat
(
animation
:
Animator
?)
{
}
})
animator
.
start
()
}
private
fun
showRedPkgAwardDialog
()
{
mRedPkgAwardDialog
=
RedPkgAwardDialog
(
requireContext
(),
10
,
132434
,
true
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
super
.
onClick
(
dialog
,
v
)
dialog
?.
dismiss
()
when
(
v
?.
id
)
{
R
.
id
.
unlock
->
{
}
R
.
id
.
ib_close
->
{
HalfScreenManagerNoPre
.
getInstance
().
showAd
(
requireActivity
(),
null
)
}
else
->
{}
}
}
})
mRedPkgAwardDialog
?.
show
()
}
private
fun
showWithdrawSucDialog
()
{
mWithDrawSucDialog
=
WithDrawSucDialog
(
requireContext
(),
10
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
super
.
onClick
(
dialog
,
v
)
dialog
?.
dismiss
()
when
(
v
?.
id
)
{
R
.
id
.
btn
->
{
HalfScreenManagerNoPre
.
getInstance
().
showAd
(
requireActivity
(),
null
)
}
R
.
id
.
ib_close
->
{
HalfScreenManagerNoPre
.
getInstance
().
showAd
(
requireActivity
(),
null
)
}
else
->
{}
}
}
})
mWithDrawSucDialog
?.
show
()
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/dayplaylet/ui/widgets/RedPkgAwardDialog.kt
0 → 100644
View file @
517c8dcb
package
com.duben.dayplaylet.ui.widgets
import
android.app.Dialog
import
android.content.Context
import
android.view.KeyEvent
import
android.view.View
import
android.view.WindowManager
import
android.widget.ImageButton
import
android.widget.TextView
import
androidx.core.content.ContextCompat
import
com.duben.dayplaylet.R
import
com.duben.dayplaylet.utils.FormatUtil
import
com.duben.dayplaylet.utils.SpanUtils
/**
* 同城红包弹框
*/
class
RedPkgAwardDialog
(
context
:
Context
,
cash
:
Int
,
cashSum
:
Int
,
showBtn
:
Boolean
,
listener
:
DialogListener
)
:
Dialog
(
context
,
R
.
style
.
dialog
)
{
private
val
lp
:
WindowManager
.
LayoutParams
private
val
ibClose
:
ImageButton
private
val
tvTitle
:
TextView
private
val
tvInfo
:
TextView
private
val
unlock
:
View
init
{
setContentView
(
R
.
layout
.
dialog_redpkg_award
)
lp
=
window
!!
.
attributes
lp
.
width
=
WindowManager
.
LayoutParams
.
MATCH_PARENT
lp
.
height
=
WindowManager
.
LayoutParams
.
MATCH_PARENT
lp
.
windowAnimations
=
R
.
style
.
DialogAnimFade
window
!!
.
attributes
=
lp
// 设置外部不可关闭
setCancelable
(
true
)
setCanceledOnTouchOutside
(
true
)
setOnKeyListener
{
_
,
i
,
_
->
i
==
KeyEvent
.
KEYCODE_BACK
}
listener
.
setDialog
(
this
)
ibClose
=
findViewById
(
R
.
id
.
ib_close
)
tvTitle
=
findViewById
(
R
.
id
.
tv_title
)
tvInfo
=
findViewById
(
R
.
id
.
tv_info
)
unlock
=
findViewById
(
R
.
id
.
unlock
)
tvTitle
.
text
=
SpanUtils
()
.
append
(
""
+
cash
)
.
setFontSize
(
50
,
true
)
.
append
(
"张"
)
.
setFontSize
(
20
,
true
)
.
create
()
tvInfo
.
text
=
SpanUtils
()
.
append
(
"已有"
)
.
append
(
""
+
cashSum
)
.
setForegroundColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FFFC9F
))
.
append
(
"红包可兑换"
)
.
append
(
FormatUtil
.
getCashFormaet
(
cashSum
))
.
setForegroundColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FFFC9F
))
.
append
(
"元"
)
.
create
()
if
(
showBtn
)
{
unlock
.
visibility
=
View
.
VISIBLE
}
else
{
unlock
.
visibility
=
View
.
GONE
}
ibClose
.
setOnClickListener
(
listener
)
unlock
.
setOnClickListener
(
listener
)
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/dayplaylet/ui/widgets/WindowInsetsFrameLayout.java
0 → 100644
View file @
517c8dcb
package
com
.
duben
.
dayplaylet
.
ui
.
widgets
;
import
android.annotation.TargetApi
;
import
android.content.Context
;
import
android.os.Build
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
android.view.WindowInsets
;
import
android.widget.FrameLayout
;
/**
* https://www.jianshu.com/p/79e2f272a42a
*/
public
class
WindowInsetsFrameLayout
extends
FrameLayout
{
public
WindowInsetsFrameLayout
(
Context
context
)
{
this
(
context
,
null
);
}
public
WindowInsetsFrameLayout
(
Context
context
,
AttributeSet
attrs
)
{
this
(
context
,
attrs
,
0
);
}
@TargetApi
(
Build
.
VERSION_CODES
.
LOLLIPOP
)
public
WindowInsetsFrameLayout
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
setOnHierarchyChangeListener
(
new
OnHierarchyChangeListener
()
{
@Override
public
void
onChildViewAdded
(
View
parent
,
View
child
)
{
requestApplyInsets
();
}
@Override
public
void
onChildViewRemoved
(
View
parent
,
View
child
)
{
}
});
}
@TargetApi
(
Build
.
VERSION_CODES
.
KITKAT_WATCH
)
@Override
public
WindowInsets
onApplyWindowInsets
(
WindowInsets
insets
)
{
int
childCount
=
getChildCount
();
for
(
int
index
=
0
;
index
<
childCount
;
index
++)
{
getChildAt
(
index
).
dispatchApplyWindowInsets
(
insets
);
}
return
insets
;
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/dayplaylet/ui/widgets/WithDrawSucDialog.kt
0 → 100644
View file @
517c8dcb
package
com.duben.dayplaylet.ui.widgets
import
android.app.Dialog
import
android.content.Context
import
android.view.Gravity
import
android.view.KeyEvent
import
android.view.WindowManager
import
android.widget.Button
import
android.widget.FrameLayout
import
android.widget.ImageButton
import
android.widget.TextView
import
com.duben.dayplaylet.R
import
com.duben.dayplaylet.ad.express.ExpressAdCallback
import
com.duben.dayplaylet.ad.express.ExpressManager
import
com.duben.dayplaylet.ad.express.MyExpressManager
import
com.duben.dayplaylet.utils.UIUtils
/**
* 同城红包弹框
*/
class
WithDrawSucDialog
(
context
:
Context
,
cash
:
Int
,
listener
:
DialogListener
)
:
Dialog
(
context
,
R
.
style
.
dialog
)
{
private
val
lp
:
WindowManager
.
LayoutParams
private
val
ibClose
:
ImageButton
private
val
btn
:
Button
private
val
tvCash1
:
TextView
private
val
tvCash2
:
TextView
private
val
tvCash3
:
TextView
private
val
flAd
:
FrameLayout
init
{
setContentView
(
R
.
layout
.
dialog_withdraw_suc
)
lp
=
window
!!
.
attributes
lp
.
gravity
=
Gravity
.
CENTER
lp
.
width
=
WindowManager
.
LayoutParams
.
MATCH_PARENT
lp
.
height
=
WindowManager
.
LayoutParams
.
WRAP_CONTENT
lp
.
windowAnimations
=
R
.
style
.
DialogAnimFade
window
!!
.
attributes
=
lp
// 设置外部不可关闭
setCancelable
(
true
)
setCanceledOnTouchOutside
(
true
)
setOnKeyListener
{
_
,
i
,
_
->
i
==
KeyEvent
.
KEYCODE_BACK
}
listener
.
setDialog
(
this
)
ibClose
=
findViewById
(
R
.
id
.
ib_close
)
btn
=
findViewById
(
R
.
id
.
btn
)
tvCash1
=
findViewById
(
R
.
id
.
tv_cash_1
)
tvCash2
=
findViewById
(
R
.
id
.
tv_cash_2
)
tvCash3
=
findViewById
(
R
.
id
.
tv_cash_3
)
flAd
=
findViewById
(
R
.
id
.
fl_ad
)
tvCash1
.
text
=
""
tvCash1
.
text
=
""
tvCash1
.
text
=
""
ibClose
.
setOnClickListener
(
listener
)
btn
.
setOnClickListener
(
listener
)
showAdView
()
}
private
fun
showAdView
()
{
MyExpressManager
.
instance
.
getAdView
(
object
:
ExpressAdCallback
{
override
fun
loadSuccess
(
adView
:
FrameLayout
?)
{
adView
?.
let
{
UIUtils
.
removeFromParent
(
it
)
flAd
.
removeAllViews
()
flAd
.
addView
(
it
)
}
}
override
fun
renderSuccess
(
adView
:
FrameLayout
?):
Boolean
{
adView
?.
let
{
UIUtils
.
removeFromParent
(
it
)
flAd
.
removeAllViews
()
flAd
.
addView
(
it
)
}
ExpressManager
.
instance
.
preLoadAd
()
return
false
}
override
fun
loadFail
()
{
}
})
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/library/utils/GlideUtils.kt
View file @
517c8dcb
...
...
@@ -67,12 +67,12 @@ object GlideUtils {
//加载Gif*****
fun
loadRoundImageViewGif
(
mContext
:
Context
,
drawable
:
Int
,
imageView
:
ImageView
)
{
val
options
=
RequestOptions
()
.
fitCenter
()
.
diskCacheStrategy
(
DiskCacheStrategy
.
DATA
)
.
fitCenter
()
.
diskCacheStrategy
(
DiskCacheStrategy
.
DATA
)
Glide
.
with
(
mContext
)
.
load
(
drawable
)
.
apply
(
options
)
.
into
(
imageView
)
.
load
(
drawable
)
.
apply
(
options
)
.
into
(
imageView
)
}
//默认加载
...
...
@@ -170,6 +170,17 @@ object GlideUtils {
Glide
.
with
(
mContext
!!
).
load
(
path
).
apply
(
requestOptions
).
into
(
mImageView
!!
)
}
//设置加载中以及加载失败圆形图片
fun
loadCircleImageView
(
mContext
:
Context
?,
path
:
Any
?,
mImageView
:
ImageView
?
)
{
val
requestOptions
=
RequestOptions
()
requestOptions
.
circleCrop
()
Glide
.
with
(
mContext
!!
).
load
(
path
).
apply
(
requestOptions
).
into
(
mImageView
!!
)
}
//加载Gif
fun
loadImageViewGif
(
mContext
:
Context
?,
drawable
:
Int
,
imageView
:
ImageView
?)
{
Glide
.
with
(
mContext
!!
).
asGif
().
load
(
drawable
).
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
)
...
...
video/app/src/main/res/drawable/shape_bg_blue_send.xml
0 → 100644
View file @
517c8dcb
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<!-- 填充的颜色 -->
<solid
android:color=
"#1177EA"
/>
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners
android:radius=
"6dip"
/>
</shape>
\ No newline at end of file
video/app/src/main/res/drawable/shape_bg_blue_withdraw.xml
0 → 100644
View file @
517c8dcb
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<!-- 填充的颜色 -->
<solid
android:color=
"#1177EA"
/>
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners
android:radius=
"50dip"
/>
</shape>
\ No newline at end of file
video/app/src/main/res/drawable/shape_gradient_redpkg.xml
0 → 100644
View file @
517c8dcb
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<gradient
android:centerColor=
"@color/color_FFDF85"
android:endColor=
"@color/full_transparent"
android:startColor=
"@color/full_transparent"
/>
</shape>
\ No newline at end of file
video/app/src/main/res/drawable/shape_msg_left.xml
0 → 100644
View file @
517c8dcb
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"#FFFFFF"
/>
<corners
android:bottomLeftRadius=
"5dp"
android:bottomRightRadius=
"5dp"
android:topRightRadius=
"5dp"
/>
</shape>
\ No newline at end of file
video/app/src/main/res/drawable/shape_msg_right.xml
0 → 100644
View file @
517c8dcb
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"#1177EA"
/>
<corners
android:bottomLeftRadius=
"5dp"
android:bottomRightRadius=
"5dp"
android:topLeftRadius=
"5dp"
/>
</shape>
\ No newline at end of file
video/app/src/main/res/drawable/shape_scrollbar_thumb.xml
0 → 100644
View file @
517c8dcb
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<size
android:width=
"6dp"
/>
<solid
android:color=
"@color/graya"
/>
<corners
android:radius=
"10dp"
/>
</shape>
\ No newline at end of file
video/app/src/main/res/drawable/shape_withdraw_main.xml
0 → 100644
View file @
517c8dcb
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<!-- android:radius 弧形的半径 -->
<corners
android:radius=
"30dip"
/>
<gradient
android:endColor=
"#FF3D25"
android:startColor=
"#FF9A69"
/>
</shape>
\ No newline at end of file
video/app/src/main/res/drawable/shape_withdraw_num.xml
0 → 100644
View file @
517c8dcb
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"10dp"
/>
<solid
android:color=
"@color/color_50B0F7"
/>
</shape>
\ No newline at end of file
video/app/src/main/res/layout/activity_main.xml
View file @
517c8dcb
...
...
@@ -4,13 +4,12 @@
android:layout_height=
"match_parent"
android:clipChildren=
"false"
>
<FrameLayout
<
com.duben.dayplaylet.ui.widgets.WindowInsets
FrameLayout
android:id=
"@+id/content_layout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginBottom=
"50dp"
android:background=
"@color/white"
android:orientation=
"vertical"
/>
android:background=
"@color/white"
/>
<View
android:layout_width=
"match_parent"
...
...
video/app/src/main/res/layout/activity_song_award.xml
View file @
517c8dcb
...
...
@@ -134,6 +134,13 @@
</LinearLayout>
<com.duben.dayplaylet.ui.widgets.RoundRectLayout
android:id=
"@+id/fl_ad"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:background=
"@drawable/shape_bg_write"
/>
</LinearLayout>
</RelativeLayout>
video/app/src/main/res/layout/dialog_redpkg_award.xml
0 → 100644
View file @
517c8dcb
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/half_transparent"
android:gravity=
"center"
>
<LinearLayout
android:id=
"@+id/ll"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"30dp"
android:layout_marginEnd=
"30dp"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/ic_red_envelope_coupon_top"
/>
<TextView
android:id=
"@+id/tv_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:textColor=
"@color/color_FFFC9F"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tv_info"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:background=
"@drawable/shape_gradient_redpkg"
android:gravity=
"center"
android:textColor=
"@color/white"
android:textSize=
"18sp"
android:textStyle=
"bold"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/ic_red_envelope_coupon_bg"
/>
<RelativeLayout
android:id=
"@+id/unlock"
android:layout_width=
"280dp"
android:layout_height=
"56dp"
>
<View
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginStart=
"@dimen/dp_10"
android:layout_marginTop=
"@dimen/dp_10"
android:layout_marginEnd=
"@dimen/dp_10"
android:background=
"@drawable/shape_withdraw_main"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
android:src=
"@mipmap/ic_redpkg_withdraw"
/>
<TextView
android:id=
"@+id/tv"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
android:drawablePadding=
"@dimen/dp_10"
android:paddingTop=
"10dp"
android:text=
"再领一个"
android:textColor=
"@color/white"
app:drawableStartCompat=
"@mipmap/ic_ad"
/>
</RelativeLayout>
<ImageButton
android:id=
"@+id/ib_close"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:background=
"@mipmap/ic_close_circle"
/>
</LinearLayout>
</RelativeLayout>
video/app/src/main/res/layout/dialog_withdraw_suc.xml
0 → 100644
View file @
517c8dcb
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<LinearLayout
android:id=
"@+id/ll"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"30dp"
android:layout_marginEnd=
"30dp"
android:orientation=
"vertical"
>
<ImageButton
android:id=
"@+id/ib_close"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"end"
android:background=
"@mipmap/ic_close_circle"
/>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:src=
"@mipmap/ic_red_envelope_coupon_draw_top"
/>
<RelativeLayout
android:layout_width=
"190dp"
android:layout_height=
"212dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"@dimen/dp_10"
android:background=
"@mipmap/bg_withdraw_suc"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_marginStart=
"20dp"
android:layout_marginEnd=
"20dp"
android:layout_marginBottom=
"16dp"
>
<TextView
android:id=
"@+id/tv_cash_1"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:background=
"@drawable/shape_withdraw_num"
android:gravity=
"center"
android:maxLength=
"1"
android:text=
"0"
android:textColor=
"@color/white"
android:textSize=
"36dp"
android:textStyle=
"bold"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"10dp"
android:layout_marginEnd=
"10dp"
android:text=
"."
android:textColor=
"@color/white"
android:textSize=
"30sp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tv_cash_2"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"10dp"
android:layout_weight=
"1"
android:background=
"@drawable/shape_withdraw_num"
android:gravity=
"center"
android:maxLength=
"1"
android:text=
"0"
android:textColor=
"@color/white"
android:textSize=
"36dp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tv_cash_3"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:background=
"@drawable/shape_withdraw_num"
android:gravity=
"center"
android:maxLength=
"1"
android:text=
"1"
android:textColor=
"@color/white"
android:textSize=
"36dp"
android:textStyle=
"bold"
/>
</LinearLayout>
</RelativeLayout>
<Button
android:id=
"@+id/btn"
android:layout_width=
"210dp"
android:layout_height=
"46dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"30dp"
android:background=
"@drawable/shape_bg_blue_withdraw"
android:text=
"开心收下"
android:textColor=
"@color/white"
android:textSize=
"18sp"
/>
<com.duben.dayplaylet.ui.widgets.RoundRectLayout
android:id=
"@+id/fl_ad"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:background=
"@drawable/shape_bg_write"
/>
</LinearLayout>
</RelativeLayout>
video/app/src/main/res/layout/fragment_redpkg.xml
View file @
517c8dcb
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:fitsSystemWindows=
"true"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/ry_redpkg"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginTop=
"50dp"
android:layout_marginBottom=
"50dp"
android:background=
"@color/my_color_gray2"
/>
<androidx.core.widget.ContentLoadingProgressBar
android:id=
"@+id/clpb"
style=
"@android:style/Widget.Holo.ProgressBar.Large"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"10dp"
android:padding=
"5dp"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:background=
"@color/white"
>
<TextView
android:id=
"@+id/tv_title"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_centerHorizontal=
"true"
android:gravity=
"center"
android:text=
"北京市同城红包群(1234)"
android:textColor=
"@color/color_42494F"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/iv_refresh"
android:layout_width=
"50dp"
android:layout_height=
"50dp"
android:layout_alignParentEnd=
"true"
android:padding=
"10dp"
android:src=
"@mipmap/ic_loadding"
/>
</RelativeLayout>
<LinearLayout
android:id=
"@+id/ll_input"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:layout_alignParentBottom=
"true"
android:background=
"@color/my_color_gray2"
android:orientation=
"horizontal"
>
<EditText
android:id=
"@+id/et_input"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"6dp"
android:layout_marginEnd=
"6dp"
android:layout_weight=
"1"
android:background=
"@drawable/shape_bg_write"
android:gravity=
"center_vertical"
android:hint=
"请输入你想说的..."
android:inputType=
"textMultiLine"
android:maxHeight=
"200dp"
android:maxLength=
"2000"
android:minHeight=
"40dp"
android:paddingStart=
"16dp"
android:paddingTop=
"10dp"
android:paddingEnd=
"16dp"
android:paddingBottom=
"10dp"
android:scrollbarThumbVertical=
"@drawable/shape_scrollbar_thumb"
android:scrollbars=
"vertical"
android:textColor=
"@color/black"
android:textColorHint=
"@color/graya"
android:textSize=
"14sp"
/>
<Button
android:id=
"@+id/btn_send"
android:layout_width=
"80dp"
android:layout_height=
"40dp"
android:layout_gravity=
"center_vertical"
android:layout_marginEnd=
"6dp"
android:background=
"@drawable/shape_bg_blue_send"
android:text=
"发送"
android:textColor=
"@color/white"
/>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
video/app/src/main/res/layout/item_msg_pic.xml
0 → 100644
View file @
517c8dcb
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
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:id=
"@+id/rl_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:layout_marginBottom=
"4dp"
>
<com.duben.dayplaylet.ui.widgets.CircleImageView
android:id=
"@+id/iv_head_left"
android:layout_width=
"46dp"
android:layout_height=
"46dp"
android:layout_alignParentStart=
"true"
android:layout_marginStart=
"6dp"
app:cornerRadius=
"20dp"
/>
<com.duben.dayplaylet.ui.widgets.CircleImageView
android:id=
"@+id/iv_head_right"
android:layout_width=
"46dp"
android:layout_height=
"46dp"
android:layout_alignParentEnd=
"true"
android:layout_marginEnd=
"6dp"
app:cornerRadius=
"20dp"
/>
<FrameLayout
android:id=
"@+id/fl_body"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"60dp"
android:layout_marginTop=
"6dp"
android:layout_marginEnd=
"60dp"
>
<LinearLayout
android:id=
"@+id/ll_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tv_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"6dp"
android:text=
"@string/app_name"
/>
<FrameLayout
android:layout_width=
"220dp"
android:layout_height=
"100dp"
>
<ImageView
android:id=
"@+id/iv_content"
android:layout_width=
"200dp"
android:layout_height=
"85dp"
android:src=
"@mipmap/hongbao"
/>
<com.airbnb.lottie.LottieAnimationView
android:id=
"@+id/finger_view"
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:layout_gravity=
"end|bottom"
android:visibility=
"gone"
/>
</FrameLayout>
</LinearLayout>
</FrameLayout>
</RelativeLayout>
\ No newline at end of file
video/app/src/main/res/layout/item_msg_text.xml
0 → 100644
View file @
517c8dcb
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
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:id=
"@+id/rl_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:layout_marginBottom=
"4dp"
>
<com.duben.dayplaylet.ui.widgets.CircleImageView
android:id=
"@+id/iv_head_left"
android:layout_width=
"46dp"
android:layout_height=
"46dp"
android:layout_alignParentStart=
"true"
android:layout_marginStart=
"6dp"
app:cornerRadius=
"20dp"
/>
<com.duben.dayplaylet.ui.widgets.CircleImageView
android:id=
"@+id/iv_head_right"
android:layout_width=
"46dp"
android:layout_height=
"46dp"
android:layout_alignParentEnd=
"true"
android:layout_marginEnd=
"6dp"
app:cornerRadius=
"20dp"
/>
<FrameLayout
android:id=
"@+id/fl_body"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"60dp"
android:layout_marginTop=
"6dp"
android:layout_marginEnd=
"60dp"
>
<LinearLayout
android:id=
"@+id/ll_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tv_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"6dp"
android:text=
"@string/app_name"
/>
<TextView
android:id=
"@+id/tv_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/shape_msg_left"
android:gravity=
"center_vertical|start"
android:padding=
"10dp"
android:textColor=
"#111111"
android:textSize=
"14sp"
/>
</LinearLayout>
</FrameLayout>
</RelativeLayout>
\ No newline at end of file
video/app/src/main/res/mipmap-xhdpi/bg_withdraw_suc.png
0 → 100644
View file @
517c8dcb
18.1 KB
video/app/src/main/res/mipmap-xhdpi/hongbao.png
0 → 100755
View file @
517c8dcb
12.1 KB
video/app/src/main/res/mipmap-xhdpi/ic_loadding.png
0 → 100755
View file @
517c8dcb
1.14 KB
video/app/src/main/res/mipmap-xhdpi/ic_red_envelope_coupon_bg.png
0 → 100755
View file @
517c8dcb
190 KB
video/app/src/main/res/mipmap-xhdpi/ic_red_envelope_coupon_draw_top.png
0 → 100644
View file @
517c8dcb
41.9 KB
video/app/src/main/res/mipmap-xhdpi/ic_red_envelope_coupon_top.png
0 → 100755
View file @
517c8dcb
46.9 KB
video/app/src/main/res/mipmap-xhdpi/ic_redpkg_withdraw.png
0 → 100644
View file @
517c8dcb
2.22 KB
video/app/src/main/res/mipmap-xhdpi/icon_reward_play.png
0 → 100755
View file @
517c8dcb
1.38 KB
video/app/src/main/res/values/colors.xml
View file @
517c8dcb
...
...
@@ -21,11 +21,14 @@
<color
name=
"product_net_text"
>
#121B32
</color>
<color
name=
"order_color"
>
#63677E
</color>
<color
name=
"my_color_gray"
>
#E6E6E6
</color>
<color
name=
"my_color_gray2"
>
#F9FAFB
</color>
<color
name=
"color_A24240"
>
#A24240
</color>
<color
name=
"color_F61F03"
>
#FD563B
</color>
<color
name=
"color_50B0F7"
>
#50B0F7
</color>
<color
name=
"color_42494F"
>
#42494F
</color>
<color
name=
"color_3F2F8F"
>
#3F2F8F
</color>
<color
name=
"color_F9F9F9"
>
#F9F9F9
</color>
<color
name=
"color_FDE7CF"
>
#FDE7CF
</color>
...
...
@@ -34,6 +37,8 @@
<color
name=
"color_D78E0C"
>
#D78E0C
</color>
<color
name=
"color_FA6013"
>
#FA6013
</color>
<color
name=
"color_FFFC9F"
>
#FFFC9F
</color>
<color
name=
"color_FFDF85"
>
#FFDF85
</color>
<color
name=
"color_50FFFC9F"
>
#80FFFC9F
</color>
<color
name=
"color_8D8F90"
>
#7F8182
</color>
...
...
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