SoBitmap


Source link: https://github.com/airk000/SoBitmap

SoBitmap

SoBitmap is not an ImageLoader, it born for process single bitmap. Some conditions, we want a image displayed in some limit, such as the max size, the memory cost and its format. SoBitmap handle these all for you, then release you to concern the real important things. You can totally use SoBitmap as a black box, the only things you need care are the input configuration and the output bitmap.

Feature

  • support local file, MediaStore and network stream

  • support two config way:

    1. exact limit include max input, max output, and compress quality down step
    2. fuzzy limit that you only need set a level or just by default.
  • use okhttp as httpclient for downloading, I think we can trust it(Shall we have a choice about it?)

  • all callback heppen in UI thread, so relax about it

Usage

Include in your project

  • Gradle
repositories {

  maven {
 url "https://oss.sonatype.org/content/repositories/snapshots" 
}
 
}
  dependencies {
  compile 'com.github.airk000:sobitmap:0.1.+' 
}

Permissions

<!-- if SoBitmap need to load image from network --> <uses-permission android:name="android.permission.INTERNET" /> <!-- if your want use external storage for cache --> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Min SDK

API9 (Android2.3)

Custom display option

Exactly
Options.ExactOptionsBuilder builder = new Options.ExactOptionsBuilder();
 builder.step(10)

.format(Bitmap.CompressFormat.JPEG)

.maxOutput(200)

.maxInput(10 * 1000)

.maxSize(5000);
 Options ops = builder.build();
Fuzzy
Options.FuzzyOptionsBuilder builder = new Options.FuzzyOptionsBuilder();
 builder.maxSize(5000)

.format(Bitmap.CompressFormat.PNG)

.level(Options.QualityLevel.HIGH);
 Options ops = builder.build();
Change the default option
SoBitmap.getInstance(context).setDefaultOption(myCustomOps);

Hunting bitmap

SoBitmap.getInstance(this).hunt(uri, new Callback() {

 @Override

 public void onHunted(Bitmap bitmap, BitmapFactory.Options options) {

  imageView.setImageBitmap(bitmap);

 
}

  @Override

 public void onException(HuntException e) {

  textView.setText(e.toString());

 
}

}
);

TODO:

  • Multi thread speed up the decoding duration

License

Copyright 2016 Kevin Liu  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

Konveyor is a tiny library which intends to battle RecyclerView.Adapter Hell by introducing "Composition over inheritance" approach when dealing with RecyclerView adapters. While making your Adapter related logic testable by providing abstraction layer over its logic, it will make you forget all of the ViewType hassle all together.

Secure and efficient cryptography library for Android. (Auto fix SecureRandom bugs in API 18 and below.)

Features

  • AES-256 encryption algorithm
  • CBC/CTR mode of operations
  • Block padding with PKCS7 (only with CBC)
  • Computationally secure random salt (of cipher block size)
  • Password stretching with PBKDF2
  • Random IV generated on each encryption (16 bytes)
  • Supports MD5, SHA1, and SHA2 hash functions
  • Generate secure keys with SecureRandom or random.org
  • Asymmetric encryption with RSA
  • Auto handle large data by using hybrid asymmetric encryption
  • Supported RSA key sizes are 2048 bits and 4096 bits

This is an IntelliJ/Android Studio IDE plugin to detect the code with @Experimental and @Beta annotations and show a custom icon on the gutter when you use it.

Waterfall Toolbar is an Android version of Material Design's web component waterfall toolbar. Basically, what it does is dynamize an ordinary Toolbar, increasing and decreasing its shadow when an associated view is scrolled.

A smart switchable button, support multiple tabs.

Add clickable markers to android street view.

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