background preloader


Facebook Twitter

Conversational UX Platform for products and services - API.AI. Shimmer for Android. About a year ago, we released Shimmer for iOS.

Shimmer for Android

Shimmer is an easy way to add a shimmering effect to any view in your app — it's useful as an unobtrusive loading indicator. Today, we are releasing a similar component for Android. The component is implemented as a layout so that you can apply the effect to arbitrarily complex views. Just nest your view inside ShimmerFrameLayout and call startShimmerAnimation() - done! As an example, you can include the following snippet in your layout XML file: <com.facebook.shimmer.ShimmerFrameLayout android:id=“@+id/shimmer_view_container” android:layout_width=“wrap_content” android:layout_height="wrap_content" shimmer:duration="5000" // Number of milliseconds to animate one ‘sweep’ > // your complex view here </com.facebook.shimmer.ShimmerFrameLayout> In your code, you can then start the animation:

GitHub - facebook/device-year-class: A library that analyzes an Android device's specifications and calculates which year the device would be considered "high end”. GitHub - facebook/network-connection-class: Listen to current network traffic in the app and categorize the quality of the network. GitHub - facebook/conceal: Conceal provides easy Android APIs for performing fast encryption and authentication of data. Writing Custom Views. DraweeHolders There will always be times when DraweeViews won’t fit your needs.

Writing Custom Views

You may need to show additional content inside the same view as your image. You might need to show multiple images inside a single view. We provide two alternative classes you can use to host your Drawee: DraweeHolder for a single image MultiDraweeHolder for multiple images DraweeHolder is a class that holds one DraweeHierarchy and the associated DraweeController. Responsibilities of custom views Android lays out View objects, and only they get notified of system events.

Handling attach/detach events Your app may leak memory if these steps are not followed. There is no point in images staying in memory when Android is no longer displaying the view - it may have scrolled off-screen, or otherwise not be drawing. All this is automatic in a DraweeView, but won’t happen in a custom view unless you handle four system events. Handling touch events Your custom onDraw You must call or the Drawee won’t appear at all. An image management library. Usage - roottools - RootTools Usage/Examples - RootTools gives Rooted developers easy access to common rooted tools... Here is an overview of what methods are provided by the RootTools library and how to use them.

Usage - roottools - RootTools Usage/Examples - RootTools gives Rooted developers easy access to common rooted tools...

Everything below is subject to change at any time, and it fact will be changing. This library is constantly evolving and becoming better. When we change things, we will try and make it as pain free for you as possible. For more information on methods available within the RootTools Library please look at this Javadoc: Including the RootTools library into your project so that you can utilize it is simple!

In Eclipse, right click your project, navigate to "Build Path", then to "configure build path" Now choose "add External Jar" Navigate to the RootTools .jar file you download and choose it. That's all there is to it! To turn debug mode on and off, simply do the following in your app: Square/otto. Retrofit/retrofit-converters at master · square/retrofit. Square/tape. Retrofit. Introduction Retrofit turns your REST API into a Java interface. public interface GitHubService { @GET("/users/{user}/repos") List<Repo> listRepos(@Path("user") String user);} The RestAdapter class generates an implementation of the GitHubService interface.


RestAdapter restAdapter = new RestAdapter.Builder() .setEndpoint(" .build(); GitHubService service = restAdapter.create(GitHubService.class); Each call on the generated GitHubService makes an HTTP request to the remote webserver. List<Repo> repos = service.listRepos("octocat"); Use annotations to describe the HTTP request: URL parameter replacement and query parameter support Object conversion to request body (e.g., JSON, protocol buffers) Multipart request body and file upload API Declaration Annotations on the interface methods and its parameters indicate how a request will be handled.

Request Method Every method must have an HTTP annotation that provides the request method and relative URL. @GET("/users/list") Butter Knife. Introduction Annotate fields with @Bind and a view ID for Butter Knife to find and automatically cast the corresponding view in your layout. class ExampleActivity extends Activity { @Bind( TextView title; @Bind( TextView subtitle; @Bind( TextView footer; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_activity); ButterKnife.bind(this); // TODO Use fields... }} Instead of slow reflection, code is generated to perform the view look-ups.

Butter Knife

Calling bind delegates to this generated code that you can see and debug. The generated code for the above example is roughly equivalent to the following: