This is an Image slider with swipes, Here we used Volley to Image load URL's from JSON! Here we make it very easy way to load images from Internet and We customized the description font style(OpenSans).

Overview

ImageSliderWithSwipes

This is an Image slider with swipes, Here we used Volley to load URL's from JSON! Here we make it very easy way to load images from Internet and We customized the description font(OpenSans).

First of all thanks to AndroidImageSlider, Here You can easily load images from an internet URL, drawable, or file. And there are many kinds of amazing animations you can choose. Happy Coding!

Get it on Google Play

Kindly use the following links to use this library:

In build.gradle (Project)

allprojects {
  repositories {
			...
		maven { url "https://jitpack.io" }
	}
}

And then in the other gradle file(may be your app gradle or your own module library gradle, but never add in both of them to avoid conflict.)

dependencies {
	implementation 'com.github.myinnos:ImageSliderWithSwipes:1.0.2'
}

Example

ImageSliderWithSwipes

Create Android Project (set name ImageSliderWithSwipes)
Add permissions to AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Add dependencies for Loading Images from URL's(Here we used Volley)
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:25.1.0'
    implementation 'com.github.myinnos:ImageSliderWithSwipes:1.0.1'
    implementation 'com.mcxiaoke.volley:library:1.0.+'
}
Copy this code in to activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:custom="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <in.myinnos.imagesliderwithswipeslibrary.SliderLayout
        android:id="@+id/slider"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        custom:auto_cycle="true"
        custom:indicator_visibility="visible"
        custom:pager_animation="Stack"
        custom:pager_animation_span="1100" />

</RelativeLayout>
Copy this code in to MainActivity.java
public class MainActivity extends AppCompatActivity implements BaseSliderView.OnSliderClickListener {

    private SliderLayout mDemoSlider;

    // Billionaires json url
    private static final String getURL = "http://api.androidhive.info/json/movies.json";
    HashMap<String, String> url_maps;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mDemoSlider = (SliderLayout) findViewById(R.id.slider);

        // Creating volley request obj
        JsonArrayRequest billionaireReq = new JsonArrayRequest(getURL,
                new Response.Listener<JSONArray>() {
                    @Override
                    public void onResponse(JSONArray response) {
                        url_maps = new HashMap<String, String>();
                        // Parsing json
                        for (int i = 0; i < response.length(); i++) {
                            try {

                                JSONObject obj = response.getJSONObject(i);
                                url_maps.put(obj.getString("title") + " - " + obj.getString("releaseYear"), obj.getString("image"));

                            } catch (JSONException e) {
                                e.printStackTrace();
                            }
                        }

                        for (String name : url_maps.keySet()) {
                            TextSliderView textSliderView = new TextSliderView(MainActivity.this);
                            // initialize a SliderLayout
                            textSliderView
                                    .description(name)
				    .descriptionSize(20)
                                    .image(url_maps.get(name))
                                    .setScaleType(BaseSliderView.ScaleType.CenterCrop)
                                    .setOnSliderClickListener(MainActivity.this);

                            //add your extra information
                            textSliderView.bundle(new Bundle());
                            textSliderView.getBundle().putString("extra", name);

                            mDemoSlider.addSlider(textSliderView);
                        }
                    }
                }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                Toast.makeText(getApplicationContext(), "network issue: please enable wifi/mobile data", Toast.LENGTH_SHORT).show();
            }
        });

        // Adding request to request queue
        AppController.getInstance().addToRequestQueue(billionaireReq);

        mDemoSlider.setPresetTransformer(SliderLayout.Transformer.Stack);
        mDemoSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Top);
        mDemoSlider.setCustomAnimation(new DescriptionAnimation());
        mDemoSlider.setDuration(4000);

        mDemoSlider.setPresetTransformer("Stack");

    }

    @Override
    protected void onStop() {
        // To prevent a memory leak on rotation, make sure to call stopAutoCycle() on the slider before activity or fragment is destroyed
        mDemoSlider.stopAutoCycle();
        super.onStop();
    }

    @Override
    public void onSliderClick(BaseSliderView slider) {
        Toast.makeText(this, slider.getBundle().get("extra") + "", Toast.LENGTH_SHORT).show();
    }

}

Apps using ImageSliderWithSwipes

If you are using ImageSliderWithSwipes in your app and would like to be listed here, please let us know by opening a new issue!

Thanks

Contact

Prabhakar Thota

Flattr this git repo

License

Copyright 2017 MyInnos

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Release build aar contains 'hannibal.jpg'

    Release build aar contains 'hannibal.jpg'

    https://jitpack.io/com/github/myinnos/ImageSliderWithSwipes/1.0.1/ImageSliderWithSwipes-1.0.1.aar

    contains a 129kb file 'res/drawable/hannibal.jpg' which shouldn't be in a release build of the library.

    opened by molexx 2
  • Hw to use from inside Fragment?

    Hw to use from inside Fragment?

    I try on fragment more dont work.

    `public class Photo extends Fragment implements BaseSliderView.OnSliderClickListener {

    private SliderLayout mDemoSlider;
    

    .....`

    U can help me. ;) Thanks for amazing lib

    question 
    opened by Jsaiao 2
  • Description is fixed size

    Description is fixed size

    Amazing library ! but it will be more amazing if description's could be controlled to make it bigger or smaller specially on tablets it's look too small

    enhancement 
    opened by manafalsarraf 2
  • AppController

    AppController

    what is this AppController actually. I am getting an error "can't resolve symbol 'AppController' " Please explain this ASAP. Thanks for support.

    question 
    opened by raqib850 1
  • [ImgBot] optimizes images

    [ImgBot] optimizes images

    Beep boop. Your images are optimized!

    Your image file size has been reduced by 6% 🎉

    Details

    | File | Before | After | Percent reduction | |:--|:--|:--|:--| | /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png | 10.24kb | 9.45kb | 7.73% | | /app/src/main/res/mipmap-xxhdpi/ic_launcher.png | 7.54kb | 7.04kb | 6.66% | | /app/src/main/res/mipmap-xhdpi/ic_launcher.png | 4.73kb | 4.46kb | 5.76% | | /app/src/main/res/mipmap-hdpi/ic_launcher.png | 3.34kb | 3.24kb | 2.90% | | /app/src/main/res/mipmap-mdpi/ic_launcher.png | 2.15kb | 2.10kb | 2.40% | | | | | | | Total : | 28.00kb | 26.28kb | 6.12% |


    📝docs | :octocat: repo | 🙋issues | 🏅swag | 🏪marketplace

    opened by imgbot[bot] 0
  • Incorrect Image Oientation

    Incorrect Image Oientation

    I have a portrait image coming from URL and it appears rotated by 90 degree on the slider.. How to fix this any idea? Image width: 3024 - image Height: 4032

    enhancement 
    opened by emmessess 0
  • How to use in Fragment

    How to use in Fragment

    This library is amazing. I want to use in fragment. But I can't handle. I searched in google, but I can't found. Please help me how to use in fragment.

    question 
    opened by DpakOjha 1
Releases(1.0.3)
Owner
Prabhakar Thota
Mobile Engineer[AIML], UI/UX. I believe in the quote which says "Creativity is thinking up new things. Innovation is doing new things." Happy Coding :)
Prabhakar Thota
Android library project for cropping images

I guess people are just cropping out all the sadness An Android library project that provides a simple image cropping Activity, based on code from AOS

Jamie McDonald 4.5k Jan 7, 2023
Custom view for circular images in Android while maintaining the best draw performance

CircularImageView Custom view for circular images in Android while maintaining the best draw performance Usage To make a circular ImageView, add this

Pkmmte Xeleon 1.2k Dec 28, 2022
Polygon shaped images

ShapeShifter Provides Polygon shaped imageView Screenshot Usage Step 1. Add the JitPack repository to your build file allprojects { repositori

Dushyant Mainwal 24 Oct 20, 2020
Note saver app which can save images as well with customization.

Note-With-Images-App Note saver app which can save images as well with customization. Demo final.demo.mp4 What i used? Kotlin Paging 3 library flow li

agam koradiya 9 Oct 31, 2022
PixaPay - Images Search client

PixaPay - Images Search client Getting started Signup or Login into Pixabay for getting API_KEY Add APY_KEY="Your_Key_Here" and BASE_URL="https://pixa

Mohamed Ibrahim 6 Nov 6, 2022
OpenGLES - an embedded version of the OpenGL cross-platform API which is used to render 2D/3D texture

OpenGLES is an embedded version of the OpenGL cross-platform API which is used to render 2D/3D texture. This sample code contains the implementation of shape rendering using OpenGLES.

MindInventory 5 Sep 20, 2022
Library to save image locally and shows options to open and share !

Image Save and Share Library to save image locally and shows options to open and share ! Download Demo APK from HERE Kindly use the following links to

Prabhakar Thota 27 Apr 18, 2022
Add curve at bottom of image views and relative layouts.

Crescento Android library that adds a curve at the below of image views and relative layouts. CrescentoImageView and CrescentoContainer are the image

Shivam Satija 1.3k Nov 18, 2022
Android widget for cropping and rotating an image.

Cropper The Cropper is an image cropping tool. It provides a way to set an image in XML and programmatically, and displays a resizable crop window on

Edmodo 2.9k Nov 14, 2022
Customizable Android full screen image viewer for Fresco library supporting "pinch to zoom" and "swipe to dismiss" gestures. Made by Stfalcon

This project is no longer supported. If you're able to switch from Fresco to any other library that works with the Android's ImageView, please migrate

Stfalcon LLC 1.8k Dec 19, 2022
Add curve at bottom of image views and relative layouts.

Crescento Android library that adds a curve at the below of image views and relative layouts. CrescentoImageView and CrescentoContainer are the image

Shivam Satija 1.3k Mar 24, 2021
Dali is an image blur library for Android. It contains several modules for static blurring, live blurring and animations.

Dali Dali is an image blur library for Android. It is easy to use, fast and extensible. Dali contains several modules for either static blurring, live

Patrick Favre-Bulle 1k Dec 1, 2022
Auto Scrolling Image Pager with Pager Indicator and Text

AutoImageFlipper Auto Scrolling Image Pager with Pager Indicator and Text Note: It works only on Apps which are using AndroidX dependencies, if you're

Shahbaz Hussain 105 Nov 10, 2022
An Android project containing image recognition and object detection models.

An Android project containing image recognition and object detection models. Users can input images into the deep learning model by taking photos, opening photo albums, and real-time previews on the Android side. After the calculation on the Android side is completed, the model will output the prediction result and show it to the user.

null 7 Nov 27, 2022
An Android transformation library providing a variety of image transformations for Coil, Glide, Picasso, and Fresco.

An Android transformation library providing a variety of image transformations for Coil, Glide, Picasso, and Fresco.

Daichi Furiya 257 Jan 2, 2023
Pixel Boom is a Java-based Android software, featuring image super-resolution and colorization

Pixel Boom is a Java-based Android software, featuring image super-resolution and colorization.

Zaitian 1 Jul 3, 2022
some android image filters

android-image-filter some android image filters in some filter, I use NDK to implement to make it more efficient Setup Install Android NDK and properl

RagnarokStack 643 Dec 27, 2022
An android image compression library.

Compressor Compressor is a lightweight and powerful android image compression library. Compressor will allow you to compress large photos into smaller

Zetra 6.7k Dec 31, 2022
A simple image cropping library for Android.

SimpleCropView The SimpleCropView is an image cropping library for Android. It simplifies your code for cropping image and provides an easily customiz

Issei Aoki 2.5k Dec 28, 2022