mancj / slideup-android Goto Github PK
View Code? Open in Web Editor NEWSlideUp is a small library that allows you to add sweet slide effect to any view.
License: MIT License
SlideUp is a small library that allows you to add sweet slide effect to any view.
License: MIT License
i cannot find this methow...
I am trying to run sample provided. SlideDown is not working. It is not simply showing view when I try to drag from top
When using either an START or END gravity, the user must ensure that the layout height is greater than (or equal to) the layout width for this library to work. My suspicion is that the layout_height attribute is used as the sliding distance even when a sideways orientation is specified.
Without delving into the code in this library, this assumption is backed up by looking at the sliding velocity with a layout with a small width and tall height when it is hidden - it leaves the screen very rapidly without the correct interpolation.
Tried to add this on my project but can't seem to get it to work just by following the usage steps described, so I tried to set it up on a new empty project but still not able to make it work.
Imports and everything is in place added it to both fragment and activity but to no avail.
Is there anything that I am missing.
No errors shows up on android monitor.
I believe that the correct dependencie to be added is this below
dependencies {
compile 'com.github.mancj:SlideUp:2.2.2'
}
May i know which version number i have to use it in dependencie.i have tried 2.2.7.1. But its showing Failed to resolve error. Thanks
I was wondering how I could detect that sliding view is fully closed or fully opened. For that, I'm started using
slideUp = new SlideUpBuilder(root).withStartState(SlideUp.State.HIDDEN)
.withStartGravity(Gravity.BOTTOM)
.withSlideFromOtherView(root)
.withLoggingEnabled(true)
.withListeners(new SlideUp.Listener.Events() {
public void onVisibilityChanged(int visibility)
public void onSlide(float percent)
Pannel slide up from bottom and back. When I call show()
I've got these events:
Listener(0) (onSlide ) value = 100.0
Listener(0) (onVisibilityChanged ) value = GONE
Listener(0) (onSlide ) value = 100.0
Listener(0) (onVisibilityChanged ) value = GONE
Listener(0) (onSlide ) value = NaN
How based on such events detect when the panel is closed and when its open?
visibility in event is always GONE and slideUp.isVisible during events - too.
I show the slide view with a button click.
If I close the Slide view by dragging it, I can't open it again.
If there is a virtual bar at the bottom of the phone,When view slide virual bar,return percent greater than 100
.
float difference = event.getRawY() - startPositionY;
float moveTo = viewStartPositionY + difference;
float percents = moveTo * 100 / view.getHeight();
int alpha = (int)(percent * 2.55f);
dim.setAlpha(1 - (percent / 100));
if (alpha >= 256)
alpha = 255;
toolbar.setTitleTextColor(Color.argb(alpha,255,255,255));
how to i change fab with other button ?
Your library is very good, very fool. But the interface or method too little.I can not use it well.
hi:
I got error message when gradle running, Error:Failed to resolve: annotationProcessor, why ?
best
please update gifs fo examples of the lib to know how it look before using it
Error:(34, 13) Failed to resolve: com.github.mancj:SlideUp-Android:2.2.2
Show in File
Show in Project Structure dialog
what is this Error?
Hi there,
Can you please explain how to keep the panel collapsed like the media player .gif of you README page?
I couldn't find any implementation of this in the demo app...
Also, it would be very nice of you could include a link to that player.
I tried going to the mentioned developer repository on github but couldn't find it.
Thank you very much
First of all, great library. Works great for me. But it started giving issues when I used multiple slide views with a multiple show/hide calls.
slideViewA?.hide()
slideViewB?.hide()
slideViewC?.hide()
slideViewD?.show()
But most of the time, any of the action gets ignored. is the problem in my logic or theres something else ? please give a suggestion
Thanks in advance.
how i can close slide by button or just touch arrow icon
is possible?
Hello Mansur,
is it possible to push the main content when a bottom panel open. I want to open a panel from bottom and move the map above the panel.
Thanks in advance.
The slide up is working great but I've noticed that in other parts of my app, I can't initialize the selected index of a spinner. The spinner is in an activity which isn't even implementing the SlideUp. I'm performing the following line in an AlertDialog
mySpinner.setSelection(7);
The line executes fine, but then when I tell the AlertDialog to show, the app crashes. I then remove your library and everything works fine. I'm not sure how your library could be causing this, but it seems like it is.
Please let me know if there's any more information you need in order to get this resolved.
Hello,
Could you eventually open the slideView slower? It is very fast in my opinion..
Best Regards
MatsG23
In the hidden case can also be clicked, I set the Setclickable (false) also no use, can you help me?
Hi,
I followed the steps given in readme, but every time I am getting this error -
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.view.View.getResources()' on a null object reference
at com.mancj.slideup.SlideUp$Builder.(SlideUp.java:165)
This is my code -
slideView = (LinearLayout) findViewById(R.id.slideView);
slideUp = new SlideUp.Builder(slideView)
.withStartState(SlideUp.State.HIDDEN)
.withStartGravity(Gravity.BOTTOM)
.build();
slideUp.show();
xml file -
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sliderview" />
</LinearLayout>
And when I opened the SlideUp.class file, I got this error -
library source code does not match the bytecode for class SlideUp
Please help me, I have been scratching my head for 3hrs.
Thanks
trying to put PlaybackControlView in the slider layout, black screen appears,
nothing is rendered.
i use your library in 2 project, one in androidx and one in support library
it's work well in androidx, but in support library i got this exception when touch in dimmed area,
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.mancj.slideup.VerticalTouchConsumer.consumeBottomToTop(android.view.View, android.view.MotionEvent)' on a null object reference
at com.mancj.slideup.SlideUp.onTouch(SlideUp.java:538)
is the problem in my layout or theres something else ? please give me a suggestion
private SlideUp dialog() {
slideUp = new SlideUpBuilder(mDialog)
.withListeners(new SlideUp.Listener.Events() {
@Override
public void onSlide(float percent) {
DIM.setAlpha(1 - (percent / 100));
}
@Override
public void onVisibilityChanged(int visibility) {
if (visibility== View.VISIBLE) {
buttonAction.setVisibility(View.INVISIBLE);
} else {
buttonAction.setVisibility(View.VISIBLE);
}
}
})
.withStartGravity(Gravity.BOTTOM)
.withGesturesEnabled(true)
.withStartState(SlideUp.State.SHOWED)
.build();
return slideUp;
}
Implemented your library on a LinearLayout which contains a third party layout....
But it doesn't work...the slide Right doesnt work. niether the slide Left....
may be I am missing something here...need to implement something else as well ?
I followed the steps you gave for a simple implementation.
What's happening is everything freezes..it neither goes into a hidden state neither it slides..
The third party layout which i am implementing is ArcLayout from com.ogaclejapan.arclayout.ArcLayout.
Kindly help.
I use the stable version of the Android Studio (2.3.3)
And the latest stable appcompat-v7: compile 'com.android.support:appcompat-v7:25.3.1'
In the lib's build.gradle:
dependencies {
compile "com.android.support:support-annotations:${versions.support}"
compile "com.android.support:appcompat-v7:${versions.support}"
}
hi, I used your library and it's working perfect! but there is one problem!
when user opens the slideView, expects to slideDown when the user slides on the slideview itself! but this library doesn't do that! and only the parent view can detect the touch and slide down move!!
how can I fix this issue?!
Либа великолепная, но требует немного доработки.
inteface SlideListener
на class SlideListener
чтобы можно было выбрать только 1 из необходимых методов слушателя.I'm trying to use show() and hide() but not working they throw an Unresolved reference.
here is my code:
val slideUp: SlideUpBuilder = SlideUpBuilder(PlayerView)
slideUp.withStartState(SlideUp.State.SHOWED)
slideUp.withStartGravity(Gravity.TOP)
slideUp.withAutoSlideDuration(500)
slideUp.build()
Here is my button click code example:
btn_ShowPlayer.setOnClickListener{
slideUp.show() //both show() and hide() throw an Unresolved reference error
}
Hello !
I've tried to add you library. it looks awesome by the way.
In the documentation you state that the library is tagged 2.2.2, and that we have to add this line:
as well as the maven { url "https://jitpack.io" } in the repositories section.
This is the error I get, and it goes away if I replace the 2.2.2 version by 2.2.1, it work, so I guess there might be a problem with your uploading of the library ;)
EDIT:
It looks like looking at the releases, the 2.2.1 is the last one, so it is a mistake in the readme which states 2.2.2 instead of 2.2.1
Thanks,
Guillaume.
slideUp = new SlideUpBuilder(slideUp_msgList)
.withListeners(new SlideUp.Listener.Events() {
@OverRide
public void onSlide(float percent) {
et_comment.setText("");
}
@Override
public void onVisibilityChanged(int visibility) {
if (visibility == View.GONE) {
et_comment.setText("");
}
}
})
.withSlideFromOtherView(slideUpRootView)
.withStartGravity(Gravity.BOTTOM)
.withLoggingEnabled(true)
.withGesturesEnabled(true)
.withStartState(SlideUp.State.HIDDEN)
.withAutoSlideDuration(2000)
.withSavedState(savedInstanceState)
.build();
Animation time does not work properly.
It shows up immediately.
May I know how can i fix it?
Hi, I'm currently using slideup but as I have observed it does not use the defined apptheme even though I already tried to set the theme of the layout xml file.
This happened to me while I was testing my app on API 23, the view is fine on API 26 the checkbox is showing and text. But When I transferred to API 23 the checkbox and text showed are all white. which makes it invisible on a white background.
The local.properties
may change on each computer, it should not be commited. Can you remove it?
Thanks for this library :-)
Implemented .withStartState(SlideUp.State.HIDDEN)
on onViewCreated
for slideUp but on Initialize it is showing instead of hidden. When I downloaded the example project on initialize the layouts for slideup were hidden. The implementation of the two are the same, only thing is that I do it on a Fragment instead of an Activity.
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="app.realtech.newapplication.MapFragment">
<!-- TODO: Update blank fragment layout -->
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.gms.maps.MapView
android:id="@+id/mapView"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintVertical_bias="0.0"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
app:layout_constraintRight_toRightOf="parent" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/floatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_weight="1"
android:clickable="true"
app:backgroundTint="@color/belebColor"
app:fabSize="auto"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:srcCompat="@drawable/ic_vehicletime_select" />
<include
layout="@layout/slidingpanetest"
android:layout_width="58dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="0dp"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="0dp"
app:layout_constraintVertical_bias="0.0"
android:layout_marginRight="0dp"
app:layout_constraintRight_toRightOf="parent" />
</android.support.constraint.ConstraintLayout>
</FrameLayout>
This is my fragments layout file
ifile:- build-gradle(project:reaction)
buildscript {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
file:- build-gradle ( module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.technetty.reaction"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.android.support:support-v4:28.0.0-rc02'
testImplementation 'junit:junit:4.12'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.+'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.facebook.android:facebook-login:[4,5)'
<---- this line have error in "$current_version" i tryed $current_version= v2.2.8---->
// implementation "com.github.mancj:SlideUp-Android:$current_version"
}
mSlideUp = new SlideUpBuilder(mContactUsView)
.withStartState(SlideUp.State.HIDDEN)
.withStartGravity(Gravity.BOTTOM)
.withGesturesEnabled(false)
.withLoggingEnabled(true)
.build();
I can still drag the view and I don't see any logs
Hi !
I have a recyclerView inside the slide panel view, how can a I get the panel sliding down at the end of the recycler view ? I tried enabling nested scrolling in the recyclerView but it does not work
Sorry for my English, thanks !
Help! How to use it with nestedscrollvew?
Hello,
Could you add an Option for SlideUpBuilder like
.withGesturesEnabled(true)
but with the difference, that the user can't slide the view in?
Maybe
.enableGestureSlideOut(true)
or
.disableGestureSlideIn(true)
?
I built an app with an list view. The view shouldn't be slid up by the user (when no item has been selected).
Best Regards
MatsG23
Is there any way to setting visible distance in hide position? temporarily i manipulated the view's size but can we adjust the visible distance as a percentage or by another way?
Thank for your job.
I Think it can make more small or can use a external links?
hi , i am getting below error
Error:(27, 13) Failed to resolve: com.github.mancj:SlideUp-Android:2.2.5
<a href="openFile:/home/dev/Documents/drag/DragNDropApp/app/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
app build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:gridlayout-v7:25.3.1'
compile 'com.github.mancj:SlideUp-Android:2.2.5'
}
Does onSlide
still exist? I poked around the code and it looks like it doesn't. I only found onVisibility
and onSlideDown
. If it doesn't, how might one change the alpha of the background view according to the slide percentage?
is it possible to have a portion of slideUp
always visible? Essentially, I'd like to have a button on the very top of slideUp
which displays a name for slideUp
and, when pressed, calls slideUp.animateIn();
Thanks for the awesome implementation of this!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.