SlideUp-Android
SlideUp is a small library that allows you to add sweet slide effect to any view.
Top Related Projects
Easily add slide to dismiss functionality to an Activity
A vertical-handled and multi-panel support SlidingPanelLayout. 一个竖直方向的SlidingPanelLayout,支持加载多个Panel,可以灵活地实现漂亮的的交互效果。
Material Design Search Bar for Android
SweetAlert for Android, a beautiful and clever alert dialog
Quick Overview
SlideUp-Android is a lightweight Android library that provides a simple way to create sliding panels in Android applications. It allows developers to easily implement sliding animations for views, enabling them to slide up, down, left, or right with customizable properties and callbacks.
Pros
- Easy to integrate and use with minimal setup required
- Supports multiple sliding directions (up, down, left, right)
- Customizable animation properties, such as duration and interpolation
- Provides callback methods for various sliding states
Cons
- Limited to sliding animations only, not suitable for complex view transformations
- May require additional work to handle edge cases or complex layouts
- Documentation could be more comprehensive with more examples
Code Examples
- Basic sliding panel setup:
val slideView = findViewById<View>(R.id.slideView)
val sliderPanel = SlideUp.Builder(slideView)
.withStartState(SlideUp.State.HIDDEN)
.withStartGravity(Gravity.BOTTOM)
.build()
// Show the panel
sliderPanel.show()
// Hide the panel
sliderPanel.hide()
- Customizing animation properties:
val sliderPanel = SlideUp.Builder(slideView)
.withDuration(500)
.withInterpolator(OvershootInterpolator())
.withAutoSlideDuration(300)
.build()
- Adding callbacks:
sliderPanel.addSlideListener(object : SlideUp.Listener.Slide {
override fun onSlide(percent: Float) {
// Called during sliding animation
}
override fun onVisibilityChanged(visibility: Int) {
// Called when visibility changes
}
})
Getting Started
- Add the dependency to your app's
build.gradle
file:
dependencies {
implementation 'com.github.mancj:SlideUp-Android:2.2.8'
}
- Add the JitPack repository to your project's
build.gradle
file:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- Use the SlideUp builder in your activity or fragment:
val slideView = findViewById<View>(R.id.slideView)
val sliderPanel = SlideUp.Builder(slideView)
.withStartState(SlideUp.State.HIDDEN)
.withStartGravity(Gravity.BOTTOM)
.build()
// Show the panel
sliderPanel.show()
Competitor Comparisons
Easily add slide to dismiss functionality to an Activity
Pros of Slidr
- More comprehensive sliding functionality, allowing for sliding from all edges (left, right, top, bottom)
- Supports both activity and fragment sliding
- Offers more customization options, including color transitions and edge size
Cons of Slidr
- Slightly more complex implementation due to additional features
- May have a steeper learning curve for beginners
- Less focused on vertical sliding compared to SlideUp-Android
Code Comparison
SlideUp-Android:
SlideUp slideUp = new SlideUp.Builder(slideView)
.withStartState(SlideUp.State.HIDDEN)
.withStartGravity(Gravity.BOTTOM)
.build();
Slidr:
Slidr.attach(this, new SlidrConfig.Builder()
.position(SlidrPosition.LEFT)
.sensitivity(1f)
.scrimColor(Color.BLACK)
.build());
Both libraries offer simple implementation, but Slidr provides more configuration options in its builder. SlideUp-Android focuses on vertical sliding, while Slidr allows for sliding from multiple directions. Slidr's code snippet demonstrates its ability to attach to activities and customize various aspects of the sliding behavior, whereas SlideUp-Android's example shows a more straightforward vertical sliding setup.
A vertical-handled and multi-panel support SlidingPanelLayout. 一个竖直方向的SlidingPanelLayout,支持加载多个Panel,可 以灵活地实现漂亮的的交互效果。
Pros of SlidingUpPanelLayout
- More customizable with additional features like shadow and fade color
- Supports multiple panels and nested panels
- Better performance optimization for smooth animations
Cons of SlidingUpPanelLayout
- Slightly more complex implementation due to additional features
- May require more setup time for basic use cases
Code Comparison
SlideUp-Android:
SlideUp slideUp = new SlideUp.Builder(slideView)
.withStartGravity(Gravity.BOTTOM)
.withLoggingEnabled(true)
.withStartState(SlideUp.State.HIDDEN)
.build();
SlidingUpPanelLayout:
SlidingUpPanelLayout layout = findViewById(R.id.sliding_layout);
layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
layout.addPanelSlideListener(new PanelSlideListener() {
@Override
public void onPanelSlide(View panel, float slideOffset) {}
// ... other methods
});
Both libraries provide sliding panel functionality for Android applications. SlideUp-Android offers a simpler API for basic sliding panels, while SlidingUpPanelLayout provides more advanced features and customization options. The choice between the two depends on the specific requirements of your project and the level of complexity you're willing to work with.
Material Design Search Bar for Android
Pros of MaterialSearchBar
- Focused on search functionality, providing a ready-to-use search bar component
- Offers more customization options for the search interface
- Includes features like suggestions and voice search integration
Cons of MaterialSearchBar
- Limited to search functionality, less versatile for other UI elements
- May require more setup for basic search functionality
- Potentially larger library size due to additional features
Code Comparison
MaterialSearchBar:
MaterialSearchBar searchBar = findViewById(R.id.searchBar);
searchBar.setHint("Search");
searchBar.setOnSearchActionListener(new MaterialSearchBar.OnSearchActionListener() {
@Override
public void onSearchStateChanged(boolean enabled) {
// Handle search state change
}
});
SlideUp-Android:
View slideView = findViewById(R.id.slideView);
SlideUp slideUp = new SlideUp.Builder(slideView)
.withStartState(SlideUp.State.HIDDEN)
.withStartGravity(Gravity.BOTTOM)
.build();
slideUp.show();
Summary
MaterialSearchBar is specifically designed for search functionality, offering more features and customization options for search interfaces. SlideUp-Android, on the other hand, is a more general-purpose library for creating sliding panels and animations. While MaterialSearchBar provides a more comprehensive search solution, SlideUp-Android offers greater flexibility for various UI elements and animations beyond search functionality.
SweetAlert for Android, a beautiful and clever alert dialog
Pros of sweet-alert-dialog
- Provides a customizable and attractive dialog UI for Android
- Offers a variety of pre-designed dialog styles and animations
- Easy to implement with minimal code
Cons of sweet-alert-dialog
- Limited to dialog functionality, less versatile than SlideUp-Android
- May not integrate as seamlessly with complex UI layouts
- Less actively maintained (last update was several years ago)
Code Comparison
sweet-alert-dialog:
new SweetAlertDialog(this, SweetAlertDialog.WARNING_TYPE)
.setTitleText("Are you sure?")
.setContentText("Won't be able to recover this file!")
.setConfirmText("Yes,delete it!")
.setConfirmClickListener(sDialog -> sDialog.dismissWithAnimation())
.show();
SlideUp-Android:
SlideUp slideUp = new SlideUp.Builder(slideView)
.withStartState(SlideUp.State.HIDDEN)
.withStartGravity(Gravity.BOTTOM)
.build();
slideUp.show();
Summary
While sweet-alert-dialog excels in creating visually appealing dialog boxes with minimal effort, SlideUp-Android offers more flexibility for creating sliding panels and complex UI interactions. sweet-alert-dialog is ideal for quick implementations of attractive alerts, while SlideUp-Android is better suited for more diverse sliding UI elements. The choice between the two depends on the specific requirements of your Android application.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
NOT MAINTAINED ANYMORE
SlideUp-Android
SlideUp is a small library that allows you to add sweet slide effect to any view. Slide your views up, down, left or right with SlideUp!
Usage
Get SlideUp library
Add the JitPack repository to your build file. Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency
dependencies {
compile "com.github.mancj:SlideUp-Android:$current_version"
compile 'ru.ztrap:RxSlideUp2:2.x.x' //optional, for reactive listeners based on RxJava-2
compile 'ru.ztrap:RxSlideUp:1.x.x' //optional, for reactive listeners based on RxJava
}
To add the SlideUp into your project, follow these three simple steps:
Step 1:
create any type of layout
<LinearLayout
android:id="@+id/slideView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Step 2:
Find that view in your activity/fragment
View slideView = findViewById(R.id.slideView);
Step 3:
Create a SlideUp object and pass in your view
slideUp = new SlideUpBuilder(slideView)
.withStartState(SlideUp.State.HIDDEN)
.withStartGravity(Gravity.BOTTOM)
//.withSlideFromOtherView(anotherView)
//.withGesturesEnabled()
//.withHideSoftInputWhenDisplayed()
//.withInterpolator()
//.withAutoSlideDuration()
//.withLoggingEnabled()
//.withTouchableAreaPx()
//.withTouchableAreaDp()
//.withListeners()
//.withSavedState()
.build();
Enjoy!
Reactive extensions
- RxSlideUp - Listening events in reactive style
Advanced example
rootView = findViewById(R.id.rootView);
slideView = findViewById(R.id.slideView);
dim = findViewById(R.id.dim);
fab = (FloatingActionButton) findViewById(R.id.fab);
slideUp = new SlideUpBuilder(slideView)
.withListeners(new SlideUp.Listener.Events() {
@Override
public void onSlide(float percent) {
dim.setAlpha(1 - (percent / 100));
if (percent < 100 && fab.isShown()) {
// slideUp started showing
fab.hide();
}
}
@Override
public void onVisibilityChanged(int visibility) {
if (visibility == View.GONE){
fab.show();
}
}
})
.withStartGravity(Gravity.TOP)
.withLoggingEnabled(true)
.withStartState(SlideUp.State.HIDDEN)
.withSlideFromOtherView(rootView)
.build();
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
slideUp.show();
}
});
The player is designed by Jauzee
Migration
- See MIGRATION.md
Documentation
- See javadocs
Changelog
- See CHANGELOG.md
Contract
Please let us know, if you use the library in your applications. We want to collect and publish this list.
License
MIT License
Copyright (c) 2018 Mansur
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Top Related Projects
Easily add slide to dismiss functionality to an Activity
A vertical-handled and multi-panel support SlidingPanelLayout. 一个竖直方向的SlidingPanelLayout,支持加载多个Panel,可以灵活地实现漂亮的的交互效果。
Material Design Search Bar for Android
SweetAlert for Android, a beautiful and clever alert dialog
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot