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
/** | |
* Created by McGalanes on 02/12/2016. | |
*/ | |
import android.content.Context; | |
import android.content.res.Resources; | |
import android.graphics.Point; | |
import android.util.DisplayMetrics; | |
import android.view.Display; | |
import android.view.View; |
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
HEADER : Content-Type:application/graphql | |
graphQl | |
.query("todos { title }") | |
.cast(Data.class) | |
.enqueue(new Callback<Data>(){ | |
public void onResponse(Data data){ | |
} |
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
apply plugin: 'com.jfrog.bintray' | |
version = libraryVersion | |
task sourcesJar(type: Jar) { | |
from sourceSets.main.allSource | |
classifier = 'sources' | |
} | |
task javadocJar(type: Jar, dependsOn: javadoc) { |
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
apply plugin: 'com.github.dcendents.android-maven' | |
group = publishedGroupId // Maven Group ID for the artifact | |
install { | |
repositories.mavenInstaller { | |
// This generates POM.xml with proper parameters | |
pom { | |
project { | |
packaging 'aar' |
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
apply plugin: 'com.jfrog.bintray' | |
version = libraryVersion | |
task sourcesJar(type: Jar) { | |
from android.sourceSets.main.java.srcDirs | |
classifier = 'sources' | |
} | |
task javadoc(type: Javadoc) { |
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
import org.junit.rules.TestRule; | |
import org.junit.runner.Description; | |
import org.junit.runners.model.Statement; | |
import io.reactivex.Scheduler; | |
import io.reactivex.android.plugins.RxAndroidPlugins; | |
import io.reactivex.annotations.NonNull; | |
import io.reactivex.functions.Function; | |
import io.reactivex.plugins.RxJavaPlugins; | |
import io.reactivex.schedulers.Schedulers; |
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
@Model | |
public class User { | |
String name; | |
int age; | |
} | |
List<User> user = UserDAO.findByAge(3); | |
User user = UserDAO.findByAge(3).first(); |
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
package florent37.github.com.rxcomponentlifecycle; | |
import android.app.Application; | |
import android.content.ContentProvider; | |
import android.content.ContentValues; | |
import android.content.Context; | |
import android.database.Cursor; | |
import android.net.Uri; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; |
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
User use = molki(User.class) | |
.given(user -> user.getName()).willReturn(3) | |
.given(user -> user.getFirstName()).willReturn(4) |
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
class OmdbRepository { | |
final apiKey = "my_key"; | |
const OmdbRepository(); | |
Future<List<Movie>> searchMovies(String byName) async { | |
final response = await http.get('http://www.omdbapi.com/?s=$byName&apikey=$apiKey'); | |
final jsonValue = json.decode(response.body); | |
return SearchResponse.fromJson(jsonValue).movies; | |
} | |
} |