Skip to content

Latest commit

 

History

History
205 lines (128 loc) · 11 KB

day07.md

File metadata and controls

205 lines (128 loc) · 11 KB

Day7


Time : October 28th,2015 / Author : xiaomeixw

library

1.UI:

  • FAImageView --- (From skyfe79) : FAImageView is a Frame Animation ImageView for Android. [自定义帧动画View].

  • CircleImageView --- (From hdodenhof) : A circular ImageView for Android. [圆形图片].

  • RoundedImageView --- (From vinc3m1) : A fast ImageView that supports rounded corners, ovals, and circles. [各种自定义形状图片].

  • android-crop --- (From jdamcd) : Android library project for cropping images. [裁剪图片].

  • cropper --- (From edmodo) : Android widget for cropping and rotating an image. [裁剪图片].

  • SimpleCropView --- (From IsseiAoki) : A simple image cropping library for Android. [裁剪图片].

  • CropImageView --- (From cesards) : Widget allows you crop from whatever side in an ImageView. Currently Android only supports centerCrop type of cropping. [各种不同的角度中间centerCrop截取图片].

  • Masaccio --- (From Subito-it) : An Android library providing a useful widget class which automatically detects the presence of faces in the source image and crop it accordingly so to achieve the best visual result. [自动识别图片中人脸并截取出来].

2.Logic:

  • android-priority-jobqueue --- (From path & Tag is AsyncTask) : A Job Queue specifically written for Android to easily schedule jobs (tasks) that run in the background, improving UX and application stability. [后台异步线程调度,Path出品,必属精品].

      // A job to send a tweet
      public class PostTweetJob extends Job {
          public static final int PRIORITY = 1;
          private String text;
          public PostTweetJob(String text) {
              // This job requires network connectivity,
              // and should be persisted in case the application exits before job is completed.
              super(new Params(PRIORITY).requireNetwork().persist());
          }
          @Override
          public void onAdded() {
              // Job has been saved to disk.
              // This is a good place to dispatch a UI event to indicate the job will eventually run.
              // In this example, it would be good to update the UI with the newly posted tweet.
          }
          @Override
          public void onRun() throws Throwable {
              // Job logic goes here. In this example, the network call to post to Twitter is done here.
              webservice.postTweet(text);
          }
          @Override
          protected boolean shouldReRunOnThrowable(Throwable throwable) {
              // An error occurred in onRun.
              // Return value determines whether this job should retry running (true) or abort (false).
          }
          @Override
          protected void onCancel() {
              // Job has exceeded retry attempts or shouldReRunOnThrowable() has returned false.
          }
      }
    

3.Architecture:

  • mv2m --- (From fabioCollini) : Android MVVM lightweight library based on Android Data Binding. [基于google的Android Data Binding基础的MVVM架构探索].

    Model:

    A Model class contains the data used to populate the user interface using Data Binding library. It's saved automatically in Actvity/Fragment state, for this reason it must implement Parcelable interface.

    View:

    The View is an Activity or a Fragment, the user interface is managed using Android Data Binding. You need to extend ViewModelActivity or ViewModelFragment class and implement createViewModel method returning a new ViewModel object.

    ViewModel:

    The ViewModel is a subclass of ViewModel class, it is automatically saved in a retained fragment to avoid the creation of a new object on every configuration change. The ViewModel is usually the object bound to the layout using the Data Binding framework. It manages the background tasks and all the business logic of the application.

App-Demo

  • GEM --- (From Substance-Project A Organization from United States) : A music player for Android, in stunning Material Design. [带Material Design设计风格的音乐App-Demo].

    Check the Source in Github.Want to know more about the App-Demo see http://substanceproject.net

  • StickerCamera --- (From Skykai521 A Developer from China) : This is an Android application with camera,picture cropping,collage sticking and tagging. [图片裁剪图片标签App-Demo].

    Check the Source in Github.

article

  • JOE'S GREAT ADAPTER HELL ESCAPE --- (From Author sockeqwe blog http://hannesdorfmann.com) --- [Source in Github]

    Favor composition over inheritance!

    Let me tell you a story about Joe Somebody an android developer at MyLittleZoo Inc. and how he walked through the hell while trying to create reusable RecyclerView Adapters with different view types and how he finally managed to implement reusable Adapters painlessly. [Translation:组合优于继承,逃离Adapter-Type的地狱].

      public class AdapterDelegatesManager<T> {
    
          SparseArrayCompat<AdapterDelegate<T>> delegates = new SparseArrayCompat();
          
          public AdapterDelegatesManager<T> addDelegate(@NonNull AdapterDelegate<T> delegate) {
              return addDelegate(delegate, false);
          }
      
      
          public AdapterDelegatesManager<T> addDelegate(@NonNull AdapterDelegate<T> delegate,boolean allowReplacingDelegate) {
              return this;
          }
      
      
          public AdapterDelegatesManager<T> removeDelegate(@NonNull AdapterDelegate<T> delegate) {
              return this;
          }
      
      
          public AdapterDelegatesManager<T> removeDelegate(int viewType) {
              delegates.remove(viewType);
              return this;
          }
      
      
          public int getItemViewType(@NonNull T items, int position) {
              for (int i = 0; i < delegatesCount; i++) {
                  AdapterDelegate<T> delegate = delegates.valueAt(i);
                  if (delegate.isForViewType(items, position)) {
                      return delegate.getItemViewType();
                  }
              }
              
          }
      
      
          @NonNull public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
              AdapterDelegate<T> delegate = delegates.get(viewType);
              RecyclerView.ViewHolder vh = delegate.onCreateViewHolder(parent);
              return vh;
          }
      
      
          public void onBindViewHolder(@NonNull T items, int position, @NonNull RecyclerView.ViewHolder viewHolder) {
              AdapterDelegate<T> delegate = delegates.get(viewHolder.getItemViewType());
              delegate.onBindViewHolder(items, position, viewHolder);
          }
      }
    

website

  • jsonschema2pojo --- (Build By joelittlejohn) :Generates Java types from JSON Schema (or example JSON) and annotates those types for data-binding with Jackson 1.x or 2.x, Gson, etc. [自动将json转成pojo对象,简化JavaBean对象书写].