Skip to content

Instantly share code, notes, and snippets.

💻
Working

Harry's Lab HarinTrivedi

💻
Working
Block or report user

Report or block HarinTrivedi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View theme_overlay.xml
<!--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>
View Typography.xml
<!--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>
...
View ShapeTheming.xml
<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 Oct 23, 2018
Example of using Easy.Api with Architecture components ViewModel and LiveData
View UserViewModel.kt
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
View LoginInteracter.java
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;
View IFirebaseCallbackListener.java
package com.hlabexamples.commonmvp.base.mvp.callback;
/**
* Created by H.T. on 01/12/17.
*/
public interface IFirebaseCallbackListener<T> {
void childAdded(T trip);
View BaseBindingActivity.java
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();
View ICallbackListener.java
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);
View BasePresenter.java
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);
View BaseView.java
package com.hlabexamples.commonmvp.base.mvp.view;
/**
* Created by H.T. on 01/12/17.
*/
public interface BaseView extends ILoadingView {
void initPresenter();
You can’t perform that action at this time.