Don't inflate ad view, use it directly in layouts

This commit is contained in:
serso
2016-02-20 14:46:10 +01:00
parent 8b87de2f29
commit 928f23945f
15 changed files with 46 additions and 96 deletions

View File

@@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 serso aka se.solovyev
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Contact details
~
~ Email: se.solovyev@gmail.com
~ Site: http://se.solovyev.org
-->
<org.solovyev.android.calculator.AdView
xmlns:a="http://schemas.android.com/apk/res/android"
a:id="@+id/ad"
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:layout_gravity="center"
a:visibility="gone" />

View File

@@ -1,34 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 serso aka se.solovyev
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Contact details
~
~ Email: se.solovyev@gmail.com
~ Site: http://se.solovyev.org
-->
<com.google.android.gms.ads.AdView
xmlns:a="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
a:id="@+id/admob"
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:layout_gravity="center"
a:visibility="gone"
ads:adSize="BANNER"
ads:adUnitId="@string/admob" />

View File

@@ -29,7 +29,6 @@
a:layout_width="match_parent"
a:layout_height="match_parent">
<include layout="@layout/ad" />
<org.solovyev.android.calculator.AdView style="@style/CppAd" />
</LinearLayout>

View File

@@ -31,7 +31,7 @@
a:layout_gravity="center_horizontal"
a:orientation="vertical">
<include layout="@layout/ad" />
<org.solovyev.android.calculator.AdView style="@style/CppAd" />
<TextView
a:layout_width="match_parent"

View File

@@ -29,7 +29,7 @@
a:layout_width="match_parent"
a:layout_height="match_parent">
<include layout="@layout/ad" />
<org.solovyev.android.calculator.AdView style="@style/CppAd" />
<LinearLayout
a:layout_width="match_parent"

View File

@@ -31,7 +31,7 @@
a:layout_gravity="center_horizontal"
a:orientation="vertical">
<include layout="@layout/ad" />
<org.solovyev.android.calculator.AdView style="@style/CppAd" />
<LinearLayout
a:layout_width="match_parent"

View File

@@ -29,7 +29,7 @@
a:layout_width="match_parent"
a:layout_height="match_parent">
<include layout="@layout/ad" />
<org.solovyev.android.calculator.AdView style="@style/CppAd" />
<org.solovyev.android.plotter.PlotView
a:id="@+id/plotview"

View File

@@ -29,7 +29,7 @@
a:layout_width="match_parent"
a:layout_height="match_parent">
<include layout="@layout/ad" />
<org.solovyev.android.calculator.AdView style="@style/CppAd" />
<FrameLayout
a:layout_width="match_parent"

View File

@@ -29,7 +29,7 @@
a:layout_width="match_parent"
a:layout_height="match_parent">
<include layout="@layout/ad" />
<org.solovyev.android.calculator.AdView style="@style/CppAd" />
<FrameLayout
a:layout_width="match_parent"

View File

@@ -37,7 +37,7 @@
a:layout_width="match_parent"
a:layout_height="wrap_content" />
<include layout="@layout/ad" />
<org.solovyev.android.calculator.AdView style="@style/CppAd" />
<LinearLayout
a:layout_width="match_parent"

View File

@@ -21,6 +21,7 @@
-->
<resources>
<item name="cpp_ad" type="id" />
<item name="cpp_button_1" type="id" />
<item name="cpp_button_2" type="id" />
<item name="cpp_button_3" type="id" />

View File

@@ -349,6 +349,13 @@
<item name="backgroundSplit">@color/cpp_material_actionbar_light</item>
</style>
<style name="CppAd">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_gravity">center</item>
<item name="android:visibility">gone</item>
</style>
<dimen name="list_item_text_size">16sp</dimen>
<dimen name="list_item_text_size_small">14sp</dimen>
</resources>