OpenSooq / Pluto

Pluto is an Easy, lightweight and high performance slider view library for Android. You have the flexibility to customize it to any view since it based RecyclerView.
https://engineering.opensooq.com
109 stars 16 forks source link

Indicator hides on sliding #1

Closed KamranSajidWurfel closed 5 years ago

KamranSajidWurfel commented 5 years ago

Hi there, I am using customIndicator and it hides when I slide any item.

tamtom commented 5 years ago

Hello Karman, can you please show me your implementation of custom indicator? thanks

On Tue, May 7, 2019 at 9:44 AM KamranSajidWurfel notifications@github.com wrote:

Hi there, I am using customIndicator and it hides when I slide any item.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/OpenSooq/Pluto/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AB3H3BI6I7NURPHFBMIMVCDPUEQOLANCNFSM4HLF2JGQ .

-- Omar Al-Tamimi Android Developer | OpenSooq phone: 00962788241284 email: omar.tamimid1@gmail.com

KamranSajidWurfel commented 5 years ago

My Layout: <android.support.constraint.ConstraintLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@id/live_matches_heading">

        <com.opensooq.pluto.PlutoView
                android:id="@+id/live_matches_view"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:auto_cycle="false"
                app:indicator_visibility="true"/>

        <com.opensooq.pluto.PlutoIndicator
                android:id="@+id/live_matches_indicator"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/live_matches_view"
                style="@style/Pluto_Corner_Oval_Orange"/>
    </android.support.constraint.ConstraintLayout>

//ItemView <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent">

<TextView
        android:id="@+id/textView_series"
        android:layout_width="wrap_content"
        android:layout_centerInParent="true"
        android:text="@string/live_matches"
        android:textColor="@color/colorAccent"
        android:textSize="@dimen/_10sdp"
        android:layout_height="wrap_content"/>

//Adapter public class LiveMatchesAdapter extends PlutoAdapter<LiveMatch, LiveMatchesAdapter.ViewHolder> {

public LiveMatchesAdapter(List<LiveMatch> items) {
    super(items);
}

@Override
public ViewHolder getViewHolder(ViewGroup parent, int viewType) {
    return new ViewHolder(parent, R.layout.live_match_item);
}

public static class ViewHolder extends PlutoViewHolder<LiveMatch> {
    TextView textViewSeries;

    public ViewHolder(ViewGroup parent, int itemLayoutId) {
        super(parent, itemLayoutId);
        //initialize view items
        textViewSeries = getView(R.id.textView_series);
    }

    @Override
    public void set(LiveMatch item, int pos) {
        //  yourImageLoader.with(mContext).load(item.getPosterId()).into(ivPoster);
        textViewSeries.setText(item.getSeriesName());
    }
}

}

// Usage (Kotlin) liveMatchesView = view.findViewById(R.id.live_matches_view) liveMatches= LiveMatches() liveMatches.liveMatchList.add(LiveMatch("LiveMatch1")) liveMatches.liveMatchList.add(LiveMatch("LiveMatch2")) liveMatches.liveMatchList.add(LiveMatch("LiveMatch3")) liveMatchesAdapter = LiveMatchesAdapter(liveMatches.liveMatchList) liveMatchesView.create(liveMatchesAdapter) liveMatchesView.setCustomIndicator(view.findViewById(R.id.live_matches_indicator))

tamtom commented 5 years ago

@KamranSajidWurfel thank you for reporting yes there is a bug when you turn off the auto_cycle we will fix it in the next version for a workaround you can set app:auto_cycle to true and put the duration 100000 to mimic the no autocycle

tamtom commented 5 years ago

@KamranSajidWurfel this bug is fixed in version 1.4