- Two of the most useful shortcuts utilize the Fn (function) keys. It is therefore recommended that you enable the "Use all F1, F2, etc. keys as standard function keys" option [System Preferences > Keyboard].
- Be sure to enable the Mac OS X 10.5+ keymap in Android Studio [Preferences > Keymap].
- A fairly complete shortcut list can be found here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Custom Scroll listener for RecyclerView. | |
| * Based on implementation https://gist.github.com/ssinss/e06f12ef66c51252563e | |
| */ | |
| public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { | |
| public static String TAG = "EndlessScrollListener"; | |
| private int previousTotal = 0; // The total number of items in the dataset after the last load | |
| private boolean loading = true; // True if we are still waiting for the last set of data to load. | |
| private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.daeheehan.util; | |
| import android.view.View; | |
| import android.view.View.MeasureSpec; | |
| import android.view.ViewGroup; | |
| import android.widget.ListAdapter; | |
| import android.widget.ListView; | |
| /** | |
| * List View Utility |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.json.JSONArray; | |
| import org.json.JSONException; | |
| import org.json.JSONObject; | |
| import java.util.*; | |
| public class JsonHelper { | |
| public static Object toJSON(Object object) throws JSONException { | |
| if (object instanceof Map) { | |
| JSONObject json = new JSONObject(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void postNewComment(Context context,final UserAccount userAccount,final String comment,final int blogId,final int postId){ | |
| mPostCommentResponse.requestStarted(); | |
| RequestQueue queue = Volley.newRequestQueue(context); | |
| StringRequest sr = new StringRequest(Request.Method.POST,"http://api.someservice.com/post/comment", new Response.Listener<String>() { | |
| @Override | |
| public void onResponse(String response) { | |
| mPostCommentResponse.requestCompleted(); | |
| } | |
| }, new Response.ErrorListener() { | |
| @Override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| StringRequest request = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() { | |
| @Override | |
| public void onResponse(String s) { | |
| ///handle response from service | |
| }, new ErrorResponse() { | |
| @Override | |
| public void onErrorResponse(VolleyError volleyError) { | |
| //handle error response | |
| } | |
| }) { |