This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Serialize data to Ion format | |
val out = ByteArrayOutputStream() | |
val ionWriter = IonTextWriterBuilder.standard().build(out) | |
ionWriter.stepIn(IonType.STRUCT) | |
ionWriter.setFieldName("name") | |
ionWriter.writeString("John Doe") | |
ionWriter.stepOut() | |
// Deserialize Ion data | |
val inputStream = ByteArrayInputStream(out.toByteArray()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<vector xmlns:android="http://schemas.android.com/apk/res/android" | |
android:width="12dp" | |
android:height="12dp" | |
android:viewportWidth="12" | |
android:viewportHeight="12"> | |
<path | |
android:name="my_path" | |
android:pathData="M 6 3 L 6 9" | |
android:strokeColor="#a4c639" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
graph.addEdge(2889, 2781); | |
graph.addEdge(2889, 156); | |
graph.addEdge(2881, 2886); | |
graph.addEdge(2881, 2590); | |
graph.addEdge(2881, 2112); | |
graph.addEdge(2881, 1978); | |
graph.addEdge(2881, 1938); | |
graph.addEdge(2881, 482); | |
graph.addEdge(2881, 389); | |
graph.addEdge(2875, 2886); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private LatLng getLatLng(String lat, String lng){ | |
LatLng ll = null; | |
if(lat.length() == 6 && lng.length() == 7){ | |
double hoursLat = Double.valueOf(lat.substring(0,2)); | |
double minLat = Double.valueOf(lat.substring(2,4)); | |
double secLat = Double.valueOf(lat.substring(4,6)); | |
double hoursLng = Double.valueOf(lng.substring(0,3)); | |
double minLng = Double.valueOf(lng.substring(3,5)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Method onRefresh() from SwipeRefreshLayout.OnRefreshListener | |
@Override | |
public void onRefresh() { | |
// I'm using Retrofit, so this is the way I get new data from the server | |
new RestAdapter().get().getItems(new Callback<List<Foo>>() { | |
@Override | |
public void success(List<Foo> foos, Response response) { | |
// IMPORTANT: This is important to add new items at the top of the listview |