Added basic channel subscription and feed pages (#620)
Added basic channel subscription and feed pages - Room Persistence for sqlite support. - RxJava2 for reactive async support. - Stetho for database inspection support. - Enabled Multidex for debug build.
This commit is contained in:
parent
cb5b0ff764
commit
10c4f7b465
33 changed files with 1775 additions and 32 deletions
34
app/src/main/java/org/schabi/newpipe/NewPipeDatabase.java
Normal file
34
app/src/main/java/org/schabi/newpipe/NewPipeDatabase.java
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
package org.schabi.newpipe;
|
||||
|
||||
import android.arch.persistence.room.Room;
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import org.schabi.newpipe.database.AppDatabase;
|
||||
|
||||
import static org.schabi.newpipe.database.AppDatabase.DATABASE_NAME;
|
||||
|
||||
public class NewPipeDatabase {
|
||||
|
||||
private static AppDatabase sInstance;
|
||||
|
||||
// For Singleton instantiation
|
||||
private static final Object LOCK = new Object();
|
||||
|
||||
@NonNull
|
||||
public synchronized static AppDatabase getInstance(Context context) {
|
||||
if (sInstance == null) {
|
||||
synchronized (LOCK) {
|
||||
if (sInstance == null) {
|
||||
|
||||
sInstance = Room.databaseBuilder(
|
||||
context.getApplicationContext(),
|
||||
AppDatabase.class,
|
||||
DATABASE_NAME
|
||||
).build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue