QiniuImageLoader


Source link: https://github.com/lingochamp/QiniuImageLoader

QiniuImageLoader

??????? ????API????????????????????????

PS: ???????????????????????API?????(?????)?

I. ??

1. ???( library):

new QiniuImageLoader(context, url)

.centerCrop() // ????

.formatWebp() // ???????webp

.sizeR(R.dimen.target_width) // ?????????????

.addOpBlur(40, 20) // ????????????(radius=40, sigma=20)

.addRotate(60) // ??????60?

.createQiniuUrl();
 // ??????url  // ????????????????????????????? new QiniuImageLoader(context, url)

.wR(R.dimen.max_width)

.createQiniuUrl();
 

2. ?? Picasso??????( utils-picasso)

?????????????????????????

??????picasso??????????????picasso

 // ?????????????????? PicassoLoader.setGlobalPlaceHolder(R.drawable.default_place_holder, R.drawable.default_avatar_place_holder);
  /**  * ??????com.squareup.picasso.Target???  * ??????Activity?????????????(?Activity#onResume??  *

??target?????Activity?????????)  */ PicassoLoader.setGlobalTargetProvider(defaultTargetProvider);
  PicassoLoader.display7Niu(imageview1, MOCK_DATA_URL)

  .target(target) // ???????????Target

  .attach();
 // ???imageview1?  PicassoLoader.display7Niu(imageview2, MOCK_DATA_URL)

  .centerCrop() // ????

  .wR(R.dimen.max_width) // ??????????????????????????

  .addOpBlur(40, 20) // ????????????(radius=40, sigma=20)

  .attach();
 // ???imageview2?  

II. ??

1.0.2???? jitpack.io repository:

allprojects {
  repositories {

  jcenter()
  maven {
 url "https://jitpack.io" 
}
  
}
 
}
 
dependencies {

// ???
compile 'com.github.lingochamp.QiniuImageLoader:library:1.0.3'
// ???: ??????picasso??????????????????
compile 'com.github.lingochamp.QiniuImageLoader:utils-picasso:1.0.3' 
}
 

III. ??????API

???????????????API???????????

????????? QiniuImageLoader?? #createQiniuUrl

?? ???????imageMogr2?????????:

  • /auto-orient
  • /thumbnail/<imageSizeGeometry>
  • /gravity/<gravityType>
  • /crop/<imageSizeAndOffsetGeometry>
  • /format/<destinationImageFormat>
  • /blur/<radius>x<sigma>
  • /rotate/<rotateDegree>

IV. ???

??????????????api????????????????????????????URL??????

??Android???????????????????????????????????????????????????????????????????????:

  1. ????????????????????????(?????????????????????????)????????????????????(picasso?fresco?glide?bala.bala.)
  2. ????OOM(565?Activity????largeHeep?nodpi??????)
  3. ?????????cache??????????????????????????base64?????????????REST?????????????????????????????????????????

???????????????????,?????????????????????????????????????????????????????????????????????????????????????????????????????????????????

???????:

  • ?????????????????????????????????
  • ?????????webp????????????????30%~70%(????)
  • ???????????????/?/??(????????????????????)??????????????????????????????????
  • ?????(????????centerCrop?fitXY?)???????????????cpu????

V. ??

1. ???

?? ??? ??
size/w/h ??????? ???????????? GL10.GL_MAX_TEXTURE_SIZE
mode FIT_XY ?????
format webp ??????,webp????png?30%~70%????????????
Op ???? ??????

2. ????

????library??

??? url ??
CenterCrop /1/w/<Width>/h/<Height> ?????????? <Width>????? <Height>???????????????????????? <Width>x<Height> ????????????????????????????????????? w?????? h?????????????????
FitXY /2/w/<Width>/h/<Height> ?????????? <Width>????? <Height>????????????????? w ?????????????????? h ???????????????
ForceOrigin /1/w/<Width>/h/<Height> ????????

3. ??????

  • webp (???)
  • jpg
  • gif
  • png
  • origin

4. ??????

  • rotate
  • blur

??????

1. library:

???? ??
w(width:int)/wR(@DimenRes) ??????
h(width:int)/hR(@DimenRes) ??????
size(size:int)/sizeR(@DimenRes) ??????
screenW(void) ???????????
halfScreenW(void) ??????????????
wTimesN2H(n:float) ??????n?
fitXY(void) ???FitXY??
centerCrop(void) ???CenterCrop??
forceOrigin(void) ????????? GL10.GL_MAX_TEXTURE_SIZE
formatJpg(void) ????jpg??
formatOrigin(void) ???????
formatPng(void) ????png??
formatWebp(void) ????webp??
addOpBlur(radius:int, sigma:int) ????????????
addOpRotate(rotateDegree:int) ??????????
attach(void) ???????ImageView????????(????????????????attachNoClear(void)

2. utils-picasso

utils-picasso??? library? libarry???????? utils-picasso?????? utils-picasso???????????

??????
 // ???????????????????? PicassoLoader.setGlobalPlaceHolder(defaultPlaceHolder:int, defaultAvatarPlaceHolder:int)  // ???????Target??? PicassoLoader.setGlobalTargetProvider(@Nullable provider:TargetProvider) 
???????
???? ??
avatar(void) ?????????????
defaultD(defaultDrawable:Drawable)/defaultD(@DrawableRes) ?????
target(target:com.squareup.picasso.Target) ??picasso?Target
transformation(transformation:com.squareup.picasso.Transformation) ??Transformation
attachWidthNoClear(void) ??Picasso???????ImageView????????????????
attachCallback(attachCallback:com.squareup.picasso.Callback) ??picasso?Callback
fetch(void) ???????

???

?wifi????????????

??????????webp?????????????????????????????? ?????????api??????jpg??????????????????? ???????????????????????(???????)


LICENSE

Copyright (c) 2015 LingoChamp Inc.  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. 

Resources

Persian calendar view for android.

Kotlin Android Library, that makes preference usage simple and fun.

If you want to add route maps feature in your apps you can use DrawRouteMaps to make you work more easier. This is lib will help you to draw route maps between two point LatLng.

Pay your attention to our new library that makes it possible to read, edit and write CSV files. If you use Android-based device, you can easily use our library for implementation of all aforementioned actions. In addition, you will be able to change rows and columns, display the picture via link, and align the required data. It will surely help you cope with your tasks faster and make your output higher. AdaptiveTableLayout library is at your disposal.

A simple scene manager for Android. CoffeeScene allows to switch the current scene of an Activity, ViewGroup and Fragment (v4 supported). This library can be usefull if you want to switch from a spinner loader to your main content or a placeholder for example.

Android fields validation library based on data binding adapters.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes