Skip to content

Instantly share code, notes, and snippets.

View javiergamarra's full-sized avatar
😠

Javier Gamarra javiergamarra

😠
View GitHub Profile
@javiergamarra
javiergamarra / content_main.xml
Created October 8, 2015 13:15
login screenlet
<com.liferay.mobile.screens.auth.login.LoginScreenlet
android:layout_width="match_parent"
android:layout_height="match_parent"
app:basicAuthMethod="email"
app:layoutId="@layout/login_default"/>
<com.liferay.mobile.screens.ddl.form.DDLFormScreenlet
android:id="@+id/ddl_form"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutId="@layout/ddl_form_default"
app:recordSetId="79281"
app:structureId="79279"/>
<com.liferay.mobile.screens.ddl.list.DDLListScreenlet
android:layout_width="match_parent"
android:layout_height="match_parent"
app:labelFields="Title,Subtitle"
app:recordSetId="79281"
app:layoutId="@layout/ddl_list_material"/>
<com.liferay.mobile.screens.webcontentdisplay.WebContentDisplayScreenlet
android:layout_width="match_parent"
android:layout_height="match_parent"
app:articleId="79236"/>
@javiergamarra
javiergamarra / AddDeliciousInteractorImpl.java
Created December 11, 2015 13:08
Example of a custom interactor
package com.liferay.mobile.screens.bookmark.interactor;
import com.liferay.mobile.screens.base.interactor.BaseRemoteInteractor;
import com.liferay.mobile.screens.util.EventBusUtil;
import com.liferay.mobile.screens.util.LiferayLogger;
import com.squareup.okhttp.Headers;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import java.io.IOException;
@javiergamarra
javiergamarra / dagger2.md
Created February 2, 2016 14:05
Dagger2 DI

"Don't use Dagger for unit tests; just instantiate the class being tested and pass its dependencies manually."

  • "By building on standard javax.inject annotations (JSR 330), each class is easy to test. You don't need a bunch of boilerplate just to swap the RpcCreditCardService out for a FakeCreditCardService." -- Dagger Home Page
//Child component
@Output()
artistClicked:EventEmitter = new EventEmitter(); //does not need type
click() {
this.artistClicked.emit(this.artist);
}
//html
<spotify-artist [artist]="artista" (artistClicked)="receive($event)"></spotify-artist>
@javiergamarra
javiergamarra / gist:1f5cc859ce70eff7d86be22548f17697
Created September 20, 2017 06:30
Playing with kotlin and functional concepts
import java.util.function.Consumer
data class User(val name: String, val password: String, val age: Int, var organizationId: Int?)
fun addUser(name: String, password: String, age: Int): Result<User, UserError> {
val user = User(name, password, age, 0)
val userValidator: Validator = compose(compose(validateAge, nameValidator), validatePassword)
@javiergamarra
javiergamarra / android_things.md
Last active March 9, 2018 09:57
Requisitos para el taller de Android Things

Importante

Tenemos material para 30 personas aproximadamente (en parejas), si hay más asistentes nos organizaremos en grupos de 3.

El requisito principal es llevar instalado Android Studio 3.0 con el SDK de Android.

Requisitos

Es muy importante que lleves el entorno montado, ocupa 2GB y será difícil bajarlo de la red en el momento.