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
9a6134c2
Commit
9a6134c2
authored
Jan 25, 2025
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
d45e8790
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
136 additions
and
123 deletions
+136
-123
AppConfig.java
...rc/main/java/com/duben/loveplayletd/common/AppConfig.java
+2
-0
UserHelper.kt
...rc/main/java/com/duben/loveplayletd/manager/UserHelper.kt
+13
-10
BasicUserProfileActivity.kt
...ben/loveplayletd/ui/activitys/BasicUserProfileActivity.kt
+46
-44
ShareActivity.kt
...java/com/duben/loveplayletd/ui/activitys/ShareActivity.kt
+5
-5
SquareAdapter.kt
...n/java/com/duben/loveplayletd/ui/adapter/SquareAdapter.kt
+67
-63
activity_share.xml
video/app/src/main/res/layout/activity_share.xml
+3
-1
No files found.
video/app/src/main/java/com/duben/loveplayletd/common/AppConfig.java
View file @
9a6134c2
...
...
@@ -27,8 +27,10 @@ public class AppConfig {
public
static
boolean
showVipVedio
=
false
;
public
static
boolean
showVipAdDialog
=
false
;
public
static
boolean
showVedioPageAdFlag
=
false
;
public
static
boolean
basicUserProfileFlag
=
false
;
public
static
String
detailDialogUnlockText
=
""
;
public
static
long
splashTime
=
0L
;
public
static
double
firstVipPrice
=
0.0
;
}
video/app/src/main/java/com/duben/loveplayletd/manager/UserHelper.kt
View file @
9a6134c2
...
...
@@ -9,6 +9,7 @@ import android.os.Looper
import
com.duben.library.net.neterror.BaseSubscriber
import
com.duben.library.net.neterror.Throwable
import
com.duben.loveplayletd.MintsApplication
import
com.duben.loveplayletd.common.AppConfig
import
com.duben.loveplayletd.common.Constant
import
com.duben.loveplayletd.mvp.model.BaseResponse
import
com.duben.loveplayletd.ui.activitys.BasicUserProfileActivity
...
...
@@ -68,6 +69,8 @@ class UserHelper private constructor() {
COMMON_ERROR_CODE_BASIC_PROFILE
->
{
// 缺少基础资料
// ToastUtil.show(MintsApplication.getContext(), "缺少基础资料")
if
(
AppConfig
.
basicUserProfileFlag
)
return
intent
=
Intent
(
appContext
,
BasicUserProfileActivity
::
class
.
java
)
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
appContext
.
startActivity
(
intent
)
...
...
@@ -123,20 +126,20 @@ class UserHelper private constructor() {
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"shareCode"
]
=
clipboardText
AppHttpManager
.
getInstance
(
application
)
.
call
(
application
.
loanService
.
updateRuserShareCode
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
JsonObject
>>()
{
override
fun
onCompleted
()
{}
override
fun
onError
(
e
:
Throwable
)
{}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
JsonObject
>)
{
if
(
baseResponse
.
status
==
200
)
{
}
}
})
.
call
(
application
.
loanService
.
updateRuserShareCode
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
JsonObject
>>()
{
override
fun
onCompleted
()
{}
override
fun
onError
(
e
:
Throwable
)
{}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
JsonObject
>)
{
if
(
baseResponse
.
status
==
200
)
{
}
}
})
}
fun
getClipboardText
(
context
:
Context
):
String
{
val
clipboard
=
context
.
getSystemService
(
Context
.
CLIPBOARD_SERVICE
)
as
ClipboardManager
context
.
getSystemService
(
Context
.
CLIPBOARD_SERVICE
)
as
ClipboardManager
if
(
clipboard
.
hasPrimaryClip
())
{
val
clip
:
ClipData
?
=
clipboard
.
primaryClip
if
(
clip
!=
null
&&
clip
.
itemCount
>
0
)
{
...
...
video/app/src/main/java/com/duben/loveplayletd/ui/activitys/BasicUserProfileActivity.kt
View file @
9a6134c2
...
...
@@ -13,6 +13,7 @@ import com.duben.library.utils.GlideUtils
import
com.duben.loveplayletd.R
import
com.duben.loveplayletd.ui.activitys.base.BaseActivity
import
com.duben.library.utils.nodoubleclick.AntiShake
import
com.duben.loveplayletd.common.AppConfig
import
com.duben.loveplayletd.common.OssType
import
com.duben.loveplayletd.common.UserProfile
import
com.duben.loveplayletd.manager.OssManager
...
...
@@ -134,7 +135,7 @@ class BasicUserProfileActivity : BaseActivity(), View.OnClickListener, BasicUser
if
(
UserHelper
.
instance
.
isBpkg
()
&&
!
isHaveGuid
&&
et_ruid_code
.
text
.
toString
()
.
isNotEmpty
()
.
isNotEmpty
()
)
{
basicUserProfilePresenter
.
updateRuserShareCode
(
et_ruid_code
.
text
.
toString
())
}
...
...
@@ -153,12 +154,12 @@ class BasicUserProfileActivity : BaseActivity(), View.OnClickListener, BasicUser
private
fun
showAgePickDialog
()
{
mSinglePickDialog
=
SinglePickDialog
(
this
,
UserProfile
.
PROFILE_NL
.
str
,
getAgePickerData
(),
"1990"
this
,
UserProfile
.
PROFILE_NL
.
str
,
getAgePickerData
(),
"1990"
)
mSinglePickDialog
?.
setPickResultListener
(
object
:
SinglePickDialog
.
OnPickResultListener
{
SinglePickDialog
.
OnPickResultListener
{
override
fun
onPickResult
(
result
:
String
)
{
tv_age
.
text
=
result
}
...
...
@@ -183,6 +184,7 @@ class BasicUserProfileActivity : BaseActivity(), View.OnClickListener, BasicUser
}
override
fun
initBasicSuc
()
{
AppConfig
.
basicUserProfileFlag
=
true
finish
()
}
...
...
@@ -199,42 +201,42 @@ class BasicUserProfileActivity : BaseActivity(), View.OnClickListener, BasicUser
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
)
{
val
isEnableCrop
=
true
PictureSelector
.
create
(
this
)
.
openGallery
(
PictureMimeType
.
ofImage
())
.
theme
(
R
.
style
.
picture_WeChat_style
)
// 微信主题色
.
isWeChatStyle
(
true
)
// 微信样式
.
isCamera
(
true
)
//列表是否显示拍照按钮
.
isZoomAnim
(
false
)
//图片选择缩放效果
.
isEnableCrop
(
isEnableCrop
)
//是否开启裁剪
.
setPictureWindowAnimationStyle
(
windowAnimationStyle
)
.
withAspectRatio
(
4
,
4
)
.
isCompress
(
true
)
//是否压缩
.
compressFocusAlpha
(
false
)
//压缩后是否保持图片的透明通道
.
minimumCompressSize
(
200
)
// 小于多少kb的图片不压缩
.
compressQuality
(
60
)
//图片压缩后输出质量
.
synOrAsy
(
true
)
//开启同步or异步压缩
.
maxSelectNum
(
10
)
.
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
)
{
val
isEnableCrop
=
true
PictureSelector
.
create
(
this
)
.
openGallery
(
PictureMimeType
.
ofImage
())
.
theme
(
R
.
style
.
picture_WeChat_style
)
// 微信主题色
.
isWeChatStyle
(
true
)
// 微信样式
.
isCamera
(
true
)
//列表是否显示拍照按钮
.
isZoomAnim
(
false
)
//图片选择缩放效果
.
isEnableCrop
(
isEnableCrop
)
//是否开启裁剪
.
setPictureWindowAnimationStyle
(
windowAnimationStyle
)
.
withAspectRatio
(
4
,
4
)
.
isCompress
(
true
)
//是否压缩
.
compressFocusAlpha
(
false
)
//压缩后是否保持图片的透明通道
.
minimumCompressSize
(
200
)
// 小于多少kb的图片不压缩
.
compressQuality
(
60
)
//图片压缩后输出质量
.
synOrAsy
(
true
)
//开启同步or异步压缩
.
maxSelectNum
(
10
)
.
setRequestedOrientation
(
ActivityInfo
.
SCREEN_ORIENTATION_UNSPECIFIED
)
//屏幕旋转方向
.
selectionMode
(
PictureConfig
.
SINGLE
)
//单选or多选
.
imageEngine
(
GlideEngine
.
createGlideEngine
())
// 图片加载引擎
.
forResult
(
PictureConfig
.
CHOOSE_REQUEST
)
}
else
{
showMissingPermissionDialog
(
"位置 相机"
)
}
}
}
}
/**
...
...
@@ -257,13 +259,13 @@ class BasicUserProfileActivity : BaseActivity(), View.OnClickListener, BasicUser
@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
>)
{
...
...
@@ -312,7 +314,7 @@ class BasicUserProfileActivity : BaseActivity(), View.OnClickListener, BasicUser
// 相册获取图片
PictureConfig
.
CHOOSE_REQUEST
->
{
val
selectList
:
List
<
LocalMedia
>
=
PictureSelector
.
obtainMultipleResult
(
data
)
PictureSelector
.
obtainMultipleResult
(
data
)
val
img
=
selectList
[
0
]
uploadOss
(
img
.
compressPath
,
OssType
.
PHOTO
.
type
)
}
...
...
video/app/src/main/java/com/duben/loveplayletd/ui/activitys/ShareActivity.kt
View file @
9a6134c2
...
...
@@ -151,11 +151,11 @@ class ShareActivity : BaseActivity(), View.OnClickListener, InviteView {
rcy_my_invite
.
adapter
=
mShareInviteAdapter
if
(
UserManager
.
getInstance
().
userSex
==
1
)
{
tv_tips
.
visibility
=
View
.
GONE
tv_tip2
.
visibility
=
View
.
GONE
tv_tip3
.
text
=
"2.通过邀请用户充值VIP即可获取相应会员奖励。"
}
//
if (UserManager.getInstance().userSex == 1) {
//
tv_tips.visibility = View.GONE
//
tv_tip2.visibility = View.GONE
//
tv_tip3.text = "2.通过邀请用户充值VIP即可获取相应会员奖励。"
//
}
}
override
fun
onClick
(
v
:
View
?)
{
...
...
video/app/src/main/java/com/duben/loveplayletd/ui/adapter/SquareAdapter.kt
View file @
9a6134c2
This diff is collapsed.
Click to expand it.
video/app/src/main/res/layout/activity_share.xml
View file @
9a6134c2
...
...
@@ -289,6 +289,7 @@
android:textColor=
"@color/color_F1D6BA"
/>
<TextView
android:visibility=
"gone"
android:id=
"@+id/tv_tips"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
@@ -297,6 +298,7 @@
android:textColor=
"@color/color_F1D6BA"
/>
<TextView
android:visibility=
"gone"
android:id=
"@+id/tv_tip2"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
@@ -311,7 +313,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:text=
"
3
.通过邀请用户充值VIP即可获取相应佣金和会员奖励。"
android:text=
"
2
.通过邀请用户充值VIP即可获取相应佣金和会员奖励。"
android:textColor=
"@color/color_F1D6BA"
/>
<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