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
918eec43
Commit
918eec43
authored
Oct 03, 2017
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert to previous AdView
parent
2b787d50
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
14 deletions
+6
-14
mobile/src/main/scala/com/github/shadowsocks/ProfilesFragment.scala
.../main/scala/com/github/shadowsocks/ProfilesFragment.scala
+6
-14
No files found.
mobile/src/main/scala/com/github/shadowsocks/ProfilesFragment.scala
View file @
918eec43
...
@@ -40,7 +40,7 @@ import com.github.shadowsocks.database.Profile
...
@@ -40,7 +40,7 @@ import com.github.shadowsocks.database.Profile
import
com.github.shadowsocks.plugin.PluginConfiguration
import
com.github.shadowsocks.plugin.PluginConfiguration
import
com.github.shadowsocks.utils._
import
com.github.shadowsocks.utils._
import
com.github.shadowsocks.widget.UndoSnackbarManager
import
com.github.shadowsocks.widget.UndoSnackbarManager
import
com.google.android.gms.ads.
{
AdRequest
,
AdSize
,
NativeExpress
AdView
}
import
com.google.android.gms.ads.
{
AdRequest
,
AdSize
,
AdView
}
import
scala.collection.mutable.
{
ArrayBuffer
,
ListBuffer
}
import
scala.collection.mutable.
{
ArrayBuffer
,
ListBuffer
}
import
scala.util.Random
import
scala.util.Random
...
@@ -88,7 +88,7 @@ final class ProfilesFragment extends ToolbarFragment with Toolbar.OnMenuItemClic
...
@@ -88,7 +88,7 @@ final class ProfilesFragment extends ToolbarFragment with Toolbar.OnMenuItemClic
// it will not take effect unless set in code
// it will not take effect unless set in code
itemView
.
findViewById
[
View
](
R
.
id
.
indicator
).
setBackgroundResource
(
R
.
drawable
.
background_profile
)
itemView
.
findViewById
[
View
](
R
.
id
.
indicator
).
setBackgroundResource
(
R
.
drawable
.
background_profile
)
private
var
adView
:
NativeExpress
AdView
=
_
private
var
adView
:
AdView
=
_
{
{
val
share
=
itemView
.
findViewById
[
View
](
R
.
id
.
share
)
val
share
=
itemView
.
findViewById
[
View
](
R
.
id
.
share
)
...
@@ -143,22 +143,14 @@ final class ProfilesFragment extends ToolbarFragment with Toolbar.OnMenuItemClic
...
@@ -143,22 +143,14 @@ final class ProfilesFragment extends ToolbarFragment with Toolbar.OnMenuItemClic
new
LinearLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
new
LinearLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
params
.
gravity
=
Gravity
.
CENTER_HORIZONTAL
params
.
gravity
=
Gravity
.
CENTER_HORIZONTAL
params
.
setMargins
(
0
,
getResources
.
getDimensionPixelOffset
(
R
.
dimen
.
margin_small
),
0
,
0
)
params
.
setMargins
(
0
,
getResources
.
getDimensionPixelOffset
(
R
.
dimen
.
margin_small
),
0
,
0
)
adView
=
new
NativeExpress
AdView
(
getActivity
)
adView
=
new
AdView
(
getActivity
)
adView
.
setLayoutParams
(
params
)
adView
.
setLayoutParams
(
params
)
adView
.
setAdUnitId
(
"ca-app-pub-9097031975646651/
5224027521
"
)
adView
.
setAdUnitId
(
"ca-app-pub-9097031975646651/
7760346322
"
)
adView
.
setAdSize
(
new
AdSize
(
328
,
132
)
)
adView
.
setAdSize
(
AdSize
.
LARGE_BANNER
)
itemView
.
findViewById
[
LinearLayout
](
R
.
id
.
content
).
addView
(
adView
)
itemView
.
findViewById
[
LinearLayout
](
R
.
id
.
content
).
addView
(
adView
)
// Demographics
val
random
=
new
Random
()
val
adBuilder
=
new
AdRequest
.
Builder
()
adBuilder
.
setGender
(
AdRequest
.
GENDER_MALE
)
val
year
=
1975
+
random
.
nextInt
(
40
)
val
month
=
1
+
random
.
nextInt
(
12
)
val
day
=
random
.
nextInt
(
28
)
adBuilder
.
setBirthday
(
new
GregorianCalendar
(
year
,
month
,
day
).
getTime
)
// Load Ad
// Load Ad
val
adBuilder
=
new
AdRequest
.
Builder
()
adView
.
loadAd
(
adBuilder
.
build
())
adView
.
loadAd
(
adBuilder
.
build
())
}
else
adView
.
setVisibility
(
View
.
VISIBLE
)
}
else
adView
.
setVisibility
(
View
.
VISIBLE
)
}
else
if
(
adView
!=
null
)
adView
.
setVisibility
(
View
.
GONE
)
}
else
if
(
adView
!=
null
)
adView
.
setVisibility
(
View
.
GONE
)
...
...
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