diff options
author | desperateCoder <admin@life-style-art.de> | 2019-03-12 16:27:11 +0300 |
---|---|---|
committer | desperateCoder <admin@life-style-art.de> | 2019-03-12 16:27:11 +0300 |
commit | c01b0ab3649fd9228b83e71cb2d4b39536cc8908 (patch) | |
tree | 06b80bef8727e6b29339917fa0ae5de928295dfa | |
parent | 92856a5e0f8589e463c7bbf3b97521b2d75ac76f (diff) | |
parent | aa407232b3e98f50737f657232e9d06074d19762 (diff) |
Merge branch 'edit' of https://github.com/stefan-niedermann/nextcloud-deck into upsync
71 files changed, 536 insertions, 477 deletions
diff --git a/.idea/modules.xml b/.idea/modules.xml index dd53b4260..435960061 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -4,7 +4,6 @@ <modules> <module fileurl="file://$PROJECT_DIR$/Android-SingleSignOn/Android-SingleSignOn.iml" filepath="$PROJECT_DIR$/Android-SingleSignOn/Android-SingleSignOn.iml" /> <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> - <module fileurl="file://$PROJECT_DIR$/nc_deck.iml" filepath="$PROJECT_DIR$/nc_deck.iml" /> <module fileurl="file://$PROJECT_DIR$/nextcloud-deck.iml" filepath="$PROJECT_DIR$/nextcloud-deck.iml" /> </modules> </component> diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 35eb1ddfb..1a3821a57 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,5 +2,6 @@ <project version="4"> <component name="VcsDirectoryMappings"> <mapping directory="" vcs="Git" /> + <mapping directory="$PROJECT_DIR$/Android-SingleSignOn/Android-SingleSignOn" vcs="Git" /> </component> </project>
\ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 3b54f9f9c..1356c8b39 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,7 +8,7 @@ android { targetSdkVersion 28 versionCode 1 versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true javaCompileOptions { annotationProcessorOptions { @@ -16,6 +16,9 @@ android { } } } + dataBinding { + enabled = true + } buildTypes { release { minifyEnabled false @@ -35,27 +38,27 @@ dependencies { implementation 'io.reactivex.rxjava2:rxandroid:2.0.1' implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0' implementation 'com.google.code.gson:gson:2.8.5' - implementation 'com.squareup.retrofit2:retrofit:2.4.0' + implementation 'com.squareup.retrofit2:retrofit:2.5.0' implementation 'com.squareup.retrofit2:converter-gson:2.3.0' - implementation 'com.jakewharton:butterknife:8.8.1' - annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' + implementation 'com.jakewharton:butterknife:10.1.0' + annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0' implementation 'com.github.bumptech.glide:glide:4.9.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0' implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'com.android.support:appcompat-v7:28.0.0' - implementation 'com.android.support:design:28.0.0' - implementation 'com.android.support.constraint:constraint-layout:1.1.3' - implementation 'com.android.support:support-v4:28.0.0' + implementation 'androidx.appcompat:appcompat:1.1.0-alpha02' + implementation 'com.google.android.material:material:1.0.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + androidTestImplementation 'androidx.test:runner:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' // Room components - implementation "android.arch.persistence.room:runtime:$rootProject.roomVersion" - annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomVersion" - androidTestImplementation "android.arch.persistence.room:testing:$rootProject.roomVersion" + implementation "androidx.room:room-runtime:$rootProject.roomVersion" + annotationProcessor "androidx.room:room-compiler:$rootProject.roomVersion" + androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion" // Lifecycle components - implementation "android.arch.lifecycle:extensions:$rootProject.archLifecycleVersion" - annotationProcessor "android.arch.lifecycle:compiler:$rootProject.archLifecycleVersion" + implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.archLifecycleVersion" + annotationProcessor "androidx.lifecycle:lifecycle-compiler:$rootProject.archLifecycleVersion" }
\ No newline at end of file diff --git a/app/src/androidTest/java/it/niedermann/nextcloud/deck/ExampleInstrumentedTest.java b/app/src/androidTest/java/it/niedermann/nextcloud/deck/ExampleInstrumentedTest.java index b8a827120..da95d9b20 100644 --- a/app/src/androidTest/java/it/niedermann/nextcloud/deck/ExampleInstrumentedTest.java +++ b/app/src/androidTest/java/it/niedermann/nextcloud/deck/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package it.niedermann.nextcloud.deck; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.InstrumentationRegistry; +import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ColorUtil.java b/app/src/main/java/it/niedermann/nextcloud/deck/ColorUtil.java index c4c74bc93..7da582b21 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ColorUtil.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ColorUtil.java @@ -1,7 +1,7 @@ package it.niedermann.nextcloud.deck; import android.graphics.Color; -import android.support.annotation.ColorInt; +import androidx.annotation.ColorInt; /** * Helper implementation to deal with color related functionality. diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/AccessControl.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/AccessControl.java index 087162f6d..78e2eb50c 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/AccessControl.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/AccessControl.java @@ -1,8 +1,8 @@ package it.niedermann.nextcloud.deck.model; -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.Ignore; -import android.arch.persistence.room.Index; +import androidx.room.Entity; +import androidx.room.Ignore; +import androidx.room.Index; import it.niedermann.nextcloud.deck.model.interfaces.AbstractRemoteEntity; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/Account.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/Account.java index 99258b1df..a636562b0 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/Account.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/Account.java @@ -1,10 +1,10 @@ package it.niedermann.nextcloud.deck.model; -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.Ignore; -import android.arch.persistence.room.Index; -import android.arch.persistence.room.PrimaryKey; -import android.support.annotation.NonNull; +import androidx.room.Entity; +import androidx.room.Ignore; +import androidx.room.Index; +import androidx.room.PrimaryKey; +import androidx.annotation.NonNull; import java.io.Serializable; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/Attachment.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/Attachment.java index f5b74acdc..c44081284 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/Attachment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/Attachment.java @@ -1,6 +1,6 @@ package it.niedermann.nextcloud.deck.model; -import android.arch.persistence.room.Entity; +import androidx.room.Entity; import java.util.Date; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/Board.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/Board.java index 18c8e9145..cc926703b 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/Board.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/Board.java @@ -1,8 +1,8 @@ package it.niedermann.nextcloud.deck.model; -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.ForeignKey; -import android.arch.persistence.room.Index; +import androidx.room.Entity; +import androidx.room.ForeignKey; +import androidx.room.Index; import java.util.Date; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/Card.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/Card.java index f0168eff3..4435d7713 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/Card.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/Card.java @@ -1,8 +1,8 @@ package it.niedermann.nextcloud.deck.model; -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.Index; -import android.support.annotation.NonNull; +import androidx.room.Entity; +import androidx.room.Index; +import androidx.annotation.NonNull; import java.util.Date; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinBoardWithLabel.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinBoardWithLabel.java index c2caac45f..3bab18160 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinBoardWithLabel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinBoardWithLabel.java @@ -1,9 +1,9 @@ package it.niedermann.nextcloud.deck.model; -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.ForeignKey; -import android.arch.persistence.room.Index; -import android.support.annotation.NonNull; +import androidx.room.Entity; +import androidx.room.ForeignKey; +import androidx.room.Index; +import androidx.annotation.NonNull; @Entity( primaryKeys = {"labelId", "boardId"}, diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinBoardWithPermission.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinBoardWithPermission.java index 3530f8b97..d3d4f9b72 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinBoardWithPermission.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinBoardWithPermission.java @@ -1,9 +1,9 @@ package it.niedermann.nextcloud.deck.model; -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.ForeignKey; -import android.arch.persistence.room.Index; -import android.support.annotation.NonNull; +import androidx.room.Entity; +import androidx.room.ForeignKey; +import androidx.room.Index; +import androidx.annotation.NonNull; @Entity( primaryKeys = {"permissionId", "boardId"}, diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinBoardWithUser.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinBoardWithUser.java index 71e74c120..09167a2d2 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinBoardWithUser.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinBoardWithUser.java @@ -1,9 +1,9 @@ package it.niedermann.nextcloud.deck.model; -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.ForeignKey; -import android.arch.persistence.room.Index; -import android.support.annotation.NonNull; +import androidx.room.Entity; +import androidx.room.ForeignKey; +import androidx.room.Index; +import androidx.annotation.NonNull; @Entity( primaryKeys = {"userId", "boardId"}, diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinCardWithLabel.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinCardWithLabel.java index 7b7e50116..e827fa320 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinCardWithLabel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinCardWithLabel.java @@ -1,9 +1,9 @@ package it.niedermann.nextcloud.deck.model; -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.ForeignKey; -import android.arch.persistence.room.Index; -import android.support.annotation.NonNull; +import androidx.room.Entity; +import androidx.room.ForeignKey; +import androidx.room.Index; +import androidx.annotation.NonNull; @Entity( primaryKeys = {"labelId", "cardId"}, diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinCardWithUser.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinCardWithUser.java index 457ccc187..7ea4e2706 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinCardWithUser.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/JoinCardWithUser.java @@ -1,9 +1,9 @@ package it.niedermann.nextcloud.deck.model; -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.ForeignKey; -import android.arch.persistence.room.Index; -import android.support.annotation.NonNull; +import androidx.room.Entity; +import androidx.room.ForeignKey; +import androidx.room.Index; +import androidx.annotation.NonNull; @Entity( primaryKeys = {"userId", "cardId"}, diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/Label.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/Label.java index a0b1fcbd5..51bfe039d 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/Label.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/Label.java @@ -1,6 +1,6 @@ package it.niedermann.nextcloud.deck.model; -import android.arch.persistence.room.Entity; +import androidx.room.Entity; import it.niedermann.nextcloud.deck.model.interfaces.AbstractRemoteEntity; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/Permission.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/Permission.java index 8407bb4a5..6f742152d 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/Permission.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/Permission.java @@ -1,7 +1,7 @@ package it.niedermann.nextcloud.deck.model; -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.PrimaryKey; +import androidx.room.Entity; +import androidx.room.PrimaryKey; import it.niedermann.nextcloud.deck.model.enums.PermissionType; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/Stack.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/Stack.java index 60ba7e972..18d3dcb5b 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/Stack.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/Stack.java @@ -1,8 +1,8 @@ package it.niedermann.nextcloud.deck.model; -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.Index; -import android.support.annotation.NonNull; +import androidx.room.Entity; +import androidx.room.Index; +import androidx.annotation.NonNull; import java.util.Date; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/User.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/User.java index 71b231421..30edce5c4 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/User.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/User.java @@ -1,8 +1,8 @@ package it.niedermann.nextcloud.deck.model; -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.Ignore; -import android.arch.persistence.room.Index; +import androidx.room.Entity; +import androidx.room.Ignore; +import androidx.room.Index; import it.niedermann.nextcloud.deck.model.interfaces.AbstractRemoteEntity; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/full/FullBoard.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/full/FullBoard.java index d5f43fa54..efa94780b 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/full/FullBoard.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/full/FullBoard.java @@ -1,8 +1,8 @@ package it.niedermann.nextcloud.deck.model.full; -import android.arch.persistence.room.Embedded; -import android.arch.persistence.room.Ignore; -import android.arch.persistence.room.Relation; +import androidx.room.Embedded; +import androidx.room.Ignore; +import androidx.room.Relation; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/full/FullCard.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/full/FullCard.java index 122ab64b6..df49f2a65 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/full/FullCard.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/full/FullCard.java @@ -1,8 +1,8 @@ package it.niedermann.nextcloud.deck.model.full; -import android.arch.persistence.room.Embedded; -import android.arch.persistence.room.Ignore; -import android.arch.persistence.room.Relation; +import androidx.room.Embedded; +import androidx.room.Ignore; +import androidx.room.Relation; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/full/FullStack.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/full/FullStack.java index f699eb32f..eddbafce4 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/full/FullStack.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/full/FullStack.java @@ -1,8 +1,8 @@ package it.niedermann.nextcloud.deck.model.full; -import android.arch.persistence.room.Embedded; -import android.arch.persistence.room.Ignore; -import android.arch.persistence.room.Relation; +import androidx.room.Embedded; +import androidx.room.Ignore; +import androidx.room.Relation; import java.util.List; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/interfaces/AbstractRemoteEntity.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/interfaces/AbstractRemoteEntity.java index 25b55044f..cafe1c48a 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/interfaces/AbstractRemoteEntity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/interfaces/AbstractRemoteEntity.java @@ -1,10 +1,10 @@ package it.niedermann.nextcloud.deck.model.interfaces; -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.Ignore; -import android.arch.persistence.room.Index; -import android.arch.persistence.room.PrimaryKey; -import android.support.annotation.NonNull; +import androidx.room.Entity; +import androidx.room.Ignore; +import androidx.room.Index; +import androidx.room.PrimaryKey; +import androidx.annotation.NonNull; import java.util.Date; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/interfaces/IRemoteEntity.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/interfaces/IRemoteEntity.java index 49b8a990e..a5cf78607 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/interfaces/IRemoteEntity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/interfaces/IRemoteEntity.java @@ -1,6 +1,6 @@ package it.niedermann.nextcloud.deck.model.interfaces; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import java.util.Date; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/viewmodel/FullCardViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/viewmodel/FullCardViewModel.java new file mode 100644 index 000000000..9163059d5 --- /dev/null +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/viewmodel/FullCardViewModel.java @@ -0,0 +1,11 @@ +package it.niedermann.nextcloud.deck.model.viewmodel; + +import androidx.lifecycle.LiveData; +import androidx.lifecycle.ViewModel; +import it.niedermann.nextcloud.deck.model.full.FullCard; + +public class FullCardViewModel extends ViewModel { + + public LiveData<FullCard> fullCard; + +} diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java index 78f8a119d..c6931ca61 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java @@ -1,7 +1,7 @@ package it.niedermann.nextcloud.deck.persistence.sync; import android.app.Activity; -import android.arch.lifecycle.LiveData; +import androidx.lifecycle.LiveData; import android.content.Context; import android.content.SharedPreferences; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DataBaseAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DataBaseAdapter.java index 7e868052a..461aa1c50 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DataBaseAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DataBaseAdapter.java @@ -1,6 +1,6 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db; -import android.arch.lifecycle.LiveData; +import androidx.lifecycle.LiveData; import android.content.Context; import java.util.Date; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DateTypeConverter.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DateTypeConverter.java index 5605fe383..6b198a502 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DateTypeConverter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DateTypeConverter.java @@ -1,6 +1,6 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db; -import android.arch.persistence.room.TypeConverter; +import androidx.room.TypeConverter; import java.util.Date; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DeckDatabase.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DeckDatabase.java index 4ba3c7a26..c34681162 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DeckDatabase.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DeckDatabase.java @@ -1,9 +1,9 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db; -import android.arch.persistence.room.Database; -import android.arch.persistence.room.Room; -import android.arch.persistence.room.RoomDatabase; -import android.arch.persistence.room.TypeConverters; +import androidx.room.Database; +import androidx.room.Room; +import androidx.room.RoomDatabase; +import androidx.room.TypeConverters; import android.content.Context; import it.niedermann.nextcloud.deck.model.AccessControl; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AccessControlDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AccessControlDao.java index 692732637..faa65c8f1 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AccessControlDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AccessControlDao.java @@ -1,8 +1,8 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; -import android.arch.lifecycle.LiveData; -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Query; +import androidx.lifecycle.LiveData; +import androidx.room.Dao; +import androidx.room.Query; import it.niedermann.nextcloud.deck.model.AccessControl; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AccountDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AccountDao.java index 7e7a6d8a6..e81373c8a 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AccountDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AccountDao.java @@ -1,8 +1,8 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; -import android.arch.lifecycle.LiveData; -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Query; +import androidx.lifecycle.LiveData; +import androidx.room.Dao; +import androidx.room.Query; import java.util.List; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AttachmentDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AttachmentDao.java index 921c6ce3c..6c56429be 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AttachmentDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AttachmentDao.java @@ -1,8 +1,8 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; -import android.arch.lifecycle.LiveData; -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Query; +import androidx.lifecycle.LiveData; +import androidx.room.Dao; +import androidx.room.Query; import java.util.List; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/BoardDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/BoardDao.java index f253d9f0d..82e3d01d8 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/BoardDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/BoardDao.java @@ -1,9 +1,9 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; -import android.arch.lifecycle.LiveData; -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Query; -import android.arch.persistence.room.Transaction; +import androidx.lifecycle.LiveData; +import androidx.room.Dao; +import androidx.room.Query; +import androidx.room.Transaction; import java.util.List; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/CardDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/CardDao.java index 4e6671998..441abc3e3 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/CardDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/CardDao.java @@ -1,9 +1,9 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; -import android.arch.lifecycle.LiveData; -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Query; -import android.arch.persistence.room.Transaction; +import androidx.lifecycle.LiveData; +import androidx.room.Dao; +import androidx.room.Query; +import androidx.room.Transaction; import java.util.List; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/GenericDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/GenericDao.java index 7a96ac0c1..97e62226d 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/GenericDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/GenericDao.java @@ -1,8 +1,8 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; -import android.arch.persistence.room.Delete; -import android.arch.persistence.room.Insert; -import android.arch.persistence.room.Update; +import androidx.room.Delete; +import androidx.room.Insert; +import androidx.room.Update; public interface GenericDao<T> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithLabelDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithLabelDao.java index 990ccd89b..df8812f5b 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithLabelDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithLabelDao.java @@ -1,7 +1,7 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Query; +import androidx.room.Dao; +import androidx.room.Query; import it.niedermann.nextcloud.deck.model.JoinBoardWithLabel; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithPermissionDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithPermissionDao.java index f4def3c2f..28989d190 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithPermissionDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithPermissionDao.java @@ -1,7 +1,7 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Query; +import androidx.room.Dao; +import androidx.room.Query; import it.niedermann.nextcloud.deck.model.JoinBoardWithPermission; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithUserDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithUserDao.java index 488b61e35..b1663e52c 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithUserDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithUserDao.java @@ -1,7 +1,7 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Query; +import androidx.room.Dao; +import androidx.room.Query; import it.niedermann.nextcloud.deck.model.JoinBoardWithUser; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinCardWithLabelDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinCardWithLabelDao.java index 6dd01c5a2..c9a3a80bd 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinCardWithLabelDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinCardWithLabelDao.java @@ -1,7 +1,7 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Query; +import androidx.room.Dao; +import androidx.room.Query; import it.niedermann.nextcloud.deck.model.JoinCardWithLabel; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinCardWithUserDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinCardWithUserDao.java index 5316ef787..ab0e18122 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinCardWithUserDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinCardWithUserDao.java @@ -1,7 +1,7 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Query; +import androidx.room.Dao; +import androidx.room.Query; import it.niedermann.nextcloud.deck.model.JoinCardWithUser; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/LabelDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/LabelDao.java index 01f43b689..ab409cefc 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/LabelDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/LabelDao.java @@ -1,8 +1,8 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; -import android.arch.lifecycle.LiveData; -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Query; +import androidx.lifecycle.LiveData; +import androidx.room.Dao; +import androidx.room.Query; import java.util.List; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/PermissionDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/PermissionDao.java index e7ae48edf..7b6444ab3 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/PermissionDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/PermissionDao.java @@ -1,6 +1,6 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; -import android.arch.persistence.room.Dao; +import androidx.room.Dao; import it.niedermann.nextcloud.deck.model.Permission; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/StackDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/StackDao.java index 0a97a8368..f26e12264 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/StackDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/StackDao.java @@ -1,9 +1,9 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; -import android.arch.lifecycle.LiveData; -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Query; -import android.arch.persistence.room.Transaction; +import androidx.lifecycle.LiveData; +import androidx.room.Dao; +import androidx.room.Query; +import androidx.room.Transaction; import java.util.List; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/UserDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/UserDao.java index 431ab45d1..18ae2b45e 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/UserDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/UserDao.java @@ -1,8 +1,8 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; -import android.arch.lifecycle.LiveData; -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Query; +import androidx.lifecycle.LiveData; +import androidx.room.Dao; +import androidx.room.Query; import java.util.List; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/util/LiveDataHelper.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/util/LiveDataHelper.java index dfed27367..dd85b6e87 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/util/LiveDataHelper.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/util/LiveDataHelper.java @@ -1,10 +1,10 @@ package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.util; -import android.arch.lifecycle.LiveData; -import android.arch.lifecycle.MediatorLiveData; -import android.arch.lifecycle.MutableLiveData; -import android.arch.lifecycle.Observer; -import android.support.annotation.Nullable; +import androidx.lifecycle.LiveData; +import androidx.lifecycle.MediatorLiveData; +import androidx.lifecycle.MutableLiveData; +import androidx.lifecycle.Observer; +import androidx.annotation.Nullable; public class LiveDataHelper { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/AboutActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/AboutActivity.java index 3a47cd78c..8fc0aa29e 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/AboutActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/AboutActivity.java @@ -1,12 +1,12 @@ package it.niedermann.nextcloud.deck.ui; import android.os.Bundle; -import android.support.design.widget.TabLayout; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentPagerAdapter; -import android.support.v4.view.ViewPager; -import android.support.v7.app.AppCompatActivity; +import com.google.android.material.tabs.TabLayout; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentPagerAdapter; +import androidx.viewpager.widget.ViewPager; +import androidx.appcompat.app.AppCompatActivity; import butterknife.BindView; import butterknife.ButterKnife; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/EditActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/EditActivity.java index 7079537c0..cee45024c 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/EditActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/EditActivity.java @@ -1,18 +1,23 @@ package it.niedermann.nextcloud.deck.ui; import android.os.Bundle; -import android.support.design.widget.TabLayout; -import android.support.v4.view.ViewPager; -import android.support.v7.app.AppCompatActivity; import android.widget.EditText; import android.widget.TextView; +import com.google.android.material.tabs.TabLayout; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.databinding.DataBindingUtil; +import androidx.lifecycle.ViewModelProviders; +import androidx.viewpager.widget.ViewPager; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.Unbinder; import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.SupportUtil; +import it.niedermann.nextcloud.deck.databinding.ActivityEditBinding; import it.niedermann.nextcloud.deck.model.full.FullCard; +import it.niedermann.nextcloud.deck.model.viewmodel.FullCardViewModel; import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; import it.niedermann.nextcloud.deck.ui.card.CardTabAdapter; @@ -21,7 +26,6 @@ import static it.niedermann.nextcloud.deck.ui.card.CardAdapter.BUNDLE_KEY_LOCAL_ public class EditActivity extends AppCompatActivity { - FullCard card; SyncManager syncManager; @BindView(R.id.title) @@ -36,6 +40,7 @@ public class EditActivity extends AppCompatActivity { @BindView(R.id.pager) ViewPager pager; + FullCardViewModel fullCardViewModel; private Unbinder unbinder; private long accountId; @@ -44,36 +49,46 @@ public class EditActivity extends AppCompatActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_edit); + + + fullCardViewModel = ViewModelProviders.of(this) + .get(FullCardViewModel.class); + + ActivityEditBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_edit); + + // Assign the component to a property in the binding class. + binding.setLifecycleOwner(this); + binding.setEditmodel(fullCardViewModel); + + //setContentView(R.layout.activity_edit); unbinder = ButterKnife.bind(this); + Bundle extras = getIntent().getExtras(); if (extras != null) { accountId = extras.getLong(BUNDLE_KEY_ACCOUNT_ID); localId = extras.getLong(BUNDLE_KEY_LOCAL_ID); syncManager = new SyncManager(getApplicationContext(), this); - syncManager.getCardByLocalId(accountId, localId) - .observe(EditActivity.this, (FullCard card) -> { - this.card = card; - if (this.card != null) { - title.setText(this.card.getCard().getTitle()); - if (this.card.getCard().getCreatedAt() != null - && this.card.getCard().getLastModified() != null) { - timestamps.setText( - getString( - R.string.modified_created_time, - SupportUtil.getRelativeDateTimeString( - this, - this.card.getCard().getLastModified().getTime()), - SupportUtil.getRelativeDateTimeString( - this, - this.card.getCard().getCreatedAt().getTime()) - ) - ); - } - } - }); + fullCardViewModel.fullCard = syncManager.getCardByLocalId(accountId, localId); + fullCardViewModel.fullCard.observe(EditActivity.this, (FullCard card) -> { + if (card != null) { + if (card.getCard().getCreatedAt() != null + && card.getCard().getLastModified() != null) { + timestamps.setText( + getString( + R.string.modified_created_time, + SupportUtil.getRelativeDateTimeString( + this, + card.getCard().getLastModified().getTime()), + SupportUtil.getRelativeDateTimeString( + this, + card.getCard().getCreatedAt().getTime()) + ) + ); + } + } + }); } else { throw new IllegalArgumentException("No localId argument"); } @@ -94,7 +109,8 @@ public class EditActivity extends AppCompatActivity { @Override protected void onPause() { - syncManager.updateCard(this.card.card); + // TODO ???? + syncManager.updateCard(fullCardViewModel.fullCard.getValue().card); super.onPause(); } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java index 6c6ccf163..32218a519 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java @@ -4,28 +4,29 @@ import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.design.widget.FloatingActionButton; -import android.support.design.widget.NavigationView; -import android.support.design.widget.Snackbar; -import android.support.design.widget.TabLayout; -import android.support.v4.graphics.drawable.DrawableCompat; -import android.support.v4.view.GravityCompat; -import android.support.v4.view.ViewPager; -import android.support.v4.widget.DrawerLayout; -import android.support.v7.app.ActionBarDrawerToggle; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.view.SubMenu; import android.view.View; +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.google.android.material.navigation.NavigationView; +import com.google.android.material.snackbar.Snackbar; +import com.google.android.material.tabs.TabLayout; import com.nextcloud.android.sso.helper.SingleAccountHelper; import com.nextcloud.android.sso.model.SingleSignOnAccount; import java.util.List; +import androidx.annotation.NonNull; +import androidx.appcompat.app.ActionBarDrawerToggle; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatDelegate; +import androidx.appcompat.widget.Toolbar; +import androidx.core.graphics.drawable.DrawableCompat; +import androidx.core.view.GravityCompat; +import androidx.drawerlayout.widget.DrawerLayout; +import androidx.viewpager.widget.ViewPager; import butterknife.BindView; import butterknife.ButterKnife; import it.niedermann.nextcloud.deck.R; @@ -75,6 +76,9 @@ public class MainActivity extends AppCompatActivity syncManager = new SyncManager(getApplicationContext(), this); stackAdapter = new StackAdapter(getSupportFragmentManager()); + //TODO limit this call only to lower API levels like KitKat because they crash without + AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); + //TODO replace nulls new CrossTabDragAndDrop().register(this, viewPager, null, null); @@ -150,7 +154,9 @@ public class MainActivity extends AppCompatActivity MainActivity.this.syncManager.synchronize(new IResponseCallback<Boolean>(this.account) { @Override public void onResponse(Boolean response) { - syncManager.getBoards(this.account.getId()).observe(MainActivity.this, MainActivity.this::buildSidenavMenu); + runOnUiThread(() -> { + syncManager.getBoards(this.account.getId()).observe(MainActivity.this, MainActivity.this::buildSidenavMenu); + }); } @Override diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/about/AboutFragmentContributingTab.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/about/AboutFragmentContributingTab.java index 7b4e195a0..823a6aa5d 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/about/AboutFragmentContributingTab.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/about/AboutFragmentContributingTab.java @@ -1,7 +1,7 @@ package it.niedermann.nextcloud.deck.ui.about; import android.os.Bundle; -import android.support.v4.app.Fragment; +import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/about/AboutFragmentCreditsTab.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/about/AboutFragmentCreditsTab.java index 81e4dabdf..8cf2c8867 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/about/AboutFragmentCreditsTab.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/about/AboutFragmentCreditsTab.java @@ -1,7 +1,7 @@ package it.niedermann.nextcloud.deck.ui.about; import android.os.Bundle; -import android.support.v4.app.Fragment; +import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/about/AboutFragmentLicenseTab.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/about/AboutFragmentLicenseTab.java index 6f5371b56..7d9b42450 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/about/AboutFragmentLicenseTab.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/about/AboutFragmentLicenseTab.java @@ -3,7 +3,7 @@ package it.niedermann.nextcloud.deck.ui.about; import android.content.Intent; import android.net.Uri; import android.os.Bundle; -import android.support.v4.app.Fragment; +import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardActivityFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardActivityFragment.java index c9b6b0426..d8fb95a3b 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardActivityFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardActivityFragment.java @@ -1,8 +1,8 @@ package it.niedermann.nextcloud.deck.ui.card; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v4.app.Fragment; +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAdapter.java index a83fe8ab0..cd59e9d6b 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAdapter.java @@ -5,14 +5,14 @@ import android.content.Context; import android.content.Intent; import android.content.res.ColorStateList; import android.graphics.Color; -import android.os.Build; -import android.support.annotation.ColorRes; -import android.support.annotation.DrawableRes; -import android.support.annotation.NonNull; -import android.support.design.card.MaterialCardView; -import android.support.design.chip.Chip; -import android.support.design.chip.ChipGroup; -import android.support.v7.widget.RecyclerView; + +import androidx.annotation.ColorRes; +import androidx.annotation.DrawableRes; +import androidx.annotation.NonNull; +import com.google.android.material.card.MaterialCardView; +import com.google.android.material.chip.Chip; +import com.google.android.material.chip.ChipGroup; +import androidx.recyclerview.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAttachmentsFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAttachmentsFragment.java index 19a16586d..d55235bae 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAttachmentsFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAttachmentsFragment.java @@ -1,8 +1,8 @@ package it.niedermann.nextcloud.deck.ui.card; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v4.app.Fragment; +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardDetailsFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardDetailsFragment.java index f1918fd09..08ddbaf67 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardDetailsFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardDetailsFragment.java @@ -2,25 +2,16 @@ package it.niedermann.nextcloud.deck.ui.card; import android.app.DatePickerDialog; import android.app.TimePickerDialog; -import android.content.Context; import android.content.res.ColorStateList; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.design.chip.Chip; -import android.support.design.chip.ChipGroup; -import android.support.v4.app.Fragment; -import android.support.v4.graphics.ColorUtils; -import android.support.v4.graphics.drawable.DrawableCompat; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.AdapterView; import android.widget.DatePicker; -import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; @@ -28,6 +19,8 @@ import android.widget.TimePicker; import com.bumptech.glide.Glide; import com.bumptech.glide.request.RequestOptions; +import com.google.android.material.chip.Chip; +import com.google.android.material.chip.ChipGroup; import com.nextcloud.android.sso.exceptions.NextcloudFilesAppAccountNotFoundException; import com.nextcloud.android.sso.exceptions.NoCurrentAccountSelectedException; import com.nextcloud.android.sso.helper.SingleAccountHelper; @@ -38,6 +31,12 @@ import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Locale; +import androidx.annotation.NonNull; +import androidx.core.graphics.ColorUtils; +import androidx.core.graphics.drawable.DrawableCompat; +import androidx.databinding.DataBindingUtil; +import androidx.fragment.app.Fragment; +import androidx.lifecycle.ViewModelProviders; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.Unbinder; @@ -45,9 +44,11 @@ import it.niedermann.nextcloud.deck.ColorUtil; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.SupportUtil; +import it.niedermann.nextcloud.deck.databinding.FragmentCardEditTabDetailsBinding; import it.niedermann.nextcloud.deck.model.Label; import it.niedermann.nextcloud.deck.model.User; import it.niedermann.nextcloud.deck.model.full.FullCard; +import it.niedermann.nextcloud.deck.model.viewmodel.FullCardViewModel; import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; import it.niedermann.nextcloud.deck.ui.widget.DelayedAutoCompleteTextView; @@ -58,6 +59,7 @@ public class CardDetailsFragment extends Fragment implements DatePickerDialog.On TimePickerDialog.OnTimeSetListener { private static final String TAG = CardDetailsFragment.class.getCanonicalName(); + private FullCardViewModel fullCardViewModel; private FullCard card; private SyncManager syncManager; private DateFormat dateFormat; @@ -82,9 +84,6 @@ public class CardDetailsFragment extends Fragment implements DatePickerDialog.On @BindView(R.id.labelsGroup) ChipGroup labelsGroup; - @BindView(R.id.description) - EditText description; - public static CardDetailsFragment newInstance(long accountId, long localId) { Bundle bundle = new Bundle(); bundle.putLong(BUNDLE_KEY_ACCOUNT_ID, accountId); @@ -101,8 +100,17 @@ public class CardDetailsFragment extends Fragment implements DatePickerDialog.On ViewGroup container, Bundle savedInstanceState) { - View view = inflater.inflate(R.layout.fragment_card_edit_tab_details, container, false); - unbinder = ButterKnife.bind(this, view); + + fullCardViewModel = ViewModelProviders.of(this) + .get(FullCardViewModel.class); + + + FragmentCardEditTabDetailsBinding binding = DataBindingUtil.inflate(inflater, R.layout.fragment_card_edit_tab_details, container, false); + + binding.setLifecycleOwner(this); + binding.setEditmodel(fullCardViewModel); + + unbinder = ButterKnife.bind(this, binding.getRoot()); dateFormat = android.text.format.DateFormat.getDateFormat(getActivity()); //dueTime = android.text.format.DateFormat.getTimeFormat(getActivity()); @@ -114,30 +122,27 @@ public class CardDetailsFragment extends Fragment implements DatePickerDialog.On setupView(accountId, localId); } - return view; + return binding.getRoot(); } private void setupView(long accountId, long localId) { syncManager = new SyncManager(getActivity().getApplicationContext(), getActivity()); - syncManager.getCardByLocalId(accountId, localId) - .observe(CardDetailsFragment.this, (FullCard card) -> { - // TODO read/set available card details data - this.card = card; - if (this.card != null) { - // people - setupPeople(accountId); + this.fullCardViewModel.fullCard = syncManager.getCardByLocalId(accountId, localId); + this.fullCardViewModel.fullCard.observe(CardDetailsFragment.this, (FullCard card) -> { + // TODO read/set available card details data + this.card = card; + if (this.card != null) { + // people + setupPeople(accountId); - // labels - setupLabels(); + // labels + setupLabels(); - // due date - setupDueDate(); - - // description - setupDescription(); - } - }); + // due date + setupDueDate(); + } + }); dueDate.setOnClickListener(v -> { int year; @@ -178,12 +183,6 @@ public class CardDetailsFragment extends Fragment implements DatePickerDialog.On }); } - private void setupDescription() { - if (this.card.getCard().getDescription() != null) { - description.setText(this.card.getCard().getDescription()); - } - } - private void setupDueDate() { if (this.card.getCard().getDueDate() != null) { dueDate.setText(dateFormat.format(this.card.getCard().getDueDate())); @@ -246,7 +245,7 @@ public class CardDetailsFragment extends Fragment implements DatePickerDialog.On ImageView avatar; String baseUrl = account.url; int px = SupportUtil.getAvatarDimension(getContext()); - int margin = SupportUtil.dpToPx(getContext(),8); + int margin = SupportUtil.dpToPx(getContext(), 8); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(px, px); params.setMargins( 0, 0, margin, 0); @@ -257,7 +256,7 @@ public class CardDetailsFragment extends Fragment implements DatePickerDialog.On String uri = baseUrl + "/index.php/avatar/" + Uri.encode(user.getUid()) + "/" + px; peopleList.addView(avatar); avatar.requestLayout(); - Glide.with(this) + Glide.with(getContext()) .load(uri) .apply(RequestOptions.circleCropTransform()) .into(avatar); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardItemTouchHelper.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardItemTouchHelper.java index 08cefb66e..184351e77 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardItemTouchHelper.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardItemTouchHelper.java @@ -1,11 +1,8 @@ package it.niedermann.nextcloud.deck.ui.card; -import android.support.annotation.NonNull; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.helper.ItemTouchHelper; -import android.util.Log; - -import java.util.List; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; +import androidx.recyclerview.widget.ItemTouchHelper; public class CardItemTouchHelper extends ItemTouchHelper { public CardItemTouchHelper(CardAdapter adapter) { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardTabAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardTabAdapter.java index 739eb3b19..3c91101e4 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardTabAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardTabAdapter.java @@ -1,8 +1,8 @@ package it.niedermann.nextcloud.deck.ui.card; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentStatePagerAdapter; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentStatePagerAdapter; public class CardTabAdapter extends FragmentStatePagerAdapter { private CardDetailsFragment detailsFragment; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/UserAutoCompleteAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/UserAutoCompleteAdapter.java index dfd9284be..b86fbea1b 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/UserAutoCompleteAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/UserAutoCompleteAdapter.java @@ -1,10 +1,11 @@ package it.niedermann.nextcloud.deck.ui.card; -import android.arch.lifecycle.LifecycleOwner; -import android.arch.lifecycle.LiveData; +import androidx.fragment.app.Fragment; +import androidx.lifecycle.LifecycleOwner; +import androidx.lifecycle.LiveData; import android.content.Context; import android.net.Uri; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -12,7 +13,6 @@ import android.widget.BaseAdapter; import android.widget.Filter; import android.widget.Filterable; import android.widget.ImageView; -import android.widget.LinearLayout; import android.widget.TextView; import com.bumptech.glide.Glide; @@ -98,15 +98,17 @@ public class UserAutoCompleteAdapter extends BaseAdapter implements Filterable { protected FilterResults performFiltering(CharSequence constraint) { FilterResults filterResults = new FilterResults(); if (constraint != null) { - LiveDataHelper.onlyIfChanged( - syncManager.searchUserByUidOrDisplayName(accountId, constraint.toString()) - ) - .observe(owner, (List<User> users) -> { - if (users != null) { - filterResults.values = users; - filterResults.count = users.size(); - } - }); + ((Fragment)owner).getActivity().runOnUiThread(() -> { + LiveDataHelper.onlyIfChanged( + syncManager.searchUserByUidOrDisplayName(accountId, constraint.toString()) + ) + .observe(owner, (List<User> users) -> { + if (users != null) { + filterResults.values = users; + filterResults.count = users.size(); + } + }); + }); } return filterResults; } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/helper/dnd/CrossTabDragAndDrop.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/helper/dnd/CrossTabDragAndDrop.java index d64819ad9..a57b40f23 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/helper/dnd/CrossTabDragAndDrop.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/helper/dnd/CrossTabDragAndDrop.java @@ -2,8 +2,8 @@ package it.niedermann.nextcloud.deck.ui.helper.dnd; import android.app.Activity; import android.graphics.Point; -import android.support.v4.view.ViewPager; -import android.support.v7.widget.RecyclerView; +import androidx.viewpager.widget.ViewPager; +import androidx.recyclerview.widget.RecyclerView; import android.view.DragEvent; import android.view.View; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/login/LoginDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/login/LoginDialogFragment.java index 86b14559e..5704a4049 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/login/LoginDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/login/LoginDialogFragment.java @@ -3,9 +3,9 @@ package it.niedermann.nextcloud.deck.ui.login; import android.app.Dialog; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.DialogFragment; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; import android.util.Log; import com.nextcloud.android.sso.AccountImporter; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackAdapter.java index bd686d5eb..9766df3b0 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackAdapter.java @@ -1,9 +1,9 @@ package it.niedermann.nextcloud.deck.ui.stack; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentStatePagerAdapter; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentStatePagerAdapter; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java index aea339573..6d682cd39 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java @@ -1,12 +1,12 @@ package it.niedermann.nextcloud.deck.ui.stack; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v4.app.Fragment; -import android.support.v4.widget.SwipeRefreshLayout; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.helper.ItemTouchHelper; +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.recyclerview.widget.ItemTouchHelper; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/DelayedAutoCompleteTextView.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/DelayedAutoCompleteTextView.java index 4d68dab8c..9dcb61787 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/DelayedAutoCompleteTextView.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/DelayedAutoCompleteTextView.java @@ -12,9 +12,9 @@ import android.widget.ProgressBar; * https://makovkastar.github.io/blog/2014/04/12/android-autocompletetextview-with-suggestions-from-a-web-service/ * by Alex Melnykov */ -public class DelayedAutoCompleteTextView extends android.support.v7.widget.AppCompatAutoCompleteTextView { +public class DelayedAutoCompleteTextView extends androidx.appcompat.widget.AppCompatAutoCompleteTextView { private static final int MESSAGE_TEXT_CHANGED = 100; - private static final int DEFAULT_AUTOCOMPLETE_DELAY = 500; + private static final int DEFAULT_AUTOCOMPLETE_DELAY = 10; private int mAutoCompleteDelay = DEFAULT_AUTOCOMPLETE_DELAY; private ProgressBar mLoadingIndicator; diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 00f694eff..78e17475d 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -4,12 +4,12 @@ android:layout_height="match_parent" android:orientation="vertical"> - <android.support.design.widget.TabLayout + <com.google.android.material.tabs.TabLayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content" /> - <android.support.v4.view.ViewPager + <androidx.viewpager.widget.ViewPager android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="wrap_content" /> diff --git a/app/src/main/res/layout/activity_edit.xml b/app/src/main/res/layout/activity_edit.xml index 0a1afb66a..ba09053d5 100644 --- a/app/src/main/res/layout/activity_edit.xml +++ b/app/src/main/res/layout/activity_edit.xml @@ -1,40 +1,50 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout 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" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <EditText - android:id="@+id/title" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:hint="@string/label_title" - android:importantForAutofill="no" - android:layout_marginLeft="16dp" - android:layout_marginRight="16dp" - android:inputType="textPersonName" /> - - <TextView - android:id="@+id/timestamps" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="16dp" - android:layout_marginLeft="19dp" - android:layout_marginRight="19dp" - tools:text="Modified: 12 days ago Created: 12 days ago"/> - - <android.support.design.widget.TabLayout - android:id="@+id/tab_layout" - android:layout_width="match_parent" - android:layout_height="wrap_content" - app:tabGravity="center" - app:tabMode="fixed" /> +<layout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> - <android.support.v4.view.ViewPager - android:id="@+id/pager" + <data> + <variable + name="editmodel" + type="it.niedermann.nextcloud.deck.model.viewmodel.FullCardViewModel" /> + </data> + + <LinearLayout xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="fill_parent"/> + android:layout_height="match_parent" + android:orientation="vertical"> + + + <EditText + android:id="@+id/title" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:text="@{editmodel.fullCard.card.title}" + android:hint="@string/label_title" + android:importantForAutofill="no" + android:inputType="textPersonName" /> + + <TextView + android:id="@+id/timestamps" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="19dp" + android:layout_marginRight="19dp" + android:layout_marginBottom="16dp" + tools:text="Modified: 12 days ago Created: 12 days ago" /> + + <com.google.android.material.tabs.TabLayout + android:id="@+id/tab_layout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:tabGravity="center" + app:tabMode="fixed" /> + + <androidx.viewpager.widget.ViewPager + android:id="@+id/pager" + android:layout_width="match_parent" + android:layout_height="fill_parent" /> -</LinearLayout>
\ No newline at end of file + </LinearLayout> +</layout>
\ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index e05f336d6..57dafac35 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" +<androidx.drawerlayout.widget.DrawerLayout 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" android:id="@+id/drawer_layout" @@ -8,23 +8,23 @@ android:fitsSystemWindows="true" tools:openDrawer="start"> - <android.support.design.widget.CoordinatorLayout + <androidx.coordinatorlayout.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".ui.MainActivity"> - <android.support.design.widget.AppBarLayout + <com.google.android.material.appbar.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content"> - <android.support.v7.widget.Toolbar + <androidx.appcompat.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <android.support.design.widget.TabLayout + <com.google.android.material.tabs.TabLayout android:id="@+id/stackLayout" android:layout_height="wrap_content" android:layout_width="match_parent" @@ -34,20 +34,20 @@ app:tabGravity="fill" app:collapsedTitleGravity="top" /> - </android.support.design.widget.AppBarLayout> + </com.google.android.material.appbar.AppBarLayout> - <android.support.constraint.ConstraintLayout + <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"> - <android.support.v4.view.ViewPager + <androidx.viewpager.widget.ViewPager android:id="@+id/viewPager" android:layout_width="match_parent" android:layout_height="match_parent" /> - </android.support.constraint.ConstraintLayout> + </androidx.constraintlayout.widget.ConstraintLayout> - <android.support.design.widget.FloatingActionButton + <com.google.android.material.floatingactionbutton.FloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -57,14 +57,14 @@ app:rippleColor="@color/primary_dark" app:srcCompat="@drawable/ic_add_white_24dp" /> - </android.support.design.widget.CoordinatorLayout> + </androidx.coordinatorlayout.widget.CoordinatorLayout> - <android.support.design.widget.NavigationView + <com.google.android.material.navigation.NavigationView android:id="@+id/navigationView" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" android:fitsSystemWindows="false" - app:headerLayout="@layout/nav_header_main"></android.support.design.widget.NavigationView> + app:headerLayout="@layout/nav_header_main" /> -</android.support.v4.widget.DrawerLayout> +</androidx.drawerlayout.widget.DrawerLayout> diff --git a/app/src/main/res/layout/fragment_card.xml b/app/src/main/res/layout/fragment_card.xml index d5f4c5e3d..0d43f437a 100644 --- a/app/src/main/res/layout/fragment_card.xml +++ b/app/src/main/res/layout/fragment_card.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> -<android.support.design.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android" +<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" + xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/card" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -31,25 +32,26 @@ android:maxLines="3" tools:text="Card detailed description\nmultiline\n3 lines tops."/> - <android.support.design.chip.ChipGroup + <com.google.android.material.chip.ChipGroup android:id="@+id/labels" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" /> - <TextView + <androidx.appcompat.widget.AppCompatTextView android:id="@+id/card_due_date" android:layout_width="wrap_content" + android:layout_height="wrap_content" android:layout_marginTop="8dp" android:gravity="center_vertical" android:minLines="0" android:maxLines="1" - android:layout_height="wrap_content" - android:drawableLeft="@drawable/calendar_blank_grey600_24dp" - android:drawableStart="@drawable/calendar_blank_grey600_24dp" android:drawablePadding="4dp" android:padding="4dp" + app:drawableLeftCompat="@drawable/calendar_blank_grey600_24dp" + app:drawableStartCompat="@drawable/calendar_blank_grey600_24dp" tools:text="in 16 days" android:background="@drawable/due_tomorrow_background"/> + </LinearLayout> -</android.support.design.card.MaterialCardView>
\ No newline at end of file +</com.google.android.material.card.MaterialCardView>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_card_edit_tab_details.xml b/app/src/main/res/layout/fragment_card_edit_tab_details.xml index 550fbf7ad..4dd57bcee 100644 --- a/app/src/main/res/layout/fragment_card_edit_tab_details.xml +++ b/app/src/main/res/layout/fragment_card_edit_tab_details.xml @@ -1,151 +1,162 @@ <?xml version="1.0" encoding="utf-8"?> -<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:fillViewport="true"> -<LinearLayout - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:padding="16dp" - android:orientation="vertical"> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal"> +<layout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> - <ImageView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="12dp" - android:layout_marginEnd="@dimen/standard_margin" - android:layout_marginRight="@dimen/standard_margin" - android:contentDescription="@null" - app:srcCompat="@drawable/ic_person_grey600_24dp" /> - - <it.niedermann.nextcloud.deck.ui.widget.DelayedAutoCompleteTextView - android:id="@+id/people" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:hint="@string/hint_assign_people" /> - </LinearLayout> + <data> - <LinearLayout - android:id="@+id/peopleList" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:layout_marginStart="40dp" - android:layout_marginLeft="40dp"/> + <variable + name="editmodel" + type="it.niedermann.nextcloud.deck.model.viewmodel.FullCardViewModel" /> + </data> - <LinearLayout + <ScrollView android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal"> + android:layout_height="match_parent" + android:fillViewport="true"> - <ImageView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="12dp" - android:layout_marginEnd="@dimen/standard_margin" - android:layout_marginRight="@dimen/standard_margin" - android:contentDescription="@null" - app:srcCompat="@drawable/ic_label_grey600_24dp" /> - - <AutoCompleteTextView - android:id="@+id/labels" + <LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="@string/label_labels" /> - </LinearLayout> - - <android.support.design.chip.ChipGroup - android:id="@+id/labelsGroup" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginLeft="40dp" - android:layout_marginStart="40dp" /> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal"> - - <ImageView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="12dp" - android:layout_marginEnd="@dimen/standard_margin" - android:layout_marginRight="@dimen/standard_margin" - android:contentDescription="@null" - app:srcCompat="@drawable/calendar_blank_grey600_24dp" /> - - <EditText - android:id="@+id/dueDateDate" - android:layout_width="116dp" - android:layout_height="wrap_content" - android:layout_marginTop="8dp" - android:drawablePadding="4dp" - android:enabled="true" - android:focusable="false" - android:hint="@string/hint_due_date_date" - android:maxLines="1" - android:padding="4dp" - android:textAlignment="center" - tools:text="01/07/2020" /> - - <EditText - android:id="@+id/dueDateTime" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="8dp" - android:drawablePadding="4dp" - android:enabled="true" - android:focusable="false" - android:hint="@string/hint_due_date_time" - android:maxLines="1" - android:minLines="0" - android:padding="4dp" - android:textAlignment="center" - tools:text="11:45" /> - - <ImageView - android:id="@+id/clearDueDate" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingLeft="4dp" - android:paddingTop="6dp" - android:paddingRight="4dp" - app:srcCompat="@drawable/ic_close_circle_grey600" /> - </LinearLayout> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="0dp" - android:layout_weight="1" - android:orientation="horizontal"> - - <ImageView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="12dp" - android:layout_marginEnd="@dimen/standard_margin" - android:layout_marginRight="@dimen/standard_margin" - android:contentDescription="@null" - app:srcCompat="@drawable/ic_format_align_left_black_24dp" /> - - <EditText - android:id="@+id/description" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:gravity="top" - android:hint="@string/label_description" - android:inputType="textMultiLine|textCapSentences" - android:scrollbars="vertical" - /> - </LinearLayout> - -</LinearLayout> - </ScrollView>
\ No newline at end of file + android:orientation="vertical" + android:padding="16dp"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="12dp" + android:layout_marginEnd="@dimen/standard_margin" + android:layout_marginRight="@dimen/standard_margin" + android:contentDescription="@null" + app:srcCompat="@drawable/ic_person_grey600_24dp" /> + + <it.niedermann.nextcloud.deck.ui.widget.DelayedAutoCompleteTextView + android:id="@+id/people" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:hint="@string/hint_assign_people" /> + </LinearLayout> + + <LinearLayout + android:id="@+id/peopleList" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="40dp" + android:layout_marginLeft="40dp" + android:orientation="horizontal" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="12dp" + android:layout_marginEnd="@dimen/standard_margin" + android:layout_marginRight="@dimen/standard_margin" + android:contentDescription="@null" + app:srcCompat="@drawable/ic_label_grey600_24dp" /> + + <AutoCompleteTextView + android:id="@+id/labels" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:hint="@string/label_labels" /> + </LinearLayout> + + <com.google.android.material.chip.ChipGroup + android:id="@+id/labelsGroup" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="40dp" + android:layout_marginLeft="40dp" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="12dp" + android:layout_marginEnd="@dimen/standard_margin" + android:layout_marginRight="@dimen/standard_margin" + android:contentDescription="@null" + app:srcCompat="@drawable/calendar_blank_grey600_24dp" /> + + <EditText + android:id="@+id/dueDateDate" + android:layout_width="116dp" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:drawablePadding="4dp" + android:enabled="true" + android:focusable="false" + android:hint="@string/hint_due_date_date" + android:maxLines="1" + android:padding="4dp" + android:textAlignment="center" + tools:text="01/07/2020" /> + + <EditText + android:id="@+id/dueDateTime" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:drawablePadding="4dp" + android:enabled="true" + android:focusable="false" + android:hint="@string/hint_due_date_time" + android:maxLines="1" + android:minLines="0" + android:padding="4dp" + android:textAlignment="center" + tools:text="11:45" /> + + <ImageView + android:id="@+id/clearDueDate" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingLeft="4dp" + android:paddingTop="6dp" + android:paddingRight="4dp" + app:srcCompat="@drawable/ic_close_circle_grey600" /> + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" + android:orientation="horizontal"> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="12dp" + android:layout_marginEnd="@dimen/standard_margin" + android:layout_marginRight="@dimen/standard_margin" + android:contentDescription="@null" + app:srcCompat="@drawable/ic_format_align_left_black_24dp" /> + + <EditText + android:id="@+id/description" + android:text="@{editmodel.fullCard.card.description}" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="top" + android:hint="@string/label_description" + android:inputType="textMultiLine|textCapSentences" + android:scrollbars="vertical" /> + </LinearLayout> + + </LinearLayout> + </ScrollView> +</layout>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_stack.xml b/app/src/main/res/layout/fragment_stack.xml index 0bba32766..219c067d2 100644 --- a/app/src/main/res/layout/fragment_stack.xml +++ b/app/src/main/res/layout/fragment_stack.xml @@ -3,15 +3,15 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - <android.support.v4.widget.SwipeRefreshLayout + <androidx.swiperefreshlayout.widget.SwipeRefreshLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/swipe_refresh_layout"> - <android.support.v7.widget.RecyclerView + <androidx.recyclerview.widget.RecyclerView android:id="@+id/recycler_view" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="vertical" /> - </android.support.v4.widget.SwipeRefreshLayout> + </androidx.swiperefreshlayout.widget.SwipeRefreshLayout> </LinearLayout>
\ No newline at end of file diff --git a/build.gradle b/build.gradle index 9447929fe..e1851ac42 100644 --- a/build.gradle +++ b/build.gradle @@ -28,6 +28,6 @@ task clean(type: Delete) { } ext { - roomVersion = '1.1.1' - archLifecycleVersion = '1.1.1' + roomVersion = '2.0.0' + archLifecycleVersion = '2.0.0' }
\ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 743d692ce..8de505811 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,6 +6,8 @@ # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. +android.enableJetifier=true +android.useAndroidX=true org.gradle.jvmargs=-Xmx1536m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit |