Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
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_goodmoney
Commits
9db567c7
Commit
9db567c7
authored
Jan 30, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
2c8070d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
TaskCpdFragment.kt
...n/java/com/mints/goodmoney/ui/fragment/TaskCpdFragment.kt
+8
-8
TaskCpdHistoryFragment.kt
...com/mints/goodmoney/ui/fragment/TaskCpdHistoryFragment.kt
+4
-4
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/TaskCpdFragment.kt
View file @
9db567c7
...
...
@@ -97,10 +97,10 @@ class TaskCpdFragment : BaseFragment(), TaskView,
}
private
fun
initView
()
{
val
gridLayoutManager
=
GridLayoutManager
(
mContext
,
3
)
val
gridLayoutManager
=
GridLayoutManager
(
activity
,
3
)
recy_task
.
layoutManager
=
gridLayoutManager
recy_task
.
addItemDecoration
(
SpacesItemDecoration
(
3
,
SpacesItemDecoration
.
px2dp
(
10f
)))
mTaskAdapter
=
TaskAdapter
(
mFakeTaskList
,
mContext
)
mTaskAdapter
=
TaskAdapter
(
mFakeTaskList
,
activity
!!
)
recy_task
.
adapter
=
mTaskAdapter
recy_task
.
setItemViewCacheSize
(
20
)
mTaskAdapter
?.
setOnItemChildClickListener
(
this
)
...
...
@@ -365,8 +365,8 @@ class TaskCpdFragment : BaseFragment(), TaskView,
DownloadApkManager
.
destroy
()
if
(
mReceiverBroadcastReceiver
!=
null
)
{
mContext
.
stopService
(
Intent
(
context
,
AppInstallService
::
class
.
java
))
mContext
.
unregisterReceiver
(
mReceiverBroadcastReceiver
)
activity
?.
stopService
(
Intent
(
activity
,
AppInstallService
::
class
.
java
))
activity
?
.
unregisterReceiver
(
mReceiverBroadcastReceiver
)
mReceiverBroadcastReceiver
=
null
}
...
...
@@ -393,7 +393,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
mFakeTaskList
[
it
.
getPosition
()].
state
=
0
it
.
notifyItemChanged
(
it
.
getPosition
())
}
else
{
if
(
AppUtil
.
checkPackInfo
(
mContext
,
currentPkgName
))
{
if
(
AppUtil
.
checkPackInfo
(
activity
!!
,
currentPkgName
))
{
AppTryPlayManager
.
toTryPlay
(
currentPkgName
)
}
else
{
...
...
@@ -431,7 +431,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
mFakeTaskList
[
it
.
getPosition
()].
state
=
0
it
.
notifyItemChanged
(
it
.
getPosition
())
}
else
{
if
(
AppUtil
.
checkPackInfo
(
mContext
,
currentPkgName
))
{
if
(
AppUtil
.
checkPackInfo
(
activity
!!
,
currentPkgName
))
{
AppTryPlayManager
.
toTryPlay
(
currentPkgName
)
}
else
{
showToast
(
"未找到当前APP、可能被卸载,请重试~"
)
...
...
@@ -480,7 +480,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
private
fun
registerBroad
()
{
if
(
mReceiverBroadcastReceiver
!=
null
)
return
mContext
.
startService
(
Intent
(
context
,
AppInstallService
::
class
.
java
))
activity
?.
startService
(
Intent
(
activity
,
AppInstallService
::
class
.
java
))
mReceiverBroadcastReceiver
=
object
:
BroadcastReceiver
()
{
override
fun
onReceive
(
context
:
Context
?,
intent
:
Intent
?)
{
...
...
@@ -526,7 +526,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
val
intentFilter
=
IntentFilter
()
intentFilter
.
addAction
(
AppInstallService
.
APP_INSTALL_ACTION
)
mContext
.
registerReceiver
(
this
.
mReceiverBroadcastReceiver
,
intentFilter
)
activity
?
.
registerReceiver
(
this
.
mReceiverBroadcastReceiver
,
intentFilter
)
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/TaskCpdHistoryFragment.kt
View file @
9db567c7
...
...
@@ -39,9 +39,9 @@ class TaskCpdHistoryFragment : LazyLoadBaseFragment(), TaskCpdHistoryView,
override
fun
initViewsAndEvents
()
{}
private
fun
initView
()
{
val
linearLayoutManager
=
LinearLayoutManager
(
mContext
)
val
linearLayoutManager
=
LinearLayoutManager
(
activity
)
recy_task
.
layoutManager
=
linearLayoutManager
mTaskAdapter
=
TaskCpdHistoryAdapter
(
mFakeTaskList
,
mContext
)
mTaskAdapter
=
TaskCpdHistoryAdapter
(
mFakeTaskList
,
activity
!!
)
recy_task
.
adapter
=
mTaskAdapter
mTaskAdapter
?.
setOnItemChildClickListener
(
this
)
}
...
...
@@ -104,7 +104,7 @@ class TaskCpdHistoryFragment : LazyLoadBaseFragment(), TaskCpdHistoryView,
mFakeTaskList
[
it
.
getPosition
()].
state
=
3
it
.
notifyItemChanged
(
it
.
getPosition
())
}
else
{
if
(
AppUtil
.
checkPackInfo
(
mContext
,
currentPkgName
))
{
if
(
AppUtil
.
checkPackInfo
(
activity
!!
,
currentPkgName
))
{
AppTryPlayManager
.
toTryPlay
(
currentPkgName
)
}
else
{
...
...
@@ -139,7 +139,7 @@ class TaskCpdHistoryFragment : LazyLoadBaseFragment(), TaskCpdHistoryView,
mFakeTaskList
[
it
.
getPosition
()].
state
=
3
it
.
notifyItemChanged
(
it
.
getPosition
())
}
else
{
if
(
AppUtil
.
checkPackInfo
(
mContext
,
currentPkgName
))
{
if
(
AppUtil
.
checkPackInfo
(
activity
!!
,
currentPkgName
))
{
AppTryPlayManager
.
toTryPlay
(
currentPkgName
)
}
else
{
showToast
(
"未找到当前APP、可能被卸载,请重试~"
)
...
...
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