Code Monkey home page Code Monkey logo

androidslidinguppanel's Introduction

Maven Central Badge

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 and Google Maps) to your Android application.

As seen in Umano Android App (now acquired by Dropbox):

SlidingUpPanelLayout

Known Uses in Popular Apps

If you are using the library and you would like to have your app listed, simply let us know.

Importing the Library

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

dependencies {
    repositories {
        mavenCentral()
    }
    compile 'com.sothree.slidinguppanel:library:3.4.0'
}

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. 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.

<com.sothree.slidinguppanel.SlidingUpPanelLayout
    xmlns:sothree="http://schemas.android.com/apk/res-auto"
    android:id="@+id/sliding_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="bottom"
    sothree:umanoPanelHeight="68dp"
    sothree:umanoShadowHeight="4dp">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:text="Main Content"
        android:textSize="16sp" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center|top"
        android:text="The Awesome Sliding Up Panel"
        android:textSize="16sp" />
</com.sothree.slidinguppanel.SlidingUpPanelLayout>

For smooth interaction with the ActionBar, make sure that windowActionBarOverlay is set to true in your styles:

<style name="AppTheme">
    <item name="android:windowActionBarOverlay">true</item>
</style>

However, in this case you would likely want to add a top margin to your main layout of ?android:attr/actionBarSize or ?attr/actionBarSize to support older API versions.

Caveats, Additional Features and Customization

  • If you are using a custom umanoDragView, the panel will pass through the click events to the main layout. Make your second layout clickable to prevent this.
  • You can change the panel height by using the setPanelHeight method or umanoPanelHeight attribute.
  • If you would like to hide the shadow above the sliding panel, set shadowHeight attribute to 0.
  • Use setEnabled(false) to completely disable the sliding panel (including touch and programmatic sliding)
  • 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 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 component from the r13 of the Android Support Library. Thanks Android team!

Requirements

Tested on Android 2.2+

Other Contributors

  • Nov 23, 15 - @kiyeonk - umanoScrollInterpolator support
  • Jan 21, 14 - ChaYoung You (@yous) - Slide from the top support
  • Aug 20, 13 - @gipi - Android Studio Support
  • Jul 24, 13 - Philip Schiffer (@hameno) - Maven Support
  • Oct 20, 13 - Irina PreΘ™a (@iriina) - Anchor Support
  • Dec 1, 13 - (@youchy) - XML Attributes Support
  • Dec 22, 13 - Vladimir Mironov (@MironovNsk) - Custom Expanded Panel Height

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.
    • setEnabled(false) - now completely disables the sliding panel (touch and programmatic sliding)
    • setTouchEnabled(false) - disables panel's touch responsiveness (drag and click), you can still control the panel programatically
    • getPanelState - is now the only method to get the current panel state
    • setPanelState - is now the only method to modify the panel state from code
  • 2.0.2 - Allow wrap_content for sliding view height attribute. Bug fixes.
  • 2.0.1 - Bug fixes.
  • 2.0.0 - Cleaned up various public method calls. Added animated showPanel/hidePanel methods.
  • 1.0.1 - Initial Release

Licence

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or 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.

androidslidinguppanel's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

androidslidinguppanel's Issues

Background clickable

Hi,

Thanks for the great library. Very easy to implement. However i have som problems with the backgound (mainlayout) still being clickable when the pane is expanded. I'm only using expandPane() and collapsePane() programatically.

Is there any easy way to disable clicks on the main view when pane is expanded?

ListView inside slide panel is cut off when setpanelheight is limited.

I have a list view inside the slide panel and when i set the setPanelHeight to anything but the maximum screen height, the list view inside the panel is cut off.

Example I have the following list:
1
2
3
4
5

If I set the setPanelHeightto about half the screen i end up with this list:
1
2
3

In order to view them all (1-5) I have to bring up the panel to full height. Any fix for this? Or am I just doing it wrong.

Cannot draw recycled bitmaps

This error occurs when trying to display the panel .showPane().

.showPane() breaks when initializing the second element of "com.sothree.slidinguppanel.SlidingUpPanelLayout" with "visivility = gone"

Error occurred on Android 4.1.2. Not so in previous versions.

Can not show the ViewPager in the up panel

