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

Set of extensions for Kotlin that provides Discrete Math functionalities as an Kotlin extension functions.

Include:

  • Permutations
  • Combinations
  • Powerset
  • Product
  • Factorial
  • Splits number
  • Numbers divisible and non-divisible by
  • Splits of sets and numbers
  • Iterable multiplication

Rxjava2 scheduler transformer tools for RxLife.

Use Java Annotations to accelerate your web scraping with Jsoup!

Quickly customize the calendar UI. You can use EasyCalendar to quickly get the calendar style UI.

Feature

  • Custom layout for title.
  • Custom layout for date.
  • Show or hide divider for date.
  • Show or hide overflow date.
  • Listen to date's view be clicked.

Colors is a theming library for Android. It allows your app to use over 4,000 color combinations from the Material Design Palette by separately picking a primary and accent color.

Android utility library which contains usefull utility classes with simple reusable methods.

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