GithubHelp home page GithubHelp logo

vanwang / multipleimagepick Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bhavesh-hirpara/multipleimagepick

0.0 2.0 0.0 3.83 MB

Smart android gallery with multiple image selection action.

multipleimagepick's Introduction

Smart Gallery with Single and Multiple image pick action.

Features

  • luminous.ACTION_PICK for choosing single image.
  • luminous.ACTION_MULTIPLE_PICK for choosing multiple image.
  • Also custom Theme.

Screenshot- Screenshot- Screenshot

Usage

// For single image
Intent i = new Intent(Action.ACTION_PICK);
startActivityForResult(i, 100);

// For multiple images
Intent i = new Intent(Action.ACTION_MULTIPLE_PICK);
startActivityForResult(i, 200);

@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);

		if (requestCode == 100 && resultCode == Activity.RESULT_OK) {
			adapter.clear();

			viewSwitcher.setDisplayedChild(1);
			String single_path = data.getStringExtra("single_path");
			imageLoader.displayImage("file://" + single_path, imgSinglePick);

		} else if (requestCode == 200 && resultCode == Activity.RESULT_OK) {
			String[] all_path = data.getStringArrayExtra("all_path");

			ArrayList<CustomGallery> dataT = new ArrayList<CustomGallery>();

			for (String string : all_path) {
				CustomGallery item = new CustomGallery();
				item.sdcardPath = string;

				dataT.add(item);
			}

			viewSwitcher.setDisplayedChild(0);
			adapter.addAll(dataT);
		}
	}

In AndroidManifest.xml

 <activity android:name="CustomGalleryActivity" >
            <intent-filter>
                <action android:name="luminous.ACTION_PICK" />
                <action android:name="luminous.ACTION_MULTIPLE_PICK" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
 </activity>

multipleimagepick's People

Contributors

bhavesh-hirpara avatar

Watchers

James Cloos avatar  avatar

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.