This file contains hidden or 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 Dinorah Tovar on 18/01/19. | |
* Main Activity that verify if the user is availbale | |
*/ | |
class MainActivity : AppCompatActivity() { | |
private var viewModel: MainViewModel? = null | |
/** | |
* On Create View instance |
This file contains hidden or 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
image: java:8 | |
pipelines: | |
branches: | |
deployment: | |
- step: | |
caches: | |
- gradle | |
- android-sdk |
This file contains hidden or 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 Dinorah Tovar on 8/21/18 | |
* All presenter should extend from this. | |
*/ | |
open class BasePresenter : DisposableImpl { | |
/** | |
* Save disposables in a list to dispose them once user is navigate out of screen. | |
*/ |
This file contains hidden or 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 Dinorah Tovar on 8/21/18 | |
* All fragments should extend from this fragment. | |
*/ | |
open class BaseFragment : Fragment() { | |
/** | |
* Keep reference of the active presenter | |
*/ |
This file contains hidden or 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 Dinorah Tovar on 8/21/18 | |
* Base custom activity managing all the disposables | |
*/ | |
open class BaseActivity : AppCompatActivity() { | |
/** | |
* Keep reference of the active presenter. | |
*/ |
This file contains hidden or 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 Dinorah Tovar on 2/22/18. | |
* Application Owner using lifecycleObserver to know the application of | |
* the application. | |
*/ | |
class ApplicationOwner : LifecycleObserver { | |
/** | |
* Companion Object |
This file contains hidden or 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
<com.our.project.common.PasswordTextInputLayout | |
android:id="@+id/login_password_layout" | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
android:layout_marginEnd="35dp" | |
android:layout_marginStart="35dp" | |
android:layout_marginTop="2dp" | |
android:theme="@style/EditTextBlue" | |
app:errorEnabled="false" | |
app:hintEnabled="true" |
This file contains hidden or 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 android.content.Context | |
import android.graphics.Rect | |
import android.support.design.widget.TextInputLayout | |
import android.util.AttributeSet | |
import java.lang.reflect.InvocationTargetException | |
import java.lang.reflect.Method | |
/** | |
* Created by Dinorah Tovar on 6/19/18 | |
* Password with |
This file contains hidden or 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
/** | |
* Returns an observable from a function that decrypts stored user data | |
*/ | |
fun currentUserObservable(): Observable<UserViewModel> { | |
return Observable.create(ObservableOnSubscribe<UserViewModel> { subscriber -> | |
val user = currentUser() | |
if (user != null) | |
subscriber.onNext(user) | |
else | |
subscriber.onError(Throwable("User is null")) |
This file contains hidden or 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
@Headers("Content-Type:application/json; charset=UTF-8") | |
@GET("yourwebsite/{someParam}/login") | |
fun logout(@Path("someParam") someParam: String?): Observable<LoginResponseViewModel> |
NewerOlder