Day12
Time : November 2th,2015 / Author : xiaomeixw
library
1.UI:
TabbedCoordinatorLayout --- (From vitovalov) : TabbedCoordinatorLayout is a Sample project demostrating the usage of TabLayout (ViewPager with Tabs) inside of CollapsingToolbarLayout all together in CoordinatorLayout. [基于Android Design Support Library兼容控件实现视差Tab效果].
BlurZoomGallery --- (From fafaldo) : Extended CoordinatorLayout, that helps creating background galleries. [继承自 CoordinatorLayout,实现背景缩放与模糊效果].
Lab-Android-DesignLibrary --- (From nuuneoi) : A full tutorial on how to use Android Design Support Library. (60 mins). [基于Android Design Support Library兼容控件实现的Simple].
LargeImage --- (From LuckyJayce) : Loading big Image,Maximum support 10000ps x 10000ps. [Android 加载大图 可以高清显示10000*10000像素的图片].
2.Logic:
enroscar-async --- (From stanfy & Tag is AsyncTask) : Makes it easy to put your asynchronous operations behind Android's Loader. [使用注解异步线程调度].
//1.Describe an asynchronous operation. class Foo { @Load Async<String> loadGreeting(final String name) { return Tools.async(new Callable<String>() { public String call() { try { Thread.sleep(1000); } catch (InterruptedException ignored) { } return "Hello " + name; } }); } } //2.Use it // this an object that provides operations Foo foo = new Foo(); // prepare the operator // FooOperator is a generated class FooOperator operator = FooOperator.build() .withinActivity(activity) .operations(foo) .get(); // subscribing operator.when().loadGreetingIsFinished() .doOnResult(new Action<String>() { @Override public void act(final String greeting) { Log.i("Async", "Greeting loaded: " + greeting); } }); // starting operator.loadGreeting(); // cancelling operator.cancelLoadGreeting();
feather --- (From zsoltherpai & Tag is Annotation):Lightweight dependency injection for Java and Android (JSR-330). [Java和android轻量级的依赖注入].
public class A { @Inject public A(B b) { // ... } } public class B { @Inject public B(C c, D d) { // ... } } public class C {} @Singleton public class D { // something expensive or other reasons for being singleton }
secure-preferences --- (From scottyab & Tag is Encryption): Android Shared preference wrapper than encrypts the values of Shared Preferences. It's not bullet proof security but rather a quick win for incrementally making your android app more secure. [给Shared Preferences存储的数据进行AES的加密].
SecurePreferences securePrefs = new SecurePreferences(context, "userpassword","my_user_prefs.xml"); securePrefs.handlePasswordChange("newPassword", context);
java-aes-crypto --- (From tozny & Tag is Encryption):A simple Android class for encrypting & decrypting strings, aiming to avoid the classic mistakes that most such classes suffer from. [使用AES加解密].
//1.Generate new key AesCbcWithIntegrity.SecretKeys keys = AesCbcWithIntegrity.generateKey(); //2.Encrypt AesCbcWithIntegrity.CipherTextIvMac cipherTextIvMac = AesCbcWithIntegrity.encrypt("some test", keys); //store or send to server String ciphertextString = cipherTextIvMac.toString(); //3.Decrypt String plainText = AesCbcWithIntegrity.decryptString(cipherTextIvMac, keys);
AESCrypt-Android --- (From scottyab & Tag is Encryption):Simple API to perform AES encryption on Android. This is the Android counterpart to the AESCrypt library Ruby and Obj-C (with the same defaults) created by Gurpartap Singh. [使用AES加解密].
//Encrypt String password = "password"; String message = "hello world"; try { String encryptedMsg = AESCrypt.encrypt(password, message); }catch (GeneralSecurityException e){ //handle error } //Decrypt String password = "password"; String encryptedMsg = "2B22cS3UC5s35WBihLBo8w=="; try { String messageAfterDecrypt = AESCrypt.decrypt(password, encryptedMsg); }catch (GeneralSecurityException e){ //handle error - could be due to incorrect password or tampered encryptedMsg }
3.Architecture:
powermock --- (From jayway) : PowerMock is a Java framework that allows you to unit test code normally regarded as untestable. [超强的测试框架].
![](https://img.shields.io/badge/The%20Day12-End%20!-ED1C24.svg?style=flat)