-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
164 additions
and
32 deletions.
There are no files selected for viewing
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
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
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
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
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
27 changes: 27 additions & 0 deletions
27
app/src/main/java/io/github/storagereloaded/android/viewmodel/DatabaseListViewModel.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.github.storagereloaded.android.viewmodel; | ||
|
||
import android.app.Application; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.lifecycle.AndroidViewModel; | ||
import androidx.lifecycle.LiveData; | ||
|
||
import java.util.List; | ||
|
||
import io.github.storagereloaded.android.DataRepository; | ||
import io.github.storagereloaded.android.StoReApp; | ||
import io.github.storagereloaded.android.db.entity.DatabaseEntity; | ||
|
||
public class DatabaseListViewModel extends AndroidViewModel { | ||
|
||
private final DataRepository repository; | ||
|
||
public DatabaseListViewModel(@NonNull Application application) { | ||
super(application); | ||
this.repository = ((StoReApp) application).getRepository(); | ||
} | ||
|
||
public LiveData<List<DatabaseEntity>> getDatabases() { | ||
return repository.getDatabases(); | ||
} | ||
} |
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