diff options
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/drawable/ic_volume_off_black_24dp.xml | 25 | ||||
-rw-r--r-- | app/src/main/res/drawable/ic_volume_up_black_24dp.xml | 25 | ||||
-rw-r--r-- | app/src/main/res/layout/toro_exo_control_view.xml | 181 | ||||
-rw-r--r-- | app/src/main/res/layout/toro_exo_player_view.xml | 89 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 19 | ||||
-rw-r--r-- | app/src/main/res/values/styles.xml | 26 |
6 files changed, 364 insertions, 1 deletions
diff --git a/app/src/main/res/drawable/ic_volume_off_black_24dp.xml b/app/src/main/res/drawable/ic_volume_off_black_24dp.xml new file mode 100644 index 00000000..628a8aef --- /dev/null +++ b/app/src/main/res/drawable/ic_volume_off_black_24dp.xml @@ -0,0 +1,25 @@ +<!-- + ~ Copyright (c) 2018 Nam Nguyen, nam@ene.im + ~ + ~ 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. + --> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:height="32dp" + android:viewportHeight="24.0" + android:viewportWidth="24.0" + android:width="32dp"> + <path + android:fillColor="#FFFFFF" + android:pathData="M16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v2.21l2.45,2.45c0.03,-0.2 0.05,-0.41 0.05,-0.63zM19,12c0,0.94 -0.2,1.82 -0.54,2.64l1.51,1.51C20.63,14.91 21,13.5 21,12c0,-4.28 -2.99,-7.86 -7,-8.77v2.06c2.89,0.86 5,3.54 5,6.71zM4.27,3L3,4.27 7.73,9L3,9v6h4l5,5v-6.73l4.25,4.25c-0.67,0.52 -1.42,0.93 -2.25,1.18v2.06c1.38,-0.31 2.63,-0.95 3.69,-1.81L19.73,21 21,19.73l-9,-9L4.27,3zM12,4L9.91,6.09 12,8.18L12,4z"/> +</vector> diff --git a/app/src/main/res/drawable/ic_volume_up_black_24dp.xml b/app/src/main/res/drawable/ic_volume_up_black_24dp.xml new file mode 100644 index 00000000..7c11fa9e --- /dev/null +++ b/app/src/main/res/drawable/ic_volume_up_black_24dp.xml @@ -0,0 +1,25 @@ +<!-- + ~ Copyright (c) 2018 Nam Nguyen, nam@ene.im + ~ + ~ 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. + --> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="32dp" + android:height="32dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:fillColor="#FFFFFF" + android:pathData="M3,9v6h4l5,5L12,4L7,9L3,9zM16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v8.05c1.48,-0.73 2.5,-2.25 2.5,-4.02zM14,3.23v2.06c2.89,0.86 5,3.54 5,6.71s-2.11,5.85 -5,6.71v2.06c4.01,-0.91 7,-4.49 7,-8.77s-2.99,-7.86 -7,-8.77z"/> +</vector> diff --git a/app/src/main/res/layout/toro_exo_control_view.xml b/app/src/main/res/layout/toro_exo_control_view.xml new file mode 100644 index 00000000..481230bf --- /dev/null +++ b/app/src/main/res/layout/toro_exo_control_view.xml @@ -0,0 +1,181 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (c) 2018 Nam Nguyen, nam@ene.im + ~ + ~ 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. + --> + +<androidx.appcompat.widget.LinearLayoutCompat + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:layout_marginTop="4dp" + android:background="#CC000000" + android:gravity="center_vertical" + android:layoutDirection="ltr" + android:orientation="horizontal" + android:theme="@style/Theme.AppCompat" + tools:ignore="UnusedAttribute" + > + + <!--<androidx.appcompat.widget.AppCompatImageButton + android:id="@id/exo_play" + tools:ignore="ContentDescription" + style="@style/ToroMediaButton.Play" + /> + + <androidx.appcompat.widget.AppCompatImageButton + android:id="@id/exo_pause" + tools:ignore="ContentDescription" + tools:visibility="gone" + style="@style/ToroMediaButton.Pause" + /> + + <androidx.appcompat.widget.AppCompatTextView + android:id="@id/exo_position" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:includeFontPadding="false" + android:paddingLeft="4dp" + android:paddingRight="4dp" + android:textColor="#FFBEBEBE" + android:textSize="14sp" + android:textStyle="bold" + tools:text="1:25" + /> + + <androidx.appcompat.widget.AppCompatTextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:includeFontPadding="false" + android:text="/" + android:textColor="#FFBEBEBE" + android:textSize="14sp" + android:textStyle="bold" + tools:ignore="HardcodedText" + /> + + <androidx.appcompat.widget.AppCompatTextView + android:id="@id/exo_duration" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:includeFontPadding="false" + android:paddingLeft="4dp" + android:paddingRight="4dp" + android:textColor="#FFBEBEBE" + android:textSize="14sp" + android:textStyle="bold" + tools:text="5:25" + /> + + <com.google.android.exoplayer2.ui.DefaultTimeBar + android:id="@id/exo_progress" + android:layout_width="0dp" + android:layout_height="24dp" + android:layout_weight="1" + /> + + <androidx.appcompat.widget.AppCompatImageButton + android:id="@+id/exo_volume_up" + tools:ignore="ContentDescription" + style="@style/ToroMediaButton.VolumeUp" + /> + + <androidx.appcompat.widget.AppCompatImageButton + android:id="@+id/exo_volume_off" + tools:ignore="ContentDescription" + tools:visibility="gone" + style="@style/ToroMediaButton.VolumeOff" + />--> + + <androidx.appcompat.widget.AppCompatImageButton + android:id="@id/exo_play" + tools:ignore="ContentDescription" + style="@style/ToroMediaButton.Play" + /> + + <androidx.appcompat.widget.AppCompatImageButton + android:id="@id/exo_pause" + tools:ignore="ContentDescription" + tools:visibility="gone" + style="@style/ToroMediaButton.Pause" + /> + + <androidx.appcompat.widget.AppCompatTextView + android:id="@id/exo_position" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:includeFontPadding="false" + android:paddingLeft="4dp" + android:paddingRight="4dp" + android:textColor="#FFBEBEBE" + android:textSize="14sp" + android:textStyle="bold" + tools:text="1:25" + /> + + <androidx.appcompat.widget.AppCompatTextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:includeFontPadding="false" + android:text="/" + android:textColor="#FFBEBEBE" + android:textSize="14sp" + android:textStyle="bold" + tools:ignore="HardcodedText" + /> + + <androidx.appcompat.widget.AppCompatTextView + android:id="@id/exo_duration" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:includeFontPadding="false" + android:paddingLeft="4dp" + android:paddingRight="4dp" + android:textColor="#FFBEBEBE" + android:textSize="14sp" + android:textStyle="bold" + tools:text="5:25" + /> + + <com.google.android.exoplayer2.ui.DefaultTimeBar + android:id="@id/exo_progress" + android:layout_width="0dp" + android:layout_height="24dp" + android:layout_weight="1" + /> + + <androidx.appcompat.widget.AppCompatImageButton + android:id="@+id/exo_volume_up" + tools:ignore="ContentDescription" + style="@style/ToroMediaButton.VolumeUp" + /> + + <androidx.appcompat.widget.AppCompatImageButton + android:id="@+id/exo_volume_off" + tools:ignore="ContentDescription" + tools:visibility="gone" + style="@style/ToroMediaButton.VolumeOff" + /> + + <com.google.android.exoplayer2.ui.DefaultTimeBar + android:id="@+id/volume_bar" + android:layout_width="80dp" + android:layout_height="24dp" + android:layout_marginEnd="8dp" + android:layout_marginRight="8dp" + /> + +</androidx.appcompat.widget.LinearLayoutCompat>
\ No newline at end of file diff --git a/app/src/main/res/layout/toro_exo_player_view.xml b/app/src/main/res/layout/toro_exo_player_view.xml new file mode 100644 index 00000000..b318b954 --- /dev/null +++ b/app/src/main/res/layout/toro_exo_player_view.xml @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + ~ Copyright (c) 2018 Nam Nguyen, nam@ene.im + ~ + ~ 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. + --> + +<merge xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + > + + <com.google.android.exoplayer2.ui.AspectRatioFrameLayout + android:id="@id/exo_content_frame" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center" + > + + <!-- Video surface will be inserted as the first child of the content frame. --> + + <View + android:id="@id/exo_shutter" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@android:color/black" + /> + + <androidx.appcompat.widget.AppCompatImageView + android:id="@id/exo_artwork" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:scaleType="fitXY" + /> + + <com.google.android.exoplayer2.ui.SubtitleView + android:id="@id/exo_subtitles" + android:layout_width="match_parent" + android:layout_height="match_parent" + /> + + <androidx.appcompat.widget.AppCompatTextView + android:id="@id/exo_error_message" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center" + android:background="@color/exo_error_message_background_color" + android:gravity="center" + android:padding="16dp" + /> + + </com.google.android.exoplayer2.ui.AspectRatioFrameLayout> + + <FrameLayout + android:id="@id/exo_ad_overlay" + android:layout_width="match_parent" + android:layout_height="match_parent" + /> + + <FrameLayout + android:id="@id/exo_overlay" + android:layout_width="match_parent" + android:layout_height="match_parent" + /> + + <ProgressBar + android:id="@id/exo_buffering" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:indeterminate="true" + /> + + <ml.docilealligator.infinityforreddit.videoautoplay.ui.ToroControlView + android:id="@id/exo_controller" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + app:controller_layout_id="@layout/toro_exo_control_view" /> + +</merge>
\ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ee96d717..29108bee 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,4 +1,4 @@ -<resources> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="application_name" translatable="false">Infinity</string> <string name="login_activity_label">Login</string> <string name="search_activity_label" translatable="false"> </string> @@ -1295,4 +1295,21 @@ <string name="handle_link">Handle Link</string> <string name="invalid_link">Invalid link</string> + <string name="unexpected_intent_action">Unexpected intent action: <xliff:g id="action">%1$s</xliff:g></string> + <string name="enable_random_adaptation">Enable random adaptation</string> + <string name="error_drm_not_supported">Protected content not supported on API levels below 18</string> + <string name="error_drm_unsupported_scheme">This device does not support the required DRM scheme</string> + <string name="error_drm_unknown">An unknown DRM error occurred</string> + <string name="error_no_decoder">This device does not provide a decoder for <xliff:g id="mime_type">%1$s</xliff:g></string> + <string name="error_no_secure_decoder">This device does not provide a secure decoder for <xliff:g id="mime_type">%1$s</xliff:g></string> + <string name="error_querying_decoders">Unable to query device decoders</string> + <string name="error_instantiating_decoder">Unable to instantiate decoder <xliff:g id="decoder_name">%1$s</xliff:g></string> + <string name="error_unsupported_video">Media includes video tracks, but none are playable by this device</string> + <string name="error_unsupported_audio">Media includes audio tracks, but none are playable by this device</string> + <string name="storage_permission_denied">Permission to access storage was denied</string> + <string name="sample_list_load_error">One or more sample lists failed to load</string> + + <string name="exo_controls_volume_up_description">Volume Up</string> + <string name="exo_controls_volume_off_description">Volume Off</string> + </resources> diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 40a2c351..35c75d46 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -517,4 +517,30 @@ <item name="switchStyle">@style/Widget.App.Switch.Dark</item> </style> + <style name="ToroMediaButton"> + <item name="android:background">@null</item> + <item name="android:layout_width">65dp</item> + <item name="android:layout_height">48dp</item> + </style> + + <style name="ToroMediaButton.Play"> + <item name="android:src">@drawable/exo_controls_play</item> + <item name="android:contentDescription">@string/exo_controls_play_description</item> + </style> + + <style name="ToroMediaButton.Pause"> + <item name="android:src">@drawable/exo_controls_pause</item> + <item name="android:contentDescription">@string/exo_controls_pause_description</item> + </style> + + <style name="ToroMediaButton.VolumeUp"> + <item name="android:src">@drawable/ic_volume_up_black_24dp</item> + <item name="android:contentDescription">@string/exo_controls_volume_up_description</item> + </style> + + <style name="ToroMediaButton.VolumeOff"> + <item name="android:src">@drawable/ic_volume_off_black_24dp</item> + <item name="android:contentDescription">@string/exo_controls_volume_off_description</item> + </style> + </resources> |