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
public class MainActivity extends BaseActivity<MainActivityViewModel> { | |
@Inject | |
MainActivityViewModel viewModel; | |
@Override | |
public MainActivityViewModel getViewModel() { | |
return viewModel; | |
} |
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
@Module | |
public class CategoryFragmentModule { | |
Context context; | |
View.OnClickListener listener; | |
@Provides | |
CategoryViewModel categoryViewModel(CategoryRepository repository) { | |
return new CategoryViewModel(repository); | |
} |
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
@Module | |
public abstract class CategoryFragmentProvider { | |
@ContributesAndroidInjector(modules = CategoryFragmentModule.class) | |
abstract CategoryFragment provideCategoryFragmentFactory(); | |
} |
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
public class CategoryViewModel extends ViewModel { | |
public CategoryRepository repository; | |
@Inject | |
public CategoryViewModel(CategoryRepository repository) { | |
this.repository = repository; | |
} | |
} |
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
public class HorizonMainApplication extends DaggerApplication { | |
private static HorizonMainApplication instance; | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
} | |
public static synchronized HorizonMainApplication getInstance() { |
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
/** | |
* A simple {@link Fragment} subclass. | |
*/ | |
public class CategoryFragment extends BaseFragment<CategoryViewModel> { | |
@Inject | |
ViewModelProvider.Factory factory; | |
private CategoryViewModel viewModel; | |
@Inject | |
Utils utils; |
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
@Module | |
public class MainActivityModule { | |
@Provides | |
MainActivityViewModel provideMainActivityViewModel(){ | |
return new MainActivityViewModel(); | |
} | |
} |
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
public class MainActivityViewModel extends ViewModel { | |
@Inject | |
public MainActivityViewModel() { | |
} | |
} |
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
//Android Libs | |
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:'1.3.11' | |
implementation 'com.android.support:appcompat-v7:'28.0.0' | |
implementation 'com.android.support:design:'28.0.0' |
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
<?xml version="1.0" encoding="utf-8"?> | |
<layout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
app:behavior_peekHeight="200dp" | |
app:layout_behavior="android.support.design.widget.BottomSheetBehavior" | |
tools:context=".screens.bottomSheet.BottomSheetFragment"> | |
<data> | |
<variable |