View dart-list-merge-extension.dart
import 'dart:math'; | |
extension ListExtension<R> on List<R> { | |
// combine two list | |
// [A,B,C], [D,E,F] => [A,D,B,E,C,F] | |
List<R> merge(List<R> list) { | |
List<R> output = []; | |
var minLength = min(length, list.length); | |
var maxLength = max(length, list.length); |
View OkHttpDownloadProgress.java
@RunWith(AndroidJUnit4.class) | |
public class DownloadSample { | |
private Service mService; | |
public DownloadSample() { | |
Retrofit retrofit = new Retrofit.Builder() | |
.client(new OkHttpClient()) | |
.baseUrl("https://github.com") | |
.addConverterFactory(GsonConverterFactory.create()) |