Skip to content

Commit

Permalink
Fix Cast notification having no buttons, fix miscolored items
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Schoen authored and Steven Schoen committed May 22, 2016
1 parent ce2ca73 commit bca9761
Show file tree
Hide file tree
Showing 30 changed files with 176 additions and 147 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 96
versionName '3.1.6'
versionCode 97
versionName '3.1.7'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public PutioUtils getPutioUtils() {
public void buildVideoCastManager() {
CastConfiguration.Builder castConfigBuilder = new CastConfiguration.Builder(PutioUtils.CAST_APPLICATION_ID)
.enableNotification()
.addNotificationAction(CastConfiguration.NOTIFICATION_ACTION_PLAY_PAUSE, true)
.addNotificationAction(CastConfiguration.NOTIFICATION_ACTION_DISCONNECT, false)
.enableLockScreen();
if (BuildConfig.DEBUG) castConfigBuilder.enableDebug();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@ public void onGlobalLayout() {
}

toolbar = (Toolbar) view.findViewById(R.id.toolbar_filedetails);
toolbar.setNavigationOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (hasCallbacks()) {
callbacks.onFileDetailsClosed();
} else {
getActivity().finish();
}
}
});
if (isAdded()) {
if (UIUtils.isTablet(getActivity())) {
toolbar.inflateMenu(R.menu.menu_filedetails);
Expand Down Expand Up @@ -272,21 +282,8 @@ public void onClick(View v) {

fetchFileData();

ImageButton buttonClose = (ImageButton) view.findViewById(R.id.button_filedetails_close);
buttonClose.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (hasCallbacks()) {
callbacks.onFileDetailsClosed();
} else {
getActivity().finish();
}
}
});

