app/src/main/res/layout/fragment_about.xml
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
tools:context="com.bedrock.padder.fragment.AboutFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/actionbar"
android:layout_marginTop="-10dp"
android:background="@color/white">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:orientation="vertical">
<include layout="@layout/fragment_cardview_music"/>
<include layout="@layout/fragment_cardview_preset_store"/>
<android.support.v7.widget.CardView
android:id="@+id/cardview_ad"
android:layout_width="360dp"
android:layout_height="wrap_content"
android:clickable="true"
android:foreground="?selectableItemBackground"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="4dp"
app:cardElevation="4dp"
app:cardUseCompatPadding="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:background="@color/grey_100">
<!-- descendantFocusability from https://stackoverflow.com/questions/9842494/ -->
<com.google.android.gms.ads.AdView
android:id="@+id/adView_about"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
ads:adSize="MEDIUM_RECTANGLE"
ads:adUnitId="@string/admob_unit_id_about"/>
<RelativeLayout
android:id="@+id/cardview_ad_loading"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_horizontal"
android:orientation="vertical">
<ProgressBar
android:id="@+id/cardview_ad_loading_progress_bar"
style="?android:attr/progressBarStyleLarge"
android:layout_width="64dp"
android:layout_height="64dp"
android:indeterminate="false"
android:max="84"/>
<TextView
android:id="@+id/cardview_ad_loading_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/progressbar_loading_ad"
android:textColor="@color/dark_secondary"
android:textSize="16sp"/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/cardview_ad_failed"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:visibility="gone">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:id="@+id/cardview_ad_failed_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/about_image_ad_failed"/>
<TextView
android:id="@+id/cardview_ad_failed_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="@string/progressbar_loading_ad_failed"
android:textColor="@color/dark_hint"
android:textSize="16sp"/>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
<include layout="@layout/fragment_cardview_about"/>
<include layout="@layout/fragment_cardview_dev"/>
<View
android:id="@+id/about_bottom_margin"
android:layout_width="match_parent"
android:layout_height="100dp"/>
</LinearLayout>
</RelativeLayout>
</ScrollView>
<include layout="@layout/fragment_actionbar"/>
</RelativeLayout>
</FrameLayout>