Commit 7626d89b authored by Geoffrey Métais's avatar Geoffrey Métais

Merge TV flavor with vanilla

parent 342ebd2e
......@@ -26,7 +26,8 @@
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="23" />
android:targetSdkVersion="23"
tools:overrideLibrary="android.support.v17.leanback"/>
<!-- FIXME Because manifest merger will add it otherwise... -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove" />
......@@ -37,6 +38,9 @@
<!-- Internet -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Launch recommendations service once device is booted -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<!-- normal -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
......@@ -53,6 +57,14 @@
<uses-permission android:name="org.videolan.vlc.permission.READ_EXTENSION_DATA" />
<uses-permission android:name="org.videolan.vlc.permission.BIND_DATA_CONSUMER" />
<uses-feature android:name="android.software.leanback"
android:required="true" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<uses-feature android:name="android.hardware.microphone"
android:required="false"/>
<application
android:name="org.videolan.vlc.VLCApplication"
android:hardwareAccelerated="true"
......@@ -62,6 +74,15 @@
android:label="@string/app_name"
android:logo="@drawable/icon"
android:theme="@style/Theme.VLC.NoTitleBar" >
<activity
android:name="org.videolan.vlc.StartActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".gui.MainActivity"
android:icon="@drawable/icon"
......@@ -69,11 +90,6 @@
android:launchMode="singleTask"
android:windowSoftInputMode="adjustPan"
android:theme="@style/Theme.VLC" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable" />
......@@ -472,6 +488,50 @@
<action android:name="_PACKAGENAME_.remote.PlayPause" />
</intent-filter>
</receiver>
<!-- TV components -->
<activity
android:name="org.videolan.vlc.gui.tv.MainTvActivity"
android:label="@string/app_name"
android:launchMode="singleInstance"
android:theme="@style/Theme.Leanback" />
<activity
android:name="org.videolan.vlc.gui.tv.DetailsActivity"
android:exported="true"
android:theme="@style/Theme.Leanback" />
<activity
android:name=".gui.tv.browser.VerticalGridActivity"
android:exported="true"
android:theme="@style/Theme.Leanback" />
<!--<activity-->
<!--android:name=".gui.preferences.PreferencesActivity"-->
<!--android:exported="true"-->
<!--tools:replace="android:theme"-->
<!--android:theme="@style/Theme.VLC.Leanback.Preferences" />-->
<activity
android:name="org.videolan.vlc.gui.tv.SearchActivity"
android:exported="true"
android:theme="@style/Theme.Leanback" />
<activity
android:name="org.videolan.vlc.gui.tv.audioplayer.AudioPlayerActivity"
android:exported="true"
android:launchMode="singleTop"
android:allowTaskReparenting="true"
android:theme="@style/Theme.Leanback" />
<service
android:name="org.videolan.vlc.gui.tv.RecommendationsService"
android:exported="false" >
</service>
<receiver
android:name="org.videolan.vlc.gui.tv.BootupReceiver"
android:enabled="true"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
</application>
</manifest>
......@@ -210,7 +210,7 @@ dependencies {
compile 'com.android.support:support-annotations:23.1.1'
compile 'com.android.support:preference-v7:23.1.1'
compile 'com.android.support:percent:23.1.1'
tvCompile 'com.android.support:leanback-v17:23.1.1'
compile 'com.android.support:leanback-v17:23.1.1'
tvCompile 'com.android.support:preference-leanback-v17:23.1.1'
testCompile 'junit:junit:4.12'
}
......
......@@ -31,7 +31,7 @@
tools:node="replace"
android:enabled="false"/>
<activity
android:name="org.videolan.vlc.gui.tv.StartActivity">
android:name=".StartActivity">
<intent-filter android:priority="5" >
<action android:name="android.intent.action.MAIN" />
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android=
"http://schemas.android.com/apk/res/android">
<item android:state_activated="true"
android:drawable="@color/primary_dark_material_light" />
<item android:drawable="@color/primary_material_dark" />
</selector>
\ No newline at end of file
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Define the background properties like color etc -->
<item
android:id="@android:id/background"
android:height="@dimen/half_default_margin"
android:gravity="center"
android:start="2dp"
android:end="2dp">
<shape>
<solid android:color="@color/grey700" />
</shape>
</item>
<!-- Define the progress properties like start color, end color etc -->
<item
android:id="@android:id/progress"
android:height="@dimen/half_default_margin"
android:gravity="center"
android:start="2dp"
android:end="2dp">
<clip>
<shape>
<solid android:color="@color/orange500" />
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="@dimen/tv_overscan_vertical"
android:layout_marginLeft="@dimen/tv_overscan_horizontal"
android:layout_marginRight="@dimen/tv_overscan_horizontal"
android:layout_marginTop="@dimen/tv_overscan_vertical"
android:orientation="horizontal">
<!-- Cover -->
<ImageView
android:id="@+id/album_cover"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
android:scaleType="fitCenter"
android:src="@drawable/icon" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center_horizontal"
android:orientation="vertical">
<!-- Playlist -->
<android.support.v7.widget.RecyclerView
android:id="@+id/playlist"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="3"
android:focusable="true"
android:focusableInTouchMode="true"
android:nextFocusDown="@+id/media_progress"
android:nextFocusLeft="@+id/media_progress"
android:nextFocusRight="@+id/media_progress"
android:scrollbars="vertical" />
<!-- Media HUD -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="2"
android:gravity="center"
android:orientation="vertical"
android:paddingBottom="5dip"
android:paddingLeft="30dip"
android:paddingRight="30dip"
android:paddingTop="10dip">
<TextView
android:id="@+id/media_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Title"
android:textAppearance="@style/TextAppearance.AppCompat.SearchResult.Title" />
<TextView
android:id="@+id/media_artist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Artist"
android:textAppearance="@style/TextAppearance.AppCompat.SearchResult.Subtitle" />
<ProgressBar
android:id="@+id/media_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/half_default_margin"
android:layout_marginTop="@dimen/half_default_margin"
android:focusable="true"
android:focusableInTouchMode="true"
android:indeterminate="false"
android:nextFocusDown="@+id/button_play"
android:nextFocusUp="@+id/playlist"
android:background="@drawable/background_item"
android:progressDrawable="@drawable/tv_audioprogressbar" />
<!-- Media control buttons -->
<LinearLayout
android:id="@+id/media_controls"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:orientation="horizontal">
<ImageView
android:id="@+id/button_repeat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="10dp"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:nextFocusDown="@+id/playlist"
android:nextFocusLeft="@+id/button_shuffle"
android:nextFocusUp="@+id/media_progress"
android:onClick="onClick"
android:src="@drawable/ic_repeat_w" />
<ImageView
android:id="@+id/button_previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:nextFocusDown="@+id/playlist"
android:nextFocusUp="@+id/media_progress"
android:onClick="onClick"
android:src="@drawable/ic_previous_w" />
<ImageView
android:id="@+id/button_play"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:nextFocusDown="@+id/playlist"
android:nextFocusUp="@+id/media_progress"
android:onClick="onClick"
android:src="@drawable/ic_play_w" />
<ImageView
android:id="@+id/button_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:nextFocusDown="@+id/playlist"
android:nextFocusUp="@+id/media_progress"
android:onClick="onClick"
android:src="@drawable/ic_next_w" />
<ImageView
android:id="@+id/button_shuffle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:nextFocusDown="@+id/playlist"
android:nextFocusRight="@id/button_repeat"
android:nextFocusUp="@+id/media_progress"
android:onClick="onClick"
android:src="@drawable/ic_shuffle_w" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:name="org.videolan.vlc.gui.tv.MediaItemDetailsFragment"
android:id="@+id/details_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/material_blue_grey_800">
<fragment
android:name="android.support.v17.leanback.app.BrowseFragment"
android:id="@+id/browse_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ProgressBar
android:id="@+id/tv_main_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone"/>
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:name="org.videolan.vlc.gui.tv.SearchFragment"
android:id="@+id/search_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="@dimen/half_default_margin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/activatedBackgroundIndicator"
android:minHeight="?android:attr/listPreferredItemHeight"
android:orientation="vertical">
<TextView android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="text1"
android:textSize="20sp"
android:textStyle="bold"
android:textColor="@color/grey50"/>
<TextView android:id="@android:id/text2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="text2"
android:textSize="16sp"
android:textColor="@color/grey50"/>
</LinearLayout>
\ No newline at end of file
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/material_blue_grey_800">
<FrameLayout
android:id="@+id/tv_fragment_placeholder"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ProgressBar
android:id="@+id/tv_fragment_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone"/>
<TextView
android:id="@+id/tv_fragment_empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/directory_empty"
android:visibility="gone"/>
</FrameLayout>
\ No newline at end of file
......@@ -160,6 +160,12 @@
<string name="server_servername_hint">Server name, for conveniency</string>
<string name="server_port">Port: </string>
<string name="search_results">Search results</string>
<string name="favorites_add">Add to favorites</string>
<string name="favorites_remove">Remove from favorites</string>
<string name="favorite_added">Saved to favorites</string>
<string name="favorite_removed">Removed from favorites</string>
<string name="open">Open</string>
<string name="open_mrl">Stream</string>
<string name="open_mrl_dialog_title">Open network stream</string>
......
......@@ -164,6 +164,10 @@
<item name="ic_subtitledelay">@drawable/ic_subtitledelay_w</item>
</style>
<style name="Theme.VLC.Leanback.Preferences" parent="Theme.Leanback">
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
</style>
<style name="Theme.VLC.List" parent="android:style/Widget.AbsListView">
<item name="android:listSelector">@drawable/background_item</item>
<item name="android:divider">@android:color/transparent</item>
......
/*
* *************************************************************************
* StartActivity.java
* **************************************************************************
* Copyright © 2015 VLC authors and VideoLAN
* Author: Geoffrey Métais
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* ***************************************************************************
*/
package org.videolan.vlc;