Skip to content

Support To Change Anchor Point #548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 132 commits into
base: 3.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
ba2000f
Fixed drag state idle check
ngsilverman Jul 18, 2015
08acdf0
Merge pull request #503 from umano/3.1
tokudu Jul 18, 2015
44d8409
Bump the version to 3.1
tokudu Jul 18, 2015
bc24980
Fixed two scroll issues: 1) if you get the panel in a dragging state …
cody-young-move Jul 23, 2015
51e1651
Fixed anchor point scrolling issue. If anchor point is set, then the …
Jul 23, 2015
2597064
Merge pull request #509 from cody-young-move/fixed_scroll_issues
tokudu Jul 25, 2015
fbbcba3
Added support-annotations
tokudu Jul 25, 2015
c9bc879
Fixed the null pointer in 505 issue
tokudu Jul 25, 2015
f57b08b
Merge pull request #510 from davidluuAU/fixing_anchor_scrolling
tokudu Jul 25, 2015
e9ae5b0
Fixed issue 504
tokudu Jul 25, 2015
0dead96
Bump the version to 3.1.1
tokudu Jul 25, 2015
fb63720
add recyclerview support
Jul 26, 2015
03bfdd4
fix whitespace
Jul 26, 2015
e0e18ac
Merge pull request #514 from pdavid0/master
tokudu Jul 26, 2015
7659b59
Set getScrollableViewScrollPosition to protected
cody-young-move Aug 7, 2015
361be74
fix setClipPanel doc typo
Rbcum Aug 23, 2015
4e87225
fix the 'paralax' typos
Rbcum Aug 23, 2015
5134a97
When checking to see if we've passed drag slop, use the initial posit…
cody-young-move Sep 2, 2015
b56e9b6
Use decorated RecyclerView child sizes
AlexQuinlivan Sep 28, 2015
f2410fb
In very rare cases a multi finger touch in the main section can cause…
cody-young-move Sep 29, 2015
c15d7f9
Merge pull request #544 from cody-young-move/fixed_pointer_crash
tokudu Oct 13, 2015
dda4ce2
Merge pull request #530 from bitchouse/fix-typo
tokudu Oct 13, 2015
d9b4cb6
Merge pull request #521 from cody-young-move/protected_scroll_function
tokudu Oct 13, 2015
b588d68
Merge pull request #543 from AlexQuinlivan/master
tokudu Oct 13, 2015
902b10f
Merge pull request #502 from ngsilverman/master
tokudu Oct 13, 2015
26e2e67
Merge pull request #535 from cody-young-move/fixed_edge_drag_issue
tokudu Oct 13, 2015
eac02ad
Bump the versions
tokudu Oct 13, 2015
b6da0be
Add attribute for setting scroller interpolator
kiyeonk Oct 28, 2015
a3d5838
Fix #525
PhpXp Oct 31, 2015
ffad02b
Fix NPE at writeToParcel PanelState.
Nov 15, 2015
2873400
Have a default state for mLastNotDraggingSlideState
ivgiuliani Nov 16, 2015
c7fc8b0
Merge pull request #584 from plastiv/fix-writetoparcel-npe
tokudu Nov 17, 2015
58b292f
Update LICENSE.txt
lohnn Nov 18, 2015
b16882b
Delete unused leftovers from gradle migration.
plastiv Nov 20, 2015
d173909
Update android plugin to 1.5.0.
plastiv Nov 20, 2015
58efe1b
Fix #356 and #545
tokudu Nov 24, 2015
e5d1e5e
Removed an extra empty line
tokudu Nov 24, 2015
2784300
Merge pull request #594 from plastiv/delete-unused-files
tokudu Nov 24, 2015
eba050c
Merge pull request #589 from lohnn/patch-1
tokudu Nov 24, 2015
1fd6fee
Merge pull request #585 from kratorius/fix-536
tokudu Nov 24, 2015
ab534ac
Merge pull request #570 from PhpXp/issue-525
tokudu Nov 24, 2015
9b8f62f
Update README.md
tokudu Nov 24, 2015
9405df0
Merge pull request #567 from kiyeonk/add_interpolator
tokudu Nov 24, 2015
3e7b96d
Update README.md
tokudu Nov 24, 2015
d7c241d
Update to compile sdk 23.
plastiv Nov 24, 2015
0bbccc3
Update gradle to 2.9.
plastiv Nov 24, 2015
d0ad4e8
Merge pull request #602 from plastiv/update-android-plugin
tokudu Dec 22, 2015
512efac
Merge pull request #603 from plastiv/update-gradle
tokudu Dec 22, 2015
6f16197
Merge pull request #601 from plastiv/update-compile-sdk
tokudu Dec 22, 2015
82ca21b
Fixed a theme bug from the last pull request
tokudu Dec 22, 2015
3913049
Updated the build tools version to 23.0.2
tokudu Dec 22, 2015
75b5bbd
Added support for ScrollableViewHelpers
tokudu Dec 22, 2015
739c755
Update README.md
tokudu Dec 22, 2015
81e3d5a
Add support for layout_weight for the sliding view
tokudu Dec 22, 2015
3c38e2e
Update README.md
tokudu Dec 22, 2015
e444d10
Update README.md
tokudu Dec 22, 2015
88bd2fe
Release 3.2.1
tokudu Dec 22, 2015
96c0165
fix typo
cypressious Dec 27, 2015
23770b7
Popular Android library badge
libtastic Jan 30, 2016
f30c3b5
Merge pull request #648 from libtastic/patch-1
tokudu Feb 1, 2016
6480b86
Update README.md
tokudu Feb 1, 2016
bc2d25b
Merge pull request #629 from cypressious/patch-1
tokudu Feb 1, 2016
6ed0b16
Remove the broken links to the Umano app.
tokudu Feb 2, 2016
b27e959
Allow to change anchor points
tokudu Feb 6, 2016
cab9a6b
Allow multiple state listeners
tokudu Feb 6, 2016
b69a6bf
Add the ability to add listener for the faded protion of the main layout
tokudu Feb 6, 2016
9172855
Fix mCoveredFadeColor setter
tokudu Feb 6, 2016
a69241d
Fix an NPE
tokudu Feb 6, 2016
b4baf27
Fix a crash
tokudu Feb 6, 2016
d31a33a
Updating maven_push.gradle to the latest version.
dvoiss Feb 17, 2016
906e3d0
Update gradle to 2.11.
plastiv Feb 18, 2016
df5bf71
Add travis configuration yml.
plastiv Feb 18, 2016
b2a60a1
Merge pull request #668 from plastiv/update-gradle
tokudu Feb 24, 2016
dd6deeb
Merge pull request #669 from plastiv/add-travis
tokudu Mar 7, 2016
a7895a1
Merged
tokudu Mar 7, 2016
3e06e9a
Change the format of the PanelSlideListener
tokudu Mar 7, 2016
966fee4
Fix the onTouchEnabled problem
tokudu Mar 7, 2016
7064ed7
Use standart gradle source folders for project.
plastiv Feb 18, 2016
80b1e03
Prevent the panel from getting stuck in the dragging state
tokudu Mar 7, 2016
7014c73
Fix a bug with the fadeclicklistener
tokudu Mar 7, 2016
c115a36
bump the version
tokudu Mar 7, 2016
c44f86b
Fix some javadoc issues
tokudu Mar 7, 2016
c729f01
Update README.md
tokudu Mar 7, 2016
a592298
Update README.md
tokudu Mar 7, 2016
db05b06
Fix NPE in drawChild() when returning to Fragment with animation. App…
pandasys Mar 21, 2016
5d801c8
Bugfix: java.util.ConcurrentModificationException on Listeners.
Apr 18, 2016
b78435d
Fix #623, a crash on Android N
May 25, 2016
8cbefcb
Fix drag problem
Kevinrob Jun 23, 2016
7f63b88
Fix wrong state saved while dragging or in drag motion
Jul 26, 2016
c95898a
Update to android gradle plugin 2.1.2.
plastiv Aug 23, 2016
3f06333
Update to build tools 23.0.3.
plastiv Aug 23, 2016
4ec61db
Update to Gradle 2.13.
plastiv Aug 23, 2016
047c4f4
Update to support lib 23.4.0.
plastiv Aug 23, 2016
2b8b3de
Refactors the way savedinstancestate works to avoid BadParceableExcep…
Aug 24, 2016
b39b196
Merge pull request #757 from plastiv/update_deps
tokudu Sep 13, 2016
c65d361
Merge pull request #759 from srMarlins/feature/srmarlins/SavedInstanc…
tokudu Sep 13, 2016
384fefd
Drop NineOldDroids library
tokudu Sep 13, 2016
214025a
Merge pull request #722 from BrianOn99/fix-android-N-bug
tokudu Sep 13, 2016
00793c6
Merge pull request #746 from talentprince/bug/saving-state-while-drag…
tokudu Sep 13, 2016
0c642d2
Merge pull request #727 from Kevinrob/master
tokudu Sep 13, 2016
7032da0
Merge pull request #703 from gfred/bugfixConcurrent
tokudu Sep 13, 2016
51e52bb
Merge pull request #692 from pandasys/master
tokudu Sep 13, 2016
9c091c4
Updated the version
tokudu Sep 13, 2016
ad9807d
Update README.md
tokudu Sep 13, 2016
61c8950
Added more known uses.
tokudu Sep 15, 2016
fc15689
Update README.md
tokudu Sep 15, 2016
a08f233
Update README.md
tokudu Sep 15, 2016
295ea97
Update README.md
tokudu Sep 15, 2016
4c201af
Update README.md
tokudu Sep 15, 2016
7fb8e1e
Update README.md
tokudu Sep 15, 2016
fa0238c
Changed mPanelSlideListeners to a CopyOnWriteArrayList. Addresses #695.
Oct 25, 2016
4f2f5ee
Fixed Bug: SlidingUpPanelLayout ignores setPanelState(), as long as a…
May 9, 2017
0f96fb7
Merge pull request #774 from atomjack/issue695
tokudu May 17, 2017
83d367d
Update build.gradle
NeilMajumder Jun 17, 2017
1c9680c
Fix potential NPEs and synchronization errors.
reshma-kumar-ck Jun 18, 2017
23f58d2
Merge pull request #838 from NullPointeRR/master
tokudu Jun 19, 2017
4544df7
Update build.gradle
NeilMajumder Jun 19, 2017
4c32d21
Update build.gradle
NeilMajumder Jun 20, 2017
b296636
Update gradle.properties
NeilMajumder Jun 20, 2017
88e4d89
Update gradle.properties
NeilMajumder Jun 20, 2017
1be3593
Update gradle.properties
NeilMajumder Jun 20, 2017
cf9108c
Update build.gradle
NeilMajumder Jun 20, 2017
b95f31d
Update gradle-wrapper.properties
NeilMajumder Jun 20, 2017
96677b6
Update .travis.yml
NeilMajumder Jun 20, 2017
41fadaa
In SlidingUpPanelLayout.dispatchTouchEvent(), ignore horizontal scrolls
Aug 14, 2017
23cbb33
Merge pull request #857 from hansonchris/hansonchris/horizontalScrollFix
tokudu Sep 14, 2017
a96cfcb
Merge pull request #830 from WurstMitDurst/setPanelStateBugfix
tokudu Sep 17, 2017
f88e850
Update README.md
tokudu Sep 17, 2017
6337d98
Merge pull request #837 from NeilMajumder/patch-3
tokudu Sep 17, 2017
2e01794
Upgrade to SDK
tokudu Sep 17, 2017
869dd59
Update the library
tokudu Sep 17, 2017
45a4604
Fix the group
tokudu Sep 17, 2017
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
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: android
jdk: oraclejdk7