When a try to use a viewpager to show something,it works will in the first layout,but in the second layout--the up panel,it's works very weird,the viewpager is there,i can do the scroll and click,but i just can not see the viewpager.Anyone else here have seen the same issue?

How to make the scrolling panel's background (child 1 of sliding's panel) transparent?

Hey!

First of all good job!
πŸ‘

I'm trying to achieve something like this:
http://www.gru.at/android/wp-content/uploads/2010/09/s_close.png
http://www.gru.at/android/wp-content/uploads/2010/09/s_open.png

my xml is like that (I Hope you'll understand :|)

RelativeLayout

SlidingPanel

RelativeLayout (The main content)
RelativeLayout
LinearLayout background=#00000000 (which I try to make transparent)
#ImageView background="up_arrow"
LinearLayout

SlidingPanel

RelativeLayout

However, the linearlayout's backgorund is always white

If I try to make it red, blue, brown, etc.. it works!
but transparent doesn't work

It seems like there is a permanent white background somewhere there in the back

I need your help, thanks in advance! :)

The whole panel responds to tap/click once expanded instead of only the top part

I am using the panel to list clickable items(that would slide up) and the items are not getting the click/tap event as the whole panel is responding to click. I would expect to collapse/expand when tap/click happens only to the top part. Is there anyway I can limit the click/tap to only the top portion so the rest of the panel can be utilized for clickable items? Or disable the tap on the complete panel?

There is not reliable way to know if is expanded from collapsed and viceversa

I'm developing an application where i want to hide (with an animation) a search box when the panel is expanded from the collapsed state. I start the animation when the onPanelCollapsed() is called but this function is also called when I drag a little the panel but not so much to make it expand to the expand state.

The problem is that you can't tell from which state the actual state is reached.

Panel can't be hidden upon creation

Hello, thanks for this excellent component. πŸ‘

I'm having a small problem with the hidePanel() method. Looking at the source code, I see that for obvious reasons, the panel sets its visibility to GONE once the slideableView is measured (and therefore not null), as seen in the hidePane method:

public void hidePane() {
        if (mSlideableView == null) {
            return;
        }
        mSlideableView.setVisibility(View.GONE);
        requestLayout();
    }

I have my SlidingUpPanel in a base class (it's a complex layout, that also contains a Navigational Drawer and a View Pager, and Fragments, etc.).

It all works ok, until I've been requested to hide the panel upon startup, so it will only be seen after the user starts certain actions.

So, my before even checking the source code I added mPanel.hidePane() after I create it. Of course it didn't work (because well… views are probably not laid out yet and can't be measured).

For the record, I am using

setDragView(someView);

I've tried adding the following code in different places:

Handler h = new Handler();
        h.post(new Runnable() {
            @Override
            public void run() {
                mSlidingUpPanelLayout.hidePane();

            }
        });

To no avail.

I've tried it in:

  • BaseActivity
    • onCreate (after the findViewById(R.id.sliding_layout); and such)
    • onResume()
  • MyActivity extends BaseActivity
    • onCreate
    • onResume
    • onStart

It never works, because mSlideableView is null during that time (I've added logging to see if this was the case).

I've even tried runOnUiThread just in case.

If, after everything is up, I go to another MyActivity, the panel is hidden, and everything works. Even if I force hidePane and showPane from a button action.

Any ideas how can this be accomplished?

Maven Support

Hello, this is an excellent library. Is there any chance of adding maven support ?

The sliding panel background cannot be set to be transparent

Using the demo application included in your download, I changed the background to transparent of all the child elements in the sliding panel linear layout. I would expect that the main text view "Main Content" would now be visible through the sliding panel. But that isn't the case. The sliding panel is still an opaque white color underneath the transparent child elements.

ImageViews in Header

I can't seem to get imageViews to appear in the header. Is there a better way to go about putting buttons in the header?

ListView on second layout.

I'm trying to put ListView on second layout but unable to scroll the listview. Is there any solution ?

Problem with ViewPager and ICS

First child element is GoogleMap and second child element is ViewPager. I am able to slide panel vertically but not able to swap horizontally.

Its not working in ICS, when I slide the panel, GoogleMap comes on the top of the panel.

Show and Hide Jumpy

Is there a method that I am missing that can show and hide the panel view like in google maps so that the entire view doesn't re-size and jump on showPane() and hidePane(). More like the panel is on top and not apart of it like that acitionbar when you add true?

Related to canvas runnable

can someone please dispatch this panel for the bugs on loading a surfaceview with canvas updating constantly? I have came across with the sliding panel with an animated canvas as the main view.

I have integrate this component into a parent view with animation canvas where it draws simple lines and circles. The class is called DrawingPanel.class. I have found an issue related to lock canvas, draw on canvas, and unlock and post on the canvas

08-07 11:37:10.358      356-832/? W/InputMethodManagerService: Got RemoteException sending setActive(false) notification to pid 10101 uid 10114
08-07 11:37:26.733  10185-10203/? E/AndroidRuntime: FATAL EXCEPTION: Thread-773
        java.lang.IllegalArgumentException
        at android.view.Surface.unlockCanvasAndPost(Native Method)
        at android.view.SurfaceView$4.unlockCanvasAndPost(SurfaceView.java:879)
        at com.hkm.occanvas.CanvasShapes.DrawingPanel$CanvasThread.run(DrawingPanel.java:348)
08-07 11:43:58.834      356-376/? W/InputMethodManagerService: Got RemoteException sending setActive(false) notification to pid 10185 uid 10114
08-07 11:44:00.045      356-832/? W/InputMethodManagerService: Got RemoteException sending setActive(false) notification to pid 10185 uid 10114
08-07 11:44:16.850  10313-10331/? E/AndroidRuntime: FATAL EXCEPTION: Thread-779
        java.lang.IllegalArgumentException
        at android.view.Surface.unlockCanvasAndPost(Native Method)
        at android.view.SurfaceView$4.unlockCanvasAndPost(SurfaceView.java:879)
        at com.hkm.occanvas.CanvasShapes.DrawingPanel$CanvasThread.run(DrawingPanel.java:348)
08-07 11:44:30.584  10381-10395/? E/AndroidRuntime: FATAL EXCEPTION: Thread-782
        java.lang.IllegalArgumentException
        at android.view.Surface.unlockCanvasAndPost(Native Method)
        at android.view.SurfaceView$4.unlockCanvasAndPost(SurfaceView.java:879)
        at com.hkm.occanvas.CanvasShapes.DrawingPanel$CanvasThread.run(DrawingPanel.java:348)
08-07 11:44:39.319      356-510/? W/WindowManager: Failed looking up window
        java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@42969fb8 does not exist
        at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8677)
        at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8668)
        at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:909)
        at android.os.BinderProxy.sendDeathNotice(Binder.java:449)
        at dalvik.system.NativeStart.run(Native Method)
08-07 11:53:18.756     356-2090/? W/InputMethodManagerService: Got RemoteException sending setActive(false) notification to pid 10444 uid 10114
08-07 11:53:34.866  10525-10543/? E/AndroidRuntime: FATAL EXCEPTION: Thread-791
        java.lang.IllegalArgumentException
        at android.view.Surface.unlockCanvasAndPost(Native Method)
        at android.view.SurfaceView$4.unlockCanvasAndPost(SurfaceView.java:879)
        at com.hkm.occanvas.CanvasShapes.DrawingPanel$CanvasThread.run(DrawingPanel.java:348)
08-07 11:56:58.748  10649-10666/com.hkm.occanvas W/System.err: java.lang.NullPointerException
08-07 11:56:58.748  10649-10666/com.hkm.occanvas W/dalvikvm: threadid=11: thread exiting with uncaught exception (group=0x411c52a0)
08-07 11:56:58.756  10649-10666/com.hkm.occanvas E/AndroidRuntime: FATAL EXCEPTION: Thread-797
        java.lang.IllegalArgumentException
        at android.view.Surface.unlockCanvasAndPost(Native Method)
        at android.view.SurfaceView$4.unlockCanvasAndPost(SurfaceView.java:879)
        at com.hkm.occanvas.CanvasShapes.DrawingPanel$CanvasThread.run(DrawingPanel.java:348)

I am using
This crash incurs when the sliding panel isExpanded.

in my manifest I use

hardware acceleration is on for the activity

the first part of the code in [install_slidingUP_panel] I have got nothing on the listener API event

    private void install_slidingUP_panel() {
        slidingUpPanel = (SlidingUpPanelLayout) findViewById(R.id.overlay_panel);
        slidingUpPanel.setInterceptingPanelEvents(true);
        // slidingUpPanel.setDraggerView(R.id.lowerpanel, 50);
        slidingUpPanel.setDraggerHeight(50);
        slidingUpPanel.setShadowDrawable(getResources().getDrawable(R.drawable.above_shadow));
        // slidingUpPanel.setContentHeight(100);
        //slidingUpPanel.setMaxContentHeightRatio(0.6f);
        slidingUpPanel.setPanelSlideListener(new SlidingUpPanelLayout.PanelSlideListener() {
           // private AtomicBoolean mPanelCollapsed = new AtomicBoolean(true);

            @Override
            public void onPanelSlide(View panel, float slideOffset) {
                if (slideOffset < 0.3) {

                    PlotNative.this.topText.setText("action slide Offset < 0.3");

                    if (getActionBar().isShowing()) {
                       // getActionBar().hide();
                    }
                } else {
                    PlotNative.this.topText.setText("action slide Offset > 0.3");
                    if (!getActionBar().isShowing()) {
                       // getActionBar().show();
                    }
                }
            }

            @Override
            public void onPanelCollapsed(View panel) {
                /*if (mPanelCollapsed.compareAndSet(false, true)) {
                    // LOG.trace("onPanelCollapsed");
                    //   PlotNative.this.panel.resume();
                    trace_msg("p closed");
                }*/
            }

            @Override
            public void onPanelExpanded(View panel) {
                /*if (mPanelCollapsed.compareAndSet(true, false)) {
                    // LOG.trace("onPanelExpanded");
                    //    PlotNative.this.panel.pause();
                    trace_msg("p opened");
                }*/
            }
        });
        // View v=findViewById(R.id.part_bottom_panel);
     //   TextView t = (TextView) findViewById(R.id.textarea);
     //   t.setMovementMethod(LinkMovementMethod.getInstance());
    }


    @Override
    public void onCreate(Bundle savedInstanceState) {
        init_windowwork();
        super.onCreate(savedInstanceState);
        init_actionbar();
        dataprepare();
        //trace_msg("layout loading native plot activity ... ");
        try {
            setContentView(R.layout.native_plot_activity);
        } catch (Exception e) {
            e.printStackTrace();
        }
        install_canvas_panel();
        install_slidingUP_panel();
    }



    private void init_windowwork() {
        getWindow().requestFeature(Window.FEATURE_ACTION_BAR|Window.FEATURE_ACTION_BAR_OVERLAY);
        //getWindow().setBackgroundDrawableResource(R.drawable.bc_face2);
    }

    private void init_actionbar() {
        final ActionBar ab = getActionBar();
        // ActionBar ab = getSupportActionBar();
        ab.setDisplayShowHomeEnabled(true);
        ab.setDisplayShowTitleEnabled(false);
       // ab.setDisplayShowCustomEnabled(true);
        ab.setIcon(R.drawable.ruler);
        trace_msg("actionbar seting up ... ");
        ab.setTitle("test");

        // Show the custom action bar but hide the home icon and title
        ab.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM,
                ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME |
                        ActionBar.DISPLAY_SHOW_TITLE);
        final LayoutInflater i = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        try {
            View v = i.inflate(R.layout.top_bar, null);
            topText = (TextView)v.findViewById(R.id.editText_1);
            ab.setCustomView(v);
        } catch (Exception e) {
            e.printStackTrace();
        }
        //getWindow().windowActionBarOverlay(true);
        //ab.hide();
    }

Are there any fixes??

In the canvas thread I have this setup for the parent view..

private class CanvasThread extends Thread {
        private SurfaceHolder surfaceHolder;
        private boolean isRun = false;

        public CanvasThread(SurfaceHolder h) {
            this.surfaceHolder = h;
        }

        public void setRunning(boolean run) {
            this.isRun = run;
        }

        @Override
        public void run() {
            Canvas c;
            while (isRun) {
                c = null;
                if (!surfaceHolder.getSurface().isValid()) {
                    continue;
                }
                try {
                    c = this.surfaceHolder.lockCanvas(null);
                    synchronized (this.surfaceHolder) {
                        DrawingPanel.this.onDraw(c);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                } finally {
                    surfaceHolder.unlockCanvasAndPost(c);
                }
            }
        }
    }

do i need to stop that thread from running into crash once the panel is expended??

Collapsing the panel in code

Is there any way to collapse the panel in code. I want it to drop down when i perform certain actions inside the panel, I can't just set it to setDragView because I still want the object inside the panel to be clickable.

Set intermediate break points for SlidingUpPanelLayout

Thanks for this library - it's helped me a lot πŸ‘

Is there any way to set an intermediate position for the SlidingUpPanelLayout in a similar way to the new Google Maps? I'm trying to sort out an activity with the panel half way up, at which point the user can either swipe up to the top or bottom and then back to the middle.

Hoping I've just missed something, any advice would be great.

Cheers

gmapseg

Slide from the top

It would be great if you guys can add a "slide from top" configuration. I know a lot of developers that needs this option. Great work!

Make slide panel keep scrolling after top reached?

Would it be plausible to make the expanded panel layout's height larger than the screen's height, so that when the panel has been slid to the top of the screen, it just gonna work like a normal scrollview? (hope I'm being clear)

I've tried myself to kinda tweak some of the variables, but I haven't gotten anything close to what I'm looking for. Any help? Thanks

EDIT:

Okay, I've been at this for some hours now, and I have in fact managed to add a scrollview inside the panel, and then by changing the dragview at the appropriate time, it actually works, but still, in my opinion, with a major issue.

Posted a stackoverflow question on it: http://stackoverflow.com/questions/19619964/dispatch-scroll-event-from-view-to-view-sliding-panel-with-scrollview-like-goo

SlidingUpPanel and Viewpager

Hi,

I want to have a SlidingUpPanel like in the new Google Maps. You have a panel and can slide also swipe left and right to display other results (try searching for pizza in the maps and you can see the different results by swiping the collapsed and expanded panel).

I tried several approaches but havent got it working the right way. Here is what I did with the sample:

I tried several ways (setting the whole ViewPager as a DragView doesn't work), so I just added the the Headline as a DragView. Now I can swipe through the list, but it is very hard to open/close the panel. You have to try several times to get it done and I don't know why :-(

SlidingUpPanel in xml root

Is it possible to have a SlidingUpPanel in root of an xml or do I have to wrap it in a RelativeLayout (as in the Demo)?

Pulling panel up partially feature

I would love a feature where you can define the distance the panel can be pulled up (not only full screen).
For example the panel is only shown 50% of the screen, or (if possible) to only show the height of the content of the panel.

Thanks.

Smooth expandPane effect

I am trying to call the expandPane method during the initial load. The problem is the effect is very choppy when there is work being done after the call. When called alone it is very smooth. Anyway around this?

EditText or Button behind Sliding panel Up receives the onClick

If you set your dragView and behind the Sliding Panel Up it is a Form layout (with buttons and edittexts) they can be clicked. For example:

slidingUpLayout.setDragView(mediaPlayer);

login.setOnClickListener() {
//...
Toast.makeText(getContext, "LoginButton Clicked", Toast.LENGTH_SHORT).show;
}

Panel keeps on collapsing on touch of the views inside it (button)

Hi,

First of all, thanks for this one. =)

I just wanna ask, I tried running the Demo app included in the project and then added some buttons inside the sliding panel but I can't click on the buttons, but instead the panel keeps on hiding.

Am I missing something here?

Thanks and regards!

Prevent sliding to top

Is it possible to limit the slide to the anchor-point? And prevent the user from sliding the panel to the very top?

Can it work from the top as well?

Right now it seems you can only position it at the bottom of the screen and slide up. Seems like it shouldn't be to hard to make it optionally slide down from the top?

How to start with the panel hidden?

Trying to start a fragment with the AndroidSlidingUpPanel hidden.

but layout.hidePane() is all I can find to hide the pane and it doesn't work until after I am in the fragment. Is there something that I am missing? All help is appreciated thank you.

Panel open to quick

Great Lib!!! Thank you!
I was wondering if there is a way to slow down the opening of the panel?
When I start an activity and let the panel open automatically it opens too fast, almost looks like it's skipping. Is there a way to slow it down?

ViewPager as a slider + ViewPager

Hello,

I'm trying to display a MapView and a ViewPager as the slider part.
In fact, I'm trying to reproduce the same behaviour as the last Maps app !

But, with devices under Android 4.0, when my ViewPager is expanded, it's displayed under the mapview ! (I can see part of my viewpager at the zoom button...)

It seems that the problem is related to a issue in mapview which is displayed using SurfaceView with 4.0 (fixed in 4.1, mapview is using TextureView)

Did you identify this problem and maybe a fix is known ?

Thanks !
Tom.

PanelSlideListener called too often

When slighty sliding down the panel and letting it snap back to expanded state, the onPanelExpanded gets called everytime - even if it was previously expanded.
I think it should only be called if it was previously collapsed and vice versa.

Also, the tap on the collapsed panel causes two consecutive calls, first onPanelCollapsed then onPanelExpanded and vice versa for a expanded panel.

Multiple Sliding Panels

Have anyone explored the possibility of using more than one sliding panel (child views 1-2)? I'm digging in the code right now and it seems plausible, if anyone cares to point me in the right direction I should come back with a pull request.

How to slide the panel but not all the way up?

The content in my sliding panel (the second child of SlidingUpPanelLayout) is not that much. I need to slide it to display its content only, not slide all the way up.

Is there a way to do that?

Action bar Overlays the layout

the action bar overlays my SlidingUpPanel...
if i comment this:
getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
then the layout looks ok, but sliding jumps like crazy...

i attached screeny
2013-06-12 23 20 11

Strange FC

I followed the exact same attributes as the demo. However I get an FC with the log saying that there's a NullPointer at onMeasure() ?

Height of expanded panel

Hi, is it possible to define the height of expanded sliding panel? I could not managed to find that option and it would be great for my project.

Second layout overshooting to the bottom under the panel

Hi,
I am having problem to incorporate the sliding menu and your AndroidSlidingUpPanel from
http://www.michenux.net/android-sliding-menu-part-22-690.html
When it first launched, the bottom panel showed up ok, I did a click/touch on the
sliding up panel, it goes up alright to show the second screen. Problem come when I click/touch again on the second screen, it slided down but the screen overshoot to lower screen. It doesn't goes back to the original location.
I have marked problem with "?????" and red color.
screenshot001

screenshot002

How to set background of sliding up panel to transparent

I have tried to set android:background="#00000000 in following code.

<com.sothree.slidinguppaneldemo.SlidingUpPanelLayout
    android:id="@+id/sliding_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#00000000 >

or set the same code on the layout (for example, RelativeLayout) whitch is inner SlidingUpPanelLayout, but the background is still white.
How do I write the code to make background transparent?

Include project with Maven

Hi,

I'm trying to inlcude this project with Maven by adding a dependency as follows:

<dependency>
    <groupId>com.sothree.slidinguppanel</groupId>
    <artifactId>slidinguppanel</artifactId>
    <version>1.0.0-SNAPSHOT</version>
</dependency>

After I've installed the project in my local repository. During compilation of my project however, Maven can't find this dependency in my local repository. Any idea how I can fix this?

alternative to setDragView

Hello, first of all thanks for providing a great open-source code!

I have an issue regarding setDragView. Instead of explicitly providing setDragView, why not by default, the layout behaves like this:

Check if the clicked area (most specially if it is a child view) has a touch event to it. If there is, execute the child view's touch event. Otherwise, proceed with the layout's expand/collapse behavior.

Could it work in API 8?

Hi! How could I to use this library in an API 8?? Because i cannot create two application for two different versions.

Collapsing the pane to a set height in code

Hi, is there any way to collapse the pane in code such that if i have a button in the pane, and i click it, it collapses the pane only half way.

I know I could set the entire pane to a specific height at the start but I would like it better if it was hidden first.

This is currently what i have inside the onclicklistener of the button.

            layout.setPanelHeight(400);
            layout.collapsePane();
            layout.setPanelHeight(height);

I am thinking that I would set the panel height to half the screen, then collapse it, so it would stay at 400 and then set the panelheight to the full screen height again, if the user decides to pull it up again.

I do hope i am making sense. Primary is that i want to collapse it to a certain height (different from its starting height).

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.