Commit 894c8426 authored by Max Lv's avatar Max Lv

fix ad view

parent 6c4d015a
...@@ -466,7 +466,7 @@ class Shadowsocks ...@@ -466,7 +466,7 @@ class Shadowsocks
def initAdView() { def initAdView() {
if (settings.getString(Key.proxy, "") == "198.199.101.152") { if (settings.getString(Key.proxy, "") == "198.199.101.152") {
val layoutView = drawer.getContentContainer val layoutView = drawer.getContentContainer.asInstanceOf[ViewGroup].getChildAt(0)
if (layoutView != null) { if (layoutView != null) {
val adView = { val adView = {
if (isSinglePane) { if (isSinglePane) {
...@@ -475,9 +475,6 @@ class Shadowsocks ...@@ -475,9 +475,6 @@ class Shadowsocks
new AdView(this, AdSize.BANNER, "a151becb8068b09") 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) layoutView.asInstanceOf[ViewGroup].addView(adView, 0)
adView.loadAd(new AdRequest) adView.loadAd(new AdRequest)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment