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
Expand all
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
This diff is collapsed.
Click to expand it.
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