Top Related Projects
An image loading and caching library for Android focused on smooth scrolling
A powerful image downloading and caching library for Android
Powerful and flexible library for loading, caching and displaying images on Android.
Implementation of ImageView for Android that supports zooming, by various touch gestures.
Android library (AAR). Highly configurable, easily extendable deep zoom view for displaying huge images without loss of detail. Perfect for photo galleries, maps, building plans etc.
Image Cropping Library for Android
Quick Overview
RxGalleryFinal is an Android image/video selector and editor library. It provides a customizable gallery interface with features like multi-select, cropping, and filtering, all integrated with RxJava for reactive programming.
Pros
- Comprehensive media selection and editing capabilities
- Reactive programming support through RxJava integration
- Highly customizable UI and functionality
- Supports both image and video selection
Cons
- Learning curve for developers unfamiliar with RxJava
- May be overkill for simple image selection needs
- Limited documentation in English
- Potential performance issues with large media libraries
Code Examples
- Basic image selection:
RxGalleryFinal.with(this)
.image()
.radio()
.crop()
.imageLoader(ImageLoaderType.GLIDE)
.subscribe { result ->
val path = result.originalPath
// Handle selected image
}
.openGallery()
- Multi-image selection:
RxGalleryFinal.with(this)
.image()
.multiple()
.maxSize(3)
.imageLoader(ImageLoaderType.GLIDE)
.subscribe { list ->
list.forEach { result ->
val path = result.originalPath
// Handle each selected image
}
}
.openGallery()
- Video selection:
RxGalleryFinal.with(this)
.video()
.radio()
.imageLoader(ImageLoaderType.GLIDE)
.subscribe { result ->
val path = result.originalPath
// Handle selected video
}
.openGallery()
Getting Started
- Add the dependency to your app's
build.gradle
:
dependencies {
implementation 'cn.finalteam.rxgalleryfinal:library:1.1.3'
}
- Initialize RxGalleryFinal in your Activity or Fragment:
RxGalleryFinal.with(this)
.image()
.radio()
.crop()
.imageLoader(ImageLoaderType.GLIDE)
.subscribe { result ->
val path = result.originalPath
// Handle selected image
}
.openGallery()
- Don't forget to handle permissions for accessing external storage in your app.
Competitor Comparisons
An image loading and caching library for Android focused on smooth scrolling
Pros of Glide
- Highly efficient image loading and caching library
- Supports a wide range of image formats and sources
- Extensive documentation and community support
Cons of Glide
- Larger library size compared to RxGalleryFinal
- May require more configuration for complex use cases
- Limited built-in image editing capabilities
Code Comparison
RxGalleryFinal:
RxGalleryFinal.with(this)
.image()
.radio()
.crop()
.imageLoader(ImageLoaderType.GLIDE)
.subscribe(new RxBusResultSubscriber<ImageRadioResultEvent>() {
@Override
protected void onEvent(ImageRadioResultEvent imageRadioResultEvent) throws Exception {
// Handle selected image
}
})
.openGallery();
Glide:
Glide.with(this)
.load(imageUrl)
.placeholder(R.drawable.placeholder)
.error(R.drawable.error)
.into(imageView);
RxGalleryFinal focuses on providing a complete gallery solution with image selection and editing capabilities, while Glide specializes in efficient image loading and caching. RxGalleryFinal offers more built-in features for image selection and manipulation, whereas Glide excels in performance and flexibility for image loading from various sources.
A powerful image downloading and caching library for Android
Pros of Picasso
- Widely adopted and battle-tested image loading library
- Extensive caching and memory management features
- Simple API for common image loading tasks
Cons of Picasso
- Limited to image loading and basic transformations
- Lacks built-in gallery or image selection functionality
- Requires additional libraries for more advanced image processing
Code Comparison
RxGalleryFinal (Image selection):
RxGalleryFinal.with(context)
.image()
.multiple()
.maxSize(8)
.select((list, allList) -> {
// Handle selected images
})
.openGallery();
Picasso (Image loading):
Picasso.get()
.load("https://example.com/image.jpg")
.resize(300, 300)
.centerCrop()
.into(imageView);
Summary
RxGalleryFinal is a comprehensive gallery and image selection library with built-in camera functionality, while Picasso focuses solely on efficient image loading and basic transformations. RxGalleryFinal offers more features for image selection and capture, but Picasso excels in simplicity and performance for image loading tasks. Choose RxGalleryFinal for full gallery functionality or Picasso for streamlined image loading in your Android applications.
Powerful and flexible library for loading, caching and displaying images on Android.
Pros of Android-Universal-Image-Loader
- More mature and widely adopted library with extensive documentation
- Supports a broader range of image sources, including network, local storage, and assets
- Offers more customization options for image loading and caching
Cons of Android-Universal-Image-Loader
- No longer actively maintained, with the last update in 2016
- Lacks modern features like Kotlin support and integration with newer Android architecture components
Code Comparison
Android-Universal-Image-Loader:
ImageLoader imageLoader = ImageLoader.getInstance();
imageLoader.displayImage(imageUri, imageView, options);
RxGalleryFinal:
RxGalleryFinal.with(this)
.image()
.radio()
.crop()
.imageLoader(ImageLoaderType.GLIDE)
.subscribe(new RxBusResultSubscriber<ImageRadioResultEvent>() {
@Override
protected void onEvent(ImageRadioResultEvent imageRadioResultEvent) throws Exception {
// Handle selected image
}
})
.openGallery();
RxGalleryFinal focuses on providing a complete gallery solution with image selection and editing capabilities, while Android-Universal-Image-Loader is primarily an image loading and caching library. RxGalleryFinal offers a more modern approach with RxJava integration and built-in UI components, whereas Android-Universal-Image-Loader provides lower-level control over image loading and caching processes.
Implementation of ImageView for Android that supports zooming, by various touch gestures.
Pros of PhotoView
- Focused specifically on image viewing and zooming functionality
- Lightweight and easy to integrate into existing projects
- Supports gestures like pinch-to-zoom and double-tap zoom
Cons of PhotoView
- Limited to image viewing, lacks gallery management features
- No built-in image loading or caching mechanisms
- Less actively maintained compared to RxGalleryFinal
Code Comparison
PhotoView implementation:
PhotoView photoView = findViewById(R.id.photo_view);
photoView.setImageResource(R.drawable.image);
RxGalleryFinal implementation:
RxGalleryFinal.with(this)
.image()
.radio()
.crop()
.imageLoader(ImageLoaderType.GLIDE)
.subscribe(new RxBusResultSubscriber<ImageRadioResultEvent>() {
@Override
protected void onEvent(ImageRadioResultEvent imageRadioResultEvent) throws Exception {
// Handle selected image
}
})
.openGallery();
PhotoView is more straightforward for simple image viewing, while RxGalleryFinal offers a more comprehensive solution for image selection and manipulation. PhotoView is ideal for projects that only need zooming capabilities, whereas RxGalleryFinal is better suited for applications requiring full gallery functionality with additional features like image cropping and filtering.
Android library (AAR). Highly configurable, easily extendable deep zoom view for displaying huge images without loss of detail. Perfect for photo galleries, maps, building plans etc.
Pros of subsampling-scale-image-view
- Specialized for handling large images efficiently
- Supports zooming and panning with smooth animations
- Lightweight and focused on a single functionality
Cons of subsampling-scale-image-view
- Limited to image viewing, lacks gallery management features
- No built-in image selection or editing capabilities
- Requires additional implementation for multi-image handling
Code Comparison
subsampling-scale-image-view:
SubsamplingScaleImageView imageView = new SubsamplingScaleImageView(context);
imageView.setImage(ImageSource.uri("/sdcard/full-image.jpg"));
imageView.setMaxScale(10f);
RxGalleryFinal:
RxGalleryFinal.with(context)
.image()
.multiple()
.maxSize(8)
.imageLoader(ImageLoaderType.GLIDE)
.subscribe(new RxBusResultSubscriber<ImageMultipleResultEvent>() {
@Override
protected void onEvent(ImageMultipleResultEvent event) {
// Handle selected images
}
})
.openGallery();
subsampling-scale-image-view focuses on displaying and manipulating single large images with high performance, while RxGalleryFinal provides a complete gallery solution with image selection, preview, and integration with various image loading libraries. The code comparison shows the simplicity of setting up subsampling-scale-image-view for viewing a single image, contrasted with RxGalleryFinal's more comprehensive approach to gallery management and image selection.
Image Cropping Library for Android
Pros of uCrop
- Focused specifically on image cropping with advanced features
- Highly customizable UI and crop options
- Smooth animations and gestures for intuitive user experience
Cons of uCrop
- Limited to cropping functionality only
- Requires integration with other libraries for full gallery management
- May have a steeper learning curve for basic implementations
Code Comparison
uCrop:
UCrop.of(sourceUri, destinationUri)
.withAspectRatio(16, 9)
.withMaxResultSize(maxWidth, maxHeight)
.start(this);
RxGalleryFinal:
RxGalleryFinal.with(this)
.image()
.crop()
.multiple()
.maxSize(9)
.imageLoader(ImageLoaderType.GLIDE)
.subscribe(new RxBusResultSubscriber<ImageMultipleResultEvent>() {
// Handle results
})
.openGallery();
Summary
uCrop excels in providing a dedicated, feature-rich image cropping solution with high customizability. However, it's limited to cropping functionality. RxGalleryFinal offers a more comprehensive gallery management solution with built-in cropping capabilities, making it suitable for projects requiring full image selection and editing features. The choice between the two depends on the specific requirements of your project and whether you need a standalone cropping tool or a full-featured gallery solution.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
RxGalleryFinal
åè½æè¿°ï¼JDK1.8ï¼
RxGalleryFinalæ¯ä¸ä¸ªandroidå¾ç/è§é¢æ件éæ©å¨ãå ¶æ¯æå¤éãåéãææåè£åªï¼ä¸»é¢å¯èªå®ä¹ï¼æ 强å¶ç»å®ç¬¬ä¸æ¹å¾çå è½½å¨ã
çæ¬æè¿°
å¾ å®å
1.è§é¢éæ©å¨çåè°
2.å¡é¡¿é®é¢ï¼å¯å¨ Issues éæç´¢ï¼ #130 ãç²¾ãè§å¾å¡é¡¿çç¹æ
gradle
New : compile 'cn.finalteam.rxgalleryfinal:library:1.1.3' -> ç´§æ¥ä¿®å¤bug .
(Fix #191, add video)
åèï¼History Version
1.1.2 ç¹æ§
- ä¿®å¤ç¸å ³bug
- Fix #175 #178
1.1.1 ç¹æ§
- ä¿®å¤ç¸å ³bug
- #170,#165 ,#167 and fix Image No such file or directory
- æ´æ°Sample代ç
1.0.9 ç¹æ§
- ä¿®å¤ç¸å ³bug - #160
- å¢å UCROPç设置
- æ´æ°Sample代ç
- RxJavaå级
使ç¨
ä¸è½½ææ·»å ä¾èµ
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.exifinterface:exifinterface:1.1.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'io.reactivex.rxjava2:rxjava:2.2.15'
implementation 'com.github.yalantis:ucrop:2.2.4'
//æ¯æ以ä¸ä¸»æµå¾çå è½½å¨ï¼å¼åè
èªè¡éæ©
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.facebook.fresco:fresco:2.0.0'
implementation 'com.facebook.fresco:animated-gif:2.0.0'
implementation 'com.github.bumptech.glide:glide:4.10.0'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
é ç½®manifest
æªå¾ï¼
-
æä¾äºç¸å ³çApi
-
请æ¥çMainActivityç示ä¾ä»£ç æ¥ç Sample 代ç
//èªå®ä¹æ¹æ³çä½¿ç¨ onClickZDListener(); //è°ç¨å¾çéæ©å¨Api onClickSelImgListener(); //è°ç¨è§é¢éæ©å¨Api onClickSelVDListener(); //è°ç¨è£åªApi onClickImgCropListener(); //æå¨æå¼æ¥å¿ã ModelUtils.setDebugModel(true);
-
è¿éå¯ä»¥é 置主é¢
Theme
é
ç½®Theme请æ¥çsampleä¸ç xml-> TestTheme..
-
Code
//èªå®ä¹æ¹æ³çåé RxGalleryFinal .with(context) .image() .radio() .crop() .imageLoader(ImageLoaderType.GLIDE) .subscribe(new RxBusResultSubscriber<ImageRadioResultEvent>() { @Override protected void onEvent(ImageRadioResultEvent imageRadioResultEvent) throws Exception { //å¾çéæ©ç»æ ..... } }) .openGallery();
//èªå®ä¹æ¹æ³çå¤é
RxGalleryFinal.with(MainActivity.this)
.image()
.multiple()
.maxSize(8)
.imageLoader(ImageLoaderType.UNIVERSAL)
.subscribe(new RxBusResultSubscriber<ImageMultipleResultEvent>() {
@Override
protected void onEvent(ImageMultipleResultEvent imageMultipleResultEvent) throws Exception {
toast("å·²éæ©" + imageMultipleResultEvent.getResult().size() + "å¼ å¾ç");
}
@Override
public void onCompleted() {
super.onCompleted();
Toast.makeText(getBaseContext(), "OVER", Toast.LENGTH_SHORT).show();
}
}).openGallery();
//å¾å°å¾çå¤éçäºä»¶
RxGalleryListener.getInstance().setMultiImageCheckedListener(new IMultiImageCheckedListener() {
@Override
public void selectedImg(Object t, boolean isChecked) {
//è¿ä¸ªä¸»è¦ç¹å»æè
æå°å°±ä¼è§¦åï¼æ以ä¸å»ºè®®å¨è¿éè¿è¡Toast
}
@Override
public void selectedImgMax(Object t, boolean isChecked, int maxSize) {
toast("ä½ æå¤åªè½éæ©" + maxSize + "å¼ å¾ç");
}
});
//æ³¨è§£è¯ é
RxGalleryFinal.with(context)
.image()//å¾ç
.radio()//åé
.crop()//è£åª
.video()//è§é¢
.imageLoader(ImageLoaderType.GLIDE)
//éé¢å¯ä»¥éæ©ä¸»æµå¾çå·¥å
· PICASSO GLIDE FRESCO UNIVERSAL(ImageLoader)
.subscribe(rxBusResultSubscriber)
.openGallery();
//è°ç¨è£åª.RxGalleryFinalApi.getModelPath()为é»è®¤çè¾åºè·¯å¾
RxGalleryFinalApi.cropScannerForResult(MainActivity.this, RxGalleryFinalApi.getModelPath(), inputImg);
//è·åå设置 ä¿åè·¯å¾
RxGalleryFinalApi.getImgSaveRxCropDirByFile();//å¾å°è£åªè·¯å¾
RxGalleryFinalApi.getImgSaveRxCropDirByStr();//å¾å°è£åªè·¯å¾
RxGalleryFinalApi.getImgSaveRxDirByFile();//å¾å°å¾çè·¯å¾
RxGalleryFinalApi.getImgSaveRxCropDirByStr();//å¾å°å¾çè·¯å¾
//è·åå设置 ä¿åè·¯å¾
//â¦â¦ setImgSaveXXXXX().
//å¾çèªå¨ä¼åå¨å°ä¸é¢ï¼è£åªä¼èªå¨çæè·¯å¾ï¼ä¹å¯ä»¥æå¨è®¾ç½®è£åªçè·¯å¾ï¼
RxGalleryFinalApi.setImgSaveRxSDCard("dujinyang");
//èªå®ä¹è£åª
rx.cropAspectRatioOptions(0, new AspectRatio("3:3",30, 10))
.crop()
.openGallery();
//4.æ¼ç¤º åéè£åª 并ä¸å¢å åæ ï¼è£åªå¿
é¡»å¨openä¹åï¼
RxGalleryFinalApi.getInstance(this)
.onCrop(true)//æ¯å¦è£åª
.openGalleryRadioImgDefault(new RxBusResultSubscriber() {
@Override
protected void onEvent(Object o) throws Exception {
Logger.i("åªè¦éæ©å¾çå°±ä¼è§¦å");
}
})
.onCropImageResult(new IRadioImageCheckedListener() {
@Override
public void cropAfter(Object t) {
Logger.i("è£åªå®æ");
}
@Override
public boolean isActivityFinish() {
Logger.i("è¿åfalseä¸å
³éï¼è¿åtrueå为å
³é");
return true;
}
});
-
æ·»å æé
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
-
注åactivity
<application ... android:theme="@style/Theme_Light"> <activity android:name="cn.finalteam.rxgalleryfinal.ui.activity.MediaActivity" android:screenOrientation="portrait" android:exported="true" android:theme="@style/Theme_Light.Default"/> <activity android:name="com.yalantis.ucrop.UCropActivity" android:screenOrientation="portrait" android:theme="@style/Theme_Light.Default"/> </application
æ··æ·é ç½®
#1.support-v7-appcompat
-keep public class android.support.v7.widget.** { *; }
-keep public class android.support.v7.internal.widget.** { *; }
-keep public class android.support.v7.internal.view.menu.** { *; }
-keep public class * extends android.support.v4.view.ActionProvider {
public <init>(android.content.Context);
}
#2.rx
-dontwarn io.reactivex.**
-keep io.reactivex.**
-keepclassmembers class io.reactivex.** { *; }
#3.retrolambda
-dontwarn java.lang.invoke.*
#4.support-v4
-keep class android.support.v4.** { *; }
-keep interface android.support.v4.** { *; }
#5.ucrop
-dontwarn com.yalantis.ucrop**
-keep class com.yalantis.ucrop** { *; }
-keep interface com.yalantis.ucrop** { *; }
#6.photoview
-keep class uk.co.senab.photoview** { *; }
-keep interface uk.co.senab.photoview** { *; }
#7.rxgalleryfinal
-keep class cn.finalteam.rxgalleryfinal.ui.widget** { *; }
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keepclassmembers class **.R$* {
public static <fields>;
}
-keepattributes *Annotation*
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclassmembers public class * extends android.view.View {
void set*(***);
*** get*();
}
Q&A
- 1ãåºç°å¾çåç«é®é¢ï¼å¦ä½è§£å³
- 2ãå¦ä½å缩å¾ç
- 3ãAndroid 7.0éªé
- 4ãææ说æ
èç³»
å¦ææç´§æ¥äºä»¶å¯èç³»ä½è
æå Q群ï¼
- Q群å·ï¼ 218801658
- Q群å·ï¼ 246231638
Wiki
æå
´è¶£çå¯ä»¥å
³æ³¨ãPython2048ã å
¬ä¼å·
å享ææ¯ãç°è²äº§ä¸ãèä¸è§åãèµé±ä¹éãéåç ´è§£ç趣äºâ¦â¦
Top Related Projects
An image loading and caching library for Android focused on smooth scrolling
A powerful image downloading and caching library for Android
Powerful and flexible library for loading, caching and displaying images on Android.
Implementation of ImageView for Android that supports zooming, by various touch gestures.
Android library (AAR). Highly configurable, easily extendable deep zoom view for displaying huge images without loss of detail. Perfect for photo galleries, maps, building plans etc.
Image Cropping Library for Android
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot