Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/MVVMBaseProjectPublic template

An Android MVVM project for quick start.

License

NotificationsYou must be signed in to change notification settings

ohyooo/MVVMBaseProject

Repository files navigation


Introduction

This project is intent to provide a template with basic MVVM architecture framework. You can just copy it to workspace instead of creating a new project from Android Studio.

Advantages:

  • Simple, easy to read
  • Use few libs, save time for gradle syncing
  • No dagger or any other DI lib

Module

├───app│   ├───app       Application│   ├───model     models│   ├───ui        activities& fragments│   │   ├───main  MainActivity│   └───viewmodel viewmodels│├───lib│   ├───adapter   databinding adapter│   ├───extension kotlin extensions│   └───mvvm      MVVM framework│└───network    ├───api    ├───model    └───repository

MVVM

Usually, a viwemodel can only aware the destroy of its owner in onClear() method. But after making it implements LifecycleObserver and observing owner's lifecycle in ViewModelProvider.Factory. It can use onCreate() or other lifecycle event now.Check these codes in MVVMViewModelFactory.kt

Todo

many many things..


[8]ページ先頭

©2009-2025 Movatter.jp