Code Monkey home page Code Monkey logo

slideup-android's Introduction

Mansur's GitHub stats

Top Langs

trophy

slideup-android's People

Contributors

arpit0492 avatar gounlaf avatar mancj avatar paolorotolo avatar toteto avatar ydrall avatar ztrap avatar

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

slideup-android's Issues

SlideDown not working

I am trying to run sample provided. SlideDown is not working. It is not simply showing view when I try to drag from top

Sideways sliding using incorrect sliding distance

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.

SlideUp Implementation Issue

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.

Correct dependencies

I believe that the correct dependencie to be added is this below

dependencies {
compile 'com.github.mancj:SlideUp:2.2.2'
}

Version name

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

wrong events

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.

onSlide percent greater than 100

If there is a virtual bar at the bottom of the phone,When view slide virual bar,return percent greater than 100.

Reason

float difference = event.getRawY() - startPositionY;
float moveTo = viewStartPositionY + difference;
float percents = moveTo * 100 / view.getHeight();

So i was so resolved

int alpha = (int)(percent * 2.55f);
dim.setAlpha(1 - (percent / 100));
if (alpha >= 256)
    alpha = 255;
toolbar.setTitleTextColor(Color.argb(alpha,255,255,255));

Update Gifs

please update gifs fo examples of the lib to know how it look before using it

Keep panel collapsed

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

Multiple views with continuous show/hide not working

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 to push the main content

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.

Issue selecting spinner location

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.

library source code does not match the bytecode for class SlideUp

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

Exception null pointer

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;
    }

Unable to get it working...

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.

Error:Failed to resolve: com.android.support:appcompat-v7:25.4.0

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}"
}

slideView is not draggable from itself

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?!

Доработка

Либа великолепная, но требует немного доработки.

  1. Изменить inteface SlideListener на class SlideListener чтобы можно было выбрать только 1 из необходимых методов слушателя.
  2. Добавить возможность использовать несколько слушателей.
  3. Добавить возможность изменить сторону слайда (сверху - вниз, к примеру)

Show and Hide methods throw an Unresolved reference error with Kotlin

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
}

Error in dependencies

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:

  • compile 'com.github.mancj:SlideUp-Android:2.2.2'

as well as the maven { url "https://jitpack.io" } in the repositories section.

capture d ecran 2017-03-31 a 16 25 10

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.

animation time does not work.

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?

Does slideup use defined apptheme?

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.

On Initialize not Hidden

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

issues in using library "com.github.mancj:SlideUp-Android:$current_version"

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"
}

Disabling gesture and loggin doesn't work

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

Slide with RecyclerView nested scrolling

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 !

[SUGGESTION] Prevent user from opening slideView

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

show some slide view part when hide

Hi, i am using this library from bottom to top slide , but when we slide from top to bottom it completely hide the slide view , i want to show some part of the slide view when we slide from top to bottom like in the below screen show. like in the google music app.

device-2017-12-07-104144

Setting visible distance

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?

library version issue

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'
}

Show top of slideUp, and does onSlide still function?

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

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

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.