Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
045255d4
Commit
045255d4
authored
Oct 17, 2019
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix races properly
parent
d231ddee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
mobile/src/main/java/com/github/shadowsocks/ProfilesFragment.kt
.../src/main/java/com/github/shadowsocks/ProfilesFragment.kt
+12
-15
No files found.
mobile/src/main/java/com/github/shadowsocks/ProfilesFragment.kt
View file @
045255d4
...
@@ -40,6 +40,7 @@ import androidx.appcompat.widget.TooltipCompat
...
@@ -40,6 +40,7 @@ import androidx.appcompat.widget.TooltipCompat
import
androidx.core.content.getSystemService
import
androidx.core.content.getSystemService
import
androidx.core.os.bundleOf
import
androidx.core.os.bundleOf
import
androidx.fragment.app.DialogFragment
import
androidx.fragment.app.DialogFragment
import
androidx.lifecycle.lifecycleScope
import
androidx.recyclerview.widget.*
import
androidx.recyclerview.widget.*
import
com.github.shadowsocks.aidl.TrafficStats
import
com.github.shadowsocks.aidl.TrafficStats
import
com.github.shadowsocks.bg.BaseService
import
com.github.shadowsocks.bg.BaseService
...
@@ -192,21 +193,17 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
...
@@ -192,21 +193,17 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
if
(
item
.
host
==
"198.199.101.152"
)
{
if
(
item
.
host
==
"198.199.101.152"
)
{
val
builder
=
AdLoader
.
Builder
(
context
,
"ca-app-pub-9097031975646651/9333091620"
)
val
builder
=
AdLoader
.
Builder
(
context
,
"ca-app-pub-9097031975646651/9333091620"
)
builder
.
forUnifiedNativeAd
{
unifiedNativeAd
->
builder
.
forUnifiedNativeAd
{
unifiedNativeAd
->
if
(!
isAdLoaded
&&
isAttached
)
{
if
(!
isAdLoaded
&&
isAttached
)
lifecycleScope
.
launchWhenStarted
{
try
{
// OnUnifiedNativeAdLoadedListener implementation.
// OnUnifiedNativeAdLoadedListener implementation.
val
adContainer
=
itemView
.
findViewById
<
LinearLayout
>(
R
.
id
.
ad_container
)
val
adContainer
=
itemView
.
findViewById
<
LinearLayout
>(
R
.
id
.
ad_container
)
val
adView
=
layoutInflater
.
inflate
(
R
.
layout
.
ad_unified
,
adContainer
,
val
adView
=
layoutInflater
.
inflate
(
R
.
layout
.
ad_unified
,
adContainer
,
false
)
as
UnifiedNativeAdView
false
)
as
UnifiedNativeAdView
populateUnifiedNativeAdView
(
unifiedNativeAd
,
adView
)
populateUnifiedNativeAdView
(
unifiedNativeAd
,
adView
)
adContainer
.
removeAllViews
()
adContainer
.
removeAllViews
()
adContainer
.
addView
(
adView
)
adContainer
.
addView
(
adView
)
isAdLoaded
=
true
isAdLoaded
=
true
}
catch
(
ex
:
IllegalStateException
)
{
// Ignore the adView layout exception
}
}
}
}
}
...
...
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