Giter VIP home page Giter VIP logo

glideslider's People

Contributors

firdausmaulan avatar g00m avatar jekos avatar prokash-sarkar 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

glideslider's Issues

Disable AutoPause in MotionEvent

The slider stops when you move your finger on it (no necessary changing the slide), can i disable this autoPause?

@Override
   public boolean onInterceptTouchEvent(MotionEvent ev) {
       int action = ev.getAction();
       switch (action) {
           case MotionEvent.ACTION_DOWN:
               pauseAutoCycle();
               break;
       }
       return false;
   }

Support com.bumptech.glide.load.model.GlideUrl

I can not load images from my REST-Server because I can not authenticate.

Till now i used the GlideUrl for authorization:

GlideUrl urlWithHeader = new GlideUrl(url, new LazyHeaders.Builder().addHeader("Authorization", Credentials.basic(loggedInUser.getEmail(), loggedInUser.getPassword())).build());
return urlWithHeader;

And then loading the image with the GlideUrl
Glide.with(context).load(urlWithHeader).into(...);

How can I authenticate in GlideSlider to be able to load the images?

Tanks and kind regards from Germany,
wilhei

Indicators

How to get custom indicators?I want the indicators belows sliders. So it possible or not?

pitch to zoom

Hello, thx for library! Hot to add pitch to zoom in GlideSlider?

out of memory

I have a tabview (3tabs)
each tab have a listview
each listview have ten items
each item have a GlideSlider
each glideslider have 5 images
each image 100kb(assets folder)

How to increase glideslider performance?

The app wil crash if I switch to the second tab and scroll down.

I am getting error with this libery.

Process: com.example.genesishospital, PID: 15301
java.lang.NoSuchMethodError: No virtual method apply(Lcom/bumptech/glide/request/RequestOptions;)Lcom/bumptech/glide/RequestBuilder; in class Lcom/bumptech/glide/RequestBuilder; or its super classes (declaration of 'com.bumptech.glide.RequestBuilder' appears in /data/app/com.example.genesishospital-2/base.apk)
    at com.glide.slider.library.SliderTypes.BaseSliderView.bindEventAndShow(BaseSliderView.java:229)
    at com.glide.slider.library.SliderTypes.TextSliderView.getView(TextSliderView.java:25)
    at com.glide.slider.library.SliderAdapter.instantiateItem(SliderAdapter.java:82)
    at com.glide.slider.library.Tricks.InfinitePagerAdapter.instantiateItem(InfinitePagerAdapter.java:54)
    at com.glide.slider.library.Tricks.ViewPagerEx.addNewItem(ViewPagerEx.java:849)
    at com.glide.slider.library.Tricks.ViewPagerEx.populate(ViewPagerEx.java:999)
    at com.glide.slider.library.Tricks.ViewPagerEx.populate(ViewPagerEx.java:931)
    at com.glide.slider.library.Tricks.ViewPagerEx.onMeasure(ViewPagerEx.java:1454)
    at android.view.View.measure(View.java:20221)
    at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:716)
    at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:462)
    at android.view.View.measure(View.java:20221)
    at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:716)
    at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:462)
    at android.view.View.measure(View.java:20221)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at android.support.v7.widget.CardView.onMeasure(CardView.java:260)
    at android.view.View.measure(View.java:20221)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:747)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:629)
    at android.view.View.measure(View.java:20221)
    at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:716)
    at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:462)
    at android.view.View.measure(View.java:20221)
    at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1638)
    at android.view.View.measure(View.java:20221)
    at android.support.constraint.ConstraintLayout.internalMeasureChildren(ConstraintLayout.java:1227)
    at android.support.constraint.ConstraintLayout.onMeasure(ConstraintLayout.java:1572)
    at android.view.View.measure(View.java:20221)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
    at android.support.design.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:733)
    at android.support.design.widget.HeaderScrollingViewBehavior.onMeasureChild(HeaderScrollingViewBehavior.java:95)
    at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onMeasureChild(AppBarLayout.java:1556)
    at android.support.design.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:803)
    at android.view.View.measure(View.java:20221)
    at android.support.v4.widget.DrawerLayout.onMeasure(DrawerLayout.java:1119)
    at android.view.View.measure(View.java:20221)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
    at android.view.View.measure(View.java:20221)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:747)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:629)
    at android.view.View.measure(View.java:20221)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at android.view.V

How to configure cache ?

I want to have a cache system,

  • when internet connected, always download from URL
  • when internet disconnected, always load from cache
    how to make it ?
    i was try using RequestOptions and its not work, or is it my configuration false ?

my code :

RequestOptions requestOptions = new RequestOptions();
requestOptions.centerCrop();

if (isNetworkConnected()){

        requestOptions.signature(new ObjectKey(Long.toString(System.currentTimeMillis())));
        requestOptions.diskCacheStrategy(DiskCacheStrategy.RESOURCE);
        requestOptions.skipMemoryCache(false);

}

out of memory

I have a tabview (3tabs)
each tab have a listview
each listview have ten items
each item have a GlideSlider
each glideslider have 5 images
each image 100kb(assets folder)

How to increase glideslider performance?

The app wil crash if I switch to the second tab and scroll down.



public View getView(int position, View convertView, ViewGroup parent) {
        TextView tv_title;
        SliderLayout sl_slider;
        if (convertView != null) {
            tv_title = (TextView) convertView.findViewById(R.id.tv_title);
            sl_slider = (SliderLayout) convertView.findViewById(R.id.sl_slider);
            tv_title.setText(null);
            sl_slider.stopAutoCycle();
            sl_slider.removeAllSliders();
        }
        convertView = LayoutInflater.from(context).inflate(R.layout.lv_item, null);
        tv_title = (TextView) convertView.findViewById(R.id.tv_title);
        sl_slider = (SliderLayout) convertView.findViewById(R.id.sl_slider);

        Slider slider = getItem(position);
        String title = slider.getTitle();
        ArrayList<String> imageArrayList = slider.getSlideArrayList();

        tv_title.setText(title);

        for (int i = 0; i < imageArrayList.size(); i++) {
            sl_slider.addSlider(new DefaultSliderView(context)
                    .image("file:///android_asset/" + imageArrayList.get(i) + ".png")
                    .setRequestOption(requestOptions)
                    .setBackgroundColor(Color.TRANSPARENT));
        }
        sl_slider.startAutoCycle(5000, 12000, true);

        return convertView;
    }

setScaleType

.setScaleType(BaseSliderView.ScaleType.CenterCrop)

Problem with generated API GlideApp

I get this error when I add the library
I think it kind of conflict between my GlideApp and library GlideApp

2018-07-30 16:38:38.060 ? E/installd: Failed to delete /data/app/vmdl1721415789.tmp: No such file or directory
2018-07-30 16:38:39.038 ? E/Finsky: [2] com.google.android.finsky.wear.ad.a(3): onConnectionFailed: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
2018-07-30 16:38:40.360 ? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
2018-07-30 16:38:40.484 ? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
2018-07-30 16:38:42.027 ? E/ResourcesManager: failed to add asset path /data/app/com.example.myapp.debug-RQsxgyEeQth13RKqzpwItA==/base.apk
2018-07-30 16:38:42.027 ? E/ResourcesManager: failed to add asset path /data/app/com.example.myapp.debug-RQsxgyEeQth13RKqzpwItA==/base.apk
2018-07-30 16:38:42.027 ? E/ResourcesManager: failed to add asset path /data/app/com.example.myapp.debug-RQsxgyEeQth13RKqzpwItA==/base.apk
2018-07-30 16:38:42.528 com.example.myapp.debug E/RecyclerView: No adapter attached; skipping layout
2018-07-30 16:38:42.531 com.example.myapp.debug E/RecyclerView: No adapter attached; skipping layout
2018-07-30 16:38:43.334 com.example.myapp.debug E/RecyclerView: No adapter attached; skipping layout
2018-07-30 16:38:43.486 com.example.myapp.debug E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.myapp.debug, PID: 11483
java.lang.ClassCastException: com.glide.slider.library.svg.GlideRequests cannot be cast to com.example.myapp.utils.GlideRequests
at com.example.myapp.utils.GlideApp.with(GlideApp.java:88)
at com.example.myapp.home.coupons.CouponsAdapter.onBindViewHolder(CouponsAdapter.kt:37)
at com.example.myapp.home.coupons.CouponsAdapter.onBindViewHolder(CouponsAdapter.kt:17)
at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6673)
at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6714)
at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5647)
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5913)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5752)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5748)
at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2232)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1559)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1519)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:614)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3812)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3529)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:4082)
at android.view.View.layout(View.java:19659)
at android.view.ViewGroup.layout(ViewGroup.java:6075)
at android.support.constraint.ConstraintLayout.onLayout(ConstraintLayout.java:1858)
at android.view.View.layout(View.java:19659)
at android.view.ViewGroup.layout(ViewGroup.java:6075)
at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1769)
at android.view.View.layout(View.java:19659)
at android.view.ViewGroup.layout(ViewGroup.java:6075)
at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:132)
at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42)
at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1361)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:894)
at android.view.View.layout(View.java:19659)
at android.view.ViewGroup.layout(ViewGroup.java:6075)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:19659)
at android.view.ViewGroup.layout(ViewGroup.java:6075)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:19659)
at android.view.ViewGroup.layout(ViewGroup.java:6075)
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:19659)
at android.view.ViewGroup.layout(ViewGroup.java:6075)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:19659)
at android.view.ViewGroup.layout(ViewGroup.java:6075)
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:19659)
at android.view.ViewGroup.layout(ViewGroup.java:6075)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
2018-07-30 16:38:43.487 com.example.myapp.debug E/AndroidRuntime: at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:761)
at android.view.View.layout(View.java:19659)
at android.view.ViewGroup.layout(ViewGroup.java:6075)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2496)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2212)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1392)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6752)
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:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
2018-07-30 16:38:44.691 ? E/BeaconBle: Missing BluetoothAdapter
2018-07-30 16:38:44.732 ? E/BeaconBle: Scan couldn't start for Places
2018-07-30 16:38:53.527 ? E/memtrack: Couldn't load memtrack module
2018-07-30 16:39:08.124 ? E/memtrack: Couldn't load memtrack module
2018-07-30 16:39:08.145 ? E/memtrack: Couldn't load memtrack module
2018-07-30 16:39:17.021 ? E/memtrack: Couldn't load memtrack module
2018-07-30 16:39:17.037 ? E/memtrack: Couldn't load memtrack module
2018-07-30 16:39:30.266 ? E/memtrack: Couldn't load memtrack module
2018-07-30 16:39:30.289 ? E/memtrack: Couldn't load memtrack module

Change Font Type

How do I change the font type in the slider image description?

Can't add, remove, get sliders count after first add.

When I add sliders for the first time, everything is ok.
Then, when activity receives new image urls, if I try to add, indicator's number will be the same, I lost focus on all the indicators and any image disappears.
If I try to remove 1 or more sliders, I lost all the indicators and images also.

version 1.4.0 crashing with latest glide version(4.9.0)

The library version 1.4.0 is crashing as soon as the activity is launched with the latest glide version 4.9.0, but when glide version is downgraded to 4.8.0 then the app is not crashing, following is the crash:

java.lang.NoSuchMethodError: No virtual method apply(Lcom/bumptech/glide/request/RequestOptions;)Lcom/bumptech/glide/RequestBuilder; in class Lcom/bumptech/glide/RequestBuilder; or its super classes (declaration of 'com.bumptech.glide.RequestBuilder' appears in /data/app/io.github.armcha.recyclerviewkadapter-O-aYGrGwCkwJKrWSb9cRig==/base.apk)
at com.glide.slider.library.SliderTypes.BaseSliderView.bindEventAndShow(BaseSliderView.java:229)
at com.glide.slider.library.SliderTypes.TextSliderView.getView(TextSliderView.java:25)
at com.glide.slider.library.SliderAdapter.instantiateItem(SliderAdapter.java:82)
at com.glide.slider.library.Tricks.InfinitePagerAdapter.instantiateItem(InfinitePagerAdapter.java:54)
at com.glide.slider.library.Tricks.ViewPagerEx.addNewItem(ViewPagerEx.java:849)
at com.glide.slider.library.Tricks.ViewPagerEx.populate(ViewPagerEx.java:999)
at com.glide.slider.library.Tricks.ViewPagerEx.populate(ViewPagerEx.java:931)
at com.glide.slider.library.Tricks.ViewPagerEx.onMeasure(ViewPagerEx.java:1454)
at android.view.View.measure(View.java:22071)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
at android.view.View.measure(View.java:22071)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
at android.view.View.measure(View.java:22071)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
at android.view.View.measure(View.java:22071)
at androidx.constraintlayout.widget.ConstraintLayout.internalMeasureChildren(ConstraintLayout.java:1227)
at androidx.constraintlayout.widget.ConstraintLayout.onMeasure(ConstraintLayout.java:1572)
at android.view.View.measure(View.java:22071)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6602)
at androidx.coordinatorlayout.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:743)
at com.google.android.material.appbar.HeaderScrollingViewBehavior.onMeasureChild(HeaderScrollingViewBehavior.java:101)
at com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior.onMeasureChild(AppBarLayout.java:1631)
at androidx.coordinatorlayout.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:813)
at android.view.View.measure(View.java:22071)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6602)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
at android.view.View.measure(View.java:22071)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6602)
at androidx.appcompat.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:403)
at android.view.View.measure(View.java:22071)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6602)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at android.view.View.measure(View.java:22071)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6602)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1514)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:806)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:685)
at android.view.View.measure(View.java:22071)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6602)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at com.android.internal.policy.DecorView.onMeasure(DecorView.java:724)
at android.view.View.measure(View.java:22071)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2422)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1504)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1761)
2019-03-14 16:29:00.908 12556-12556/io.github.armcha.recyclerviewkadapter E/AndroidRuntime: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1392)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6752)
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:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Custom View

How can I use a custom view for the slider?

I've tried creating a class implementing BaseSliderView but bindEventAndShow is private.

No field glide_slider_viewpager

Why i always get this error?
No field glide_slider_viewpager of type I in class Lcom/glide/slider/library/R$id; or its superclasses (declaration of 'com.glide.slider.library.R$id' appears in /data/app/testing/split_lib_slice_2_apk.apk)

java.lang.NoSuchMethodError

Can't use the newest version of Glide along with the default one given with library. I'm using the following Glide dependencies explicitly:

annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
implementation 'com.github.firdausmaulan:GlideSlider:1.0.2'

This throws a java.lang.NoSuchMethodError :

java.lang.NoSuchMethodError: No virtual method into(Landroid/widget/ImageView;)Lcom/bumptech/glide/request/target/Target; in class Lcom/bumptech/glide/RequestBuilder; or its super classes (declaration of 'com.bumptech.glide.RequestBuilder' appears in /data/app/com.sslwireless.starcineplex-1/split_lib_dependencies_apk.apk)

at com.glide.slider.library.SliderTypes.BaseSliderView.bindEventAndShow(BaseSliderView.java:268)
at com.glide.slider.library.SliderTypes.TextSliderView.getView(TextSliderView.java:25)
at com.glide.slider.library.SliderAdapter.instantiateItem(SliderAdapter.java:81)
at com.glide.slider.library.Tricks.InfinitePagerAdapter.instantiateItem(InfinitePagerAdapter.java:54)
at com.glide.slider.library.Tricks.ViewPagerEx.addNewItem(ViewPagerEx.java:848)
at com.glide.slider.library.Tricks.ViewPagerEx.populate(ViewPagerEx.java:998)
at com.glide.slider.library.Tricks.ViewPagerEx.populate(ViewPagerEx.java:930)
at com.glide.slider.library.Tricks.ViewPagerEx.onMeasure(ViewPagerEx.java:1453)

RTL support

ViewPager of slider does not support RTL scroll

Can't change background color

Hi, I'm trying to change background color of the slider. I've tried using .setBackgroundColor on sliderView and also on SliderLayout.
I've even tried usin backgroundTint="@null" but it doesn't work.

photo_2018-01-26_18-53-50

ScaleType is missing

Currently, there's no way to apply ScaleType on TextSliderView. The original library has the ability to apply ScaleType e.g. .setScaleType(BaseSliderView.ScaleType.Fit)

Crash after upgrade from v1.4.1 to 1.5.1

Hi.
In version 1.4.1, it's working.
After upgrade to version 1.5.1, app crashes.
Log:
Caused by: android.view.InflateException: Binary XML file line #8: Binary XML file line #8: Error inflating class com.glide.slider.library.Tricks.InfiniteViewPager 2020-03-05 11:20:12.188 21712-21712/vn.mediatech.ntvgo E/AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class com.glide.slider.library.Tricks.InfiniteViewPager

I'm use androidx.
app build.grade:

implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation 'com.github.firdausmaulan:GlideSlider:1.5.1'

Please, help me.

Slider in fragment

How to add this slider in fragment
`package com.itechneps.radio.swadeshfm.Fragment;

import android.app.AlarmManager;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.PendingIntent;
import android.content.DialogInterface;
import android.content.Intent;
import android.media.AudioFormat;
import android.media.MediaRecorder;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.itechneps.radio.swadeshfm.R;
import com.itechneps.radio.swadeshfm.Util.Constants;
import com.itechneps.radio.swadeshfm.Util.Control;
import com.itechneps.radio.swadeshfm.Util.MyReceiver;
import com.itechneps.radio.swadeshfm.Util.NotificationService;
import com.shawnlin.numberpicker.NumberPicker;

import java.io.File;
import java.io.IOException;
import java.util.Random;
import java.util.concurrent.TimeUnit;

import omrecorder.AudioChunk;
import omrecorder.AudioRecordConfig;
import omrecorder.OmRecorder;
import omrecorder.PullTransport;
import omrecorder.PullableSource;

import static android.content.Context.ALARM_SERVICE;

public class MyFmFragment extends Fragment {

public static ImageView imageView_timer, imageView_play, imageView_record, imageView_myFm;
public static ProgressBar progressBar;
public View view;
public static TextView textView_play, textView_timer, textView_stoptimer;
private Constants constants;
private int columnWidth;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    view = inflater.inflate(R.layout.myfm_fragment, container, false);

    constants = new Constants(getActivity());
    columnWidth = (int) (constants.getScreenWidth());

    progressBar = (ProgressBar) view.findViewById(R.id.ProgressBar_myfm);
    imageView_myFm = (ImageView) view.findViewById(R.id.imageView_myfm);
    imageView_timer = (ImageView) view.findViewById(R.id.imageView_timer_myfm);
    imageView_play = (ImageView) view.findViewById(R.id.imageView_play_myfm);
    imageView_record = (ImageView) view.findViewById(R.id.imageView_record_myfm);
    textView_play = (TextView) view.findViewById(R.id.textView_play_myfm);
    textView_timer = (TextView) view.findViewById(R.id.textView_timer);
    textView_stoptimer = (TextView) view.findViewById(R.id.textView_stoptimer);
    progressBar.setVisibility(View.GONE);

    imageView_myFm.setLayoutParams(new RelativeLayout.LayoutParams(columnWidth, columnWidth / 2));

    try {
        if (Control.mRadioManager != null) {
            if (Control.mRadioManager.isPlaying()) {
                imageView_play.setImageResource(R.drawable.ic_pause);
                textView_play.setText(getResources().getString(R.string.textView_pause_myfm));
            } else {
                imageView_play.setImageResource(R.drawable.ic_play);
                textView_play.setText(getResources().getString(R.string.textView_play_myfm));
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

    if (Control.playPauseRecord) {
        imageView_record.setImageResource(R.drawable.ic_rac_hov);
    } else {
        imageView_record.setImageResource(R.drawable.ic_rac);
    }

    imageView_play.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(getActivity(), NotificationService.class);
            intent.setAction(Constants.ACTION.PLAY_ACTION);
            getActivity().startService(intent);
        }
    });

    imageView_timer.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (Control.mRadioManager.isPlaying()) {
                if (!Control.timer) {
                    timer();
                } else {
                    openCancelTimerDialog();
                }
            } else {
                Toast.makeText(getActivity(), getResources().getString(R.string.not_start_fm), Toast.LENGTH_SHORT).show();
            }
        }
    });

    imageView_record.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (Control.allowPermitionExternalStorage) {
                try {
                    recoding();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            } else {
                Toast.makeText(getActivity(), getResources().getString(R.string.cannot_use_save_permission), Toast.LENGTH_SHORT).show();
            }
        }
    });

    return view;
}


public void timer() {

    final Dialog dialog = new Dialog(getActivity());
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.dialog);

    final NumberPicker hours_picker = (NumberPicker) dialog.findViewById(R.id.hours_picker);
    final NumberPicker minute_picker = (NumberPicker) dialog.findViewById(R.id.minute_picker);
    Button button = (Button) dialog.findViewById(R.id.button_dialog);

    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            String hours = String.valueOf(hours_picker.getValue());
            String minute = String.valueOf(minute_picker.getValue());

            String totalTime = hours + ":" + minute;
            int total_timer = (int) Constants.convert_long(totalTime);
            Control.timer = true;

            Intent intent = new Intent(getActivity(), MyReceiver.class);
            Control.pendingIntent = PendingIntent.getBroadcast(getActivity().getApplicationContext(), 0, intent, PendingIntent.FLAG_ONE_SHOT);
            Control.alarmManager = (AlarmManager) getActivity().getSystemService(ALARM_SERVICE);
            if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                Control.alarmManager.setExact(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + total_timer, Control.pendingIntent);
            } else {
                Control.alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + total_timer, Control.pendingIntent);
            }
            updateTimer(System.currentTimeMillis(), total_timer);

            dialog.dismiss();
        }
    });

    dialog.show();

}

private void updateTimer(final long currentTime, final int time) {
    long timeleft = (currentTime + time) - System.currentTimeMillis();
    if (timeleft > 0) {
        String hms = String.format("%02d:%02d:%02d", TimeUnit.MILLISECONDS.toHours(timeleft),
                TimeUnit.MILLISECONDS.toMinutes(timeleft) % TimeUnit.HOURS.toMinutes(1),
                TimeUnit.MILLISECONDS.toSeconds(timeleft) % TimeUnit.MINUTES.toSeconds(1));

        textView_stoptimer.setVisibility(View.GONE);
        textView_timer.setVisibility(View.VISIBLE);
        textView_timer.setText(hms);
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                if (Control.timer) {
                    updateTimer(currentTime, time);
                } else {
                    textView_stoptimer.setVisibility(View.VISIBLE);
                    textView_timer.setVisibility(View.GONE);
                }
            }
        }, 1000);
    } else {
        textView_stoptimer.setVisibility(View.VISIBLE);
        textView_timer.setVisibility(View.GONE);
    }
}

public void recoding() throws IOException {
    if (Control.mRadioManager.isPlaying()) {
        if (Control.record) {
            Control.record = false;
            Control.playPauseRecord = true;
            setupRecorder();
            Control.recorder_var.startRecording();
            imageView_record.setImageResource(R.drawable.ic_rac_hov);
            Toast.makeText(getActivity(), getResources().getString(R.string.recording_start), Toast.LENGTH_SHORT).show();
        } else {
            Control.recorder_var.stopRecording();
            imageView_record.setImageResource(R.drawable.ic_rac);
            Toast.makeText(getActivity(), getResources().getString(R.string.recording_complite), Toast.LENGTH_SHORT).show();
            Control.record = true;
            Control.playPauseRecord = false;
        }
    } else {
        Toast.makeText(getActivity(), getResources().getString(R.string.not_start_fm), Toast.LENGTH_SHORT).show();
    }
}

private PullableSource mic() {
    return new PullableSource.Default(
            new AudioRecordConfig.Default(
                    MediaRecorder.AudioSource.MIC, AudioFormat.ENCODING_PCM_16BIT,
                    AudioFormat.CHANNEL_IN_MONO, 44100
            )
    );
}

private void setupRecorder() {
    Control.recorder_var = OmRecorder.wav(
            new PullTransport.Default(mic(), new PullTransport.OnAudioChunkPulledListener() {
                @Override
                public void onAudioChunkPulled(AudioChunk audioChunk) {
                }
            }), file());
}

@NonNull
private File file() {
    String iconsStoragePath = Environment.getExternalStorageDirectory() + "/MeroFm/";
    File sdIconStorageDir = new File(iconsStoragePath);
    //create storage directories, if they don't exist
    sdIconStorageDir.mkdirs();
    Random generator = new Random();
    int n = 10000;
    n = generator.nextInt(n);
    String fname = "Recording-" + n;
    String file_name = fname + ".wav";
    return new File(iconsStoragePath, file_name);
}

private void openCancelTimerDialog() {
    AlertDialog.Builder alert;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        alert = new AlertDialog.Builder(getActivity(), android.R.style.Theme_Material_Light_Dialog_Alert);
    } else {
        alert = new AlertDialog.Builder(getActivity());
    }

    alert.setTitle(getString(R.string.cancel_timer));
    alert.setMessage(getString(R.string.sure_cancel_timer));
    alert.setPositiveButton(getString(R.string.yes), new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            Control.timer = false;
            textView_stoptimer.setVisibility(View.VISIBLE);
            textView_timer.setVisibility(View.GONE);
            Control.alarmManager.cancel(Control.pendingIntent);
        }
    });
    alert.setNegativeButton(getString(R.string.no), new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialogInterface, int i) {

        }
    });
    alert.show();
}

}`

dependency

implementation 'com.github.firdausmaulan:GlideSlider:1.3.1'
implementation 'com.github.firdausmaulan:GlideSlider:1.3.2'
These are error dependency. these are not getting sync.

transparent background

Hi,

how can I get transparent background?
If I f.e. set solid color in:
<color name="glide_slider_background_color">#00FF00</color>
or via
slider.setBackgroundColor(Color.RED);

it works fine, but when I set color to transparent, like:
<color name="glide_slider_background_color">#0000FF00</color>
or via
slider.setBackgroundColor(Color.TRANSPARENT);

background is white, not transparent...

Can't extend the BaseSliderView

In the a066e8b, you changed the BaseSliderView constructor access to a package which made it impossible to extend from it (Urgent?).
It works for DefaultSliderView and TextSliderView because they're in the same package.
Am I missing something here?

EDIT: It's also an issue with the mOnSliderClickListener. At least you can make a getter for it.

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.