View buttonPlay = view.findViewById(R.id.button_filedetails_play);
if (getCurrentFile().isMedia()) {
PutioUtils.setupFab(buttonPlay);
buttonPlay.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Expand Down
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_action_copy_black.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/res/drawable-mdpi/ic_action_copy_black.png
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/res/drawable-mdpi/ic_filedetails_close.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_action_copy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M16,1L4,1c-1.1,0 -2,0.9 -2,2v14h2L4,3h12L16,1zM19,5L8,5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h11c1.1,0 2,-0.9 2,-2L21,7c0,-1.1 -0.9,-2 -2,-2zM19,21L8,21L8,7h11v14z"/>
</vector>
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_action_create_folder.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M20,6h-8l-2,-2L4,4c-1.11,0 -1.99,0.89 -1.99,2L2,18c0,1.11 0.89,2 2,2h16c1.11,0 2,-0.89 2,-2L22,8c0,-1.11 -0.89,-2 -2,-2zM19,14h-3v3h-2v-3h-3v-2h3L14,9h2v3h3v2z"/>
</vector>
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_toolbar_nav_close_black.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#000"
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_toolbar_nav_close_white.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFF"
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>
76 changes: 40 additions & 36 deletions app/src/main/res/layout-h400dp/filedetails.xml
Original file line number Diff line number Diff line change
@@ -1,41 +1,45 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="@android:color/white"
android:clipChildren="false">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="@android:color/white"
android:clipChildren="false">

<include
android:id="@+id/filepreview"
layout="@layout/filepreview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/holder_fileinfo"
android:layout_marginBottom="@dimen/fabSizeHalfNegative" />
<include
android:id="@+id/filepreview"
layout="@layout/filepreview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/holder_fileinfo"
android:layout_marginBottom="@dimen/fabSizeHalfNegative"/>

<RelativeLayout
android:id="@id/holder_fileinfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:clipChildren="false"
android:elevation="2dp">
<RelativeLayout
android:id="@id/holder_fileinfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:clipChildren="false"
android:elevation="2dp">

<include
layout="@layout/fileinfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/fabSizeHalf" />
<include
layout="@layout/fileinfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/fabSizeHalf"/>

<include
android:id="@+id/button_filedetails_play"
layout="@layout/fab_play"
android:layout_width="@dimen/fabSize"
android:layout_height="@dimen/fabSize"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginEnd="32dp"
android:layout_marginRight="32dp" />
</RelativeLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/button_filedetails_play"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginEnd="32dp"
android:layout_marginRight="32dp"
android:src="@drawable/mr_ic_play_light"
app:elevation="2dp"
app:fabSize="normal"/>
</RelativeLayout>
</RelativeLayout>
98 changes: 50 additions & 48 deletions app/src/main/res/layout/filedetails.xml
Original file line number Diff line number Diff line change
@@ -1,55 +1,57 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:clipChildren="false">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:clipChildren="false">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginEnd="@dimen/fabSizeHalfNegative"
android:layout_marginRight="@dimen/fabSizeHalfNegative"
android:layout_toLeftOf="@+id/holder_fileinfo"
android:layout_toStartOf="@id/holder_fileinfo">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginEnd="@dimen/fabSizeHalfNegative"
android:layout_marginRight="@dimen/fabSizeHalfNegative"
android:layout_toLeftOf="@+id/holder_fileinfo"
android:layout_toStartOf="@id/holder_fileinfo">

<include
android:id="@+id/filepreview"
layout="@layout/filepreview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
<include
android:id="@+id/filepreview"
layout="@layout/filepreview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>

<RelativeLayout
android:id="@id/holder_fileinfo"
android:layout_width="340dp"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:clipChildren="false">
<RelativeLayout
android:id="@id/holder_fileinfo"
android:layout_width="340dp"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:clipChildren="false">

<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/fabSizeHalf"
android:layout_marginStart="@dimen/fabSizeHalf">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/fabSizeHalf"
android:layout_marginStart="@dimen/fabSizeHalf">

<include
layout="@layout/fileinfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="2dp" />
</ScrollView>
<include
layout="@layout/fileinfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="2dp"/>
</ScrollView>

<include
android:id="@+id/button_filedetails_play"
layout="@layout/fab_play"
android:layout_width="@dimen/fabSize"
android:layout_height="@dimen/fabSize"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="32dp" />
</RelativeLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/button_filedetails_play"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="32dp"
android:src="@drawable/mr_ic_play_light"
app:elevation="2dp"
app:fabSize="normal"/>
</RelativeLayout>
</RelativeLayout>
38 changes: 13 additions & 25 deletions app/src/main/res/layout/filedetails_toolbar.xml
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar_filedetails"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/transparent"
android:minHeight="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:contentInsetStart="0dp"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">

<ImageButton
android:id="@+id/button_filedetails_close"
android:layout_width="56dp"
android:layout_height="match_parent"
android:layout_marginEnd="4dp"
android:layout_marginRight="4dp"
android:adjustViewBounds="true"
android:background="?attr/actionBarItemBackground"
android:contentDescription="@string/close"
android:padding="20dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_filedetails_close"
android:tint="@android:color/white" />
</android.support.v7.widget.Toolbar>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar_filedetails"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/transparent"
android:minHeight="?attr/actionBarSize"
app:contentInsetStart="0dp"
app:navigationContentDescription="@string/close"
app:navigationIcon="@drawable/ic_toolbar_nav_close_white"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
2 changes: 1 addition & 1 deletion app/src/main/res/menu/context_files_multiple.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
app:showAsAction="ifRoom" />
<item
android:id="@+id/context_copydownloadlink"
android:icon="@drawable/ic_action_copy_black"
android:icon="@drawable/ic_action_copy"
android:orderInCategory="2"
android:showAsAction="ifRoom"
android:title="@string/copy_dl_link"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/menu/context_files_single.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
app:showAsAction="ifRoom" />
<item
android:id="@+id/context_copydownloadlink"
android:icon="@drawable/ic_action_copy_black"
android:icon="@drawable/ic_action_copy"
android:orderInCategory="2"
android:showAsAction="ifRoom"
android:title="@string/copy_dl_link"
Expand Down
28 changes: 14 additions & 14 deletions app/src/main/res/menu/menu_files.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto">

<item
android:id="@+id/menu_search"
android:hint="@string/searchyourfiles"
android:orderInCategory="1"
android:title="@string/search"
app:actionViewClass="android.support.v7.widget.SearchView"
app:showAsAction="ifRoom" />
<item
android:id="@+id/menu_search"
android:hint="@string/searchyourfiles"
android:orderInCategory="1"
android:title="@string/search"
app:actionViewClass="android.support.v7.widget.SearchView"
app:showAsAction="ifRoom"/>

<item
android:id="@+id/menu_createfolder"
android:icon="@drawable/ic_action_createfolder_black"
android:orderInCategory="2"
android:title="@string/create_folder"
app:showAsAction="never" />
<item
android:id="@+id/menu_createfolder"
android:icon="@drawable/ic_action_create_folder"
android:orderInCategory="2"
android:title="@string/create_folder"
app:showAsAction="never"/>

</menu>
Loading

0 comments on commit bca9761

Please sign in to comment.