Skip to content
This repository has been archived by the owner on Nov 22, 2017. It is now read-only.

Support for orientation, useful three new listeners and improvements about compatibility with ExoPlayer #86

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.1'
classpath 'com.android.tools.build:gradle:2.1.3'
}
}

Expand Down
2 changes: 1 addition & 1 deletion draggablepanel/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package="com.github.pedrovgs">

<uses-sdk
android:minSdkVersion="8"
android:minSdkVersion="11"
android:targetSdkVersion="20"/>

</manifest>
2 changes: 1 addition & 1 deletion draggablepanel/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'checkstyle'

dependencies {
compile 'com.android.support:support-v4:20.0.0'
compile 'com.android.support:support-v4:20.0.0'
compile 'com.nineoldandroids:library:2.4.0'
}

Expand Down
9 changes: 6 additions & 3 deletions draggablepanel/res/layout/draggable_panel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
draggable_view:bottom_view_id="@+id/second_view"
draggable_view:top_view_id="@+id/drag_view">
draggable_view:top_view_id="@+id/drag_view"
>

<FrameLayout
android:id="@+id/second_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/drag_view"/>
android:layout_below="@+id/drag_view"
/>

<FrameLayout
android:id="@+id/drag_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:orientation="vertical"/>
android:orientation="vertical"
/>

</com.github.pedrovgs.DraggableView>
41 changes: 21 additions & 20 deletions draggablepanel/res/values/attrs.xml
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="draggable_panel">
<attr name="top_fragment_height" format="dimension"/>
<attr name="x_scale_factor" format="float"/>
<attr name="y_scale_factor" format="float"/>
<attr name="top_fragment_margin_right" format="dimension"/>
<attr name="top_fragment_margin_bottom" format="dimension"/>
<attr name="enable_horizontal_alpha_effect" format="boolean"/>
<attr name="enable_click_to_maximize_panel" format="boolean"/>
<attr name="enable_click_to_minimize_panel" format="boolean"/>
<attr name="enable_touch_listener_panel" format="boolean"/>
<attr format="dimension" name="top_fragment_height"/>
<attr format="float" name="x_scale_factor"/>
<attr format="float" name="y_scale_factor"/>
<attr format="dimension" name="top_fragment_margin_right"/>
<attr format="dimension" name="top_fragment_margin_bottom"/>
<attr format="boolean" name="enable_horizontal_alpha_effect"/>
<attr format="boolean" name="enable_click_to_maximize_panel"/>
<attr format="boolean" name="enable_click_to_minimize_panel"/>
<attr format="boolean" name="enable_touch_listener_panel"/>
</declare-styleable>

<declare-styleable name="draggable_view">
<attr name="top_view_id" format="reference"/>
<attr name="bottom_view_id" format="reference"/>
<attr name="top_view_height" format="dimension"/>
<attr name="top_view_x_scale_factor" format="float"/>
<attr name="top_view_y_scale_factor" format="float"/>
<attr name="top_view_margin_right" format="dimension"/>
<attr name="top_view_margin_bottom" format="dimension"/>
<attr name="enable_minimized_horizontal_alpha_effect" format="boolean"/>
<attr name="enable_click_to_maximize_view" format="boolean"/>
<attr name="enable_click_to_minimize_view" format="boolean"/>
<attr name="top_view_resize" format="boolean"/>
<attr format="reference" name="top_view_id"/>
<attr format="reference" name="bottom_view_id"/>
<attr format="dimension" name="top_view_height"/>
<attr format="float" name="top_view_x_scale_factor"/>
<attr format="float" name="top_view_y_scale_factor"/>
<attr format="dimension" name="top_view_margin_right"/>
<attr format="dimension" name="top_view_margin_bottom"/>
<attr format="string" name="orientation_for_events"/>
<attr format="boolean" name="enable_minimized_horizontal_alpha_effect"/>
<attr format="boolean" name="enable_click_to_maximize_view"/>
<attr format="boolean" name="enable_click_to_minimize_view"/>
<attr format="boolean" name="top_view_resize"/>
</declare-styleable>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package com.github.pedrovgs;

import android.view.MotionEvent;

/**
* Listener created to be notified when some drag actions are performed over DraggablePanel or
* DraggableView instances.
Expand Down Expand Up @@ -42,4 +44,28 @@ public interface DraggableListener {
* Called when the view is closed to the right.
*/
void onClosedToRight();

/**
* Called when the view is being touched at present
*/

void onTouchListener(MotionEvent ev);

/**
* Called when the view is maximized with click instead of drag
*/

void onClickedToMaximize();

/**
* Called when the view is minimized with click instead of drag
*/

void onClickedToMinimize();

/**
* Called when the view is being dragged to either minimize or maximize
*/

void onSmoothSlide();
}
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ public void setClickToMinimizeEnabled(boolean enableClickToMinimize) {
}

/**
*
* Slide the view based on scroll of the nav drawer.
* "setEnableTouch" user prevents click to expand while the drawer is moving.
* It's only possible to maximize the view when @slideOffset is equals to 0.0,
Expand Down
Loading