android:
components:
- tools
- platform-tools
- extra-android-m2repository
- extra-google-m2repository
- build-tools-26.0.0
- android-26

# Enable travis container based infrastructure
sudo: false

before_script:
- chmod +x gradlew

script:
- ./gradlew clean assemble
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2015 Anton Lopyrev

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
73 changes: 61 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.sothree.slidinguppanel/library/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.sothree.slidinguppanel/library)
[![Badge](http://www.libtastic.com/static/osbadges/30.png)](http://www.libtastic.com/technology/30/)

**Note:** we are **not** actively responding to issues right now. If you find a bug, please submit a PR.

Android Sliding Up Panel
=========================

This library provides a simple way to add a draggable sliding up panel (popularized by Google Music, Google Maps and Rdio) to your Android application. Umano Team <3 Open Source.
This library provides a simple way to add a draggable sliding up panel (popularized by Google Music and Google Maps) to your Android application.

As seen in [Umano](http://umanoapp.com) [Android app](https://play.google.com/store/apps/details?id=com.sothree.umano):
As seen in Umano Android App (now acquired by Dropbox):

![SlidingUpPanelLayout](https://raw.github.com/umano/AndroidSlidingUpPanelDemo/master/slidinguppanel.png)

### Importing the library
### Known Uses in Popular Apps

#### Eclipse
* [Soundcloud] (https://play.google.com/store/apps/details?id=com.soundcloud.android)
* [Dropbox Paper] (https://play.google.com/store/apps/details?id=com.dropbox.paper)
* [Snaptee] (https://play.google.com/store/apps/details?id=co.snaptee.android)

Download the [latest release](https://github.com/umano/AndroidSlidingUpPanel/releases) and include the `library` project as a dependency in Eclipse.
If you are using the library and you would like to have your app listed, simply let us know.

#### Android Studio
### Importing the Library

Simply add the following dependency to your `build.gradle` file to use the latest version:

Expand All @@ -25,18 +29,18 @@ dependencies {
repositories {
mavenCentral()
}
compile 'com.sothree.slidinguppanel:library:3.0.0'
compile 'com.sothree.slidinguppanel:library:3.4.0'
}
```

### Usage
### Usage

* Include `com.sothree.slidinguppanel.SlidingUpPanelLayout` as the root element in your activity layout.
* The layout must have `gravity` set to either `top` or `bottom`.
* Make sure that it has two children. The first child is your main layout. The second child is your layout for the sliding up panel.
* The main layout should have the width and the height set to `match_parent`.
* The sliding layout should have the width set to `match_parent` and the height set to either `match_parent`, `wrap_content` or the max desireable height.
* By default, the whole panel will act as a drag region and will intercept clicks and drag events. You can restrict the drag area to a specific view by using the `setDragView` method or `umanoDragView` attribute.
* The sliding layout should have the width set to `match_parent` and the height set to either `match_parent`, `wrap_content` or the max desireable height. If you would like to define the height as the percetange of the screen, set it to `match_parent` and also define a `layout_weight` attribute for the sliding view.
* By default, the whole panel will act as a drag region and will intercept clicks and drag events. You can restrict the drag area to a specific view by using the `setDragView` method or `umanoDragView` attribute.

For more information, please refer to the sample code.

Expand Down Expand Up @@ -83,13 +87,38 @@ or `?attr/actionBarSize` to support older API versions.
* Use `setTouchEnabled(false)` to disables panel's touch responsiveness (drag and click), you can still control the panel programatically
* Use `getPanelState` to get the current panel state
* Use `setPanelState` to set the current panel state
* You can add paralax to the main view by setting `umanoParalaxOffset` attribute (see demo for the example).
* You can add parallax to the main view by setting `umanoParallaxOffset` attribute (see demo for the example).
* You can set a anchor point in the middle of the screen using `setAnchorPoint` to allow an intermediate expanded state for the panel (similar to Google Maps).
* You can set a `PanelSlideListener` to monitor events about sliding panes.
* You can also make the panel slide from the top by changing the `layout_gravity` attribute of the layout to `top`.
* You can provide a scroll interpolator for the panel movement by setting `umanoScrollInterpolator` attribute. For instance, if you want a bounce or overshoot effect for the panel.
* By default, the panel pushes up the main content. You can make it overlay the main content by using `setOverlayed` method or `umanoOverlay` attribute. This is useful if you would like to make the sliding layout semi-transparent. You can also set `umanoClipPanel` to false to make the panel transparent in non-overlay mode.
* By default, the main content is dimmed as the panel slides up. You can change the dim color by changing `umanoFadeColor`. Set it to `"@android:color/transparent"` to remove dimming completely.

### Scrollable Sliding Views

If you have a scrollable view inside of the sliding panel, make sure to set `umanoScrollableView` attribute on the panel to supported nested scrolling. The panel supports `ListView`, `ScrollView` and `RecyclerView` out of the box, but you can add support for any type of a scrollable view by setting a custom `ScrollableViewHelper`. Here is an example for `NestedScrollView`

```
public class NestedScrollableViewHelper extends ScrollableViewHelper {
public int getScrollableViewScrollPosition(View scrollableView, boolean isSlidingUp) {
if (mScrollableView instanceof NestedScrollView) {
if(isSlidingUp){
return mScrollableView.getScrollY();
} else {
NestedScrollView nsv = ((NestedScrollView) mScrollableView);
View child = nsv.getChildAt(0);
return (child.getBottom() - (nsv.getHeight() + nsv.getScrollY()));
}
} else {
return 0;
}
}
}
```

Once you define your helper, you can set it using `setScrollableViewHelper` on the sliding panel.

### Implementation

This library was initially based on the opened-sourced [SlidingPaneLayout](http://developer.android.com/reference/android/support/v4/widget/SlidingPaneLayout.html) component from the r13 of the Android Support Library. Thanks Android team!
Expand All @@ -100,8 +129,9 @@ Tested on Android 2.2+

### Other Contributors

* Nov 23, 15 - [@kiyeonk](https://github.com/kiyeonk) - umanoScrollInterpolator support
* Jan 21, 14 - ChaYoung You ([@yous](https://github.com/yous)) - Slide from the top support
* Aug 20, 13 - ([@gipi](https://github.com/gipi)) - Android Studio Support
* Aug 20, 13 - [@gipi](https://github.com/gipi) - Android Studio Support
* Jul 24, 13 - Philip Schiffer ([@hameno](https://github.com/hameno)) - Maven Support
* Oct 20, 13 - Irina Preșa ([@iriina](https://github.com/iriina)) - Anchor Support
* Dec 1, 13 - ([@youchy](https://github.com/youchy)) - XML Attributes Support
Expand All @@ -111,6 +141,25 @@ If you have an awesome pull request, send it over!

### Changelog

* 3.4.0
* Use the latest support library 26 and update the min version to 14.
* Bug fixes
* 3.3.1
* Lots of bug fixes from various pull requests.
* Removed the nineoldandroids dependency. Use ViewCompat instead.
* 3.3.0
* You can now set a `FadeOnClickListener`, for when the faded area of the main content is clicked.
* `PanelSlideListener` has a new format (multiple of them can be set now
* Fixed the setTouchEnabled bug
* 3.2.1
* Add support for `umanoScrollInterpolator`
* Add support for percentage-based sliding panel height using `layout_weight` attribute
* Add `ScrollableViewHelper` to allow users extend support for new types of scrollable views.
* 3.2.0
* Rename `umanoParalaxOffset` to `umanoParallaxOffset`
* RecyclerView support.
* 3.1.0
* Added `umanoScrollableView` to supported nested scrolling in children (only ScrollView and ListView are supported for now)
* 3.0.0
* Added `umano` prefix for all attributes
* Added `clipPanel` attribute for supporting transparent panels in non-overlay mode.
Expand Down
14 changes: 11 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
classpath 'com.android.tools.build:gradle:2.3.2'
}
}

Expand All @@ -18,6 +18,14 @@ allprojects {
group = GROUP

repositories {
mavenCentral()
jcenter()
maven {
url "https://maven.google.com"
}
}
}

task wrapper(type: Wrapper) {
gradleVersion = '3.3'
distributionUrl = "https://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
}
21 changes: 6 additions & 15 deletions demo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "21.0.1"
compileSdkVersion 26
buildToolsVersion "26.0.1"

lintOptions {
abortOnError false
}

defaultConfig {
minSdkVersion 11
targetSdkVersion 21
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
minSdkVersion 14
targetSdkVersion 26
}
}

dependencies {
compile 'com.android.support:support-v4:21.0.0'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:support-v4:26.0.2'
compile 'com.android.support:appcompat-v7:26.0.2'
compile project(':library')
}
20 changes: 0 additions & 20 deletions demo/proguard-project.txt

This file was deleted.

15 changes: 0 additions & 15 deletions demo/project.properties

This file was deleted.

102 changes: 0 additions & 102 deletions demo/res/layout/activity_demo.xml

This file was deleted.

11 changes: 7 additions & 4 deletions demo/AndroidManifest.xml → demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sothree.slidinguppanel.demo"
android:versionCode="10"
android:versionName="3.0.0">
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="17"
android:versionName="3.4.0">

<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />
android:minSdkVersion="14"
android:targetSdkVersion="17"
tools:overrideLibrary="android.support.v7.appcompat,android.support.graphics.drawavle"
/>

<application
android:allowBackup="true"
Expand Down
Loading