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
f180b56c
Commit
f180b56c
authored
Feb 11, 2025
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
d052105b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
29 deletions
+52
-29
MainActivity.kt
.../java/com/duben/loveplayletd/ui/activitys/MainActivity.kt
+52
-29
No files found.
video/app/src/main/java/com/duben/loveplayletd/ui/activitys/MainActivity.kt
View file @
f180b56c
...
@@ -64,6 +64,8 @@ class MainActivity : BaseActivity(), View.OnClickListener, MainActView {
...
@@ -64,6 +64,8 @@ class MainActivity : BaseActivity(), View.OnClickListener, MainActView {
private
var
currentFragment
:
Fragment
?
=
null
private
var
currentFragment
:
Fragment
?
=
null
private
var
phoneDialog
:
PhoneDialog
?
=
null
private
var
phoneDialog
:
PhoneDialog
?
=
null
private
var
isLoadFlag
=
false
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_main
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_main
override
fun
initViewsAndEvents
()
{
override
fun
initViewsAndEvents
()
{
...
@@ -77,35 +79,7 @@ class MainActivity : BaseActivity(), View.OnClickListener, MainActView {
...
@@ -77,35 +79,7 @@ class MainActivity : BaseActivity(), View.OnClickListener, MainActView {
tab_rl_msg
.
setOnClickListener
(
this
)
tab_rl_msg
.
setOnClickListener
(
this
)
tab_rl_my
.
setOnClickListener
(
this
)
tab_rl_my
.
setOnClickListener
(
this
)
if
(
UserHelper
.
instance
.
isBpkg
())
{
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_TWO
if
(
squareFragment
==
null
)
{
squareFragment
=
SquareFragment
()
}
if
(!
squareFragment
!!
.
isAdded
)
{
// 提交事务
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
content_layout
,
squareFragment
!!
).
commitAllowingStateLoss
()
// 记录当前Fragment
currentFragment
=
squareFragment
}
tab_iv_square
.
isSelected
=
true
tab_tv_square
.
isSelected
=
true
}
else
{
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_ONE
if
(
videoFragment
==
null
)
{
videoFragment
=
FirstFragment
()
}
if
(!
videoFragment
!!
.
isAdded
)
{
// 提交事务
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
content_layout
,
videoFragment
!!
).
commitAllowingStateLoss
()
// 记录当前Fragment
currentFragment
=
videoFragment
}
tab_iv_video
.
isSelected
=
true
tab_tv_video
.
isSelected
=
true
}
initUnreadCountReceiver
()
initUnreadCountReceiver
()
}
}
...
@@ -221,11 +195,60 @@ class MainActivity : BaseActivity(), View.OnClickListener, MainActView {
...
@@ -221,11 +195,60 @@ class MainActivity : BaseActivity(), View.OnClickListener, MainActView {
tab_rl_square
.
visibility
=
View
.
VISIBLE
tab_rl_square
.
visibility
=
View
.
VISIBLE
tab_rl_invite
.
visibility
=
View
.
VISIBLE
tab_rl_invite
.
visibility
=
View
.
VISIBLE
tab_rl_msg
.
visibility
=
View
.
VISIBLE
tab_rl_msg
.
visibility
=
View
.
VISIBLE
if
(!
isLoadFlag
)
{
if
(
UserHelper
.
instance
.
isBpkg
())
{
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_TWO
if
(
squareFragment
==
null
)
{
squareFragment
=
SquareFragment
()
}
if
(!
squareFragment
!!
.
isAdded
)
{
// 提交事务
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
content_layout
,
squareFragment
!!
).
commitAllowingStateLoss
()
// 记录当前Fragment
currentFragment
=
squareFragment
}
tab_iv_square
.
isSelected
=
true
tab_tv_square
.
isSelected
=
true
}
else
{
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_ONE
if
(
videoFragment
==
null
)
{
videoFragment
=
FirstFragment
()
}
if
(!
videoFragment
!!
.
isAdded
)
{
// 提交事务
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
content_layout
,
videoFragment
!!
).
commitAllowingStateLoss
()
// 记录当前Fragment
currentFragment
=
videoFragment
}
tab_iv_video
.
isSelected
=
true
tab_tv_video
.
isSelected
=
true
}
}
}
else
{
}
else
{
tab_rl_square
.
visibility
=
View
.
GONE
tab_rl_square
.
visibility
=
View
.
GONE
tab_rl_invite
.
visibility
=
View
.
GONE
tab_rl_invite
.
visibility
=
View
.
GONE
tab_rl_msg
.
visibility
=
View
.
GONE
tab_rl_msg
.
visibility
=
View
.
GONE
if
(!
isLoadFlag
)
{
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_ONE
if
(
videoFragment
==
null
)
{
videoFragment
=
FirstFragment
()
}
if
(!
videoFragment
!!
.
isAdded
)
{
// 提交事务
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
content_layout
,
videoFragment
!!
).
commitAllowingStateLoss
()
// 记录当前Fragment
currentFragment
=
videoFragment
}
tab_iv_video
.
isSelected
=
true
tab_tv_video
.
isSelected
=
true
}
}
}
this
.
isLoadFlag
=
true
}
}
/**
/**
...
...
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