Skip to content

Instantly share code, notes, and snippets.

@hoanghiephui
Created March 31, 2021 12:51
Show Gist options
  • Save hoanghiephui/e302c6e008bdd3b3bdf69ea5b5abdb79 to your computer and use it in GitHub Desktop.
Save hoanghiephui/e302c6e008bdd3b3bdf69ea5b5abdb79 to your computer and use it in GitHub Desktop.
native_banner_ad_mopub
<?xml version="1.0" encoding="utf-8"?>
<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="wrap_content">
<ImageView
android:id="@+id/native_icon_image"
android:layout_width="80dp"
android:layout_height="80dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/native_title"
app:layout_constraintVertical_bias="0.0"
tools:srcCompat="@tools:sample/avatars" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/native_privacy_information_icon_image"
android:layout_width="35dp"
android:layout_height="35dp"
android:background="?selectableItemBackground"
android:padding="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/native_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAppearance="@style/TextAppearance.ExposureNotification.Subtitle1"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toStartOf="@+id/native_privacy_information_icon_image"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/native_icon_image"
app:layout_constraintTop_toTopOf="parent"
tools:text="TextView TextView TextView TextView TextView TextView" />
<TextView
android:id="@+id/native_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:lines="2"
android:textAppearance="@style/TextAppearance.ExposureNotification.Subtitle2"
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/native_icon_image"
app:layout_constraintTop_toBottomOf="@+id/native_title"
app:layout_constrainedWidth="true"
tools:text="TextView" />
<com.google.android.material.button.MaterialButton
android:id="@+id/native_cta"
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_marginEnd="8dp"
android:clickable="true"
android:focusable="true"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="12sp"
app:backgroundTint="@color/blue_600"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/native_text"
app:strokeColor="@color/blue_600"
tools:text="@string/learn_more" />
</androidx.constraintlayout.widget.ConstraintLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment