saeedsh92 / banner-slider Goto Github PK
View Code? Open in Web Editor NEWBanner slider is an easy to use library for implement image sliders in android apps.
Banner slider is an easy to use library for implement image sliders in android apps.
The library crashes on Android 8 when you move forward maybe due to big parcels when instance state is saved.
There is an error like that :android.os.TransactionTooLargeException: data parcel size 20195964 bytes:
Anyone else face the same on SDK 25?
The image sliding is so flat, no transition animations at all and the sight of it is visually disturbing
how can i find that Slider move to next Image
is there anyway to find out Position changed ?
imageSlider.setOnBannerClickListener(new OnBannerClickListener() {
@Override
public void onClick(int position) {
}
});
its OnBannerClickListener
i need OnBannerPositionChangeListener
Hi ...
I am getting this error for some images, while loading images from urls
W/art: Throwing OutOfMemoryError "Failed to allocate a 157818236 byte allocation with 13630068 free bytes and 108MB until OOM"
Images for those I got this error are not too much bigger but having almost 500kb
Although its loading other images of 2.5 to 3 mb images successfully.
Thanks
Thank you for this great lib.
Is there any way to override and customize the emptyView programmatically?
For instance, if I want to load an image using Picasso lib in that empty layout, how can i reach that?
Hi. I just stubled upon your slider and is amazing.
Although I find some issues.
The slider skips some images when sliding, more specifically 1 image on each autoslide.
Also, there are some memory leaks.
P.S. I'm using the slider inside a Fragment.
با سلام
مهندس یه زحمت بکش این امکان رو هم بزار که بشه به جای اینکه از نت یا عکس داخل برنامه استفاده کنه بشه از داخل رم گوشی هم عکس رو نمایش داد. یا عکس های موجود در مسیر پوشه برنامه
Caching doesnt seem to work for me. The images always loaded from the url server. If data offline no images shown even if images i visit previously. Also if i visit the same fragment instant no images shown also. App is a city guide. Places activity loaded with places fragment. Slider in fragment.
BannerSlider bannerSlider = (BannerSlider) mRootView.findViewById(R.id.banner_slider1);
banners.add(new RemoteBanner("" + mPoi.getImageExtras(2) + ""));
banners.add(new RemoteBanner("" + mPoi.getImageExtras(3) + ""));
banners.add(new RemoteBanner("" + mPoi.getImageExtras(4) + ""));
bannerSlider.setBanners(banners);
Hi there nice library but I encounter this problem. When I add app:hideIndicators="true" to the view or use if I use bannerSlider.setHideIndicators(true); the app crashes.
java.lang.NullPointerException at ss.com.bannerslider.views.BannerSlider.setBanners(BannerSlider.java:188) at ss.com.bannerslider.views.BannerSlider.renderRemainingBanners(BannerSlider.java:207) at ss.com.bannerslider.views.BannerSlider.access$1100(BannerSlider.java:37) at ss.com.bannerslider.views.BannerSlider$1.run(BannerSlider.java:147) at android.os.Handler.handleCallback(Handler.java:730) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5103) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStart.main(Native Method)
we can show dynamics image from web service?
Attempt to invoke virtual method 'void ss.com.bannerslider.views.SlideIndicatorsGroup.removeAllViews()'
I need to add a custom slide with custom layout and add them to the slider but I don't know how to customize the Banner to add any layout to it. Please add a demo or help to make it easier to add custom layout to slider
Hello there, I have made a small customization in your BannerSlider class adding the functionality to notify that the slide has been changed. Since I cannot create a branch and a pull request, I'm sending you the file, in case you're interested in adding it to master
hi everyone
i wanna create on click for banner to open activity, is it possible?
Is it possible to add disabling of auto slide?
How i can add Vidoe to slider ? İt is possible ?
بی زحمت یه بررسی بکنید این
emptyView
درست کار میکنه یا نه . چون قاعدتا باید وقتی اسلاید هنوز تصویرش دانلود نشده این ویو نشون داده بشه دیگه ؟ ولی مثل این که الان اینطوری نیست
یه مورد دیگه هم اگه تصاویر کش بشه خیلی عالی میشه.
Any possibility of moving the indicator under the banner?
Hello i detect this issue
Attempt to invoke virtual method 'void ss.com.bannerslider.views.BannerSlider.setBanners(java.util.List)' on a null object reference
thanks for your good library
but i have problem with that
when activity lunched write parseCustomAttributes error in log cat !!!
i load local drawable
how can i used picasso library in banner slider
Show images from the internel storage location in Banner Slide
how to clear or update image slider ?
Hi is there a option in which we can set the image sizes as fitxy ,fit center etc.My slider is just 150 dp height.Due to this i cant set my images fit inside the available space.
If you want to use setInterval() directly in Activity's code, setupTimer() in BannerSlider works twice.
When you use setInterval(), setupTimer() works at first time. And It checks for "is timer object created once" if so, then the timer to be stopped and created new one.
Besides, when BannerSlider is created for the first time, parseCustomAttributes() works. Also setup() in parseCustomAttributes() works. As a result setupTimer() in setup() works as well. So timer created one more time without check.
You can resolved easily this problem. Just move, the check for "is timer object created once", from "onIntervalChange()" to "setupTimer()"
Hi, In an activity does not fail the application, But in a fragment with the same image it fails.
I leave my code.
public class FragmentTabsMenuTienda extends Fragment {
View rootView;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.fragment_inicio_main_tips, container, false);
return rootView;
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setRetainInstance(false);
BannerSlider bannerSlider = (BannerSlider)rootView.findViewById(R.id.banner_slider1);
//bannerSlider.addBanner(new RemoteBanner("http://mt5.tuvotacion.com:81/imagenes_unicas/cual-perrito-es-mas-tierno-450089.jpg"));
//bannerSlider.addBanner(new DrawableBanner(R.drawable.fondo1));
bannerSlider.addBanner(new DrawableBanner(R.drawable.preview));
bannerSlider.setOnBannerClickListener(new OnBannerClickListener() {
@Override
public void onClick(int position) {
Toast.makeText(getActivity(), "Banner with position " + String.valueOf(position) + " clicked!", Toast.LENGTH_SHORT).show();
}
});
}
وقتی که اسلایدر یک دور می زند و به تصویر اول می رسد، تصویر برای لحظه ای دیده نمی شود مثل اینکه دوباره لود می شود.
چه طور می شود این مشکل را حل کرد ؟
Hi. I came across this lib and it is simply amazing.
One thing though. Wanted to use it on a fragment instead.
Please help.
Thanks!!
How can i setup placeholder and getErrorDrawable on image loading? It looks like these are always set to null during picasso image loading.
First of all great slider library..
i m sliding manually when we reach last index, it should be slide to first index, is it possible...?
My code:
`...
Slider.setBanners(banners);
Slider.setCurrentSlide(2);
...`
but always slide 0 is active
I am receiving following error:
java.lang.RuntimeException: Host activity must extend AppCompatActivity
i'm sure my activity extends AppCompatActivity.
Hello saeedsh92,
Thanks for awesome library,
I use this library in my android app for banner. but i have an issue regarding image size.
The size of images are different and they cropped from bottom. please help me to solve this problem.
how do i set these images like fitCenter, centerCrop, fitXY etc.
Thanks in advance.
Please update all depends in your library
I have called webservice and get the list of images and contents and setting into banner.but first time for first slide and second slide positions gives 0.....Can anyone answer for this...but sample code works when not using arraylist
Is there any chance to make any modifications to texts on Banners.
12-11 12:12:19.101 21312-21312/? E/BannerSlider: parseCustomAttributes:
//this is log error
i have 2 recyclerview, i was test with delay 5 second
if i set recyclerview -> bannerSlider missing with no fatal error issue
Just setting up a banner-slider with a few ImageViews loaded with Picasso and I get:
Relevant exception trace:
Fatal Exception: java.lang.ClassCastException
android.widget.ImageView cannot be cast to android.view.ViewGroup
Raw Text
android.support.v4.app.FragmentTransition.configureTransitionsUnoptimized (FragmentTransition.java:284)
android.support.v4.view.ViewPager.onMeasure (ViewPager.java:1642)
ss.com.bannerslider.views.CustomViewPager.onMeasure (CustomViewPager.java:33)
Any clues?
Full Stacktrace
Fatal Exception: java.lang.ClassCastException: android.widget.ImageView cannot be cast to android.view.ViewGroup
at android.support.v4.app.FragmentTransition.configureTransitionsUnoptimized(FragmentTransition.java:284)
at android.support.v4.app.FragmentTransition.startTransitions(FragmentTransition.java:113)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2143)
at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2098)
at android.support.v4.app.FragmentManagerImpl.execSingleAction(FragmentManager.java:1979)
at android.support.v4.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:626)
at android.support.v4.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:166)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1268)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1116)
at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1642)
at ss.com.bannerslider.views.CustomViewPager.onMeasure(CustomViewPager.java:33)
at android.view.View.measure(View.java:18805)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5952)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:18805)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5952)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
at android.view.View.measure(View.java:18805)
at android.support.v4.widget.NestedScrollView.measureChildWithMargins(NestedScrollView.java:1420)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.support.v4.widget.NestedScrollView.onMeasure(NestedScrollView.java:482)
at android.view.View.measure(View.java:18805)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5952)
at android.support.design.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:714)
at android.support.design.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:786)
at android.view.View.measure(View.java:18805)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5952)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:18805)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:716)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:462)
at android.view.View.measure(View.java:18805)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5952)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139)
at android.view.View.measure(View.java:18805)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5952)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
at android.view.View.measure(View.java:18805)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5952)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:18805)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5952)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
at android.view.View.measure(View.java:18805)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5952)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2643)
at android.view.View.measure(View.java:18805)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2100)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1216)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1452)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:606)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Sometimes the auto slide passes fast and slow images, you should also disable the slide if there is an interaction with the user
show parts of last and next image
it looks like:
|view 1|view 2|view 3|
------| screen |-------
when use this slider inside CollapsingToolbarLayout this error run:
Host activity must extend AppCompatActivity
java.lang.RuntimeException: **# Host activity must extend AppCompatActivity** at ss.com.bannerslider.views.BannerSlider$1.run(BannerSlider.java:117) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed with multiple errors, see logs
I am using this banner into a fragment. First it works great but when i open my sliding menu and go another fragment and come back again it shows error
java.lang.IllegalArgumentException: No view found for id 0x3 (unknown) for fragment BannerFragment{6f4a71d #12 id=0x3}
any one facing this issue??
I put several BannerSlider into a RecyclerView
When loading the activity and the moment I do not scroll, each bannerslider displays the good pictures I assigned to him.
As soon as I scroll, it's a mess. bannerslider disappear or others that contain a mixture of pictures of the existing and other bannerslider
An idea how to correct this?
When you try to get slide position when viewPager is not ready, it throws a null pointer exception. Maybe we should ask if viewPager is null before sending slide position as you do in other parts of the code.
این کتابخونه فوق العادست ممنون از زحمات شما
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.