Skip to content

Instantly share code, notes, and snippets.

View HarinTrivedi's full-sized avatar
💻
Working

Harry's Lab HarinTrivedi

💻
Working
View GitHub Profile
<!--Color-->
<style name="ThemeOverlay.Color" parent="AppTheme">
<!--Customization goes here-->
</style>
<!--Shape-->
<style name="ThemeOverlay.ShapeSize" parent="">
<item name="shapeAppearanceSmallComponent">@style/ShapeAppearanceComponent.RoundCorner</item>
<item name="shapeAppearanceMediumComponent">@style/ShapeAppearanceComponent.CutCorner</item>
<item name="shapeAppearanceLargeComponent">@style/ShapeAppearanceComponent.CutCorner</item>
<!--Theme 4: Typography Theme-->
<style name="AppTheme.Typography" parent="AppTheme">
<item name="textAppearanceHeadline4">@style/TextAppearance.Typography.Headline4</item>
<item name="textAppearanceHeadline5">@style/TextAppearance.Typography.Headline5</item>
<item name="textAppearanceHeadline6">@style/TextAppearance.Typography.Headline6</item>
<item name="textAppearanceBody1">@style/TextAppearance.Typography.Body1</item>
<item name="textAppearanceBody2">@style/TextAppearance.Typography.Body2</item>
</style>
...
<style name="AppTheme.Shape" parent="Theme.MaterialComponents.Light.NoActionBar">
...
<!--Global Style-->
<item name="shapeAppearanceSmallComponent">@style/ShapeAppearance.SmallComponent.Cut</item>
</style>
...
...
<style name="ShapeAppearance.SmallComponent.Cut" parent="ShapeAppearance.MaterialComponents.SmallComponent">
<item name="cornerFamily">cut</item>
<item name="cornerSize">4dp</item>
@HarinTrivedi
HarinTrivedi / UserViewModel.kt
Last active October 23, 2018 07:41
Example of using Easy.Api with Architecture components ViewModel and LiveData
class UserViewModel(application: Application) : AndroidViewModel(application) {
val usersLiveData: MediatorLiveData<List<User>>
private var usersListApi: EasyApiCall<Envelop<List<User>>>? = null
val loadingStateLiveData: MutableLiveData<STATE> = MutableLiveData()
init {
// initialize live data
usersLiveData = MediatorLiveData()
// set by default null
usersLiveData.value = null
package com.hlabexamples.commonmvp.impl;
import android.support.annotation.NonNull;
import android.util.Log;
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
import com.google.firebase.auth.AuthCredential;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.auth.GoogleAuthProvider;
public abstract class BaseBindingActivity<T extends ViewDataBinding> extends AppCompatActivity {
public PreferenceUtils preferences;
T binding;
protected abstract int attachView();
protected abstract void initView();
protected abstract void initToolbar();
package com.hlabexamples.commonmvp.base.mvp.callback;
/**
* Created by H.T. on 01/12/17.
*/
public interface IFirebaseCallbackListener<T> {
void childAdded(T trip);
package com.hlabexamples.commonmvp.base.mvp.callback;
/**
* Created by H.T. on 01/12/17.
*/
public interface ICallbackListener<T> {
void onSuccess(T data);
void onFailure(Throwable t);
package com.hlabexamples.commonmvp.base.mvp.presenter;
import com.hlabexamples.commonmvp.base.mvp.view.BaseView;
/**
* Created by H.T. on 01/12/17.
*/
public interface BasePresenter<T extends BaseView> {
void attachView(T view);
package com.hlabexamples.commonmvp.base.mvp.view;
/**
* Created by H.T. on 01/12/17.
*/
public interface BaseView extends ILoadingView {
void initPresenter();