Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_vediosocial
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_vediosocial
Commits
df84dd49
Commit
df84dd49
authored
Jan 25, 2025
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
165fd975
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
248 additions
and
168 deletions
+248
-168
build.gradle
video/app/build.gradle
+2
-2
PickBean.kt
...rc/main/java/com/duben/loveplayletd/mvp/model/PickBean.kt
+1
-1
BasicUserProfileActivity.kt
...ben/loveplayletd/ui/activitys/BasicUserProfileActivity.kt
+11
-0
FollowWechatActivity.kt
...m/duben/loveplayletd/ui/activitys/FollowWechatActivity.kt
+1
-1
RealAuthActivity.kt
...a/com/duben/loveplayletd/ui/activitys/RealAuthActivity.kt
+109
-100
SquareFragment.kt
...java/com/duben/loveplayletd/ui/fragment/SquareFragment.kt
+24
-4
SquareListFragment.kt
.../com/duben/loveplayletd/ui/fragment/SquareListFragment.kt
+6
-4
ShareImageDialog.kt
...ava/com/duben/loveplayletd/ui/widgets/ShareImageDialog.kt
+34
-9
activity_share.xml
video/app/src/main/res/layout/activity_share.xml
+5
-4
dialog_share_image.xml
video/app/src/main/res/layout/dialog_share_image.xml
+55
-43
No files found.
video/app/build.gradle
View file @
df84dd49
...
...
@@ -16,8 +16,8 @@ android {
applicationId
"com.duben.loveplayletd"
minSdkVersion
rootProject
.
ext
.
androidMinSdkVersion
targetSdkVersion
rootProject
.
ext
.
androidTargetSdkVersion
versionCode
80
0
versionName
"8.0.
0
"
versionCode
80
1
versionName
"8.0.
1
"
flavorDimensions
"default"
// dex突破65535的限制
...
...
video/app/src/main/java/com/duben/loveplayletd/mvp/model/PickBean.kt
View file @
df84dd49
...
...
@@ -8,4 +8,4 @@ package com.duben.loveplayletd.mvp.model
data class
PickBean
(
var
title
:
String
=
""
,
var
isChecked
:
Boolean
=
false
,
)
)
:
java
.
io
.
Serializable
video/app/src/main/java/com/duben/loveplayletd/ui/activitys/BasicUserProfileActivity.kt
View file @
df84dd49
...
...
@@ -5,9 +5,11 @@ import android.app.Activity
import
android.content.Intent
import
android.content.pm.ActivityInfo
import
android.graphics.Color
import
android.media.AudioManager
import
android.os.Handler
import
android.os.Looper
import
android.text.TextUtils
import
android.view.KeyEvent
import
android.view.View
import
com.duben.library.utils.GlideUtils
import
com.duben.loveplayletd.R
...
...
@@ -82,6 +84,15 @@ class BasicUserProfileActivity : BaseActivity(), View.OnClickListener, BasicUser
initListener
()
}
override
fun
onKeyDown
(
keyCode
:
Int
,
event
:
KeyEvent
):
Boolean
{
when
(
keyCode
)
{
KeyEvent
.
KEYCODE_BACK
->
{
return
true
}
}
return
true
}
private
fun
initView
()
{
rg_sex
.
setOnCheckedChangeListener
{
_
,
checkedId
->
sex
=
if
(
checkedId
==
R
.
id
.
rb_female
)
{
...
...
video/app/src/main/java/com/duben/loveplayletd/ui/activitys/FollowWechatActivity.kt
View file @
df84dd49
...
...
@@ -32,7 +32,7 @@ class FollowWechatActivity : BaseActivity(), View.OnClickListener {
when
(
v
?.
id
)
{
R
.
id
.
iv_left_icon
->
finish
()
R
.
id
.
tv_submit
->
{
finish
(
)
readyGoThenKill
(
MainActivity
::
class
.
java
)
}
R
.
id
.
tv_save
->
{
saveResourceToGallery
(
this
@FollowWechatActivity
,
R
.
mipmap
.
bg_wechat_code
)
...
...
video/app/src/main/java/com/duben/loveplayletd/ui/activitys/RealAuthActivity.kt
View file @
df84dd49
...
...
@@ -67,6 +67,7 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
private
var
mStep
=
1
private
var
isEnterFlag
=
false
private
var
isWechatQrCodeUrl
=
false
private
var
wechatQrCodeUrl
=
""
private
var
readAuthImageUrl
=
""
...
...
@@ -234,9 +235,9 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
}
}
readyGoForResult
(
UserLabelActivity
::
class
.
java
,
Constant
.
USER_LABEL_REQUEST_CODE
,
bundle
UserLabelActivity
::
class
.
java
,
Constant
.
USER_LABEL_REQUEST_CODE
,
bundle
)
}
}
...
...
@@ -337,11 +338,18 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
showToast
(
"请输入您的微信号"
)
return
}
if
(
TextUtils
.
isEmpty
(
wechatQrCodeUrl
))
{
showToast
(
"请先上传微信二维码"
)
return
}
if
(
isEnterFlag
)
{
readyGo
(
FollowWechatActivity
::
class
.
java
)
}
else
{
luban
(
wechatQrCodeUrl
)
}
}
else
->
{}
}
...
...
@@ -362,24 +370,24 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
val
pvOptions
=
OptionsPickerBuilder
(
this
)
{
options1
,
options2
,
_
,
_
->
//返回的分别是三个级别的选中位置
val
opt1tx
=
if
(
jobOptions1Items
!!
.
isNotEmpty
())
jobOptions1Items
!!
[
options1
]
.
pickerViewText
else
""
.
pickerViewText
else
""
val
opt2tx
=
if
(
jopOptions2Items
!!
.
size
>
0
&&
jopOptions2Items
!!
[
options1
].
size
>
0
&&
jopOptions2Items
!!
[
options1
].
size
>
0
)
jopOptions2Items
!!
[
options1
][
options2
]
else
""
val
tx
=
"$opt1tx-$opt2tx"
userProfileData
?.
career
=
tx
zyTv
.
text
=
tx
}
.
setSelectOptions
(
provinceIndex
,
cityIndex
)
.
setDividerColor
(
Color
.
BLACK
)
.
setTextColorCenter
(
Color
.
BLACK
)
//设置选中项文字颜色
.
setContentTextSize
(
20
)
.
build
<
Any
>()
.
setSelectOptions
(
provinceIndex
,
cityIndex
)
.
setDividerColor
(
Color
.
BLACK
)
.
setTextColorCenter
(
Color
.
BLACK
)
//设置选中项文字颜色
.
setContentTextSize
(
20
)
.
build
<
Any
>()
pvOptions
.
setPicker
(
jobOptions1Items
as
List
<
Nothing
>,
jopOptions2Items
as
List
<
Nothing
>
jobOptions1Items
as
List
<
Nothing
>,
jopOptions2Items
as
List
<
Nothing
>
)
//三级选择器
pvOptions
.
show
()
...
...
@@ -391,27 +399,27 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
// 弹出选择器
val
pvOptions
=
OptionsPickerBuilder
(
this
)
{
options1
,
options2
,
_
,
v
->
//返回的分别是三个级别的选中位置
val
opt1tx
=
if
(
addressOptions1Items
!!
.
isNotEmpty
())
addressOptions1Items
!!
[
options1
]
.
pickerViewText
else
""
val
opt2tx
=
if
(
addressOptions2Items
!!
.
size
>
0
&&
addressOptions2Items
!!
[
options1
].
size
>
0
)
addressOptions2Items
!!
[
options1
][
options2
]
else
""
val
tx
=
"$opt1tx-$opt2tx"
userProfileData
?.
findCity
=
tx
jyfwTv
.
text
=
tx
}
.
setSelectOptions
(
provinceIndex
,
cityIndex
)
.
setDividerColor
(
Color
.
BLACK
)
.
setTextColorCenter
(
Color
.
BLACK
)
//设置选中项文字颜色
.
setContentTextSize
(
20
)
.
build
<
Any
>()
OptionsPickerBuilder
(
this
)
{
options1
,
options2
,
_
,
v
->
//返回的分别是三个级别的选中位置
val
opt1tx
=
if
(
addressOptions1Items
!!
.
isNotEmpty
())
addressOptions1Items
!!
[
options1
]
.
pickerViewText
else
""
val
opt2tx
=
if
(
addressOptions2Items
!!
.
size
>
0
&&
addressOptions2Items
!!
[
options1
].
size
>
0
)
addressOptions2Items
!!
[
options1
][
options2
]
else
""
val
tx
=
"$opt1tx-$opt2tx"
userProfileData
?.
findCity
=
tx
jyfwTv
.
text
=
tx
}
.
setSelectOptions
(
provinceIndex
,
cityIndex
)
.
setDividerColor
(
Color
.
BLACK
)
.
setTextColorCenter
(
Color
.
BLACK
)
//设置选中项文字颜色
.
setContentTextSize
(
20
)
.
build
<
Any
>()
pvOptions
.
setPicker
(
addressOptions1Items
as
List
<
Nothing
>,
addressOptions2Items
as
List
<
Nothing
>
addressOptions1Items
as
List
<
Nothing
>,
addressOptions2Items
as
List
<
Nothing
>
)
pvOptions
.
show
()
}
...
...
@@ -420,13 +428,13 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
when
(
pickerType
)
{
UserProfile
.
PROFILE_SG
.
str
->
{
mSinglePickDialog
=
SinglePickDialog
(
this
,
UserProfile
.
PROFILE_SG
.
str
,
getPickerData
(
UserProfile
.
PROFILE_SG
.
str
),
defaultValue
this
,
UserProfile
.
PROFILE_SG
.
str
,
getPickerData
(
UserProfile
.
PROFILE_SG
.
str
),
defaultValue
)
mSinglePickDialog
?.
setPickResultListener
(
object
:
SinglePickDialog
.
OnPickResultListener
{
SinglePickDialog
.
OnPickResultListener
{
override
fun
onPickResult
(
result
:
String
)
{
userProfileData
?.
userHeight
=
result
sgTv
.
text
=
result
...
...
@@ -436,13 +444,13 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
}
UserProfile
.
PROFILE_TZ
.
str
->
{
mSinglePickDialog
=
SinglePickDialog
(
this
,
UserProfile
.
PROFILE_TZ
.
str
,
getPickerData
(
UserProfile
.
PROFILE_TZ
.
str
),
defaultValue
this
,
UserProfile
.
PROFILE_TZ
.
str
,
getPickerData
(
UserProfile
.
PROFILE_TZ
.
str
),
defaultValue
)
mSinglePickDialog
?.
setPickResultListener
(
object
:
SinglePickDialog
.
OnPickResultListener
{
SinglePickDialog
.
OnPickResultListener
{
override
fun
onPickResult
(
result
:
String
)
{
userProfileData
?.
bodyWeight
=
result
tzTv
.
text
=
result
...
...
@@ -452,13 +460,13 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
}
UserProfile
.
PROFILE_SX
.
str
->
{
mSinglePickDialog
=
SinglePickDialog
(
this
,
UserProfile
.
PROFILE_SX
.
str
,
getPickerData
(
UserProfile
.
PROFILE_SX
.
str
),
defaultValue
this
,
UserProfile
.
PROFILE_SX
.
str
,
getPickerData
(
UserProfile
.
PROFILE_SX
.
str
),
defaultValue
)
mSinglePickDialog
?.
setPickResultListener
(
object
:
SinglePickDialog
.
OnPickResultListener
{
SinglePickDialog
.
OnPickResultListener
{
override
fun
onPickResult
(
result
:
String
)
{
userProfileData
?.
appearance
=
result
sxTv
.
text
=
result
...
...
@@ -505,14 +513,14 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
override
fun
getFaceParamSuc
(
data
:
FaceParam
)
{
FaceVerifyHelper
.
instance
.
openCloudFaceService
(
this
,
data
,
object
:
FaceVerifyHelper
.
FaceVerifyCallback
{
override
fun
onFaceVerifyOver
(
result
:
FaceResult
)
{
if
(
result
.
isSuccess
)
{
changeStepStatus
(
3
)
object
:
FaceVerifyHelper
.
FaceVerifyCallback
{
override
fun
onFaceVerifyOver
(
result
:
FaceResult
)
{
if
(
result
.
isSuccess
)
{
changeStepStatus
(
3
)
}
realAuthPresenter
.
faceResult
(
result
)
}
realAuthPresenter
.
faceResult
(
result
)
}
})
})
}
override
fun
getFaceParamFail
()
{}
...
...
@@ -553,6 +561,7 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
}
override
fun
setWechatQRCodeSuc
()
{
this
.
isEnterFlag
=
true
showToast
(
"恭喜您完成真人认证!"
)
readyGo
(
FollowWechatActivity
::
class
.
java
)
}
...
...
@@ -562,41 +571,41 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
private
fun
showAlbum
()
{
val
windowAnimationStyle
=
PictureWindowAnimationStyle
()
windowAnimationStyle
.
ofAllAnimation
(
com
.
luck
.
picture
.
lib
.
R
.
anim
.
picture_anim_up_in
,
com
.
luck
.
picture
.
lib
.
R
.
anim
.
picture_anim_down_out
com
.
luck
.
picture
.
lib
.
R
.
anim
.
picture_anim_up_in
,
com
.
luck
.
picture
.
lib
.
R
.
anim
.
picture_anim_down_out
)
PermissionX
.
init
(
this
)
.
permissions
(
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
.
permissions
(
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
// Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest
.
permission
.
CAMERA
)
.
request
{
allGranted
:
Boolean
,
_
:
List
<
String
?
>?,
_
:
List
<
String
?
>?
->
if
(
allGranted
)
{
PictureSelector
.
create
(
this
)
.
openGallery
(
PictureMimeType
.
ofImage
())
.
theme
(
R
.
style
.
picture_WeChat_style
)
// 微信主题色
.
isWeChatStyle
(
true
)
// 微信样式
.
isCamera
(
true
)
//列表是否显示拍照按钮
.
isZoomAnim
(
true
)
//图片选择缩放效果
.
isEnableCrop
(
true
)
//是否开启裁剪
.
setPictureWindowAnimationStyle
(
windowAnimationStyle
)
.
withAspectRatio
(
4
,
4
)
.
isCompress
(
true
)
//是否压缩
.
compressFocusAlpha
(
false
)
//压缩后是否保持图片的透明通道
.
minimumCompressSize
(
200
)
// 小于多少kb的图片不压缩
.
compressQuality
(
60
)
//图片压缩后输出质量
.
synOrAsy
(
true
)
//开启同步or异步压缩
.
maxSelectNum
(
1
)
.
setRequestedOrientation
(
ActivityInfo
.
SCREEN_ORIENTATION_UNSPECIFIED
)
//屏幕旋转方向
.
selectionMode
(
PictureConfig
.
SINGLE
)
//单选or多选
.
imageEngine
(
GlideEngine
.
createGlideEngine
())
// 图片加载引擎
.
forResult
(
PictureConfig
.
CHOOSE_REQUEST
)
}
else
{
showMissingPermissionDialog
(
"存储"
)
Manifest
.
permission
.
CAMERA
)
.
request
{
allGranted
:
Boolean
,
_
:
List
<
String
?
>?,
_
:
List
<
String
?
>?
->
if
(
allGranted
)
{
PictureSelector
.
create
(
this
)
.
openGallery
(
PictureMimeType
.
ofImage
())
.
theme
(
R
.
style
.
picture_WeChat_style
)
// 微信主题色
.
isWeChatStyle
(
true
)
// 微信样式
.
isCamera
(
true
)
//列表是否显示拍照按钮
.
isZoomAnim
(
true
)
//图片选择缩放效果
.
isEnableCrop
(
true
)
//是否开启裁剪
.
setPictureWindowAnimationStyle
(
windowAnimationStyle
)
.
withAspectRatio
(
4
,
4
)
.
isCompress
(
true
)
//是否压缩
.
compressFocusAlpha
(
false
)
//压缩后是否保持图片的透明通道
.
minimumCompressSize
(
200
)
// 小于多少kb的图片不压缩
.
compressQuality
(
60
)
//图片压缩后输出质量
.
synOrAsy
(
true
)
//开启同步or异步压缩
.
maxSelectNum
(
1
)
.
setRequestedOrientation
(
ActivityInfo
.
SCREEN_ORIENTATION_UNSPECIFIED
)
//屏幕旋转方向
.
selectionMode
(
PictureConfig
.
SINGLE
)
//单选or多选
.
imageEngine
(
GlideEngine
.
createGlideEngine
())
// 图片加载引擎
.
forResult
(
PictureConfig
.
CHOOSE_REQUEST
)
}
else
{
showMissingPermissionDialog
(
"存储"
)
}
}
}
}
/**
...
...
@@ -619,13 +628,13 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
@Throws
(
Exception
::
class
)
override
fun
doInBackground
():
List
<
File
>
{
return
Luban
.
with
(
mContext
)
.
loadMediaData
<
LocalMedia
>(
arrayListOf
(
media
))
.
ignoreBy
(
200
)
.
isCamera
(
false
)
.
setCompressQuality
(
80
)
.
setTargetDir
(
null
)
.
setFocusAlpha
(
false
)
.
setNewCompressFileName
(
newFileName
).
get
()
.
loadMediaData
<
LocalMedia
>(
arrayListOf
(
media
))
.
ignoreBy
(
200
)
.
isCamera
(
false
)
.
setCompressQuality
(
80
)
.
setTargetDir
(
null
)
.
setFocusAlpha
(
false
)
.
setNewCompressFileName
(
newFileName
).
get
()
}
override
fun
onSuccess
(
files
:
List
<
File
>)
{
...
...
@@ -661,8 +670,8 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
if
(
isWechatQrCodeUrl
)
{
wechatQrCodeUrl
=
imgPath
!!
realAuthPresenter
.
setWechatQRCode
(
wechatQrCodeUrl
,
et_wechat_no
.
text
.
toString
()
wechatQrCodeUrl
,
et_wechat_no
.
text
.
toString
()
)
}
else
{
readAuthImageUrl
=
imgPath
!!
...
...
@@ -681,22 +690,22 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
// 相册获取图片
PictureConfig
.
CHOOSE_REQUEST
->
{
val
selectList
:
List
<
LocalMedia
>
=
PictureSelector
.
obtainMultipleResult
(
data
)
PictureSelector
.
obtainMultipleResult
(
data
)
val
img
=
selectList
[
0
]
if
(
isWechatQrCodeUrl
)
{
wechatQrCodeUrl
=
img
.
compressPath
GlideUtils
.
loadImageViewNoAnim2
(
this
@RealAuthActivity
,
wechatQrCodeUrl
,
iv_wechat_qrcode
this
@RealAuthActivity
,
wechatQrCodeUrl
,
iv_wechat_qrcode
)
}
else
{
readAuthImageUrl
=
img
.
compressPath
GlideUtils
.
loadImageViewNoAnim2
(
this
@RealAuthActivity
,
readAuthImageUrl
,
iv_auth
this
@RealAuthActivity
,
readAuthImageUrl
,
iv_auth
)
}
}
...
...
@@ -708,7 +717,7 @@ class RealAuthActivity : BaseActivity(), View.OnClickListener, RealAuthView {
userProfileData
?.
tagsCommon
=
sbLabel
if
(!
TextUtils
.
isEmpty
(
userProfileData
?.
tagsCommon
))
{
val
tagsList
=
gson
.
fromJson
(
userProfileData
?.
tagsCommon
,
Array
<
String
>
::
class
.
java
)
gson
.
fromJson
(
userProfileData
?.
tagsCommon
,
Array
<
String
>
::
class
.
java
)
gxbqAdapter
?.
setNewInstance
(
tagsList
.
toCollection
(
ArrayList
()))
gxbqTv
.
text
=
""
}
...
...
video/app/src/main/java/com/duben/loveplayletd/ui/fragment/SquareFragment.kt
View file @
df84dd49
...
...
@@ -32,6 +32,7 @@ import com.duben.loveplayletd.ui.activitys.WebActivity
import
com.duben.loveplayletd.ui.adapter.*
import
com.duben.loveplayletd.ui.fragment.base.LazyLoadBaseFragment
import
com.duben.loveplayletd.utils.AppPreferencesManager
import
com.duben.loveplayletd.utils.LogUtil
import
com.duben.loveplayletd.utils.PermissionXUtils
import
com.duben.loveplayletd.utils.SpanUtils
import
com.google.android.material.tabs.TabLayout
...
...
@@ -53,6 +54,7 @@ class SquareFragment : LazyLoadBaseFragment(), SquareView, View.OnClickListener
private
val
tabsData
=
mutableListOf
<
String
>()
private
var
vpAdapter
:
SquarePageAdapter
?
=
null
private
var
isShowLocationFlag
=
false
private
var
isGetCity
=
false
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_square
...
...
@@ -101,7 +103,7 @@ class SquareFragment : LazyLoadBaseFragment(), SquareView, View.OnClickListener
TrackManager
.
getInstance
().
getBaseMsg
()
}
if
(
AppConfig
.
basicUserProfileFlag
||
UserManager
.
getInstance
().
userHasBasic
())
{
if
(
AppConfig
.
basicUserProfileFlag
||
UserManager
.
getInstance
().
userHasBasic
())
{
initLocation
()
}
}
...
...
@@ -286,16 +288,34 @@ class SquareFragment : LazyLoadBaseFragment(), SquareView, View.OnClickListener
private
val
mapLocationListener
=
AMapLocationListener
{
loc
->
if
(
loc
!=
null
&&
loc
.
errorCode
==
0
)
{
LogUtil
.
d
(
"mcg=----->>>mapLocationListener"
)
// app全局使用
val
curLongitude
=
loc
.
longitude
val
curLatitude
=
loc
.
latitude
// val poiName = loc.poiName
val
city
=
loc
.
city
// val city = "北京市"
squarePresenter
.
saveGps
(
curLatitude
.
toString
(),
curLongitude
.
toString
(),
city
)
vpAdapter
?.
let
{
(
it
.
getFragments
()[
0
]
as
SquareListFragment
).
refresh
()
if
(
city
.
isEmpty
())
{
}
else
{
if
(!
isGetCity
){
LogUtil
.
d
(
"mcg=----->>>mapLocationListener upcity"
)
vpAdapter
?.
let
{
(
it
.
getFragments
()[
0
]
as
SquareListFragment
).
refresh
()
}
}
mLocationClient
?.
stopLocation
()
mLocationClient
?.
setLocationListener
(
null
)
mLocationClient
?.
onDestroy
()
mLocationClient
=
null
isGetCity
=
true
}
mLocationClient
?.
stopLocation
()
}
}
...
...
video/app/src/main/java/com/duben/loveplayletd/ui/fragment/SquareListFragment.kt
View file @
df84dd49
...
...
@@ -163,9 +163,6 @@ class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListene
if
(
hotPage
==
1
)
{
srl_square
.
finishRefresh
(
true
)
squareAdapter
.
setNewInstance
(
data
.
list
)
if
(
data
.
list
.
size
<
hotPageSize
)
{
srl_square
.
finishLoadMoreWithNoMoreData
()
}
}
else
{
if
(
data
.
list
.
size
<
hotPageSize
)
{
srl_square
.
finishLoadMoreWithNoMoreData
()
...
...
@@ -178,7 +175,8 @@ class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListene
}
override
fun
getHallListFail
()
{
srl_square
.
finishRefresh
(
true
)
hotPage
=
1
srl_square
.
finishRefresh
(
false
)
}
override
fun
toLikeSuc
(
position
:
Int
)
{
...
...
@@ -194,10 +192,14 @@ class SquareListFragment : LazyLoadBaseFragment(), SquareView, OnLoadMoreListene
override
fun
onRefresh
(
refreshLayout
:
RefreshLayout
)
{
hotPage
=
1
srl_square
.
resetNoMoreData
()
squarePresenter
.
getHallList
(
mType
,
hotPage
,
hotPageSize
)
}
fun
refresh
()
{
// hotPage = 1
// srl_square.resetNoMoreData()
// squarePresenter.getHallList(mType, hotPage, hotPageSize)
srl_square
.
autoRefresh
()
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/loveplayletd/ui/widgets/ShareImageDialog.kt
View file @
df84dd49
...
...
@@ -14,9 +14,14 @@ import cn.sharesdk.framework.PlatformActionListener
import
cn.sharesdk.framework.ShareSDK
import
cn.sharesdk.wechat.friends.Wechat
import
cn.sharesdk.wechat.moments.WechatMoments
import
com.bumptech.glide.Glide
import
com.bumptech.glide.request.target.SimpleTarget
import
com.duben.library.utils.ConstantUtil
import
com.duben.loveplayletd.MintsApplication
import
com.duben.loveplayletd.R
import
com.duben.loveplayletd.utils.ImageUtil
import
com.duben.loveplayletd.utils.LogUtil
import
com.duben.loveplayletd.utils.TimeRender
import
com.duben.loveplayletd.utils.ToastUtil
import
java.util.*
import
kotlin.concurrent.schedule
...
...
@@ -28,8 +33,8 @@ class ShareImageDialog(
shareCode
:
String
,
)
:
Dialog
(
context
,
R
.
style
.
dialog
)
{
private
val
llDialogShareWx
:
LinearLayout
private
val
llDialogShareQq
:
Linear
Layout
private
val
llDialogShareWx
:
TextView
private
val
flPoster
:
Frame
Layout
private
val
tvDialogShareNext
:
TextView
private
var
mOnShareOKListener
:
OnShareOKListener
?
=
null
...
...
@@ -57,11 +62,11 @@ class ShareImageDialog(
i
==
KeyEvent
.
KEYCODE_BACK
}
llDialogShareWx
=
findViewById
<
View
>(
R
.
id
.
llDialogShareWx
)
as
LinearLayout
llDialogShareQq
=
findViewById
<
View
>(
R
.
id
.
llDialogShareQq
)
as
LinearLayout
llDialogShareWx
=
findViewById
<
View
>(
R
.
id
.
llDialogShareWx
)
as
TextView
//
llDialogShareQq = findViewById<View>(R.id.llDialogShareQq) as LinearLayout
tvDialogShareNext
=
findViewById
<
View
>(
R
.
id
.
tvDialogShareNext
)
as
TextView
val
flPoster
=
findViewById
<
FrameLayout
>(
R
.
id
.
fl_poster
)
flPoster
=
findViewById
<
FrameLayout
>(
R
.
id
.
fl_poster
)
val
layoutParams
=
flPoster
.
layoutParams
layoutParams
.
width
=
whArr
[
0
]
layoutParams
.
height
=
whArr
[
1
]
...
...
@@ -72,18 +77,31 @@ class ShareImageDialog(
findViewById
<
TextView
>(
R
.
id
.
tv_share_code
).
text
=
"邀请码:${shareCode}"
llDialogShareWx
.
setOnClickListener
{
shareWechat
()
// shareWechat()
savePhoto
()
}
llDialogShareQq
.
setOnClickListener
{
shareWechatFavoite
()
}
//
llDialogShareQq.setOnClickListener {
//
shareWechatFavoite()
//
}
tvDialogShareNext
.
setOnClickListener
{
dismiss
()
}
}
fun
savePhoto
()
{
flPoster
.
invalidate
()
flPoster
.
isDrawingCacheEnabled
=
true
flPoster
.
drawingCacheQuality
=
View
.
DRAWING_CACHE_QUALITY_HIGH
flPoster
.
buildDrawingCache
()
val
bitmap
:
Bitmap
=
flPoster
.
drawingCache
var
bitName
=
"COUNT_"
bitName
+=
TimeRender
.
formatTime
(
Date
())
+
".jpeg"
ImageUtil
.
saveBitmap
(
context
,
bitmap
,
bitName
)
ToastUtil
.
show
(
context
,
"图片已保存至相册"
)
}
fun
setOnShareOKListener
(
onShareOKListener
:
OnShareOKListener
)
{
mOnShareOKListener
=
onShareOKListener
}
...
...
@@ -121,9 +139,12 @@ class ShareImageDialog(
wechat
.
platformActionListener
=
object
:
PlatformActionListener
{
override
fun
onComplete
(
p0
:
Platform
?,
p1
:
Int
,
p2
:
HashMap
<
String
,
Any
>?)
{
mOnShareCompleteListener
?.
onShareComplete
()
LogUtil
.
d
(
"mcg-->>shareWechat====suc"
)
}
override
fun
onError
(
p0
:
Platform
?,
p1
:
Int
,
p2
:
Throwable
?)
{
LogUtil
.
d
(
"mcg-->>shareWechat===="
+
p2
?.
printStackTrace
())
}
override
fun
onCancel
(
p0
:
Platform
?,
p1
:
Int
)
{
...
...
@@ -155,10 +176,14 @@ class ShareImageDialog(
if
(
ConstantUtil
.
isInstall
(
context
,
"com.tencent.mm"
))
{
wechatMoments
.
platformActionListener
=
object
:
PlatformActionListener
{
override
fun
onComplete
(
p0
:
Platform
?,
p1
:
Int
,
p2
:
HashMap
<
String
,
Any
>?)
{
LogUtil
.
d
(
"mcg-->>wechatMoments====suc"
)
mOnShareCompleteListener
?.
onShareComplete
()
}
override
fun
onError
(
p0
:
Platform
?,
p1
:
Int
,
p2
:
Throwable
?)
{
LogUtil
.
d
(
"mcg-->>wechatMoments===="
+
p2
?.
printStackTrace
())
}
override
fun
onCancel
(
p0
:
Platform
?,
p1
:
Int
)
{
...
...
video/app/src/main/res/layout/activity_share.xml
View file @
df84dd49
...
...
@@ -78,18 +78,18 @@
android:layout_height=
"45dp"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"30dp"
android:orientation=
"vertical"
android:gravity=
"center_horizontal"
android:layout_marginEnd=
"20dp"
>
<TextView
android:id=
"@+id/tv_share_img"
android:layout_width=
"0dp"
android:layout_width=
"
32
0dp"
android:layout_height=
"match_parent"
android:layout_marginEnd=
"10dp"
android:layout_weight=
"1"
android:background=
"@drawable/shape_share_btn"
android:elevation=
"2dp"
android:gravity=
"center"
android:text=
"
分享海报
"
android:text=
"
保存图片,邀请朋友
"
android:textColor=
"@color/color_633C1B"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
...
...
@@ -102,6 +102,7 @@
android:layout_weight=
"1"
android:background=
"@drawable/shape_share_btn"
android:elevation=
"2dp"
android:visibility=
"gone"
android:gravity=
"center"
android:text=
"分享链接"
android:textColor=
"@color/color_633C1B"
...
...
video/app/src/main/res/layout/dialog_share_image.xml
View file @
df84dd49
...
...
@@ -100,53 +100,65 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"110dp"
android:gravity=
"center
_vertical
"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<
LinearLayout
<
TextView
android:id=
"@+id/llDialogShareWx"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1.0"
android:gravity=
"center"
android:orientation=
"vertical"
>
<ImageView
android:layout_width=
"50dp"
android:layout_height=
"50dp"
android:src=
"@mipmap/ic_share_wechat"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:text=
"微信"
android:textColor=
"@color/color_929297"
android:textSize=
"14sp"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/llDialogShareQq"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1.0"
android:layout_width=
"320dp"
android:layout_height=
"60dp"
android:background=
"@drawable/shape_share_btn"
android:elevation=
"2dp"
android:gravity=
"center"
android:orientation=
"vertical"
>
<ImageView
android:layout_width=
"50dp"
android:layout_height=
"50dp"
android:layout_gravity=
"center_horizontal"
android:src=
"@mipmap/ic_wx_friends"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:text=
"朋友圈"
android:textColor=
"@color/color_929297"
android:textSize=
"14sp"
/>
</LinearLayout>
android:text=
"保存图片,微信分享"
android:textColor=
"@color/color_633C1B"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
<!-- <LinearLayout-->
<!-- android:id="@+id/llDialogShareWx"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_weight="1.0"-->
<!-- android:gravity="center"-->
<!-- android:orientation="vertical">-->
<!-- <ImageView-->
<!-- android:layout_width="50dp"-->
<!-- android:layout_height="50dp"-->
<!-- android:src="@mipmap/ic_share_wechat" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="10dp"-->
<!-- android:text="微信"-->
<!-- android:textColor="@color/color_929297"-->
<!-- android:textSize="14sp" />-->
<!-- </LinearLayout>-->
<!-- <LinearLayout-->
<!-- android:id="@+id/llDialogShareQq"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_weight="1.0"-->
<!-- android:gravity="center"-->
<!-- android:orientation="vertical">-->
<!-- <ImageView-->
<!-- android:layout_width="50dp"-->
<!-- android:layout_height="50dp"-->
<!-- android:layout_gravity="center_horizontal"-->
<!-- android:src="@mipmap/ic_wx_friends" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="10dp"-->
<!-- android:text="朋友圈"-->
<!-- android:textColor="@color/color_929297"-->
<!-- android:textSize="14sp" />-->
<!-- </LinearLayout>-->
</LinearLayout>
<TextView
...
...
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