Giter Club home page Giter Club logo

cardslider-android's People

Contributors

aleksei1000000 avatar alexmik89 avatar andreylos avatar dvg4000 avatar golovin47 avatar juriv avatar oleg-vasiliev avatar ramotiondev avatar ronnielsen 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  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

cardslider-android's Issues

Using Glide to load image in ImageView of SliderCard gives weird result

Hello Team Ramotion!

I found this as repository of choice, it was very cleverly engineered. I've to load image from URL using Glide but result is

capture

As you can see the height & width of image is not being perfect as the drawable are, i have made some changes in code as you can see

public class SliderAdapter extends RecyclerView.Adapter<SliderCard> {

    private final int count;
    private String[] mPlayerImageUrlArray; // Adding an array of Urls instead of int resIds
    private final View.OnClickListener listener;

    public SliderAdapter(String[] mPlayerImageUrlArray, int count, View.OnClickListener listener) {
        this.mPlayerImageUrlArray = mPlayerImageUrlArray;
        this.count = count;
        this.listener = listener;
    }

    @Override
    public SliderCard onCreateViewHolder(ViewGroup parent, int viewType) {
        final View view = LayoutInflater
                .from(parent.getContext())
                .inflate(R.layout.layout_slider_card, parent, false);

        if (listener != null) {
            view.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    listener.onClick(view);
                }
            });
        }

        return new SliderCard(view);
    }

    @Override
    public void onBindViewHolder(SliderCard holder, int position) {
        holder.setContent(mPlayerImageUrlArray[position]);
    }

    @Override
    public void onViewRecycled(SliderCard holder) {
        holder.clearContent();
    }

    @Override
    public int getItemCount() {
        return count;
    }

}

now SliderCard is

public class SliderCard extends RecyclerView.ViewHolder {

    private static int viewWidth = 0;
    private static int viewHeight = 0;

    private final ImageView imageView;


    public SliderCard(View itemView) {
        super(itemView);
        imageView = (ImageView) itemView.findViewById(R.id.image);

    }

    void setContent(final String imgUrl) {
        Log.e("IMG_URL", "setContent() is " + imgUrl);
        if (viewWidth == 0) {
            Log.e("IF", "Called ");
            itemView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
                @Override
                public void onGlobalLayout() {
                    itemView.getViewTreeObserver().removeOnGlobalLayoutListener(this);

                    viewWidth = itemView.getWidth()*2;//Here I tried to double the image size but in vain
                    viewHeight = itemView.getHeight()*2;//Here I tried to double the image size but in vain
                    loadBitmap(imgUrl);
                }
            });
        } else {
            loadBitmap(imgUrl);
        }
    }
   
    void clearContent() {
       /* if (task != null) {
            task.cancel(true);
        }*/
    }

    private void loadBitmap(String imgUrl) {
        //Glide comes in to place here
        imageView.setMaxWidth(viewWidth);
        imageView.setMaxHeight(viewHeight);

        Glide.with(imageView.getContext())
                .load(imgUrl)
                .into(imageView);

    }

}

Question is how can I get Image cover the SliderCard perfectly as Drawables were?

Regards,
Arshad Ali

Support RTL

Hi,
I just change layoutDirection of recycler view to rtl but this option didn't support in the CardSliderLayoutManager. how can I add this feature?

Scrolling Delete Card Positioning

Hello how are you?

When you scroll all cards to left and delete de active card the scroll position dont update example in photo

image

can you help me or tell me what i can do for that?

Why my App with same code is lagging?

i have took the latest sample code base and build it as an seperate project but i see the app is very laggy but the app which you have created is smooth while scrolling.
what I should have forgotten while making the new project?

Note: I copy pasted all the java code and dependencies from cardslider demo app
Any help is appreciated

if set the cardsGap more bigger,the card scroll will be not smoothly

Hi,the project is really cool,thank u all.
i found a problem, i want to only show left cards in screen,so i set the cardsGap to a bigger number.
but when i scroll cards,i found that when a cards x_coordinate scroll to the location of activeCardBottom,
the card will suddenly move a large distance. i hope the card will move linearly all the time.
Could u help me to solve this problem,thank u ~

How to reverse the flow??

I wanted to reverse the flow i.e. card stack at the right side and scrollable cards flow at the left side. How can I do that, please help.

When loaded data is updated, cardsliders disappear

I'm using FirebaseUI Library to get images from my database to appear on the cardslider, and it works perfectly. But whenever I update that data or add a new item, cardsliders disapear and doesn't come back unless I close my app and reopen it.

What might be wrong? Any idea? Thank you.

Error with CardsUpdater when minifyEnabled = true

Hello,

i got a problem. If i turn on minifyEnabled = true then i got following error

 Caused by: java.lang.ClassNotFoundException: Didn't find class "com.noxx.cryptofiat.moneta.dashboard.cards.adapter.CardsUpdater" on path: DexPathList[[zip file "/data/app/com.noxx.cryptofiat.moneta-iWtJskWKL4q5ZPFmkK4szw==/base.apk", zip file "/data/app/com.noxx.cryptofiat.moneta-iWtJskWKL4q5ZPFmkK4szw==/split_config.en.apk", zip file "/data/app/com.noxx.cryptofiat.moneta-iWtJskWKL4q5ZPFmkK4szw==/split_config.x86.apk", zip file "/data/app/com.noxx.cryptofiat.moneta-iWtJskWKL4q5ZPFmkK4szw==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/com.noxx.cryptofiat.moneta-iWtJskWKL4q5ZPFmkK4szw==/lib/x86, /data/app/com.noxx.cryptofiat.moneta-iWtJskWKL4q5ZPFmkK4szw==/base.apk!/lib/x86, /data/app/com.noxx.cryptofiat.moneta-iWtJskWKL4q5ZPFmkK4szw==/split_config.en.apk!/lib/x86, /data/app/com.noxx.cryptofiat.moneta-iWtJskWKL4q5ZPFmkK4szw==/split_config.x86.apk!/lib/x86, /data/app/com.noxx.cryptofiat.moneta-iWtJskWKL4q5ZPFmkK4szw==/split_config.xxhdpi.apk!/lib/x86, /system/lib]]

what could be wrong here?

I appreciate for some pointers

Please provide documentation

I have been trying to implement this library for a while now(close to a month now), have trying adding it as a library, as a module, but always get errors. For instance - it throws an error-> Unable to find ViewUpdater as soon as the app launches.

I will really appreciate any help.

Fatal Exception: java.lang.IndexOutOfBoundsException

Hello, I have a bug which I cannot fix. Maybe you can help me?
Crashlog:

       at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5885)
       at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
       at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
       at com.ramotion.cardslider.CardSliderLayoutManager.fillLeft(CardSliderLayoutManager.java:664)
       at com.ramotion.cardslider.CardSliderLayoutManager.fill(CardSliderLayoutManager.java:640)
       at com.ramotion.cardslider.CardSliderLayoutManager.onLayoutChildren(CardSliderLayoutManager.java:223)
       at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
       at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3641)
       at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:4194)
       at android.view.View.layout(View.java:20854)
       at android.view.ViewGroup.layout(ViewGroup.java:6401)
       at android.support.constraint.ConstraintLayout.onLayout(ConstraintLayout.java:1915)
       at android.view.View.layout(View.java:20854)
       at android.view.ViewGroup.layout(ViewGroup.java:6401)
       at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
       at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635)
       at android.widget.LinearLayout.onLayout(LinearLayout.java:1544)
       at android.view.View.layout(View.java:20854)
       at android.view.ViewGroup.layout(ViewGroup.java:6401)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
       at android.widget.ScrollView.onLayout(ScrollView.java:2492)
       at android.view.View.layout(View.java:20854)
       at android.view.ViewGroup.layout(ViewGroup.java:6401)
       at android.support.design.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1183)
       at android.support.design.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:870)
       at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:889)
       at android.view.View.layout(View.java:20854)
       at android.view.ViewGroup.layout(ViewGroup.java:6401)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
       at android.view.View.layout(View.java:20854)
       at android.view.ViewGroup.layout(ViewGroup.java:6401)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
       at android.view.View.layout(View.java:20854)
       at android.view.ViewGroup.layout(ViewGroup.java:6401)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
       at android.view.View.layout(View.java:20854)
       at android.view.ViewGroup.layout(ViewGroup.java:6401)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
       at android.view.View.layout(View.java:20854)
       at android.view.ViewGroup.layout(ViewGroup.java:6401)
       at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1231)
       at android.view.View.layout(View.java:20854)
       at android.view.ViewGroup.layout(ViewGroup.java:6401)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
       at android.view.View.layout(View.java:20854)
       at android.view.ViewGroup.layout(ViewGroup.java:6401)
       at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
       at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635)
       at android.widget.LinearLayout.onLayout(LinearLayout.java:1544)
       at android.view.View.layout(View.java:20854)
       at android.view.ViewGroup.layout(ViewGroup.java:6401)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
       at android.view.View.layout(View.java:20854)
       at android.view.ViewGroup.layout(ViewGroup.java:6401)
       at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
       at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635)
       at android.widget.LinearLayout.onLayout(LinearLayout.java:1544)
       at android.view.View.layout(View.java:20854)
       at android.view.ViewGroup.layout(ViewGroup.java:6401)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
       at com.android.internal.policy.DecorView.onLayout(DecorView.java:945)
       at android.view.View.layout(View.java:20854)
       at android.view.ViewGroup.layout(ViewGroup.java:6401)
       at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2956)
       at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2643)
       at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1780)
       at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7827)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
       at android.view.Choreographer.doCallbacks(Choreographer.java:723)
       at android.view.Choreographer.doFrame(Choreographer.java:658)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
       at android.os.Handler.handleCallback(Handler.java:789)
       at android.os.Handler.dispatchMessage(Handler.java:98)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6944)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)```

Card width issue

The library clips the width of the height no matter what i use. Tried cardwidth on xml and also on code but nothing seems to override the width. The width am setting is 300dp

Screenshots please

Can you please upload some documentation and screenshots about this library, it's better to understand what's exactly it is!

Move to particular position on the recyclerview

Hello,
I have been trying to move to particular position on the recyclerview, but when I use scrollToPosition() or smoothScrollToPosition() on Recyclerview it's not working or moving to passed position.
Please help.

For the first card Json data not loaded

While we are using this view with the json data..for the first card we are not getting any response even the default text of text switcher is not visible. To see the data we have slide it to the next one and only then data is visible...

Use cards as tabs

I would like to know if is possible to implement easily the cards had the behavior of tabs (swipe left on any place move from one fragment to another fragment and the cards would scroll too).

How to place the card a little bit to the left?

Hi,

i tried to set the parameter recycler_view_left_offset in dimens.xml and DEFAULT_ACTIVE_CARD_LEFT_OFFSET in CardSliderLayoutManager but it doesn't work. I appreciate if you can share the tip.

Signed APK crashes (Debug APK works perfectly)

Caused by: java.lang.IllegalStateException: Binary XML file line #10: Could not instantiate the LayoutManager: com.ramotion.cardslider.CardSliderLayoutManager
...
Caused by: java.lang.IllegalStateException: Binary XML file line #10: Unable to find ViewUpdater
...

How can I solve this problem?

How to turn off the scroll effect

Hi, do you know how to turn off the scroll effect but the card is still clickable and has zoom in/out effect? I appreciate for the pointer

Search functionality (Question)

I implemented search functionality in cardslider for to search specific card by name or etc.. and its working properly but when i slide one or some cards i am unable to show images. So, whats am i doing wrong? can you help me?

androi:screenorientation ="landscape"in AndroidManifest,error.

07-18 10:59:47.069 12541-12541/com.ramotion.cardslider.examples.simple E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ramotion.cardslider.examples.simple, PID: 12541
java.lang.IllegalArgumentException: n <= 0: -200
at java.util.Random.nextInt(Random.java:182)
at com.ramotion.cardslider.examples.simple.MainActivity$2.onGlobalLayout(MainActivity.java:162)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:912)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2031)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1147)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6262)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:886)
at android.view.Choreographer.doCallbacks(Choreographer.java:698)
at android.view.Choreographer.doFrame(Choreographer.java:633)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:872)
at android.os.Handler.handleCallback(Handler.java:743)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5665)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:822)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:712)

CardWidth is not working

in my layout :
<android.support.v7.widget.RecyclerView android:id="@+id/pileLayout" android:layout_width="match_parent" android:layout_height="250dp" android:layout_below="@+id/textview_wod_quantity" android:layout_marginBottom="16dp" android:layout_marginTop="32dp" android:clipChildren="false" android:overScrollMode="never" app:layoutManager="com.ramotion.cardslider.CardSliderLayoutManager" app:viewUpdater="com.mvince.wodrandom.ui.customView.CardsUpdater" app:cardWidth="400dp"/>

the cardWith is set but not effective in the app

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.