id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
59,300
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java
SegmentClipper.isInClipArea
public boolean isInClipArea(final long pX, final long pY) { return pX > mXMin && pX < mXMax && pY > mYMin && pY < mYMax; }
java
public boolean isInClipArea(final long pX, final long pY) { return pX > mXMin && pX < mXMax && pY > mYMin && pY < mYMax; }
[ "public", "boolean", "isInClipArea", "(", "final", "long", "pX", ",", "final", "long", "pY", ")", "{", "return", "pX", ">", "mXMin", "&&", "pX", "<", "mXMax", "&&", "pY", ">", "mYMin", "&&", "pY", "<", "mYMax", ";", "}" ]
Check if a point is in the clip area
[ "Check", "if", "a", "point", "is", "in", "the", "clip", "area" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java#L161-L163
59,301
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java
SegmentClipper.intersection
private boolean intersection( final long pX0, final long pY0, final long pX1, final long pY1, final long pX2, final long pY2, final long pX3, final long pY3 ) { return SegmentIntersection.intersection( pX0, pY0, pX1, pY1, pX2, pY2, pX3, pY3, mOptimInte...
java
private boolean intersection( final long pX0, final long pY0, final long pX1, final long pY1, final long pX2, final long pY2, final long pX3, final long pY3 ) { return SegmentIntersection.intersection( pX0, pY0, pX1, pY1, pX2, pY2, pX3, pY3, mOptimInte...
[ "private", "boolean", "intersection", "(", "final", "long", "pX0", ",", "final", "long", "pY0", ",", "final", "long", "pX1", ",", "final", "long", "pY1", ",", "final", "long", "pX2", ",", "final", "long", "pY2", ",", "final", "long", "pX3", ",", "final...
Intersection of two segments
[ "Intersection", "of", "two", "segments" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java#L187-L194
59,302
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java
SegmentClipper.intersection
private boolean intersection(final long pX0, final long pY0, final long pX1, final long pY1) { return intersection(pX0, pY0, pX1, pY1, mXMin, mYMin, mXMin, mYMax) // x min segment || intersection(pX0, pY0, pX1, pY1, mXMax, mYMin, mXMax, mYMax) // x max segment || intersection(pX0...
java
private boolean intersection(final long pX0, final long pY0, final long pX1, final long pY1) { return intersection(pX0, pY0, pX1, pY1, mXMin, mYMin, mXMin, mYMax) // x min segment || intersection(pX0, pY0, pX1, pY1, mXMax, mYMin, mXMax, mYMax) // x max segment || intersection(pX0...
[ "private", "boolean", "intersection", "(", "final", "long", "pX0", ",", "final", "long", "pY0", ",", "final", "long", "pX1", ",", "final", "long", "pY1", ")", "{", "return", "intersection", "(", "pX0", ",", "pY0", ",", "pX1", ",", "pY1", ",", "mXMin", ...
Intersection of a segment with the 4 segments of the clip area
[ "Intersection", "of", "a", "segment", "with", "the", "4", "segments", "of", "the", "clip", "area" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java#L199-L204
59,303
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java
SegmentClipper.getClosestCorner
private int getClosestCorner(final long pX0, final long pY0, final long pX1, final long pY1) { double min = Double.MAX_VALUE; int corner = 0; for (int i = 0 ; i < cornerX.length ; i ++) { final double distance = Distance.getSquaredDistanceToSegment( cornerX[i], co...
java
private int getClosestCorner(final long pX0, final long pY0, final long pX1, final long pY1) { double min = Double.MAX_VALUE; int corner = 0; for (int i = 0 ; i < cornerX.length ; i ++) { final double distance = Distance.getSquaredDistanceToSegment( cornerX[i], co...
[ "private", "int", "getClosestCorner", "(", "final", "long", "pX0", ",", "final", "long", "pY0", ",", "final", "long", "pX1", ",", "final", "long", "pY1", ")", "{", "double", "min", "=", "Double", ".", "MAX_VALUE", ";", "int", "corner", "=", "0", ";", ...
Gets the clip area corner which is the closest to the given segment @since 6.0.0 We have a clip area and we have a segment with no intersection with this clip area. The question is: how do we clip this segment? If we only clip both segment ends, we may end up with a (min,min) x (max,max) clip approximation that display...
[ "Gets", "the", "clip", "area", "corner", "which", "is", "the", "closest", "to", "the", "given", "segment" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java#L220-L233
59,304
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/MapController.java
MapController.animateTo
@Override public void animateTo(int x, int y) { // If no layout, delay this call if (!mMapView.isLayoutOccurred()) { mReplayController.animateTo(x, y); return; } if (!mMapView.isAnimating()) { mMapView.mIsFlinging = false; final int xS...
java
@Override public void animateTo(int x, int y) { // If no layout, delay this call if (!mMapView.isLayoutOccurred()) { mReplayController.animateTo(x, y); return; } if (!mMapView.isAnimating()) { mMapView.mIsFlinging = false; final int xS...
[ "@", "Override", "public", "void", "animateTo", "(", "int", "x", ",", "int", "y", ")", "{", "// If no layout, delay this call", "if", "(", "!", "mMapView", ".", "isLayoutOccurred", "(", ")", ")", "{", "mReplayController", ".", "animateTo", "(", "x", ",", "...
Start animating the map towards the given point.
[ "Start", "animating", "the", "map", "towards", "the", "given", "point", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/MapController.java#L189-L210
59,305
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/MapController.java
MapController.setCenter
@Override public void setCenter(final IGeoPoint point) { // If no layout, delay this call if (!mMapView.isLayoutOccurred()) { mReplayController.setCenter(point); return; } mMapView.setExpectedCenter(point); }
java
@Override public void setCenter(final IGeoPoint point) { // If no layout, delay this call if (!mMapView.isLayoutOccurred()) { mReplayController.setCenter(point); return; } mMapView.setExpectedCenter(point); }
[ "@", "Override", "public", "void", "setCenter", "(", "final", "IGeoPoint", "point", ")", "{", "// If no layout, delay this call", "if", "(", "!", "mMapView", ".", "isLayoutOccurred", "(", ")", ")", "{", "mReplayController", ".", "setCenter", "(", "point", ")", ...
Set the map view to the given center. There will be no animation.
[ "Set", "the", "map", "view", "to", "the", "given", "center", ".", "There", "will", "be", "no", "animation", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/MapController.java#L220-L228
59,306
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/MapController.java
MapController.stopAnimation
@Override public void stopAnimation(final boolean jumpToTarget) { if (!mMapView.getScroller().isFinished()) { if (jumpToTarget) { mMapView.mIsFlinging = false; mMapView.getScroller().abortAnimation(); } else stopPanning(); } ...
java
@Override public void stopAnimation(final boolean jumpToTarget) { if (!mMapView.getScroller().isFinished()) { if (jumpToTarget) { mMapView.mIsFlinging = false; mMapView.getScroller().abortAnimation(); } else stopPanning(); } ...
[ "@", "Override", "public", "void", "stopAnimation", "(", "final", "boolean", "jumpToTarget", ")", "{", "if", "(", "!", "mMapView", ".", "getScroller", "(", ")", ".", "isFinished", "(", ")", ")", "{", "if", "(", "jumpToTarget", ")", "{", "mMapView", ".", ...
Stops a running animation. @param jumpToTarget
[ "Stops", "a", "running", "animation", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/MapController.java#L241-L267
59,307
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java
SqlTileWriter.runCleanupOperation
public void runCleanupOperation() { final SQLiteDatabase db = getDb(); if (db == null || !db.isOpen()) { if (Configuration.getInstance().isDebugMode()) { Log.d(IMapView.LOGTAG, "Finished init thread, aborted due to null database reference"); } return; ...
java
public void runCleanupOperation() { final SQLiteDatabase db = getDb(); if (db == null || !db.isOpen()) { if (Configuration.getInstance().isDebugMode()) { Log.d(IMapView.LOGTAG, "Finished init thread, aborted due to null database reference"); } return; ...
[ "public", "void", "runCleanupOperation", "(", ")", "{", "final", "SQLiteDatabase", "db", "=", "getDb", "(", ")", ";", "if", "(", "db", "==", "null", "||", "!", "db", ".", "isOpen", "(", ")", ")", "{", "if", "(", "Configuration", ".", "getInstance", "...
this could be a long running operation, don't run on the UI thread unless necessary. This function prunes the database for old or expired tiles. @since 5.6
[ "this", "could", "be", "a", "long", "running", "operation", "don", "t", "run", "on", "the", "UI", "thread", "unless", "necessary", ".", "This", "function", "prunes", "the", "database", "for", "old", "or", "expired", "tiles", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L99-L122
59,308
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java
SqlTileWriter.exists
public boolean exists(final String pTileSource, final long pMapTileIndex) { return 1 == getRowCount(primaryKey, getPrimaryKeyParameters(getIndex(pMapTileIndex), pTileSource)); }
java
public boolean exists(final String pTileSource, final long pMapTileIndex) { return 1 == getRowCount(primaryKey, getPrimaryKeyParameters(getIndex(pMapTileIndex), pTileSource)); }
[ "public", "boolean", "exists", "(", "final", "String", "pTileSource", ",", "final", "long", "pMapTileIndex", ")", "{", "return", "1", "==", "getRowCount", "(", "primaryKey", ",", "getPrimaryKeyParameters", "(", "getIndex", "(", "pMapTileIndex", ")", ",", "pTileS...
Returns true if the given tile source and tile coordinates exist in the cache @since 5.6
[ "Returns", "true", "if", "the", "given", "tile", "source", "and", "tile", "coordinates", "exist", "in", "the", "cache" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L183-L185
59,309
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java
SqlTileWriter.purgeCache
public boolean purgeCache() { final SQLiteDatabase db = getDb(); if (db != null && db.isOpen()) { try { db.delete(TABLE, null, null); return true; } catch (Exception e) { Log.w(IMapView.LOGTAG, "Error purging the db", e); ...
java
public boolean purgeCache() { final SQLiteDatabase db = getDb(); if (db != null && db.isOpen()) { try { db.delete(TABLE, null, null); return true; } catch (Exception e) { Log.w(IMapView.LOGTAG, "Error purging the db", e); ...
[ "public", "boolean", "purgeCache", "(", ")", "{", "final", "SQLiteDatabase", "db", "=", "getDb", "(", ")", ";", "if", "(", "db", "!=", "null", "&&", "db", ".", "isOpen", "(", ")", ")", "{", "try", "{", "db", ".", "delete", "(", "TABLE", ",", "nul...
purges and deletes everything from the cache database @return @since 5.6
[ "purges", "and", "deletes", "everything", "from", "the", "cache", "database" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L209-L221
59,310
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java
SqlTileWriter.remove
@Override public boolean remove(final ITileSource pTileSourceInfo, final long pMapTileIndex) { final SQLiteDatabase db = getDb(); if (db == null || !db.isOpen()) { Log.d(IMapView.LOGTAG, "Unable to delete cached tile from " + pTileSourceInfo.name() + " " + MapTileIndex.toString(pMapTileI...
java
@Override public boolean remove(final ITileSource pTileSourceInfo, final long pMapTileIndex) { final SQLiteDatabase db = getDb(); if (db == null || !db.isOpen()) { Log.d(IMapView.LOGTAG, "Unable to delete cached tile from " + pTileSourceInfo.name() + " " + MapTileIndex.toString(pMapTileI...
[ "@", "Override", "public", "boolean", "remove", "(", "final", "ITileSource", "pTileSourceInfo", ",", "final", "long", "pMapTileIndex", ")", "{", "final", "SQLiteDatabase", "db", "=", "getDb", "(", ")", ";", "if", "(", "db", "==", "null", "||", "!", "db", ...
Removes a specific tile from the cache @since 5.6
[ "Removes", "a", "specific", "tile", "from", "the", "cache" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L382-L402
59,311
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java
SqlTileWriter.getRowCount
public long getRowCount(String tileSourceName) { if (tileSourceName == null) { return getRowCount(null, null); } return getRowCount(COLUMN_PROVIDER + "=?", new String[] {tileSourceName}); }
java
public long getRowCount(String tileSourceName) { if (tileSourceName == null) { return getRowCount(null, null); } return getRowCount(COLUMN_PROVIDER + "=?", new String[] {tileSourceName}); }
[ "public", "long", "getRowCount", "(", "String", "tileSourceName", ")", "{", "if", "(", "tileSourceName", "==", "null", ")", "{", "return", "getRowCount", "(", "null", ",", "null", ")", ";", "}", "return", "getRowCount", "(", "COLUMN_PROVIDER", "+", "\"=?\"",...
Returns the number of tiles in the cache for the specified tile source name @param tileSourceName @return @since 5.6
[ "Returns", "the", "number", "of", "tiles", "in", "the", "cache", "for", "the", "specified", "tile", "source", "name" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L411-L416
59,312
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java
SqlTileWriter.getRowCount
public long getRowCount(final String pTileSourceName, final int pZoom, final Collection<Rect> pInclude, final Collection<Rect> pExclude) { return getRowCount( getWhereClause(pZoom, pInclude, pExclude) + (pTileSourceName != null ? " and " + COLU...
java
public long getRowCount(final String pTileSourceName, final int pZoom, final Collection<Rect> pInclude, final Collection<Rect> pExclude) { return getRowCount( getWhereClause(pZoom, pInclude, pExclude) + (pTileSourceName != null ? " and " + COLU...
[ "public", "long", "getRowCount", "(", "final", "String", "pTileSourceName", ",", "final", "int", "pZoom", ",", "final", "Collection", "<", "Rect", ">", "pInclude", ",", "final", "Collection", "<", "Rect", ">", "pExclude", ")", "{", "return", "getRowCount", "...
Count cache tiles @param pTileSourceName the tile source name (possibly null) @param pZoom the zoom level @param pInclude a collection of bounding boxes to include (possibly null/empty) @param pExclude a collection of bounding boxes to exclude (possibly null/empty) @since 6.0.2 @return the number of corresponding tiles...
[ "Count", "cache", "tiles" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L456-L462
59,313
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java
SqlTileWriter.getFirstExpiry
public long getFirstExpiry() { final SQLiteDatabase db = getDb(); if (db == null || !db.isOpen()) { return 0; } try { Cursor cursor = db.rawQuery("select min(" + COLUMN_EXPIRES + ") from " + TABLE, null); cursor.moveToFirst(); long time = c...
java
public long getFirstExpiry() { final SQLiteDatabase db = getDb(); if (db == null || !db.isOpen()) { return 0; } try { Cursor cursor = db.rawQuery("select min(" + COLUMN_EXPIRES + ") from " + TABLE, null); cursor.moveToFirst(); long time = c...
[ "public", "long", "getFirstExpiry", "(", ")", "{", "final", "SQLiteDatabase", "db", "=", "getDb", "(", ")", ";", "if", "(", "db", "==", "null", "||", "!", "db", ".", "isOpen", "(", ")", ")", "{", "return", "0", ";", "}", "try", "{", "Cursor", "cu...
Returns the expiry time of the tile that expires first.
[ "Returns", "the", "expiry", "time", "of", "the", "tile", "that", "expires", "first", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L474-L490
59,314
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java
SqlTileWriter.getIndex
public static long getIndex(final long pMapTileIndex) { return getIndex(MapTileIndex.getX(pMapTileIndex), MapTileIndex.getY(pMapTileIndex), MapTileIndex.getZoom(pMapTileIndex)); }
java
public static long getIndex(final long pMapTileIndex) { return getIndex(MapTileIndex.getX(pMapTileIndex), MapTileIndex.getY(pMapTileIndex), MapTileIndex.getZoom(pMapTileIndex)); }
[ "public", "static", "long", "getIndex", "(", "final", "long", "pMapTileIndex", ")", "{", "return", "getIndex", "(", "MapTileIndex", ".", "getX", "(", "pMapTileIndex", ")", ",", "MapTileIndex", ".", "getY", "(", "pMapTileIndex", ")", ",", "MapTileIndex", ".", ...
Gets the single column index value for a map tile Unluckily, "map tile index" and "sql pk" don't match @since 5.6.5 @param pMapTileIndex
[ "Gets", "the", "single", "column", "index", "value", "for", "a", "map", "tile", "Unluckily", "map", "tile", "index", "and", "sql", "pk", "don", "t", "match" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L527-L529
59,315
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java
SqlTileWriter.delete
public long delete(final String pTileSourceName, final int pZoom, final Collection<Rect> pInclude, final Collection<Rect> pExclude) { try { final SQLiteDatabase db = getDb(); if (db == null || !db.isOpen()) { return -1; } ret...
java
public long delete(final String pTileSourceName, final int pZoom, final Collection<Rect> pInclude, final Collection<Rect> pExclude) { try { final SQLiteDatabase db = getDb(); if (db == null || !db.isOpen()) { return -1; } ret...
[ "public", "long", "delete", "(", "final", "String", "pTileSourceName", ",", "final", "int", "pZoom", ",", "final", "Collection", "<", "Rect", ">", "pInclude", ",", "final", "Collection", "<", "Rect", ">", "pExclude", ")", "{", "try", "{", "final", "SQLiteD...
Delete cache tiles @since 6.0.2 @param pTileSourceName the tile source name (possibly null) @param pZoom the zoom level @param pInclude a collection of bounding boxes to include (possibly null/empty) @param pExclude a collection of bounding boxes to exclude (possibly null/empty) @return the number of corresponding tile...
[ "Delete", "cache", "tiles" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L908-L923
59,316
osmdroid/osmdroid
osmdroid-android/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
MultiTouchController.onTouchEvent
@SuppressWarnings("unused") public boolean onTouchEvent(MotionEvent event) { try { int pointerCount = multiTouchSupported ? (Integer) m_getPointerCount.invoke(event) : 1; if (DEBUG) Log.i("MultiTouch", "Got here 1 - " + multiTouchSupported + " " + mMode + " " + handleSingleTouchEvents + " " + pointerCount)...
java
@SuppressWarnings("unused") public boolean onTouchEvent(MotionEvent event) { try { int pointerCount = multiTouchSupported ? (Integer) m_getPointerCount.invoke(event) : 1; if (DEBUG) Log.i("MultiTouch", "Got here 1 - " + multiTouchSupported + " " + mMode + " " + handleSingleTouchEvents + " " + pointerCount)...
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "public", "boolean", "onTouchEvent", "(", "MotionEvent", "event", ")", "{", "try", "{", "int", "pointerCount", "=", "multiTouchSupported", "?", "(", "Integer", ")", "m_getPointerCount", ".", "invoke", "(", "event"...
Process incoming touch events
[ "Process", "incoming", "touch", "events" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java#L250-L311
59,317
osmdroid/osmdroid
osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/tiles/raster/GeoPackageMapTileModuleProvider.java
GeoPackageMapTileModuleProvider.getTileSources
public List<GeopackageRasterTileSource> getTileSources() { List<GeopackageRasterTileSource> srcs = new ArrayList<>(); List<String> databases = manager.databases(); for (int i = 0; i < databases.size(); i++) { GeoPackage open = manager.open(databases.get(i)); List<String...
java
public List<GeopackageRasterTileSource> getTileSources() { List<GeopackageRasterTileSource> srcs = new ArrayList<>(); List<String> databases = manager.databases(); for (int i = 0; i < databases.size(); i++) { GeoPackage open = manager.open(databases.get(i)); List<String...
[ "public", "List", "<", "GeopackageRasterTileSource", ">", "getTileSources", "(", ")", "{", "List", "<", "GeopackageRasterTileSource", ">", "srcs", "=", "new", "ArrayList", "<>", "(", ")", ";", "List", "<", "String", ">", "databases", "=", "manager", ".", "da...
returns ALL available raster tile sources for all "imported" geopackage databases @return
[ "returns", "ALL", "available", "raster", "tile", "sources", "for", "all", "imported", "geopackage", "databases" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/tiles/raster/GeoPackageMapTileModuleProvider.java#L119-L143
59,318
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/ClickableIconOverlay.java
ClickableIconOverlay.set
public ClickableIconOverlay set(int id, IGeoPoint position, Drawable icon, DataType data) { set(position, icon); mId = id; mData = data; return this; }
java
public ClickableIconOverlay set(int id, IGeoPoint position, Drawable icon, DataType data) { set(position, icon); mId = id; mData = data; return this; }
[ "public", "ClickableIconOverlay", "set", "(", "int", "id", ",", "IGeoPoint", "position", ",", "Drawable", "icon", ",", "DataType", "data", ")", "{", "set", "(", "position", ",", "icon", ")", ";", "mId", "=", "id", ";", "mData", "=", "data", ";", "retur...
used to recycle this
[ "used", "to", "recycle", "this" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ClickableIconOverlay.java#L44-L49
59,319
osmdroid/osmdroid
OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/utils/JSONParser.java
JSONParser.makeHttpRequest
public JSONObject makeHttpRequest(String url) throws IOException { InputStream is = null; JSONObject jObj = null; String json = null; // Making HTTP request try { is = new URL(url).openStream(); } catch (Exception ex) { Log.d("Networking", ex.g...
java
public JSONObject makeHttpRequest(String url) throws IOException { InputStream is = null; JSONObject jObj = null; String json = null; // Making HTTP request try { is = new URL(url).openStream(); } catch (Exception ex) { Log.d("Networking", ex.g...
[ "public", "JSONObject", "makeHttpRequest", "(", "String", "url", ")", "throws", "IOException", "{", "InputStream", "is", "=", "null", ";", "JSONObject", "jObj", "=", "null", ";", "String", "json", "=", "null", ";", "// Making HTTP request", "try", "{", "is", ...
by making HTTP POST or GET method
[ "by", "making", "HTTP", "POST", "or", "GET", "method" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/utils/JSONParser.java#L33-L78
59,320
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/BoundingBox.java
BoundingBox.getCenterLongitude
public static double getCenterLongitude(final double pWest, final double pEast) { double longitude = (pEast + pWest) / 2.0; if (pEast < pWest) { // center is on the other side of earth longitude += 180; } return org.osmdroid.views.MapView.getTileSystem().cleanLongitude(longitude); }
java
public static double getCenterLongitude(final double pWest, final double pEast) { double longitude = (pEast + pWest) / 2.0; if (pEast < pWest) { // center is on the other side of earth longitude += 180; } return org.osmdroid.views.MapView.getTileSystem().cleanLongitude(longitude); }
[ "public", "static", "double", "getCenterLongitude", "(", "final", "double", "pWest", ",", "final", "double", "pEast", ")", "{", "double", "longitude", "=", "(", "pEast", "+", "pWest", ")", "/", "2.0", ";", "if", "(", "pEast", "<", "pWest", ")", "{", "/...
Compute the center of two longitudes Taking into account the case when "west is on the right and east is on the left" @since 6.0.0
[ "Compute", "the", "center", "of", "two", "longitudes", "Taking", "into", "account", "the", "case", "when", "west", "is", "on", "the", "right", "and", "east", "is", "on", "the", "left" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/BoundingBox.java#L143-L150
59,321
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/BoundingBox.java
BoundingBox.increaseByScale
public BoundingBox increaseByScale(final float pBoundingboxPaddingRelativeScale) { if (pBoundingboxPaddingRelativeScale <= 0) throw new IllegalArgumentException("pBoundingboxPaddingRelativeScale must be positive"); final TileSystem tileSystem = org.osmdroid.views.MapView.getTileSystem(); ...
java
public BoundingBox increaseByScale(final float pBoundingboxPaddingRelativeScale) { if (pBoundingboxPaddingRelativeScale <= 0) throw new IllegalArgumentException("pBoundingboxPaddingRelativeScale must be positive"); final TileSystem tileSystem = org.osmdroid.views.MapView.getTileSystem(); ...
[ "public", "BoundingBox", "increaseByScale", "(", "final", "float", "pBoundingboxPaddingRelativeScale", ")", "{", "if", "(", "pBoundingboxPaddingRelativeScale", "<=", "0", ")", "throw", "new", "IllegalArgumentException", "(", "\"pBoundingboxPaddingRelativeScale must be positive\...
Scale this bounding box by a given factor. @param pBoundingboxPaddingRelativeScale scale factor @return scaled bounding box
[ "Scale", "this", "bounding", "box", "by", "a", "given", "factor", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/BoundingBox.java#L251-L266
59,322
osmdroid/osmdroid
GoogleWrapperSample/src/main/java/org/osmdroid/google/sample/MapsActivity.java
MapsActivity.onMapReady
@Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; // Add a marker in Sydney and move the camera LatLng sydney = new LatLng(-34, 151); mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney")); mMap.moveCamera(CameraUpdateFactory.n...
java
@Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; // Add a marker in Sydney and move the camera LatLng sydney = new LatLng(-34, 151); mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney")); mMap.moveCamera(CameraUpdateFactory.n...
[ "@", "Override", "public", "void", "onMapReady", "(", "GoogleMap", "googleMap", ")", "{", "mMap", "=", "googleMap", ";", "// Add a marker in Sydney and move the camera", "LatLng", "sydney", "=", "new", "LatLng", "(", "-", "34", ",", "151", ")", ";", "mMap", "....
Manipulates the map once available. This callback is triggered when the map is ready to be used. This is where we can add markers or lines, add listeners or move the camera. In this case, we just add a marker near Sydney, Australia. If Google Play services is not installed on the device, the user will be prompted to in...
[ "Manipulates", "the", "map", "once", "available", ".", "This", "callback", "is", "triggered", "when", "the", "map", "is", "ready", "to", "be", "used", ".", "This", "is", "where", "we", "can", "add", "markers", "or", "lines", "add", "listeners", "or", "mo...
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/GoogleWrapperSample/src/main/java/org/osmdroid/google/sample/MapsActivity.java#L37-L45
59,323
osmdroid/osmdroid
osmdroid-wms/src/main/java/org/osmdroid/wms/WMSParser.java
WMSParser.parse
public static WMSEndpoint parse(InputStream inputStream) throws Exception { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); dBuilder.setEntityResolver(new EntityResolver() { @Override pub...
java
public static WMSEndpoint parse(InputStream inputStream) throws Exception { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); dBuilder.setEntityResolver(new EntityResolver() { @Override pub...
[ "public", "static", "WMSEndpoint", "parse", "(", "InputStream", "inputStream", ")", "throws", "Exception", "{", "DocumentBuilderFactory", "dbFactory", "=", "DocumentBuilderFactory", ".", "newInstance", "(", ")", ";", "DocumentBuilder", "dBuilder", "=", "dbFactory", "....
note, the input stream remains open after calling this method, closing it is the caller's problem @param inputStream @return @throws Exception
[ "note", "the", "input", "stream", "remains", "open", "after", "calling", "this", "method", "closing", "it", "is", "the", "caller", "s", "problem" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-wms/src/main/java/org/osmdroid/wms/WMSParser.java#L52-L78
59,324
osmdroid/osmdroid
osmdroid-third-party/src/main/java/org/osmdroid/google/wrapper/v2/MapFactory.java
MapFactory.isGoogleMapsV2Supported
public static boolean isGoogleMapsV2Supported(final Context aContext) { try { // first check if Google Play Services is available int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(aContext); if (resultCode == ConnectionResult.SUCCESS) { // then check if OpenGL ES 2.0 is available ...
java
public static boolean isGoogleMapsV2Supported(final Context aContext) { try { // first check if Google Play Services is available int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(aContext); if (resultCode == ConnectionResult.SUCCESS) { // then check if OpenGL ES 2.0 is available ...
[ "public", "static", "boolean", "isGoogleMapsV2Supported", "(", "final", "Context", "aContext", ")", "{", "try", "{", "// first check if Google Play Services is available", "int", "resultCode", "=", "GooglePlayServicesUtil", ".", "isGooglePlayServicesAvailable", "(", "aContext...
Check whether Google Maps v2 is supported on this device.
[ "Check", "whether", "Google", "Maps", "v2", "is", "supported", "on", "this", "device", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-third-party/src/main/java/org/osmdroid/google/wrapper/v2/MapFactory.java#L61-L75
59,325
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/TileWriter.java
TileWriter.isSymbolicDirectoryLink
private boolean isSymbolicDirectoryLink(final File pParentDirectory, final File pDirectory) { try { final String canonicalParentPath1 = pParentDirectory.getCanonicalPath(); final String canonicalParentPath2 = pDirectory.getCanonicalFile().getParent(); return !canonicalParentPath1.equals(canonicalParentPath2)...
java
private boolean isSymbolicDirectoryLink(final File pParentDirectory, final File pDirectory) { try { final String canonicalParentPath1 = pParentDirectory.getCanonicalPath(); final String canonicalParentPath2 = pDirectory.getCanonicalFile().getParent(); return !canonicalParentPath1.equals(canonicalParentPath2)...
[ "private", "boolean", "isSymbolicDirectoryLink", "(", "final", "File", "pParentDirectory", ",", "final", "File", "pDirectory", ")", "{", "try", "{", "final", "String", "canonicalParentPath1", "=", "pParentDirectory", ".", "getCanonicalPath", "(", ")", ";", "final", ...
Checks to see if it appears that a directory is a symbolic link. It does this by comparing the canonical path of the parent directory and the parent directory of the directory's canonical path. If they are equal, then they come from the same true parent. If not, then pDirectory is a symbolic link. If we get an exceptio...
[ "Checks", "to", "see", "if", "it", "appears", "that", "a", "directory", "is", "a", "symbolic", "link", ".", "It", "does", "this", "by", "comparing", "the", "canonical", "path", "of", "the", "parent", "directory", "and", "the", "parent", "directory", "of", ...
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/TileWriter.java#L229-L242
59,326
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/TileWriter.java
TileWriter.cutCurrentCache
private void cutCurrentCache() { final File lock=Configuration.getInstance().getOsmdroidTileCache(); synchronized (lock) { if (mUsedCacheSpace > Configuration.getInstance().getTileFileSystemCacheTrimBytes()) { Log.d(IMapView.LOGTAG,"Trimming tile cache from " + mUsedCacheSpace + " to " + Configurati...
java
private void cutCurrentCache() { final File lock=Configuration.getInstance().getOsmdroidTileCache(); synchronized (lock) { if (mUsedCacheSpace > Configuration.getInstance().getTileFileSystemCacheTrimBytes()) { Log.d(IMapView.LOGTAG,"Trimming tile cache from " + mUsedCacheSpace + " to " + Configurati...
[ "private", "void", "cutCurrentCache", "(", ")", "{", "final", "File", "lock", "=", "Configuration", ".", "getInstance", "(", ")", ".", "getOsmdroidTileCache", "(", ")", ";", "synchronized", "(", "lock", ")", "{", "if", "(", "mUsedCacheSpace", ">", "Configura...
If the cache size is greater than the max then trim it down to the trim level. This method is synchronized so that only one thread can run it at a time.
[ "If", "the", "cache", "size", "is", "greater", "than", "the", "max", "then", "trim", "it", "down", "to", "the", "trim", "level", ".", "This", "method", "is", "synchronized", "so", "that", "only", "one", "thread", "can", "run", "it", "at", "a", "time", ...
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/TileWriter.java#L266-L304
59,327
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/MapTileApproximater.java
MapTileApproximater.getTileBitmap
public static Bitmap getTileBitmap(final int pTileSizePx) { final Bitmap bitmap = BitmapPool.getInstance().obtainSizedBitmapFromPool(pTileSizePx, pTileSizePx); if (bitmap != null) { return bitmap; } return Bitmap.createBitmap(pTileSizePx, pTileSizePx, Bitmap.Config.ARGB_8888)...
java
public static Bitmap getTileBitmap(final int pTileSizePx) { final Bitmap bitmap = BitmapPool.getInstance().obtainSizedBitmapFromPool(pTileSizePx, pTileSizePx); if (bitmap != null) { return bitmap; } return Bitmap.createBitmap(pTileSizePx, pTileSizePx, Bitmap.Config.ARGB_8888)...
[ "public", "static", "Bitmap", "getTileBitmap", "(", "final", "int", "pTileSizePx", ")", "{", "final", "Bitmap", "bitmap", "=", "BitmapPool", ".", "getInstance", "(", ")", ".", "obtainSizedBitmapFromPool", "(", "pTileSizePx", ",", "pTileSizePx", ")", ";", "if", ...
Try to get a tile bitmap from the pool, otherwise allocate a new one @param pTileSizePx @return
[ "Try", "to", "get", "a", "tile", "bitmap", "from", "the", "pool", "otherwise", "allocate", "a", "new", "one" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/MapTileApproximater.java#L248-L254
59,328
osmdroid/osmdroid
OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/IISTrackerBase.java
IISTrackerBase.getLocation
private GeoPoint getLocation() { //sample data //{"timestamp": 1483742439, "iss_position": {"latitude": "-50.8416", "longitude": "-41.2701"}, "message": "success"} NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); boolean isConnected = activeNetwork != null && activeNetwork.isConn...
java
private GeoPoint getLocation() { //sample data //{"timestamp": 1483742439, "iss_position": {"latitude": "-50.8416", "longitude": "-41.2701"}, "message": "success"} NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); boolean isConnected = activeNetwork != null && activeNetwork.isConn...
[ "private", "GeoPoint", "getLocation", "(", ")", "{", "//sample data", "//{\"timestamp\": 1483742439, \"iss_position\": {\"latitude\": \"-50.8416\", \"longitude\": \"-41.2701\"}, \"message\": \"success\"}", "NetworkInfo", "activeNetwork", "=", "cm", ".", "getActiveNetworkInfo", "(", ")"...
HTTP callout to get a JSON document that represents the IIS's current location @return
[ "HTTP", "callout", "to", "get", "a", "JSON", "document", "that", "represents", "the", "IIS", "s", "current", "location" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/IISTrackerBase.java#L169-L194
59,329
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/PathOverlay.java
PathOverlay.addGreatCircle
public void addGreatCircle(final GeoPoint startPoint, final GeoPoint endPoint) { // get the great circle path length in meters final int greatCircleLength = (int) startPoint.distanceToAsDouble(endPoint); // add one point for every 100kms of the great circle path final int numberOfPoints...
java
public void addGreatCircle(final GeoPoint startPoint, final GeoPoint endPoint) { // get the great circle path length in meters final int greatCircleLength = (int) startPoint.distanceToAsDouble(endPoint); // add one point for every 100kms of the great circle path final int numberOfPoints...
[ "public", "void", "addGreatCircle", "(", "final", "GeoPoint", "startPoint", ",", "final", "GeoPoint", "endPoint", ")", "{", "//\tget the great circle path length in meters", "final", "int", "greatCircleLength", "=", "(", "int", ")", "startPoint", ".", "distanceToAsDoubl...
Draw a great circle. Calculate a point for every 100km along the path. @param startPoint start point of the great circle @param endPoint end point of the great circle
[ "Draw", "a", "great", "circle", ".", "Calculate", "a", "point", "for", "every", "100km", "along", "the", "path", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/PathOverlay.java#L109-L117
59,330
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/PathOverlay.java
PathOverlay.addGreatCircle
public void addGreatCircle(final GeoPoint startPoint, final GeoPoint endPoint, final int numberOfPoints) { // adapted from page http://compastic.blogspot.co.uk/2011/07/how-to-draw-great-circle-on-map-in.html // which was adapted from page http://maps.forum.nu/gm_flight_path.html // convert to radians final dou...
java
public void addGreatCircle(final GeoPoint startPoint, final GeoPoint endPoint, final int numberOfPoints) { // adapted from page http://compastic.blogspot.co.uk/2011/07/how-to-draw-great-circle-on-map-in.html // which was adapted from page http://maps.forum.nu/gm_flight_path.html // convert to radians final dou...
[ "public", "void", "addGreatCircle", "(", "final", "GeoPoint", "startPoint", ",", "final", "GeoPoint", "endPoint", ",", "final", "int", "numberOfPoints", ")", "{", "//\tadapted from page http://compastic.blogspot.co.uk/2011/07/how-to-draw-great-circle-on-map-in.html", "//\twhich w...
Draw a great circle. @param startPoint start point of the great circle @param endPoint end point of the great circle @param numberOfPoints number of points to calculate along the path
[ "Draw", "a", "great", "circle", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/PathOverlay.java#L125-L154
59,331
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/PathOverlay.java
PathOverlay.draw
@Override public void draw(final Canvas canvas, final Projection pj) { final int size = this.mPoints.size(); if (size < 2) { // nothing to paint return; } // precompute new points to the intermediate projection. while (this.mPointsPrecomputed < size) { final PointL pt = this.mPoints.get(this.mPoin...
java
@Override public void draw(final Canvas canvas, final Projection pj) { final int size = this.mPoints.size(); if (size < 2) { // nothing to paint return; } // precompute new points to the intermediate projection. while (this.mPointsPrecomputed < size) { final PointL pt = this.mPoints.get(this.mPoin...
[ "@", "Override", "public", "void", "draw", "(", "final", "Canvas", "canvas", ",", "final", "Projection", "pj", ")", "{", "final", "int", "size", "=", "this", ".", "mPoints", ".", "size", "(", ")", ";", "if", "(", "size", "<", "2", ")", "{", "// not...
This method draws the line. Note - highly optimized to handle long paths, proceed with care. Should be fine up to 10K points.
[ "This", "method", "draws", "the", "line", ".", "Note", "-", "highly", "optimized", "to", "handle", "long", "paths", "proceed", "with", "care", ".", "Should", "be", "fine", "up", "to", "10K", "points", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/PathOverlay.java#L200-L271
59,332
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/mylocation/MyLocationNewOverlay.java
MyLocationNewOverlay.enableFollowLocation
public void enableFollowLocation() { mIsFollowing = true; // set initial location when enabled if (isMyLocationEnabled()) { Location location = mMyLocationProvider.getLastKnownLocation(); if (location != null) { setLocation(location); } } // Update the screen to see changes take effect if (mM...
java
public void enableFollowLocation() { mIsFollowing = true; // set initial location when enabled if (isMyLocationEnabled()) { Location location = mMyLocationProvider.getLastKnownLocation(); if (location != null) { setLocation(location); } } // Update the screen to see changes take effect if (mM...
[ "public", "void", "enableFollowLocation", "(", ")", "{", "mIsFollowing", "=", "true", ";", "// set initial location when enabled", "if", "(", "isMyLocationEnabled", "(", ")", ")", "{", "Location", "location", "=", "mMyLocationProvider", ".", "getLastKnownLocation", "(...
Enables "follow" functionality. The map will center on your current location and automatically scroll as you move. Scrolling the map in the UI will disable.
[ "Enables", "follow", "functionality", ".", "The", "map", "will", "center", "on", "your", "current", "location", "and", "automatically", "scroll", "as", "you", "move", ".", "Scrolling", "the", "map", "in", "the", "UI", "will", "disable", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/mylocation/MyLocationNewOverlay.java#L382-L397
59,333
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/mylocation/MyLocationNewOverlay.java
MyLocationNewOverlay.runOnFirstFix
public boolean runOnFirstFix(final Runnable runnable) { if (mMyLocationProvider != null && mLocation != null) { new Thread(runnable).start(); return true; } else { mRunOnFirstFix.addLast(runnable); return false; } }
java
public boolean runOnFirstFix(final Runnable runnable) { if (mMyLocationProvider != null && mLocation != null) { new Thread(runnable).start(); return true; } else { mRunOnFirstFix.addLast(runnable); return false; } }
[ "public", "boolean", "runOnFirstFix", "(", "final", "Runnable", "runnable", ")", "{", "if", "(", "mMyLocationProvider", "!=", "null", "&&", "mLocation", "!=", "null", ")", "{", "new", "Thread", "(", "runnable", ")", ".", "start", "(", ")", ";", "return", ...
Queues a runnable to be executed as soon as we have a location fix. If we already have a fix, we'll execute the runnable immediately and return true. If not, we'll hang on to the runnable and return false; as soon as we get a location fix, we'll run it in in a new thread.
[ "Queues", "a", "runnable", "to", "be", "executed", "as", "soon", "as", "we", "have", "a", "location", "fix", ".", "If", "we", "already", "have", "a", "fix", "we", "ll", "execute", "the", "runnable", "immediately", "and", "return", "true", ".", "If", "n...
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/mylocation/MyLocationNewOverlay.java#L516-L524
59,334
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/MapTileSqlCacheProvider.java
MapTileSqlCacheProvider.hasTile
public boolean hasTile(final long pMapTileIndex) { ITileSource tileSource = mTileSource.get(); if (tileSource == null) { return false; } return mWriter.getExpirationTimestamp(tileSource, pMapTileIndex) != null; }
java
public boolean hasTile(final long pMapTileIndex) { ITileSource tileSource = mTileSource.get(); if (tileSource == null) { return false; } return mWriter.getExpirationTimestamp(tileSource, pMapTileIndex) != null; }
[ "public", "boolean", "hasTile", "(", "final", "long", "pMapTileIndex", ")", "{", "ITileSource", "tileSource", "=", "mTileSource", ".", "get", "(", ")", ";", "if", "(", "tileSource", "==", "null", ")", "{", "return", "false", ";", "}", "return", "mWriter", ...
returns true if the given tile for the current map source exists in the cache db
[ "returns", "true", "if", "the", "given", "tile", "for", "the", "current", "map", "source", "exists", "in", "the", "cache", "db" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/MapTileSqlCacheProvider.java#L137-L143
59,335
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/util/ManifestUtil.java
ManifestUtil.retrieveKey
public static String retrieveKey(final Context aContext, final String aKey) { // get the key from the manifest final PackageManager pm = aContext.getPackageManager(); try { final ApplicationInfo info = pm.getApplicationInfo(aContext.getPackageName(), PackageManager.GET_META_DAT...
java
public static String retrieveKey(final Context aContext, final String aKey) { // get the key from the manifest final PackageManager pm = aContext.getPackageManager(); try { final ApplicationInfo info = pm.getApplicationInfo(aContext.getPackageName(), PackageManager.GET_META_DAT...
[ "public", "static", "String", "retrieveKey", "(", "final", "Context", "aContext", ",", "final", "String", "aKey", ")", "{", "// get the key from the manifest", "final", "PackageManager", "pm", "=", "aContext", ".", "getPackageManager", "(", ")", ";", "try", "{", ...
Retrieve a key from the manifest meta data, or empty string if not found.
[ "Retrieve", "a", "key", "from", "the", "manifest", "meta", "data", "or", "empty", "string", "if", "not", "found", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/util/ManifestUtil.java#L17-L38
59,336
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java
CacheManager.forceLoadTile
public boolean forceLoadTile(final OnlineTileSourceBase tileSource, final long pMapTileIndex) { try { final Drawable drawable = mTileDownloader.downloadTile(pMapTileIndex, mTileWriter, tileSource); return drawable != null; } catch (CantContinueException e) { return fa...
java
public boolean forceLoadTile(final OnlineTileSourceBase tileSource, final long pMapTileIndex) { try { final Drawable drawable = mTileDownloader.downloadTile(pMapTileIndex, mTileWriter, tileSource); return drawable != null; } catch (CantContinueException e) { return fa...
[ "public", "boolean", "forceLoadTile", "(", "final", "OnlineTileSourceBase", "tileSource", ",", "final", "long", "pMapTileIndex", ")", "{", "try", "{", "final", "Drawable", "drawable", "=", "mTileDownloader", ".", "downloadTile", "(", "pMapTileIndex", ",", "mTileWrit...
Actual tile download, regardless of the tile being already present in the cache @return true if success, false if error @since 5.6.5
[ "Actual", "tile", "download", "regardless", "of", "the", "tile", "being", "already", "present", "in", "the", "cache" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L166-L173
59,337
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java
CacheManager.isTileToBeDownloaded
public boolean isTileToBeDownloaded(final ITileSource pTileSource, final long pMapTileIndex) { final Long expiration = mTileWriter.getExpirationTimestamp(pTileSource, pMapTileIndex); if (expiration == null) { return true; } final long now = System.currentTimeMillis(); ...
java
public boolean isTileToBeDownloaded(final ITileSource pTileSource, final long pMapTileIndex) { final Long expiration = mTileWriter.getExpirationTimestamp(pTileSource, pMapTileIndex); if (expiration == null) { return true; } final long now = System.currentTimeMillis(); ...
[ "public", "boolean", "isTileToBeDownloaded", "(", "final", "ITileSource", "pTileSource", ",", "final", "long", "pMapTileIndex", ")", "{", "final", "Long", "expiration", "=", "mTileWriter", ".", "getExpirationTimestamp", "(", "pTileSource", ",", "pMapTileIndex", ")", ...
"Should we download this tile?", either because it's not cached yet or because it's expired @since 5.6.5
[ "Should", "we", "download", "this", "tile?", "either", "because", "it", "s", "not", "cached", "yet", "or", "because", "it", "s", "expired" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L188-L195
59,338
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java
CacheManager.getTilesCoverageIterable
static IterableWithSize<Long> getTilesCoverageIterable(final BoundingBox pBB, final int pZoomMin, final int pZoomMax) { final MapTileAreaList list = new MapTileAreaList(); for (int zoomLevel = pZoomMin; zoomLevel <= pZoomMax; zoomLevel++) { ...
java
static IterableWithSize<Long> getTilesCoverageIterable(final BoundingBox pBB, final int pZoomMin, final int pZoomMax) { final MapTileAreaList list = new MapTileAreaList(); for (int zoomLevel = pZoomMin; zoomLevel <= pZoomMax; zoomLevel++) { ...
[ "static", "IterableWithSize", "<", "Long", ">", "getTilesCoverageIterable", "(", "final", "BoundingBox", "pBB", ",", "final", "int", "pZoomMin", ",", "final", "int", "pZoomMax", ")", "{", "final", "MapTileAreaList", "list", "=", "new", "MapTileAreaList", "(", ")...
Iterable returning tiles covered by the bounding box sorted by ascending zoom level @param pBB the given bounding box @param pZoomMin the given minimum zoom level @param pZoomMax the given maximum zoom level @return the iterable described above
[ "Iterable", "returning", "tiles", "covered", "by", "the", "bounding", "box", "sorted", "by", "ascending", "zoom", "level" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L230-L237
59,339
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java
CacheManager.getTilesCoverage
public static List<Long> getTilesCoverage(final ArrayList<GeoPoint> pGeoPoints, final int pZoomMin, final int pZoomMax) { final List<Long> result = new ArrayList<>(); for (int zoomLevel = pZoomMin; zoomLevel <= pZoomMax; zoomLevel++) { final Coll...
java
public static List<Long> getTilesCoverage(final ArrayList<GeoPoint> pGeoPoints, final int pZoomMin, final int pZoomMax) { final List<Long> result = new ArrayList<>(); for (int zoomLevel = pZoomMin; zoomLevel <= pZoomMax; zoomLevel++) { final Coll...
[ "public", "static", "List", "<", "Long", ">", "getTilesCoverage", "(", "final", "ArrayList", "<", "GeoPoint", ">", "pGeoPoints", ",", "final", "int", "pZoomMin", ",", "final", "int", "pZoomMax", ")", "{", "final", "List", "<", "Long", ">", "result", "=", ...
Computes the theoretical tiles covered by the list of points @return list of tiles, sorted by ascending zoom level
[ "Computes", "the", "theoretical", "tiles", "covered", "by", "the", "list", "of", "points" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L268-L276
59,340
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java
CacheManager.downloadAreaAsync
public CacheManagerTask downloadAreaAsync(Context ctx, ArrayList<GeoPoint> geoPoints, final int zoomMin, final int zoomMax, final CacheManagerCallback callback) { final CacheManagerTask task = new CacheManagerTask(this, getDownloadingAction(), geoPoints, zoomMin, zoomMax); task.addCallback(callback); ...
java
public CacheManagerTask downloadAreaAsync(Context ctx, ArrayList<GeoPoint> geoPoints, final int zoomMin, final int zoomMax, final CacheManagerCallback callback) { final CacheManagerTask task = new CacheManagerTask(this, getDownloadingAction(), geoPoints, zoomMin, zoomMax); task.addCallback(callback); ...
[ "public", "CacheManagerTask", "downloadAreaAsync", "(", "Context", "ctx", ",", "ArrayList", "<", "GeoPoint", ">", "geoPoints", ",", "final", "int", "zoomMin", ",", "final", "int", "zoomMax", ",", "final", "CacheManagerCallback", "callback", ")", "{", "final", "C...
Download in background all tiles covered by the GePoints list in osmdroid cache. @param ctx @param geoPoints @param zoomMin @param zoomMax
[ "Download", "in", "background", "all", "tiles", "covered", "by", "the", "GePoints", "list", "in", "osmdroid", "cache", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L436-L441
59,341
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java
CacheManager.downloadAreaAsyncNoUI
public CacheManagerTask downloadAreaAsyncNoUI(Context ctx, BoundingBox bb, final int zoomMin, final int zoomMax, final CacheManagerCallback callback) { final CacheManagerTask task = new CacheManagerTask(this, getDownloadingAction(), bb, zoomMin, zoomMax); task.addCallback(callback); execute(task...
java
public CacheManagerTask downloadAreaAsyncNoUI(Context ctx, BoundingBox bb, final int zoomMin, final int zoomMax, final CacheManagerCallback callback) { final CacheManagerTask task = new CacheManagerTask(this, getDownloadingAction(), bb, zoomMin, zoomMax); task.addCallback(callback); execute(task...
[ "public", "CacheManagerTask", "downloadAreaAsyncNoUI", "(", "Context", "ctx", ",", "BoundingBox", "bb", ",", "final", "int", "zoomMin", ",", "final", "int", "zoomMax", ",", "final", "CacheManagerCallback", "callback", ")", "{", "final", "CacheManagerTask", "task", ...
Download in background all tiles of the specified area in osmdroid cache without a user interface. @param ctx @param bb @param zoomMin @param zoomMax @since 5.3
[ "Download", "in", "background", "all", "tiles", "of", "the", "specified", "area", "in", "osmdroid", "cache", "without", "a", "user", "interface", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L467-L472
59,342
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java
CacheManager.cancelAllJobs
public void cancelAllJobs(){ Iterator<CacheManagerTask> iterator = mPendingTasks.iterator(); while (iterator.hasNext()) { CacheManagerTask next = iterator.next(); next.cancel(true); } mPendingTasks.clear(); }
java
public void cancelAllJobs(){ Iterator<CacheManagerTask> iterator = mPendingTasks.iterator(); while (iterator.hasNext()) { CacheManagerTask next = iterator.next(); next.cancel(true); } mPendingTasks.clear(); }
[ "public", "void", "cancelAllJobs", "(", ")", "{", "Iterator", "<", "CacheManagerTask", ">", "iterator", "=", "mPendingTasks", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "CacheManagerTask", "next", "=", "it...
cancels all tasks @since 5.6.3
[ "cancels", "all", "tasks" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L478-L485
59,343
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java
CacheManager.downloadAreaAsync
public CacheManagerTask downloadAreaAsync(Context ctx, List<Long> pTiles, final int zoomMin, final int zoomMax) { final CacheManagerTask task = new CacheManagerTask(this, getDownloadingAction(), pTiles, zoomMin, zoomMax); task.addCallback(getDownloadingDialog(ctx, task)); return execute(task); ...
java
public CacheManagerTask downloadAreaAsync(Context ctx, List<Long> pTiles, final int zoomMin, final int zoomMax) { final CacheManagerTask task = new CacheManagerTask(this, getDownloadingAction(), pTiles, zoomMin, zoomMax); task.addCallback(getDownloadingDialog(ctx, task)); return execute(task); ...
[ "public", "CacheManagerTask", "downloadAreaAsync", "(", "Context", "ctx", ",", "List", "<", "Long", ">", "pTiles", ",", "final", "int", "zoomMin", ",", "final", "int", "zoomMax", ")", "{", "final", "CacheManagerTask", "task", "=", "new", "CacheManagerTask", "(...
Download in background all tiles of the specified area in osmdroid cache. @param ctx @param pTiles @param zoomMin @param zoomMax
[ "Download", "in", "background", "all", "tiles", "of", "the", "specified", "area", "in", "osmdroid", "cache", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L495-L499
59,344
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java
CacheManager.cleanAreaAsync
public CacheManagerTask cleanAreaAsync(final Context ctx, ArrayList<GeoPoint> geoPoints, int zoomMin, int zoomMax) { BoundingBox extendedBounds = extendedBoundsFromGeoPoints(geoPoints,zoomMin); return cleanAreaAsync(ctx, extendedBounds, zoomMin, zoomMax); }
java
public CacheManagerTask cleanAreaAsync(final Context ctx, ArrayList<GeoPoint> geoPoints, int zoomMin, int zoomMax) { BoundingBox extendedBounds = extendedBoundsFromGeoPoints(geoPoints,zoomMin); return cleanAreaAsync(ctx, extendedBounds, zoomMin, zoomMax); }
[ "public", "CacheManagerTask", "cleanAreaAsync", "(", "final", "Context", "ctx", ",", "ArrayList", "<", "GeoPoint", ">", "geoPoints", ",", "int", "zoomMin", ",", "int", "zoomMax", ")", "{", "BoundingBox", "extendedBounds", "=", "extendedBoundsFromGeoPoints", "(", "...
Remove all cached tiles covered by the GeoPoints list. @param ctx @param geoPoints @param zoomMin @param zoomMax
[ "Remove", "all", "cached", "tiles", "covered", "by", "the", "GeoPoints", "list", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L905-L908
59,345
osmdroid/osmdroid
OpenStreetMapViewer/src/main/java/org/osmdroid/MainActivity.java
MainActivity.updateStoragePrefreneces
public static long updateStoragePrefreneces(Context ctx){ //loads the osmdroid config from the shared preferences object. //if this is the first time launching this app, all settings are set defaults with one exception, //the tile cache. the default is the largest write storage partition, which...
java
public static long updateStoragePrefreneces(Context ctx){ //loads the osmdroid config from the shared preferences object. //if this is the first time launching this app, all settings are set defaults with one exception, //the tile cache. the default is the largest write storage partition, which...
[ "public", "static", "long", "updateStoragePrefreneces", "(", "Context", "ctx", ")", "{", "//loads the osmdroid config from the shared preferences object.", "//if this is the first time launching this app, all settings are set defaults with one exception,", "//the tile cache. the default is the...
refreshes the current osmdroid cache paths with user preferences plus soe logic to work around file system permissions on api23 devices. it's primarily used for out android tests. @param ctx @return current cache size in bytes
[ "refreshes", "the", "current", "osmdroid", "cache", "paths", "with", "user", "preferences", "plus", "soe", "logic", "to", "work", "around", "file", "system", "permissions", "on", "api23", "devices", ".", "it", "s", "primarily", "used", "for", "out", "android",...
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/MainActivity.java#L205-L222
59,346
osmdroid/osmdroid
OpenStreetMapViewer/src/main/java/org/osmdroid/MainActivity.java
MainActivity.updateStorageInfo
private void updateStorageInfo(){ long cacheSize = updateStoragePrefreneces(this); //cache management ends here TextView tv = findViewById(R.id.sdcardstate_value); final String state = Environment.getExternalStorageState(); boolean mSdCardAvailable = Environment.MEDIA_MOUNTED....
java
private void updateStorageInfo(){ long cacheSize = updateStoragePrefreneces(this); //cache management ends here TextView tv = findViewById(R.id.sdcardstate_value); final String state = Environment.getExternalStorageState(); boolean mSdCardAvailable = Environment.MEDIA_MOUNTED....
[ "private", "void", "updateStorageInfo", "(", ")", "{", "long", "cacheSize", "=", "updateStoragePrefreneces", "(", "this", ")", ";", "//cache management ends here", "TextView", "tv", "=", "findViewById", "(", "R", ".", "id", ".", "sdcardstate_value", ")", ";", "f...
gets storage state and current cache size
[ "gets", "storage", "state", "and", "current", "cache", "size" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/MainActivity.java#L227-L248
59,347
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/simplefastpoint/SimpleFastPointOverlay.java
SimpleFastPointOverlay.onSingleTapConfirmed
@Override public boolean onSingleTapConfirmed(final MotionEvent event, final MapView mapView) { if(!mStyle.mClickable) return false; float hyp; Float minHyp = null; int closest = -1; Point tmp = new Point(); Projection pj = mapView.getProjection(); for(int i ...
java
@Override public boolean onSingleTapConfirmed(final MotionEvent event, final MapView mapView) { if(!mStyle.mClickable) return false; float hyp; Float minHyp = null; int closest = -1; Point tmp = new Point(); Projection pj = mapView.getProjection(); for(int i ...
[ "@", "Override", "public", "boolean", "onSingleTapConfirmed", "(", "final", "MotionEvent", "event", ",", "final", "MapView", "mapView", ")", "{", "if", "(", "!", "mStyle", ".", "mClickable", ")", "return", "false", ";", "float", "hyp", ";", "Float", "minHyp"...
Default action on tap is to select the nearest point.
[ "Default", "action", "on", "tap", "is", "to", "select", "the", "nearest", "point", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/simplefastpoint/SimpleFastPointOverlay.java#L209-L235
59,348
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/simplefastpoint/SimpleFastPointOverlay.java
SimpleFastPointOverlay.setSelectedPoint
public void setSelectedPoint(Integer toSelect) { if(toSelect == null || toSelect < 0 || toSelect >= mPointList.size()) mSelectedPoint = null; else mSelectedPoint = toSelect; }
java
public void setSelectedPoint(Integer toSelect) { if(toSelect == null || toSelect < 0 || toSelect >= mPointList.size()) mSelectedPoint = null; else mSelectedPoint = toSelect; }
[ "public", "void", "setSelectedPoint", "(", "Integer", "toSelect", ")", "{", "if", "(", "toSelect", "==", "null", "||", "toSelect", "<", "0", "||", "toSelect", ">=", "mPointList", ".", "size", "(", ")", ")", "mSelectedPoint", "=", "null", ";", "else", "mS...
Sets the highlighted point. App must invalidate the MapView. @param toSelect The index of the point (zero-based) in the original list.
[ "Sets", "the", "highlighted", "point", ".", "App", "must", "invalidate", "the", "MapView", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/simplefastpoint/SimpleFastPointOverlay.java#L241-L246
59,349
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/bing/ImageryMetaData.java
ImageryMetaData.getInstanceFromJSON
static public ImageryMetaDataResource getInstanceFromJSON(final String a_jsonContent) throws Exception { if(a_jsonContent==null) { throw new Exception("JSON to parse is null"); } /// response code should be 200 and authorization should be valid (valid BingMap key) final JSONObject jsonResult = new JSONObj...
java
static public ImageryMetaDataResource getInstanceFromJSON(final String a_jsonContent) throws Exception { if(a_jsonContent==null) { throw new Exception("JSON to parse is null"); } /// response code should be 200 and authorization should be valid (valid BingMap key) final JSONObject jsonResult = new JSONObj...
[ "static", "public", "ImageryMetaDataResource", "getInstanceFromJSON", "(", "final", "String", "a_jsonContent", ")", "throws", "Exception", "{", "if", "(", "a_jsonContent", "==", "null", ")", "{", "throw", "new", "Exception", "(", "\"JSON to parse is null\"", ")", ";...
Parse a JSON string containing ImageryMetaData response @param a_jsonContent the JSON content string @return ImageryMetaDataResource object containing parsed information @throws Exception
[ "Parse", "a", "JSON", "string", "containing", "ImageryMetaData", "response" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/bing/ImageryMetaData.java#L26-L57
59,350
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/ArchiveFileFactory.java
ArchiveFileFactory.registerArchiveFileProvider
public static void registerArchiveFileProvider(Class<? extends IArchiveFile> provider, String fileExtension){ extensionMap.put(fileExtension, provider); }
java
public static void registerArchiveFileProvider(Class<? extends IArchiveFile> provider, String fileExtension){ extensionMap.put(fileExtension, provider); }
[ "public", "static", "void", "registerArchiveFileProvider", "(", "Class", "<", "?", "extends", "IArchiveFile", ">", "provider", ",", "String", "fileExtension", ")", "{", "extensionMap", ".", "put", "(", "fileExtension", ",", "provider", ")", ";", "}" ]
Registers a custom archive file provider @param provider @param fileExtension without the dot @since 5.0
[ "Registers", "a", "custom", "archive", "file", "provider" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/ArchiveFileFactory.java#L43-L45
59,351
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/config/DefaultConfigurationProvider.java
DefaultConfigurationProvider.load
private static void load(final SharedPreferences pPrefs, final Map<String, String> pMap, final String pPrefix) { //potential fix for #1079 https://github.com/osmdroid/osmdroid/issues/1079 if (pPrefix==null || pMap==null) return; pMap.clear(); for (final St...
java
private static void load(final SharedPreferences pPrefs, final Map<String, String> pMap, final String pPrefix) { //potential fix for #1079 https://github.com/osmdroid/osmdroid/issues/1079 if (pPrefix==null || pMap==null) return; pMap.clear(); for (final St...
[ "private", "static", "void", "load", "(", "final", "SharedPreferences", "pPrefs", ",", "final", "Map", "<", "String", ",", "String", ">", "pMap", ",", "final", "String", "pPrefix", ")", "{", "//potential fix for #1079 https://github.com/osmdroid/osmdroid/issues/1079",...
Loading a map from preferences, using a prefix for the prefs keys @since 5.6.5 @param pPrefs @param pMap @param pPrefix
[ "Loading", "a", "map", "from", "preferences", "using", "a", "prefix", "for", "the", "prefs", "keys" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/config/DefaultConfigurationProvider.java#L416-L427
59,352
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/config/DefaultConfigurationProvider.java
DefaultConfigurationProvider.save
private static void save(final SharedPreferences pPrefs, final SharedPreferences.Editor pEdit, final Map<String, String> pMap, final String pPrefix) { for (final String key : pPrefs.getAll().keySet()) { if (key.startsWith(pPrefix)) { pEdit.remove(key); ...
java
private static void save(final SharedPreferences pPrefs, final SharedPreferences.Editor pEdit, final Map<String, String> pMap, final String pPrefix) { for (final String key : pPrefs.getAll().keySet()) { if (key.startsWith(pPrefix)) { pEdit.remove(key); ...
[ "private", "static", "void", "save", "(", "final", "SharedPreferences", "pPrefs", ",", "final", "SharedPreferences", ".", "Editor", "pEdit", ",", "final", "Map", "<", "String", ",", "String", ">", "pMap", ",", "final", "String", "pPrefix", ")", "{", "for", ...
Saving a map into preferences, using a prefix for the prefs keys @since 5.6.5 @param pPrefs @param pEdit @param pMap @param pPrefix
[ "Saving", "a", "map", "into", "preferences", "using", "a", "prefix", "for", "the", "prefs", "keys" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/config/DefaultConfigurationProvider.java#L438-L449
59,353
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/util/CloudmadeUtil.java
CloudmadeUtil.retrieveCloudmadeKey
public static void retrieveCloudmadeKey(final Context aContext) { mAndroidId = Settings.Secure.getString(aContext.getContentResolver(), Settings.Secure.ANDROID_ID); // get the key from the manifest mKey = ManifestUtil.retrieveKey(aContext, CLOUDMADE_KEY); // if the id hasn't changed then set the token to the...
java
public static void retrieveCloudmadeKey(final Context aContext) { mAndroidId = Settings.Secure.getString(aContext.getContentResolver(), Settings.Secure.ANDROID_ID); // get the key from the manifest mKey = ManifestUtil.retrieveKey(aContext, CLOUDMADE_KEY); // if the id hasn't changed then set the token to the...
[ "public", "static", "void", "retrieveCloudmadeKey", "(", "final", "Context", "aContext", ")", "{", "mAndroidId", "=", "Settings", ".", "Secure", ".", "getString", "(", "aContext", ".", "getContentResolver", "(", ")", ",", "Settings", ".", "Secure", ".", "ANDRO...
Retrieve the key from the manifest and store it for later use.
[ "Retrieve", "the", "key", "from", "the", "manifest", "and", "store", "it", "for", "later", "use", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/util/CloudmadeUtil.java#L54-L76
59,354
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/util/CloudmadeUtil.java
CloudmadeUtil.getCloudmadeToken
public static String getCloudmadeToken() { if (mToken.length() == 0) { synchronized (mToken) { // check again because it may have been set while we were blocking if (mToken.length() == 0) { final String url = "http://auth.cloudmade.com/token/" + mKey + "?userid=" + mAndroidId; HttpURLConnection...
java
public static String getCloudmadeToken() { if (mToken.length() == 0) { synchronized (mToken) { // check again because it may have been set while we were blocking if (mToken.length() == 0) { final String url = "http://auth.cloudmade.com/token/" + mKey + "?userid=" + mAndroidId; HttpURLConnection...
[ "public", "static", "String", "getCloudmadeToken", "(", ")", "{", "if", "(", "mToken", ".", "length", "(", ")", "==", "0", ")", "{", "synchronized", "(", "mToken", ")", "{", "// check again because it may have been set while we were blocking", "if", "(", "mToken",...
Get the token from the Cloudmade server. @return the token returned from the server, or null if not found
[ "Get", "the", "token", "from", "the", "Cloudmade", "server", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/util/CloudmadeUtil.java#L101-L165
59,355
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/gridlines/LatLonGridlineOverlay.java
LatLonGridlineOverlay.getStartEndPointsWE
private static double[] getStartEndPointsWE(double west, double east, int zoom) { double incrementor = getIncrementor(zoom); //brute force when zoom is less than 10 if (zoom < 10) { double we_startpoint = Math.floor(west); double x = 180; while (x > we_startp...
java
private static double[] getStartEndPointsWE(double west, double east, int zoom) { double incrementor = getIncrementor(zoom); //brute force when zoom is less than 10 if (zoom < 10) { double we_startpoint = Math.floor(west); double x = 180; while (x > we_startp...
[ "private", "static", "double", "[", "]", "getStartEndPointsWE", "(", "double", "west", ",", "double", "east", ",", "int", "zoom", ")", "{", "double", "incrementor", "=", "getIncrementor", "(", "zoom", ")", ";", "//brute force when zoom is less than 10", "if", "(...
gets the start and stop point for a longitude line @param west @param east @param zoom @return
[ "gets", "the", "start", "and", "stop", "point", "for", "a", "longitude", "line" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/gridlines/LatLonGridlineOverlay.java#L337-L389
59,356
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/gridlines/LatLonGridlineOverlay.java
LatLonGridlineOverlay.setDefaults
public static void setDefaults() { lineColor = Color.BLACK; fontColor=Color.WHITE; backgroundColor=Color.BLACK; lineWidth = 1f; fontSizeDp=32; DEBUG=false; DEBUG2=false; }
java
public static void setDefaults() { lineColor = Color.BLACK; fontColor=Color.WHITE; backgroundColor=Color.BLACK; lineWidth = 1f; fontSizeDp=32; DEBUG=false; DEBUG2=false; }
[ "public", "static", "void", "setDefaults", "(", ")", "{", "lineColor", "=", "Color", ".", "BLACK", ";", "fontColor", "=", "Color", ".", "WHITE", ";", "backgroundColor", "=", "Color", ".", "BLACK", ";", "lineWidth", "=", "1f", ";", "fontSizeDp", "=", "32"...
resets the settings @since 5.6.3
[ "resets", "the", "settings" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/gridlines/LatLonGridlineOverlay.java#L457-L466
59,357
osmdroid/osmdroid
OpenStreetMapViewer/src/main/java/org/osmdroid/debug/model/SqlTileWriterExt.java
SqlTileWriterExt.getSources
public List<SourceCount> getSources() { final SQLiteDatabase db = getDb(); List<SourceCount> ret = new ArrayList<>(); if (db == null) { return ret; } Cursor cur = null; try { cur = db.rawQuery( "select " ...
java
public List<SourceCount> getSources() { final SQLiteDatabase db = getDb(); List<SourceCount> ret = new ArrayList<>(); if (db == null) { return ret; } Cursor cur = null; try { cur = db.rawQuery( "select " ...
[ "public", "List", "<", "SourceCount", ">", "getSources", "(", ")", "{", "final", "SQLiteDatabase", "db", "=", "getDb", "(", ")", ";", "List", "<", "SourceCount", ">", "ret", "=", "new", "ArrayList", "<>", "(", ")", ";", "if", "(", "db", "==", "null",...
gets all the tiles sources that we have tiles for in the cache database and their counts @return
[ "gets", "all", "the", "tiles", "sources", "that", "we", "have", "tiles", "for", "in", "the", "cache", "database", "and", "their", "counts" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/debug/model/SqlTileWriterExt.java#L41-L76
59,358
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polyline.java
Polyline.isCloseTo
public boolean isCloseTo(GeoPoint point, double tolerance, MapView mapView) { return getCloseTo(point, tolerance, mapView) != null; }
java
public boolean isCloseTo(GeoPoint point, double tolerance, MapView mapView) { return getCloseTo(point, tolerance, mapView) != null; }
[ "public", "boolean", "isCloseTo", "(", "GeoPoint", "point", ",", "double", "tolerance", ",", "MapView", "mapView", ")", "{", "return", "getCloseTo", "(", "point", ",", "tolerance", ",", "mapView", ")", "!=", "null", ";", "}" ]
Detection is done is screen coordinates. @param point @param tolerance in pixels @return true if the Polyline is close enough to the point.
[ "Detection", "is", "done", "is", "screen", "coordinates", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polyline.java#L176-L178
59,359
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polyline.java
Polyline.setDefaultInfoWindowLocation
protected void setDefaultInfoWindowLocation(){ int s = mOriginalPoints.size(); if (s > 0) mInfoWindowLocation = mOriginalPoints.get(s/2); else mInfoWindowLocation = new GeoPoint(0.0, 0.0); }
java
protected void setDefaultInfoWindowLocation(){ int s = mOriginalPoints.size(); if (s > 0) mInfoWindowLocation = mOriginalPoints.get(s/2); else mInfoWindowLocation = new GeoPoint(0.0, 0.0); }
[ "protected", "void", "setDefaultInfoWindowLocation", "(", ")", "{", "int", "s", "=", "mOriginalPoints", ".", "size", "(", ")", ";", "if", "(", "s", ">", "0", ")", "mInfoWindowLocation", "=", "mOriginalPoints", ".", "get", "(", "s", "/", "2", ")", ";", ...
Internal method used to ensure that the infowindow will have a default position in all cases, so that the user can call showInfoWindow even if no tap occured before. Currently, set the position on the "middle" point of the polyline.
[ "Internal", "method", "used", "to", "ensure", "that", "the", "infowindow", "will", "have", "a", "default", "position", "in", "all", "cases", "so", "that", "the", "user", "can", "call", "showInfoWindow", "even", "if", "no", "tap", "occured", "before", ".", ...
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polyline.java#L245-L251
59,360
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/MapView.java
MapView.onDetach
public void onDetach() { this.getOverlayManager().onDetach(this); mTileProvider.detach(); mOldZoomController.setVisible(false); if (mZoomController != null) { mZoomController.onDetach(); } //https://github.com/osmdroid/osmdroid/issues/390 if (mTileRequestCompleteHandler instanceof SimpleInvalidationHa...
java
public void onDetach() { this.getOverlayManager().onDetach(this); mTileProvider.detach(); mOldZoomController.setVisible(false); if (mZoomController != null) { mZoomController.onDetach(); } //https://github.com/osmdroid/osmdroid/issues/390 if (mTileRequestCompleteHandler instanceof SimpleInvalidationHa...
[ "public", "void", "onDetach", "(", ")", "{", "this", ".", "getOverlayManager", "(", ")", ".", "onDetach", "(", "this", ")", ";", "mTileProvider", ".", "detach", "(", ")", ";", "mOldZoomController", ".", "setVisible", "(", "false", ")", ";", "if", "(", ...
destroys the map view, all references to listeners, all overlays, etc
[ "destroys", "the", "map", "view", "all", "references", "to", "listeners", "all", "overlays", "etc" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/MapView.java#L1052-L1070
59,361
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/SegmentIntersection.java
SegmentIntersection.parallelSideEffect
private static boolean parallelSideEffect( final double pXA, final double pYA, final double pXB, final double pYB, final double pXC, final double pYC, final double pXD, final double pYD, final PointL pIntersection ) { if (pXA == pXB) { return parallelSideEffec...
java
private static boolean parallelSideEffect( final double pXA, final double pYA, final double pXB, final double pYB, final double pXC, final double pYC, final double pXD, final double pYD, final PointL pIntersection ) { if (pXA == pXB) { return parallelSideEffec...
[ "private", "static", "boolean", "parallelSideEffect", "(", "final", "double", "pXA", ",", "final", "double", "pYA", ",", "final", "double", "pXB", ",", "final", "double", "pYB", ",", "final", "double", "pXC", ",", "final", "double", "pYC", ",", "final", "d...
When the segments are parallels and overlap, the middle of the overlap is considered as the intersection
[ "When", "the", "segments", "are", "parallels", "and", "overlap", "the", "middle", "of", "the", "overlap", "is", "considered", "as", "the", "intersection" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/SegmentIntersection.java#L47-L72
59,362
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/SegmentIntersection.java
SegmentIntersection.check
private static boolean check( final double pXA, final double pYA, final double pXB, final double pYB, final double pXC, final double pYC, final double pXD, final double pYD, final PointL pIntersection, final double pXI, final double pYI ) { if (pXI < Math.min(...
java
private static boolean check( final double pXA, final double pYA, final double pXB, final double pYB, final double pXC, final double pYC, final double pXD, final double pYD, final PointL pIntersection, final double pXI, final double pYI ) { if (pXI < Math.min(...
[ "private", "static", "boolean", "check", "(", "final", "double", "pXA", ",", "final", "double", "pYA", ",", "final", "double", "pXB", ",", "final", "double", "pYB", ",", "final", "double", "pXC", ",", "final", "double", "pYC", ",", "final", "double", "pX...
Checks if computed intersection is valid and sets output accordingly @param pXI intersection x @param pYI intersection y @return true if OK
[ "Checks", "if", "computed", "intersection", "is", "valid", "and", "sets", "output", "accordingly" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/SegmentIntersection.java#L85-L108
59,363
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/SegmentIntersection.java
SegmentIntersection.divisionByZeroSideEffect
private static boolean divisionByZeroSideEffect( final double pXA, final double pYA, final double pXB, final double pYB, final double pXC, final double pYC, final double pXD, final double pYD, final PointL pIntersection ) { return divisionByZeroSideEffectX(pXA, pYA, pXB, ...
java
private static boolean divisionByZeroSideEffect( final double pXA, final double pYA, final double pXB, final double pYB, final double pXC, final double pYC, final double pXD, final double pYD, final PointL pIntersection ) { return divisionByZeroSideEffectX(pXA, pYA, pXB, ...
[ "private", "static", "boolean", "divisionByZeroSideEffect", "(", "final", "double", "pXA", ",", "final", "double", "pYA", ",", "final", "double", "pXB", ",", "final", "double", "pYB", ",", "final", "double", "pXC", ",", "final", "double", "pYC", ",", "final"...
Main intersection formula works only without division by zero
[ "Main", "intersection", "formula", "works", "only", "without", "division", "by", "zero" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/SegmentIntersection.java#L134-L143
59,364
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedIconOverlay.java
ItemizedIconOverlay.onSingleTapConfirmed
@Override public boolean onSingleTapConfirmed(final MotionEvent event, final MapView mapView) { return (activateSelectedItems(event, mapView, new ActiveItem() { @Override public boolean run(final int index) { final ItemizedIconOverlay<Item> that = ItemizedIconOverlay.this; if (that.mOnItemGestureListen...
java
@Override public boolean onSingleTapConfirmed(final MotionEvent event, final MapView mapView) { return (activateSelectedItems(event, mapView, new ActiveItem() { @Override public boolean run(final int index) { final ItemizedIconOverlay<Item> that = ItemizedIconOverlay.this; if (that.mOnItemGestureListen...
[ "@", "Override", "public", "boolean", "onSingleTapConfirmed", "(", "final", "MotionEvent", "event", ",", "final", "MapView", "mapView", ")", "{", "return", "(", "activateSelectedItems", "(", "event", ",", "mapView", ",", "new", "ActiveItem", "(", ")", "{", "@"...
Each of these methods performs a item sensitive check. If the item is located its corresponding method is called. The result of the call is returned. Helper methods are provided so that child classes may more easily override behavior without resorting to overriding the ItemGestureListener methods.
[ "Each", "of", "these", "methods", "performs", "a", "item", "sensitive", "check", ".", "If", "the", "item", "is", "located", "its", "corresponding", "method", "is", "called", ".", "The", "result", "of", "the", "call", "is", "returned", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedIconOverlay.java#L118-L130
59,365
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedIconOverlay.java
ItemizedIconOverlay.activateSelectedItems
private boolean activateSelectedItems(final MotionEvent event, final MapView mapView, final ActiveItem task) { final int eventX = Math.round(event.getX()); final int eventY = Math.round(event.getY()); for (int i = 0; i < this.mItemList.size(); ++i) { if (isEventOnItem(getItem(i), eventX, eventY, mapView)) {...
java
private boolean activateSelectedItems(final MotionEvent event, final MapView mapView, final ActiveItem task) { final int eventX = Math.round(event.getX()); final int eventY = Math.round(event.getY()); for (int i = 0; i < this.mItemList.size(); ++i) { if (isEventOnItem(getItem(i), eventX, eventY, mapView)) {...
[ "private", "boolean", "activateSelectedItems", "(", "final", "MotionEvent", "event", ",", "final", "MapView", "mapView", ",", "final", "ActiveItem", "task", ")", "{", "final", "int", "eventX", "=", "Math", ".", "round", "(", "event", ".", "getX", "(", ")", ...
When a content sensitive action is performed the content item needs to be identified. This method does that and then performs the assigned task on that item. @param event @param mapView @param task @return true if event is handled false otherwise
[ "When", "a", "content", "sensitive", "action", "is", "performed", "the", "content", "item", "needs", "to", "be", "identified", ".", "This", "method", "does", "that", "and", "then", "performs", "the", "assigned", "task", "on", "that", "item", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedIconOverlay.java#L163-L175
59,366
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileCache.java
MapTileCache.garbageCollection
public void garbageCollection() { // number of tiles to remove from cache int toBeRemoved = Integer.MAX_VALUE; // MAX_VALUE for stressed memory case final int size = mCachedTiles.size(); if (!mStressedMemory) { toBeRemoved = size - mCapacity; if (toBeRemoved <= 0) { return; } } refreshAddition...
java
public void garbageCollection() { // number of tiles to remove from cache int toBeRemoved = Integer.MAX_VALUE; // MAX_VALUE for stressed memory case final int size = mCachedTiles.size(); if (!mStressedMemory) { toBeRemoved = size - mCapacity; if (toBeRemoved <= 0) { return; } } refreshAddition...
[ "public", "void", "garbageCollection", "(", ")", "{", "// number of tiles to remove from cache", "int", "toBeRemoved", "=", "Integer", ".", "MAX_VALUE", ";", "// MAX_VALUE for stressed memory case", "final", "int", "size", "=", "mCachedTiles", ".", "size", "(", ")", "...
Removes from the memory cache all the tiles that should no longer be there @since 6.0.0
[ "Removes", "from", "the", "memory", "cache", "all", "the", "tiles", "that", "should", "no", "longer", "be", "there" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileCache.java#L159-L194
59,367
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileCache.java
MapTileCache.populateSyncCachedTiles
private void populateSyncCachedTiles(final MapTileList pList) { synchronized (mCachedTiles) { pList.ensureCapacity(mCachedTiles.size()); pList.clear(); for (final long index : mCachedTiles.keySet()) { pList.put(index); } } }
java
private void populateSyncCachedTiles(final MapTileList pList) { synchronized (mCachedTiles) { pList.ensureCapacity(mCachedTiles.size()); pList.clear(); for (final long index : mCachedTiles.keySet()) { pList.put(index); } } }
[ "private", "void", "populateSyncCachedTiles", "(", "final", "MapTileList", "pList", ")", "{", "synchronized", "(", "mCachedTiles", ")", "{", "pList", ".", "ensureCapacity", "(", "mCachedTiles", ".", "size", "(", ")", ")", ";", "pList", ".", "clear", "(", ")"...
Just a helper method in order to parse all indices without concurrency side effects @since 6.0.0
[ "Just", "a", "helper", "method", "in", "order", "to", "parse", "all", "indices", "without", "concurrency", "side", "effects" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileCache.java#L314-L322
59,368
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/compass/InternalCompassOrientationProvider.java
InternalCompassOrientationProvider.startOrientationProvider
@Override public boolean startOrientationProvider(IOrientationConsumer orientationConsumer) { mOrientationConsumer = orientationConsumer; boolean result = false; final Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION); if (sensor != null) { res...
java
@Override public boolean startOrientationProvider(IOrientationConsumer orientationConsumer) { mOrientationConsumer = orientationConsumer; boolean result = false; final Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION); if (sensor != null) { res...
[ "@", "Override", "public", "boolean", "startOrientationProvider", "(", "IOrientationConsumer", "orientationConsumer", ")", "{", "mOrientationConsumer", "=", "orientationConsumer", ";", "boolean", "result", "=", "false", ";", "final", "Sensor", "sensor", "=", "mSensorMan...
Enable orientation updates from the internal compass sensor and show the compass.
[ "Enable", "orientation", "updates", "from", "the", "internal", "compass", "sensor", "and", "show", "the", "compass", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/compass/InternalCompassOrientationProvider.java#L27-L38
59,369
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/IconOverlay.java
IconOverlay.draw
@Override public void draw(Canvas canvas, Projection pj) { if (mIcon == null) return; if (mPosition == null) return; pj.toPixels(mPosition, mPositionPixels); int width = mIcon.getIntrinsicWidth(); int height = mIcon.getIntrinsicHeight(); Rect ...
java
@Override public void draw(Canvas canvas, Projection pj) { if (mIcon == null) return; if (mPosition == null) return; pj.toPixels(mPosition, mPositionPixels); int width = mIcon.getIntrinsicWidth(); int height = mIcon.getIntrinsicHeight(); Rect ...
[ "@", "Override", "public", "void", "draw", "(", "Canvas", "canvas", ",", "Projection", "pj", ")", "{", "if", "(", "mIcon", "==", "null", ")", "return", ";", "if", "(", "mPosition", "==", "null", ")", "return", ";", "pj", ".", "toPixels", "(", "mPosit...
Draw the icon.
[ "Draw", "the", "icon", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/IconOverlay.java#L49-L67
59,370
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/TileSystem.java
TileSystem.getX01FromLongitude
public double getX01FromLongitude(double longitude, boolean wrapEnabled) { longitude = wrapEnabled ? Clip(longitude, getMinLongitude(), getMaxLongitude()) : longitude; final double result = getX01FromLongitude(longitude); return wrapEnabled ? Clip(result, 0, 1) : result; }
java
public double getX01FromLongitude(double longitude, boolean wrapEnabled) { longitude = wrapEnabled ? Clip(longitude, getMinLongitude(), getMaxLongitude()) : longitude; final double result = getX01FromLongitude(longitude); return wrapEnabled ? Clip(result, 0, 1) : result; }
[ "public", "double", "getX01FromLongitude", "(", "double", "longitude", ",", "boolean", "wrapEnabled", ")", "{", "longitude", "=", "wrapEnabled", "?", "Clip", "(", "longitude", ",", "getMinLongitude", "(", ")", ",", "getMaxLongitude", "(", ")", ")", ":", "longi...
Converts a longitude to its "X01" value, id est a double between 0 and 1 for the whole longitude range @since 6.0.0
[ "Converts", "a", "longitude", "to", "its", "X01", "value", "id", "est", "a", "double", "between", "0", "and", "1", "for", "the", "whole", "longitude", "range" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/TileSystem.java#L219-L223
59,371
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/TileSystem.java
TileSystem.getY01FromLatitude
public double getY01FromLatitude(double latitude, boolean wrapEnabled) { latitude = wrapEnabled ? Clip(latitude, getMinLatitude(), getMaxLatitude()) : latitude; final double result = getY01FromLatitude(latitude); return wrapEnabled ? Clip(result, 0, 1) : result; }
java
public double getY01FromLatitude(double latitude, boolean wrapEnabled) { latitude = wrapEnabled ? Clip(latitude, getMinLatitude(), getMaxLatitude()) : latitude; final double result = getY01FromLatitude(latitude); return wrapEnabled ? Clip(result, 0, 1) : result; }
[ "public", "double", "getY01FromLatitude", "(", "double", "latitude", ",", "boolean", "wrapEnabled", ")", "{", "latitude", "=", "wrapEnabled", "?", "Clip", "(", "latitude", ",", "getMinLatitude", "(", ")", ",", "getMaxLatitude", "(", ")", ")", ":", "latitude", ...
Converts a latitude to its "Y01" value, id est a double between 0 and 1 for the whole latitude range @since 6.0.0
[ "Converts", "a", "latitude", "to", "its", "Y01", "value", "id", "est", "a", "double", "between", "0", "and", "1", "for", "the", "whole", "latitude", "range" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/TileSystem.java#L230-L234
59,372
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/infowindow/InfoWindow.java
InfoWindow.open
public void open(Object object, GeoPoint position, int offsetX, int offsetY) { close(); //if it was already opened mRelatedObject = object; mPosition = position; mOffsetX = offsetX; mOffsetY = offsetY; onOpen(object); MapView.LayoutParams lp = new MapView.LayoutPa...
java
public void open(Object object, GeoPoint position, int offsetX, int offsetY) { close(); //if it was already opened mRelatedObject = object; mPosition = position; mOffsetX = offsetX; mOffsetY = offsetY; onOpen(object); MapView.LayoutParams lp = new MapView.LayoutPa...
[ "public", "void", "open", "(", "Object", "object", ",", "GeoPoint", "position", ",", "int", "offsetX", ",", "int", "offsetY", ")", "{", "close", "(", ")", ";", "//if it was already opened", "mRelatedObject", "=", "object", ";", "mPosition", "=", "position", ...
open the InfoWindow at the specified GeoPosition + offset. If it was already opened, close it before reopening. @param object the graphical object on which is hooked the view @param position to place the window on the map @param offsetX (&offsetY) the offset of the view to the position, in pixels. This allows to of...
[ "open", "the", "InfoWindow", "at", "the", "specified", "GeoPosition", "+", "offset", ".", "If", "it", "was", "already", "opened", "close", "it", "before", "reopening", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/infowindow/InfoWindow.java#L105-L124
59,373
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/infowindow/InfoWindow.java
InfoWindow.close
public void close() { if (mIsVisible) { mIsVisible = false; ((ViewGroup) mView.getParent()).removeView(mView); onClose(); } }
java
public void close() { if (mIsVisible) { mIsVisible = false; ((ViewGroup) mView.getParent()).removeView(mView); onClose(); } }
[ "public", "void", "close", "(", ")", "{", "if", "(", "mIsVisible", ")", "{", "mIsVisible", "=", "false", ";", "(", "(", "ViewGroup", ")", "mView", ".", "getParent", "(", ")", ")", ".", "removeView", "(", "mView", ")", ";", "onClose", "(", ")", ";",...
hides the info window, which triggers another render of the map
[ "hides", "the", "info", "window", "which", "triggers", "another", "render", "of", "the", "map" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/infowindow/InfoWindow.java#L151-L157
59,374
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/infowindow/InfoWindow.java
InfoWindow.onDetach
public void onDetach() { close(); if (mView != null) mView.setTag(null); mView = null; mMapView = null; if (Configuration.getInstance().isDebugMode()) Log.d(IMapView.LOGTAG, "Marked detached"); }
java
public void onDetach() { close(); if (mView != null) mView.setTag(null); mView = null; mMapView = null; if (Configuration.getInstance().isDebugMode()) Log.d(IMapView.LOGTAG, "Marked detached"); }
[ "public", "void", "onDetach", "(", ")", "{", "close", "(", ")", ";", "if", "(", "mView", "!=", "null", ")", "mView", ".", "setTag", "(", "null", ")", ";", "mView", "=", "null", ";", "mMapView", "=", "null", ";", "if", "(", "Configuration", ".", "...
this destroys the window and all references to views
[ "this", "destroys", "the", "window", "and", "all", "references", "to", "views" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/infowindow/InfoWindow.java#L162-L170
59,375
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/infowindow/InfoWindow.java
InfoWindow.closeAllInfoWindowsOn
public static void closeAllInfoWindowsOn(MapView mapView) { ArrayList<InfoWindow> opened = getOpenedInfoWindowsOn(mapView); for (InfoWindow infoWindow : opened) { infoWindow.close(); } }
java
public static void closeAllInfoWindowsOn(MapView mapView) { ArrayList<InfoWindow> opened = getOpenedInfoWindowsOn(mapView); for (InfoWindow infoWindow : opened) { infoWindow.close(); } }
[ "public", "static", "void", "closeAllInfoWindowsOn", "(", "MapView", "mapView", ")", "{", "ArrayList", "<", "InfoWindow", ">", "opened", "=", "getOpenedInfoWindowsOn", "(", "mapView", ")", ";", "for", "(", "InfoWindow", "infoWindow", ":", "opened", ")", "{", "...
close all InfoWindows currently opened on this MapView @param mapView
[ "close", "all", "InfoWindows", "currently", "opened", "on", "this", "MapView" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/infowindow/InfoWindow.java#L181-L186
59,376
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/infowindow/InfoWindow.java
InfoWindow.getOpenedInfoWindowsOn
public static ArrayList<InfoWindow> getOpenedInfoWindowsOn(MapView mapView) { int count = mapView.getChildCount(); ArrayList<InfoWindow> opened = new ArrayList<InfoWindow>(count); for (int i = 0; i < count; i++) { final View child = mapView.getChildAt(i); Object tag = chi...
java
public static ArrayList<InfoWindow> getOpenedInfoWindowsOn(MapView mapView) { int count = mapView.getChildCount(); ArrayList<InfoWindow> opened = new ArrayList<InfoWindow>(count); for (int i = 0; i < count; i++) { final View child = mapView.getChildAt(i); Object tag = chi...
[ "public", "static", "ArrayList", "<", "InfoWindow", ">", "getOpenedInfoWindowsOn", "(", "MapView", "mapView", ")", "{", "int", "count", "=", "mapView", ".", "getChildCount", "(", ")", ";", "ArrayList", "<", "InfoWindow", ">", "opened", "=", "new", "ArrayList",...
return all InfoWindows currently opened on this MapView @param mapView @return
[ "return", "all", "InfoWindows", "currently", "opened", "on", "this", "MapView" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/infowindow/InfoWindow.java#L194-L206
59,377
osmdroid/osmdroid
OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/SampleRace.java
SampleRace.getHalfKilometerManager
private MilestoneManager getHalfKilometerManager() { final Path arrowPath = new Path(); // a simple arrow towards the right arrowPath.moveTo(-5, -5); arrowPath.lineTo(5, 0); arrowPath.lineTo(-5, 5); arrowPath.close(); final Paint backgroundPaint = getFillPaint(COLOR_BACKG...
java
private MilestoneManager getHalfKilometerManager() { final Path arrowPath = new Path(); // a simple arrow towards the right arrowPath.moveTo(-5, -5); arrowPath.lineTo(5, 0); arrowPath.lineTo(-5, 5); arrowPath.close(); final Paint backgroundPaint = getFillPaint(COLOR_BACKG...
[ "private", "MilestoneManager", "getHalfKilometerManager", "(", ")", "{", "final", "Path", "arrowPath", "=", "new", "Path", "(", ")", ";", "// a simple arrow towards the right", "arrowPath", ".", "moveTo", "(", "-", "5", ",", "-", "5", ")", ";", "arrowPath", "....
Half-kilometer milestones @since 6.0.2
[ "Half", "-", "kilometer", "milestones" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/SampleRace.java#L184-L204
59,378
osmdroid/osmdroid
osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/OsmMapShapeConverter.java
OsmMapShapeConverter.toWgs84
public Point toWgs84(Point point) { if (projection != null) { point = toWgs84.transform(point); } return point; }
java
public Point toWgs84(Point point) { if (projection != null) { point = toWgs84.transform(point); } return point; }
[ "public", "Point", "toWgs84", "(", "Point", "point", ")", "{", "if", "(", "projection", "!=", "null", ")", "{", "point", "=", "toWgs84", ".", "transform", "(", "point", ")", ";", "}", "return", "point", ";", "}" ]
Transform a projection point to WGS84 @param point @return
[ "Transform", "a", "projection", "point", "to", "WGS84" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/OsmMapShapeConverter.java#L161-L166
59,379
osmdroid/osmdroid
osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/OsmMapShapeConverter.java
OsmMapShapeConverter.toProjection
public Point toProjection(Point point) { if (projection != null) { point = fromWgs84.transform(point); } return point; }
java
public Point toProjection(Point point) { if (projection != null) { point = fromWgs84.transform(point); } return point; }
[ "public", "Point", "toProjection", "(", "Point", "point", ")", "{", "if", "(", "projection", "!=", "null", ")", "{", "point", "=", "fromWgs84", ".", "transform", "(", "point", ")", ";", "}", "return", "point", ";", "}" ]
Transform a WGS84 point to the projection @param point @return
[ "Transform", "a", "WGS84", "point", "to", "the", "projection" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/OsmMapShapeConverter.java#L174-L179
59,380
osmdroid/osmdroid
osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/OsmMapShapeConverter.java
OsmMapShapeConverter.addPolylineToMap
public static Polyline addPolylineToMap(MapView map, Polyline polyline) { if (polyline.getInfoWindow()==null) polyline.setInfoWindow(new BasicInfoWindow(R.layout.bonuspack_bubble, map)); map.getOverlayManager().add(polyline); return polylin...
java
public static Polyline addPolylineToMap(MapView map, Polyline polyline) { if (polyline.getInfoWindow()==null) polyline.setInfoWindow(new BasicInfoWindow(R.layout.bonuspack_bubble, map)); map.getOverlayManager().add(polyline); return polylin...
[ "public", "static", "Polyline", "addPolylineToMap", "(", "MapView", "map", ",", "Polyline", "polyline", ")", "{", "if", "(", "polyline", ".", "getInfoWindow", "(", ")", "==", "null", ")", "polyline", ".", "setInfoWindow", "(", "new", "BasicInfoWindow", "(", ...
Add a Polyline to the map @param map @param polyline @return
[ "Add", "a", "Polyline", "to", "the", "map" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/OsmMapShapeConverter.java#L706-L712
59,381
JakeWharton/DiskLruCache
src/main/java/com/jakewharton/disklrucache/DiskLruCache.java
DiskLruCache.close
public synchronized void close() throws IOException { if (journalWriter == null) { return; // Already closed. } for (Entry entry : new ArrayList<Entry>(lruEntries.values())) { if (entry.currentEditor != null) { entry.currentEditor.abort(); } } trimToSize(); journalWrite...
java
public synchronized void close() throws IOException { if (journalWriter == null) { return; // Already closed. } for (Entry entry : new ArrayList<Entry>(lruEntries.values())) { if (entry.currentEditor != null) { entry.currentEditor.abort(); } } trimToSize(); journalWrite...
[ "public", "synchronized", "void", "close", "(", ")", "throws", "IOException", "{", "if", "(", "journalWriter", "==", "null", ")", "{", "return", ";", "// Already closed.", "}", "for", "(", "Entry", "entry", ":", "new", "ArrayList", "<", "Entry", ">", "(", ...
Closes this cache. Stored values will remain on the filesystem.
[ "Closes", "this", "cache", ".", "Stored", "values", "will", "remain", "on", "the", "filesystem", "." ]
3e016356cfc7e5f9644a7a732fe0223e9742e024
https://github.com/JakeWharton/DiskLruCache/blob/3e016356cfc7e5f9644a7a732fe0223e9742e024/src/main/java/com/jakewharton/disklrucache/DiskLruCache.java#L633-L645
59,382
alibaba/simpleimage
simpleimage.core/src/main/java/com/alibaba/simpleimage/codec/jpeg/JPEGDecoder.java
JPEGDecoder.isSOFnMarker
protected boolean isSOFnMarker(int marker) { if (marker <= 0xC3 && marker >= 0xC0) { return true; } if (marker <= 0xCB && marker >= 0xC5) { return true; } if (marker <= 0xCF && marker >= 0xCD) { return true; } re...
java
protected boolean isSOFnMarker(int marker) { if (marker <= 0xC3 && marker >= 0xC0) { return true; } if (marker <= 0xCB && marker >= 0xC5) { return true; } if (marker <= 0xCF && marker >= 0xCD) { return true; } re...
[ "protected", "boolean", "isSOFnMarker", "(", "int", "marker", ")", "{", "if", "(", "marker", "<=", "0xC3", "&&", "marker", ">=", "0xC0", ")", "{", "return", "true", ";", "}", "if", "(", "marker", "<=", "0xCB", "&&", "marker", ">=", "0xC5", ")", "{", ...
can opt using array @param marker @return
[ "can", "opt", "using", "array" ]
aabe559c267402b754c2ad606b796c4c6570788c
https://github.com/alibaba/simpleimage/blob/aabe559c267402b754c2ad606b796c4c6570788c/simpleimage.core/src/main/java/com/alibaba/simpleimage/codec/jpeg/JPEGDecoder.java#L627-L641
59,383
alibaba/simpleimage
simpleimage.core/src/main/java/com/alibaba/simpleimage/codec/jpeg/JPEGDecoder.java
JPEGDecoder.writeFull
protected void writeFull() { byte[] imageData = rawImage.getData(); int numOfComponents = frameHeader.getNf(); int[] pixes = new int[numOfComponents * DCTSIZE2]; int blockIndex = 0; int startCoordinate = 0, scanlineStride = numOfComponents * rawImage.getWidth(), row = 0; ...
java
protected void writeFull() { byte[] imageData = rawImage.getData(); int numOfComponents = frameHeader.getNf(); int[] pixes = new int[numOfComponents * DCTSIZE2]; int blockIndex = 0; int startCoordinate = 0, scanlineStride = numOfComponents * rawImage.getWidth(), row = 0; ...
[ "protected", "void", "writeFull", "(", ")", "{", "byte", "[", "]", "imageData", "=", "rawImage", ".", "getData", "(", ")", ";", "int", "numOfComponents", "=", "frameHeader", ".", "getNf", "(", ")", ";", "int", "[", "]", "pixes", "=", "new", "int", "[...
Used by progressive mode
[ "Used", "by", "progressive", "mode" ]
aabe559c267402b754c2ad606b796c4c6570788c
https://github.com/alibaba/simpleimage/blob/aabe559c267402b754c2ad606b796c4c6570788c/simpleimage.core/src/main/java/com/alibaba/simpleimage/codec/jpeg/JPEGDecoder.java#L1101-L1163
59,384
alibaba/simpleimage
simpleimage.analyze/src/main/java/com/alibaba/simpleimage/analyze/search/tree/KMeansTreeNode.java
KMeansTreeNode.getValueId
public int getValueId(Clusterable c) { currentItems++; /* * if(isLeafNode()) { return id; } */ int index = TreeUtils.findNearestNodeIndex(subNodes, c); if (index >= 0) { KMeansTreeNode node = subNodes.get(index); return node.getValueId(c); } return id; }
java
public int getValueId(Clusterable c) { currentItems++; /* * if(isLeafNode()) { return id; } */ int index = TreeUtils.findNearestNodeIndex(subNodes, c); if (index >= 0) { KMeansTreeNode node = subNodes.get(index); return node.getValueId(c); } return id; }
[ "public", "int", "getValueId", "(", "Clusterable", "c", ")", "{", "currentItems", "++", ";", "/*\r\n\t\t * if(isLeafNode()) { return id; }\r\n\t\t */", "int", "index", "=", "TreeUtils", ".", "findNearestNodeIndex", "(", "subNodes", ",", "c", ")", ";", "if", "(", "...
Adds a clusterable to the current vocab tree for word creation
[ "Adds", "a", "clusterable", "to", "the", "current", "vocab", "tree", "for", "word", "creation" ]
aabe559c267402b754c2ad606b796c4c6570788c
https://github.com/alibaba/simpleimage/blob/aabe559c267402b754c2ad606b796c4c6570788c/simpleimage.analyze/src/main/java/com/alibaba/simpleimage/analyze/search/tree/KMeansTreeNode.java#L97-L108
59,385
alibaba/simpleimage
simpleimage.core/src/main/java/com/alibaba/simpleimage/util/NodeUtils.java
NodeUtils.cloneNode
public static Node cloneNode(Node node) { if(node == null) { return null; } IIOMetadataNode newNode = new IIOMetadataNode(node.getNodeName()); //clone user object if(node instanceof IIOMetadataNode) { IIOMetadataNode iioNode = (IIOMetadataNode)nod...
java
public static Node cloneNode(Node node) { if(node == null) { return null; } IIOMetadataNode newNode = new IIOMetadataNode(node.getNodeName()); //clone user object if(node instanceof IIOMetadataNode) { IIOMetadataNode iioNode = (IIOMetadataNode)nod...
[ "public", "static", "Node", "cloneNode", "(", "Node", "node", ")", "{", "if", "(", "node", "==", "null", ")", "{", "return", "null", ";", "}", "IIOMetadataNode", "newNode", "=", "new", "IIOMetadataNode", "(", "node", ".", "getNodeName", "(", ")", ")", ...
Currently only use by GIFStreamMetadata and GIFImageMetadata @param node @return
[ "Currently", "only", "use", "by", "GIFStreamMetadata", "and", "GIFImageMetadata" ]
aabe559c267402b754c2ad606b796c4c6570788c
https://github.com/alibaba/simpleimage/blob/aabe559c267402b754c2ad606b796c4c6570788c/simpleimage.core/src/main/java/com/alibaba/simpleimage/util/NodeUtils.java#L35-L66
59,386
alibaba/simpleimage
simpleimage.analyze/src/main/java/com/alibaba/simpleimage/analyze/search/cluster/impl/AbstractClusterBuilder.java
AbstractClusterBuilder.calculateInitialClusters
protected Cluster[] calculateInitialClusters(List<? extends Clusterable> values, int numClusters){ Cluster[] clusters = new Cluster[numClusters]; //choose centers and create the initial clusters Random random = new Random(1); Set<Integer> clusterCenters = new HashSet<Integer>(); ...
java
protected Cluster[] calculateInitialClusters(List<? extends Clusterable> values, int numClusters){ Cluster[] clusters = new Cluster[numClusters]; //choose centers and create the initial clusters Random random = new Random(1); Set<Integer> clusterCenters = new HashSet<Integer>(); ...
[ "protected", "Cluster", "[", "]", "calculateInitialClusters", "(", "List", "<", "?", "extends", "Clusterable", ">", "values", ",", "int", "numClusters", ")", "{", "Cluster", "[", "]", "clusters", "=", "new", "Cluster", "[", "numClusters", "]", ";", "//choose...
Calculates the initial clusters randomly, this could be replaced with a better algorithm @param values @param numClusters @return
[ "Calculates", "the", "initial", "clusters", "randomly", "this", "could", "be", "replaced", "with", "a", "better", "algorithm" ]
aabe559c267402b754c2ad606b796c4c6570788c
https://github.com/alibaba/simpleimage/blob/aabe559c267402b754c2ad606b796c4c6570788c/simpleimage.analyze/src/main/java/com/alibaba/simpleimage/analyze/search/cluster/impl/AbstractClusterBuilder.java#L80-L94
59,387
alibaba/simpleimage
simpleimage.analyze/src/main/java/com/alibaba/simpleimage/analyze/search/cluster/impl/Cluster.java
Cluster.getClusterMean
public float[] getClusterMean(){ float[] normedCurrentLocation = new float[mCurrentMeanLocation.length]; for ( int i = 0; i < mCurrentMeanLocation.length; i++ ){ normedCurrentLocation[i] = mCurrentMeanLocation[i]/((float)mClusterItems.size()); } return normedCurrentLocation; ...
java
public float[] getClusterMean(){ float[] normedCurrentLocation = new float[mCurrentMeanLocation.length]; for ( int i = 0; i < mCurrentMeanLocation.length; i++ ){ normedCurrentLocation[i] = mCurrentMeanLocation[i]/((float)mClusterItems.size()); } return normedCurrentLocation; ...
[ "public", "float", "[", "]", "getClusterMean", "(", ")", "{", "float", "[", "]", "normedCurrentLocation", "=", "new", "float", "[", "mCurrentMeanLocation", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "mCurrentMeanLocation", ...
Get the current mean value of the cluster's items @return
[ "Get", "the", "current", "mean", "value", "of", "the", "cluster", "s", "items" ]
aabe559c267402b754c2ad606b796c4c6570788c
https://github.com/alibaba/simpleimage/blob/aabe559c267402b754c2ad606b796c4c6570788c/simpleimage.analyze/src/main/java/com/alibaba/simpleimage/analyze/search/cluster/impl/Cluster.java#L37-L43
59,388
wdullaer/MaterialDateTimePicker
library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialPickerLayout.java
RadialPickerLayout.setItem
private void setItem(int index, Timepoint time) { time = roundToValidTime(time, index); mCurrentTime = time; reselectSelector(time, false, index); }
java
private void setItem(int index, Timepoint time) { time = roundToValidTime(time, index); mCurrentTime = time; reselectSelector(time, false, index); }
[ "private", "void", "setItem", "(", "int", "index", ",", "Timepoint", "time", ")", "{", "time", "=", "roundToValidTime", "(", "time", ",", "index", ")", ";", "mCurrentTime", "=", "time", ";", "reselectSelector", "(", "time", ",", "false", ",", "index", ")...
Set either the hour, the minute or the second. Will set the internal value, and set the selection.
[ "Set", "either", "the", "hour", "the", "minute", "or", "the", "second", ".", "Will", "set", "the", "internal", "value", "and", "set", "the", "selection", "." ]
0a8fe28f19db4f5a5a6cfc525a852416232873a8
https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialPickerLayout.java#L255-L259
59,389
wdullaer/MaterialDateTimePicker
library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialPickerLayout.java
RadialPickerLayout.isHourInnerCircle
private boolean isHourInnerCircle(int hourOfDay) { // We'll have the 00 hours on the outside circle. boolean isMorning = hourOfDay <= 12 && hourOfDay != 0; // In the version 2 layout the circles are swapped if (mController.getVersion() != TimePickerDialog.Version.VERSION_1) isMorning = !...
java
private boolean isHourInnerCircle(int hourOfDay) { // We'll have the 00 hours on the outside circle. boolean isMorning = hourOfDay <= 12 && hourOfDay != 0; // In the version 2 layout the circles are swapped if (mController.getVersion() != TimePickerDialog.Version.VERSION_1) isMorning = !...
[ "private", "boolean", "isHourInnerCircle", "(", "int", "hourOfDay", ")", "{", "// We'll have the 00 hours on the outside circle.", "boolean", "isMorning", "=", "hourOfDay", "<=", "12", "&&", "hourOfDay", "!=", "0", ";", "// In the version 2 layout the circles are swapped", ...
Check if a given hour appears in the outer circle or the inner circle @return true if the hour is in the inner circle, false if it's in the outer circle.
[ "Check", "if", "a", "given", "hour", "appears", "in", "the", "outer", "circle", "or", "the", "inner", "circle" ]
0a8fe28f19db4f5a5a6cfc525a852416232873a8
https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialPickerLayout.java#L265-L271
59,390
wdullaer/MaterialDateTimePicker
library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialPickerLayout.java
RadialPickerLayout.getCurrentlyShowingValue
private int getCurrentlyShowingValue() { int currentIndex = getCurrentItemShowing(); switch(currentIndex) { case HOUR_INDEX: return mCurrentTime.getHour(); case MINUTE_INDEX: return mCurrentTime.getMinute(); case SECOND_INDEX: ...
java
private int getCurrentlyShowingValue() { int currentIndex = getCurrentItemShowing(); switch(currentIndex) { case HOUR_INDEX: return mCurrentTime.getHour(); case MINUTE_INDEX: return mCurrentTime.getMinute(); case SECOND_INDEX: ...
[ "private", "int", "getCurrentlyShowingValue", "(", ")", "{", "int", "currentIndex", "=", "getCurrentItemShowing", "(", ")", ";", "switch", "(", "currentIndex", ")", "{", "case", "HOUR_INDEX", ":", "return", "mCurrentTime", ".", "getHour", "(", ")", ";", "case"...
If the hours are showing, return the current hour. If the minutes are showing, return the current minute.
[ "If", "the", "hours", "are", "showing", "return", "the", "current", "hour", ".", "If", "the", "minutes", "are", "showing", "return", "the", "current", "minute", "." ]
0a8fe28f19db4f5a5a6cfc525a852416232873a8
https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialPickerLayout.java#L293-L305
59,391
wdullaer/MaterialDateTimePicker
library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialPickerLayout.java
RadialPickerLayout.roundToValidTime
private Timepoint roundToValidTime(Timepoint newSelection, int currentItemShowing) { switch(currentItemShowing) { case HOUR_INDEX: return mController.roundToNearest(newSelection, null); case MINUTE_INDEX: return mController.roundToNearest(newSelection, Tim...
java
private Timepoint roundToValidTime(Timepoint newSelection, int currentItemShowing) { switch(currentItemShowing) { case HOUR_INDEX: return mController.roundToNearest(newSelection, null); case MINUTE_INDEX: return mController.roundToNearest(newSelection, Tim...
[ "private", "Timepoint", "roundToValidTime", "(", "Timepoint", "newSelection", ",", "int", "currentItemShowing", ")", "{", "switch", "(", "currentItemShowing", ")", "{", "case", "HOUR_INDEX", ":", "return", "mController", ".", "roundToNearest", "(", "newSelection", "...
Snap the input to a selectable value @param newSelection Timepoint - Time which should be rounded @param currentItemShowing int - The index of the current view @return Timepoint - the rounded value
[ "Snap", "the", "input", "to", "a", "selectable", "value" ]
0a8fe28f19db4f5a5a6cfc525a852416232873a8
https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialPickerLayout.java#L438-L447
59,392
wdullaer/MaterialDateTimePicker
library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialPickerLayout.java
RadialPickerLayout.trySettingInputEnabled
public boolean trySettingInputEnabled(boolean inputEnabled) { if (mDoingTouch && !inputEnabled) { // If we're trying to disable input, but we're in the middle of a touch event, // we'll allow the touch event to continue before disabling input. return false; } ...
java
public boolean trySettingInputEnabled(boolean inputEnabled) { if (mDoingTouch && !inputEnabled) { // If we're trying to disable input, but we're in the middle of a touch event, // we'll allow the touch event to continue before disabling input. return false; } ...
[ "public", "boolean", "trySettingInputEnabled", "(", "boolean", "inputEnabled", ")", "{", "if", "(", "mDoingTouch", "&&", "!", "inputEnabled", ")", "{", "// If we're trying to disable input, but we're in the middle of a touch event,", "// we'll allow the touch event to continue befo...
Set touch input as enabled or disabled, for use with keyboard mode.
[ "Set", "touch", "input", "as", "enabled", "or", "disabled", "for", "use", "with", "keyboard", "mode", "." ]
0a8fe28f19db4f5a5a6cfc525a852416232873a8
https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialPickerLayout.java#L878-L888
59,393
wdullaer/MaterialDateTimePicker
library/src/main/java/com/wdullaer/materialdatetimepicker/Utils.java
Utils.getPulseAnimator
public static ObjectAnimator getPulseAnimator(View labelToAnimate, float decreaseRatio, float increaseRatio) { Keyframe k0 = Keyframe.ofFloat(0f, 1f); Keyframe k1 = Keyframe.ofFloat(0.275f, decreaseRatio); Keyframe k2 = Keyframe.ofFloat(0.69f, increaseRatio); Keyframe k3 = Ke...
java
public static ObjectAnimator getPulseAnimator(View labelToAnimate, float decreaseRatio, float increaseRatio) { Keyframe k0 = Keyframe.ofFloat(0f, 1f); Keyframe k1 = Keyframe.ofFloat(0.275f, decreaseRatio); Keyframe k2 = Keyframe.ofFloat(0.69f, increaseRatio); Keyframe k3 = Ke...
[ "public", "static", "ObjectAnimator", "getPulseAnimator", "(", "View", "labelToAnimate", ",", "float", "decreaseRatio", ",", "float", "increaseRatio", ")", "{", "Keyframe", "k0", "=", "Keyframe", ".", "ofFloat", "(", "0f", ",", "1f", ")", ";", "Keyframe", "k1"...
Render an animator to pulsate a view in place. @param labelToAnimate the view to pulsate. @return The animator object. Use .start() to begin.
[ "Render", "an", "animator", "to", "pulsate", "a", "view", "in", "place", "." ]
0a8fe28f19db4f5a5a6cfc525a852416232873a8
https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/Utils.java#L64-L78
59,394
wdullaer/MaterialDateTimePicker
library/src/main/java/com/wdullaer/materialdatetimepicker/Utils.java
Utils.trimToMidnight
public static Calendar trimToMidnight(Calendar calendar) { calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); return calendar; }
java
public static Calendar trimToMidnight(Calendar calendar) { calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); return calendar; }
[ "public", "static", "Calendar", "trimToMidnight", "(", "Calendar", "calendar", ")", "{", "calendar", ".", "set", "(", "Calendar", ".", "HOUR_OF_DAY", ",", "0", ")", ";", "calendar", ".", "set", "(", "Calendar", ".", "MINUTE", ",", "0", ")", ";", "calenda...
Trims off all time information, effectively setting it to midnight Makes it easier to compare at just the day level @param calendar The Calendar object to trim @return The trimmed Calendar object
[ "Trims", "off", "all", "time", "information", "effectively", "setting", "it", "to", "midnight", "Makes", "it", "easier", "to", "compare", "at", "just", "the", "day", "level" ]
0a8fe28f19db4f5a5a6cfc525a852416232873a8
https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/Utils.java#L150-L156
59,395
wdullaer/MaterialDateTimePicker
library/src/main/java/com/wdullaer/materialdatetimepicker/date/DatePickerDialog.java
DatePickerDialog.newInstance
@SuppressWarnings("unused") public static DatePickerDialog newInstance(OnDateSetListener callback) { Calendar now = Calendar.getInstance(); return DatePickerDialog.newInstance(callback, now); }
java
@SuppressWarnings("unused") public static DatePickerDialog newInstance(OnDateSetListener callback) { Calendar now = Calendar.getInstance(); return DatePickerDialog.newInstance(callback, now); }
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "public", "static", "DatePickerDialog", "newInstance", "(", "OnDateSetListener", "callback", ")", "{", "Calendar", "now", "=", "Calendar", ".", "getInstance", "(", ")", ";", "return", "DatePickerDialog", ".", "newIn...
Create a new DatePickerDialog instance initialised to the current system date. @param callback How the parent is notified that the date is set. @return a new DatePickerDialog instance
[ "Create", "a", "new", "DatePickerDialog", "instance", "initialised", "to", "the", "current", "system", "date", "." ]
0a8fe28f19db4f5a5a6cfc525a852416232873a8
https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/date/DatePickerDialog.java#L214-L218
59,396
wdullaer/MaterialDateTimePicker
library/src/main/java/com/wdullaer/materialdatetimepicker/date/DatePickerDialog.java
DatePickerDialog.setHighlightedDays
@SuppressWarnings("unused") public void setHighlightedDays(Calendar[] highlightedDays) { for (Calendar highlightedDay : highlightedDays) { this.highlightedDays.add(Utils.trimToMidnight((Calendar) highlightedDay.clone())); } if (mDayPickerView != null) mDayPickerView.onChange(); ...
java
@SuppressWarnings("unused") public void setHighlightedDays(Calendar[] highlightedDays) { for (Calendar highlightedDay : highlightedDays) { this.highlightedDays.add(Utils.trimToMidnight((Calendar) highlightedDay.clone())); } if (mDayPickerView != null) mDayPickerView.onChange(); ...
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "public", "void", "setHighlightedDays", "(", "Calendar", "[", "]", "highlightedDays", ")", "{", "for", "(", "Calendar", "highlightedDay", ":", "highlightedDays", ")", "{", "this", ".", "highlightedDays", ".", "add...
Sets an array of dates which should be highlighted when the picker is drawn @param highlightedDays an Array of Calendar objects containing the dates to be highlighted
[ "Sets", "an", "array", "of", "dates", "which", "should", "be", "highlighted", "when", "the", "picker", "is", "drawn" ]
0a8fe28f19db4f5a5a6cfc525a852416232873a8
https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/date/DatePickerDialog.java#L814-L820
59,397
wdullaer/MaterialDateTimePicker
library/src/main/java/com/wdullaer/materialdatetimepicker/date/DatePickerDialog.java
DatePickerDialog.setTimeZone
@SuppressWarnings("DeprecatedIsStillUsed") @Deprecated public void setTimeZone(TimeZone timeZone) { mTimezone = timeZone; mCalendar.setTimeZone(timeZone); YEAR_FORMAT.setTimeZone(timeZone); MONTH_FORMAT.setTimeZone(timeZone); DAY_FORMAT.setTimeZone(timeZone); }
java
@SuppressWarnings("DeprecatedIsStillUsed") @Deprecated public void setTimeZone(TimeZone timeZone) { mTimezone = timeZone; mCalendar.setTimeZone(timeZone); YEAR_FORMAT.setTimeZone(timeZone); MONTH_FORMAT.setTimeZone(timeZone); DAY_FORMAT.setTimeZone(timeZone); }
[ "@", "SuppressWarnings", "(", "\"DeprecatedIsStillUsed\"", ")", "@", "Deprecated", "public", "void", "setTimeZone", "(", "TimeZone", "timeZone", ")", "{", "mTimezone", "=", "timeZone", ";", "mCalendar", ".", "setTimeZone", "(", "timeZone", ")", ";", "YEAR_FORMAT",...
Set which timezone the picker should use This has been deprecated in favor of setting the TimeZone using the constructor that takes a Calendar object @param timeZone The timezone to use
[ "Set", "which", "timezone", "the", "picker", "should", "use" ]
0a8fe28f19db4f5a5a6cfc525a852416232873a8
https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/date/DatePickerDialog.java#L984-L992
59,398
wdullaer/MaterialDateTimePicker
library/src/main/java/com/wdullaer/materialdatetimepicker/date/DatePickerDialog.java
DatePickerDialog.setLocale
public void setLocale(Locale locale) { mLocale = locale; mWeekStart = Calendar.getInstance(mTimezone, mLocale).getFirstDayOfWeek(); YEAR_FORMAT = new SimpleDateFormat("yyyy", locale); MONTH_FORMAT = new SimpleDateFormat("MMM", locale); DAY_FORMAT = new SimpleDateFormat("dd", loca...
java
public void setLocale(Locale locale) { mLocale = locale; mWeekStart = Calendar.getInstance(mTimezone, mLocale).getFirstDayOfWeek(); YEAR_FORMAT = new SimpleDateFormat("yyyy", locale); MONTH_FORMAT = new SimpleDateFormat("MMM", locale); DAY_FORMAT = new SimpleDateFormat("dd", loca...
[ "public", "void", "setLocale", "(", "Locale", "locale", ")", "{", "mLocale", "=", "locale", ";", "mWeekStart", "=", "Calendar", ".", "getInstance", "(", "mTimezone", ",", "mLocale", ")", ".", "getFirstDayOfWeek", "(", ")", ";", "YEAR_FORMAT", "=", "new", "...
Set a custom locale to be used when generating various strings in the picker @param locale Locale
[ "Set", "a", "custom", "locale", "to", "be", "used", "when", "generating", "various", "strings", "in", "the", "picker" ]
0a8fe28f19db4f5a5a6cfc525a852416232873a8
https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/date/DatePickerDialog.java#L998-L1004
59,399
wdullaer/MaterialDateTimePicker
library/src/main/java/com/wdullaer/materialdatetimepicker/HapticFeedbackController.java
HapticFeedbackController.start
public void start() { if (hasVibratePermission(mContext)) { mVibrator = (Vibrator) mContext.getSystemService(Service.VIBRATOR_SERVICE); } // Setup a listener for changes in haptic feedback settings mIsGloballyEnabled = checkGlobalSetting(mContext); Uri uri = Settings...
java
public void start() { if (hasVibratePermission(mContext)) { mVibrator = (Vibrator) mContext.getSystemService(Service.VIBRATOR_SERVICE); } // Setup a listener for changes in haptic feedback settings mIsGloballyEnabled = checkGlobalSetting(mContext); Uri uri = Settings...
[ "public", "void", "start", "(", ")", "{", "if", "(", "hasVibratePermission", "(", "mContext", ")", ")", "{", "mVibrator", "=", "(", "Vibrator", ")", "mContext", ".", "getSystemService", "(", "Service", ".", "VIBRATOR_SERVICE", ")", ";", "}", "// Setup a list...
Call to setup the controller.
[ "Call", "to", "setup", "the", "controller", "." ]
0a8fe28f19db4f5a5a6cfc525a852416232873a8
https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/HapticFeedbackController.java#L44-L53