firdausmaulan / glideslider Goto Github PK
View Code? Open in Web Editor NEWGlide Image Slider
Glide Image Slider
How set this style loading image view
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;
}
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
Hi, is it possible to setTag(Object) to sliderView instead using bundle?
How to get custom indicators?I want the indicators belows sliders. So it possible or not?
ERROR: Failed to resolve: com.github.firdausmaulan:GlideSlider:1.4.1
Show in Project Structure dialog
Affected Modules: app
How can remove indicator and fit image to slide it size i get over slide screen how can fit it
Is this MIT-Licensed, like https://github.com/daimajia/AndroidImageSlider ?
How can I load a Bitmap or a ByteArray as image into the DefaultSliderView?
Currently GlideSilder
can show jpg
, png
, gif
and webp
images file format.
It's nice to play mp4
video file format.
Here is sample Image/Video Slider:
https://github.com/mohan-dev1248/PosterSlider
Hello, thx for library! Hot to add pitch to zoom in GlideSlider?
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.
How can I change the color of the page indicators?
is it possibile to prevent infinite loop on slide images?
let me know how to set auto play false?
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
I want to have a cache system,
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);
}
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(BaseSliderView.ScaleType.CenterCrop)
The class BaseSliderView should accept a GlideUrl in the method image().
or is there a way to pass a Glide object to it?
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
I cant fit image to view, any solution?
I already try setCenterCrop
How do I change the font type in the slider image description?
When I first load images in the view there is an animation I don't want to have, how can I disable it?
Thanks in advance
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.
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)
when i use wrap content as height, its set like match parent which is full screen
I saw this readme file shows like below
ext.support_version = '27.1.1'
ext.glide_version = '4.7.1'
but can't I use this library with support version 28 and the latest gradle version?
How can I use a custom view for the slider?
I've tried creating a class implementing BaseSliderView but bindEventAndShow is private.
How can we achieve the Image Slider like you show here
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)
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)
ViewPager of slider does not support RTL scroll
I want to remove the possibility for the component to cycle, but to stop when it gets to the end or to the start of it.
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.
Hi.
How to round slides same as in the image:
https://imagehost.imageupload.net/2020/03/05/screenshot_1583394150.png
I downloaded the demo project and run it but it does not appear as in the image.
https://github.com/firdausmaulan/GlideSlider-Example
Sorry for my english.
Thanks.
I tried adding drawable background in slider layout, it doesn't work. How to achieve it?
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)
Hi, how can i increase android:radius for slides?
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.
I'm using data binding
I want to customize PagerIndicator but it doesn't fit with data binding because it's package name starts with capital letter
and i get build error (https://stackoverflow.com/a/52674210/4725753)
please rename package names to lowercase and update library
I want to change the default diskCacheStrategy to show animated GIFs. Is there any way to do it?
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();
}
}`
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.
Hello and thank you for all your efforts in android development.
I have one issue with this your library:
How can I create a slider layout with rounded corners as you create in the image below?
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...
It is imposible to use this library with our custom AppGlideModule...i think its because of SVG useing its own.
Please remove this form library as suggested in Glide's documentation:
http://bumptech.github.io/glide/doc/configuration.html#avoid-appglidemodule-in-libraries
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.
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.