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
dc7ea981
Commit
dc7ea981
authored
Oct 01, 2013
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix AdView
parent
8598e5a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
14 deletions
+20
-14
src/main/res/xml/pref_feature.xml
src/main/res/xml/pref_feature.xml
+2
-1
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
+18
-13
No files found.
src/main/res/xml/pref_feature.xml
View file @
dc7ea981
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
android:summary=
"@string/auto_connect_summary"
android:summary=
"@string/auto_connect_summary"
android:title=
"@string/auto_connect"
>
android:title=
"@string/auto_connect"
>
</CheckBoxPreference>
</CheckBoxPreference>
<Preference
android:key=
"blank"
>
</Preference>
</PreferenceScreen>
</PreferenceScreen>
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
View file @
dc7ea981
...
@@ -45,7 +45,7 @@ import android.graphics.{Color, Bitmap, Typeface}
...
@@ -45,7 +45,7 @@ import android.graphics.{Color, Bitmap, Typeface}
import
android.os._
import
android.os._
import
android.preference._
import
android.preference._
import
android.util.Log
import
android.util.Log
import
android.view.
{
View
,
ViewGroup
,
ViewParent
,
KeyEvent
}
import
android.view.
_
import
android.widget._
import
android.widget._
import
com.google.analytics.tracking.android.EasyTracker
import
com.google.analytics.tracking.android.EasyTracker
import
de.keyboardsurfer.android.widget.crouton.Crouton
import
de.keyboardsurfer.android.widget.crouton.Crouton
...
@@ -75,6 +75,9 @@ import com.github.shadowsocks.preferences.{ProfileEditTextPreference, PasswordEd
...
@@ -75,6 +75,9 @@ import com.github.shadowsocks.preferences.{ProfileEditTextPreference, PasswordEd
import
com.github.shadowsocks.database.Item
import
com.github.shadowsocks.database.Item
import
com.github.shadowsocks.database.Category
import
com.github.shadowsocks.database.Category
import
scala.Option
import
scala.Option
import
android.view.ViewGroup.LayoutParams
import
com.github.shadowsocks.database.Item
import
com.github.shadowsocks.database.Category
class
ProfileIconDownloader
(
context
:
Context
,
connectTimeout
:
Int
,
readTimeout
:
Int
)
class
ProfileIconDownloader
(
context
:
Context
,
connectTimeout
:
Int
,
readTimeout
:
Int
)
extends
BaseImageDownloader
(
context
,
connectTimeout
,
readTimeout
)
{
extends
BaseImageDownloader
(
context
,
connectTimeout
,
readTimeout
)
{
...
@@ -460,18 +463,21 @@ class Shadowsocks
...
@@ -460,18 +463,21 @@ class Shadowsocks
}
}
}
}
def
initAdView
(
layoutResId
:
Int
)
{
def
initAdView
()
{
if
(
settings
.
getString
(
Key
.
proxy
,
""
)
==
"198.199.101.152"
)
{
if
(
settings
.
getString
(
Key
.
proxy
,
""
)
==
"198.199.101.152"
)
{
val
adView
=
{
val
layoutView
=
drawer
.
getContentContainer
if
(
isSinglePane
)
{
new
AdView
(
this
,
AdSize
.
SMART_BANNER
,
"a151becb8068b09"
)
}
else
{
new
AdView
(
this
,
AdSize
.
BANNER
,
"a151becb8068b09"
)
}
}
val
layoutView
=
findViewById
(
layoutResId
).
asInstanceOf
[
ViewGroup
]
if
(
layoutView
!=
null
)
{
if
(
layoutView
!=
null
)
{
layoutView
.
addView
(
adView
,
0
)
val
adView
=
{
if
(
isSinglePane
)
{
new
AdView
(
this
,
AdSize
.
SMART_BANNER
,
"a151becb8068b09"
)
}
else
{
new
AdView
(
this
,
AdSize
.
BANNER
,
"a151becb8068b09"
)
}
}
val
params
=
new
FrameLayout
.
LayoutParams
(
LayoutParams
.
WRAP_CONTENT
,
LayoutParams
.
WRAP_CONTENT
)
params
.
gravity
=
Gravity
.
BOTTOM
adView
.
setLayoutParams
(
params
)
layoutView
.
asInstanceOf
[
ViewGroup
].
addView
(
adView
,
0
)
adView
.
loadAd
(
new
AdRequest
)
adView
.
loadAd
(
new
AdRequest
)
}
}
}
}
...
@@ -479,7 +485,7 @@ class Shadowsocks
...
@@ -479,7 +485,7 @@ class Shadowsocks
override
def
setContentView
(
layoutResId
:
Int
)
{
override
def
setContentView
(
layoutResId
:
Int
)
{
drawer
.
setContentView
(
layoutResId
)
drawer
.
setContentView
(
layoutResId
)
initAdView
(
layoutResId
)
initAdView
()
onContentChanged
()
onContentChanged
()
}
}
...
@@ -496,7 +502,6 @@ class Shadowsocks
...
@@ -496,7 +502,6 @@ class Shadowsocks
menuAdapter
.
setListener
(
this
)
menuAdapter
.
setListener
(
this
)
listView
.
setAdapter
(
menuAdapter
)
listView
.
setAdapter
(
menuAdapter
)
drawer
.
setMenuView
(
listView
)
drawer
.
setMenuView
(
listView
)
// The drawable that replaces the up indicator in the action bar
// The drawable that replaces the up indicator in the action bar
drawer
.
setSlideDrawable
(
R
.
drawable
.
ic_drawer
)
drawer
.
setSlideDrawable
(
R
.
drawable
.
ic_drawer
)
// Whether the previous drawable should be shown
// Whether the previous drawable should be shown
...
...
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