This file contains 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
== HTML | |
<a class="skip-main" href="#main">Skip to main content</a> | |
== CSS | |
a.skip-main { | |
left: -999px; | |
position: absolute; | |
top: auto; | |
width: 1px; | |
height: 1px; |
This file contains 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 enum AndroidStorage { | |
/** | |
* /data/data/com.mypackage.name/files | |
*/ | |
INTERNAL_APPLICATION, | |
/** | |
* /storage/emulated/0 | |
*/ | |
EXTERNAL_ROOT, |
This file contains 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
/** | |
* Formats milliseconds to human readable format "3d 12h 30m 10s" | |
* in HTML formatting | |
* | |
* @param timeInMilliseconds | |
* @return | |
*/ | |
public static Spanned getTimeFormatted(long timeInMilliseconds) { | |
int seconds = (int) (timeInMilliseconds % 60); | |
timeInMilliseconds /= 60; |
This file contains 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 LatLonGeoPoint extends GeoPoint { | |
private double lat; | |
private double lon; | |
public LatLonGeoPoint(double lat, double lon) { | |
super((int) (lat*1E6), (int) (lon*1E6)); | |
} | |
public double distanceTo(LatLonGeoPoint other) { |
This file contains 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 ScrollableTextView extends TextView { | |
public ScrollableTextView(Context context, AttributeSet attrs, int defStyle) { | |
super(context, attrs, defStyle); | |
rotate(); | |
} | |
public ScrollableTextView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
rotate(); |
This file contains 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
// Make sure to commit your changes before | |
// Removes everything from the index | |
git rm -r --cached . | |
// Add all | |
git add . | |
// Commit it | |
git commit -m ".gitignore is now working" |
This file contains 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
private String getFragmentTag(int pos){ | |
return "android:switcher:"+R.id.pager+":"+pos; | |
} |
This file contains 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
private void zoomMapToSeeAllItems(MapView mapView, List<GeoPoint> items) { | |
int minLat = Integer.MAX_VALUE; | |
int maxLat = Integer.MIN_VALUE; | |
int minLon = Integer.MAX_VALUE; | |
int maxLon = Integer.MIN_VALUE; | |
double fitFactor = 1.5; | |
for (GeoPoint item : items) { | |
int lat = item.getLatitudeE6(); | |
int lon = item.getLongitudeE6(); |