Making A Sliding Up Panel like Google Music in Android

    By seeing some Music applications in Google Play, you can find out that many of them have a layout at bottom of screen and can be dragged to top (sliding up draggable panel). For example, it's used in Google Music. In this post, I will present how to implement a common library on Github to make this pattern.
    The library is developed by Umano Team for Umano Android App used for playing article. It can be make a layout like it's thumbnail in Github Project page:

1. Start Android Studio and create a new project (min sdk I'll use is 14).

2. Open local build.gradle (usally locate in app folder) and add dependency to use this library:

3. Make a simple layout for activity:

    As you can see, there are 2 components in com.sothree.slidinguppanel.SlidingUpPanelLayout, one is "main layout" which contains all of your designs here and another is a "Sliding layout" which making a sliding up draggable panel like above picture.
    Put some elements in them and do something in programmatically code! In this, we show Sliding Up Panel state in a TextView, gone/visilble it when click 2 buttons.
    Full code for a "demo Activity":

4. As presented, after running app, we have this result:


5. Reference:

- Official Library project in Github: https://github.com/umano/AndroidSlidingUpPanel
- Demo app of Develope Team: Google Play
- Develope Team Home Page: https://umano.me/

(sorry for having ads)

Share


Previous post
« Prev Post
Next post
Next Post »