-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed Kotlin APIDemo custom playback controls issue.
PiperOrigin-RevId: 660096496
- Loading branch information
1 parent
05920e2
commit 86c0480
Showing
11 changed files
with
136 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 48 additions & 25 deletions
73
kotlin/advanced/APIDemo/app/src/main/res/layout/ad_simple_custom_template.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,58 @@ | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="8dp" | ||
android:background="#CCFFFF" | ||
android:minHeight="50dp" | ||
android:orientation="vertical" | ||
android:layout_margin="8dp"> | ||
android:orientation="vertical"> | ||
<TextView | ||
android:id="@+id/headline" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="16dp" | ||
android:gravity="center" | ||
android:textAppearance="?android:attr/textAppearanceLarge" /> | ||
<FrameLayout | ||
android:id="@+id/media_placeholder" | ||
android:layout_width="wrap_content" | ||
android:layout_height="175dp" | ||
android:layout_marginTop="16dp" | ||
android:layout_gravity="center"> | ||
|
||
<TextView | ||
android:id="@+id/simplecustom_headline" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="16dp" | ||
android:gravity="center" | ||
android:textAppearance="?android:attr/textAppearanceLarge" /> | ||
<com.google.android.gms.ads.nativead.MediaView | ||
android:id="@+id/ad_media" | ||
android:layout_gravity="center" | ||
android:layout_width="250dp" | ||
android:layout_height="175dp" | ||
android:adjustViewBounds="true" | ||
android:layout_marginTop="5dp"> | ||
</com.google.android.gms.ads.nativead.MediaView> | ||
|
||
<FrameLayout | ||
android:id="@+id/simplecustom_media_placeholder" | ||
android:layout_width="match_parent" | ||
<ImageView | ||
android:id="@+id/ad_image" | ||
android:layout_gravity="center_horizontal" | ||
android:layout_width="250dp" | ||
android:layout_height="175dp" | ||
android:layout_gravity="center" | ||
android:layout_marginTop="16dp" /> | ||
android:adjustViewBounds="true" | ||
android:layout_marginTop="5dp"/> | ||
|
||
<TextView | ||
android:id="@+id/simplecustom_caption" | ||
android:layout_width="match_parent" | ||
<com.google.android.gms.example.apidemo.CustomControlsView | ||
android:id="@+id/custom_video_controls" | ||
android:padding="4dp" | ||
android:layout_gravity="bottom" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginBottom="16dp" | ||
android:layout_marginTop="8dp" | ||
android:gravity="center" | ||
android:textAppearance="?android:attr/textAppearanceSmall" | ||
android:textColor="#888888" | ||
android:textStyle="italic" /> | ||
|
||
android:layout_marginBottom="5dp" /> | ||
</FrameLayout> | ||
<TextView | ||
android:id="@+id/caption" | ||
android:textStyle="italic" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="8dp" | ||
android:layout_marginBottom="16dp" | ||
android:gravity="center" | ||
android:textAppearance="?android:attr/textAppearanceSmall" | ||
android:textColor="#888888" /> | ||
</LinearLayout> |
44 changes: 16 additions & 28 deletions
44
kotlin/advanced/APIDemo/app/src/main/res/layout/custom_video_controls.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" android:layout_width="match_parent" | ||
android:orientation="vertical" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content"> | ||
<LinearLayout | ||
android:id="@+id/video_controls" | ||
android:layout_width="match_parent" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:gravity="center" | ||
> | ||
<Button | ||
android:gravity="center"> | ||
<ImageButton | ||
android:id="@+id/btn_play" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginBottom="16dp" | ||
android:layout_marginTop="16dp" | ||
android:layout_marginRight="10dp" | ||
android:text="@string/customcontrols_view_play"/> | ||
<Button | ||
android:background="#CC000000" | ||
android:layout_width="20dp" | ||
android:layout_height="20dp" | ||
android:scaleType="centerInside" | ||
android:src="@drawable/video_play" /> | ||
<ImageButton | ||
android:id="@+id/btn_mute" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginBottom="16dp" | ||
android:layout_marginTop="16dp" | ||
android:layout_marginLeft="10dp" | ||
android:text="@string/customcontrols_view_mute"/> | ||
|
||
android:background="#CC000000" | ||
android:layout_width="20dp" | ||
android:layout_height="20dp" | ||
android:scaleType="centerInside" | ||
android:src="@drawable/video_mute" /> | ||
</LinearLayout> | ||
<TextView | ||
android:id="@+id/tv_video_status" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginLeft="@dimen/activity_horizontal_margin" | ||
android:layout_marginRight="@dimen/activity_horizontal_margin" | ||
android:text="@string/customcontrols_view_video_status" | ||
android:gravity="center" | ||
android:textAppearance="@style/TextAppearance.AppCompat.Medium" /> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.