I implemented the small native ad on the main activity and I do not why the text of the native button is under pressure. In addition, I changed nothing in the Native template.
My Problem with Native Button ![My Problem with Native Button][1]
[1
AdLoader adLoader = new AdLoader.Builder(view.getContext(), getResources().getString(R.string.native_history))
.forUnifiedNativeAd(new UnifiedNativeAd.OnUnifiedNativeAdLoadedListener() {
@Override
public void onUnifiedNativeAdLoaded(UnifiedNativeAd unifiedNativeAd) {
NativeTemplateStyle styles = new
NativeTemplateStyle.Builder().build();
TemplateView template = view.findViewById(R.id.my_template);
template.setStyles(styles);
template.setNativeAd(unifiedNativeAd);
}
})
.build();
adLoader.loadAd(new AdRequest.Builder().build());
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
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"
tools:context=".fragments.HistoryFragment">
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@+id/recycler_view_history_fragment_history"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.ads.nativetemplates.TemplateView
android:id="@+id/my_template"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:gnt_template_type="@layout/gnt_small_template_view" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_history_fragment_history"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout2" />
</androidx.constraintlayout.widget.ConstraintLayout>