by alexander white ©
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 boolean setListViewHeightBasedOnItems(ListView listView) { | |
| ListAdapter listAdapter = listView.getAdapter(); | |
| if (listAdapter != null) { | |
| int numberOfItems = listAdapter.getCount(); | |
| // Get total height of all items. | |
| int totalItemsHeight = 0; | |
| for (int itemPos = 0; itemPos < numberOfItems, itemPos++) { |
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 abstract class CountDownTimerWithPause { | |
| /** | |
| * Millis since boot when alarm should stop. | |
| */ | |
| private long mStopTimeInFuture; | |
| /** | |
| * Real time remaining until timer completes | |
| */ |
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
| 1. System.out.println("13775.183km".replaceAll("[^0-9?!\\.]","")); | |
| //input.replaceAll("[^0-9?!\\.]","") This will ignore the decimal points. | |
| //eg: if you have an input as 13775.183km the output will be13775.183. |
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
| http://toastdroid.com/2015/06/19/material-range-slider/ |
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
| * Display SHA1 for keystore -Typically used in Google Maps | |
| # keytool -list -v -keystore ~/.android/debug.keystore -alias your_alias | |
| *Genereate hash from keystore -Typically used in Facebook | |
| # keytool -exportcert -alias your_alias -keystore debug.keystore | openssl sha1 -binary | openssl base64 | |
| adb |
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 class RestClient { | |
| private static final String TAG = "RestClient"; | |
| private static final String USER_AGENT = "VisioStorm Android"; | |
| /** Methods supported by RestClient */ | |
| public enum RequestMethod { | |
| GET, POST | |
| } |
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
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| startTimer(); | |
| } | |
| private final static int DO_UPDATE_PROMOTE = 0; | |
| int COUNTER_REFRESH_OTHERCARD = 0; |
You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.
The RecyclerView should use a LinearLayoutManager.
You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)
This is a porting of the class SimpleSectionedListAdapter provided by Google
Example:
