浏览代码

Revert "Update dependencies" & Fix issue with mimetype preview

This reverts commit 3c0c332aa2c454db6e1ae96a7f26806bce22c0e7.

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic 6 年之前
父节点
当前提交
63360a63e9

+ 21 - 20
app/build.gradle

@@ -146,7 +146,8 @@ dependencies {
     implementation ('com.gitlab.bitfireAT:dav4jvm:f2078bc846', {
     implementation ('com.gitlab.bitfireAT:dav4jvm:f2078bc846', {
         exclude group: 'org.ogce', module: 'xpp3'	// Android comes with its own XmlPullParser
         exclude group: 'org.ogce', module: 'xpp3'	// Android comes with its own XmlPullParser
     })
     })
-    implementation 'org.conscrypt:conscrypt-android:2.1.0'
+    implementation 'org.conscrypt:conscrypt-android:2.0.0'
+
 
 
     implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
     implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
 
 
@@ -156,39 +157,39 @@ dependencies {
     implementation 'androidx.multidex:multidex:2.0.1'
     implementation 'androidx.multidex:multidex:2.0.1'
 
 
     implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
     implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
-    implementation "io.reactivex.rxjava2:rxjava:2.2.9"
+    implementation "io.reactivex.rxjava2:rxjava:2.2.7"
 
 
     implementation 'com.bluelinelabs:conductor:2.1.5'
     implementation 'com.bluelinelabs:conductor:2.1.5'
     implementation 'com.bluelinelabs:conductor-support:2.1.5'
     implementation 'com.bluelinelabs:conductor-support:2.1.5'
 
 
-    implementation 'com.squareup.okhttp3:okhttp:3.14.2'
-    implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.14.2'
-    implementation 'com.squareup.okhttp3:logging-interceptor:3.14.2'
+    implementation 'com.squareup.okhttp3:okhttp:3.13.1'
+    implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.13.1'
+    implementation 'com.squareup.okhttp3:logging-interceptor:3.13.1'
 
 
     implementation 'com.bluelinelabs:logansquare:1.3.7'
     implementation 'com.bluelinelabs:logansquare:1.3.7'
-    implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.9.9'
+    implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.9.8'
     kapt 'com.bluelinelabs:logansquare-compiler:1.3.7'
     kapt 'com.bluelinelabs:logansquare-compiler:1.3.7'
 
 
     implementation 'com.squareup.retrofit2:retrofit:2.5.0'
     implementation 'com.squareup.retrofit2:retrofit:2.5.0'
     implementation 'com.squareup.retrofit2:adapter-rxjava2:2.5.0'
     implementation 'com.squareup.retrofit2:adapter-rxjava2:2.5.0'
     implementation 'com.github.aurae.retrofit2:converter-logansquare:1.4.1'
     implementation 'com.github.aurae.retrofit2:converter-logansquare:1.4.1'
 
 
-    implementation 'com.google.dagger:dagger:2.23.1'
-    kapt 'com.google.dagger:dagger-compiler:2.23.1'
+    implementation 'com.google.dagger:dagger:2.21'
+    kapt 'com.google.dagger:dagger-compiler:2.21'
     implementation 'com.github.lukaspili.autodagger2:autodagger2:1.1'
     implementation 'com.github.lukaspili.autodagger2:autodagger2:1.1'
     kapt 'com.github.lukaspili.autodagger2:autodagger2-compiler:1.1'
     kapt 'com.github.lukaspili.autodagger2:autodagger2-compiler:1.1'
     compileOnly 'javax.annotation:jsr250-api:1.0'
     compileOnly 'javax.annotation:jsr250-api:1.0'
     // Android only
     // Android only
     implementation 'org.greenrobot:eventbus:3.1.1'
     implementation 'org.greenrobot:eventbus:3.1.1'
-    implementation 'io.requery:requery:1.6.0'
-    implementation 'io.requery:requery-android:1.6.0'
+    implementation 'io.requery:requery:1.5.1'
+    implementation 'io.requery:requery-android:1.5.1'
     implementation 'net.zetetic:android-database-sqlcipher:3.5.9'
     implementation 'net.zetetic:android-database-sqlcipher:3.5.9'
-    kapt 'io.requery:requery-processor:1.6.0'
+    kapt 'io.requery:requery-processor:1.5.1'
     implementation 'org.parceler:parceler-api:1.1.12'
     implementation 'org.parceler:parceler-api:1.1.12'
     kapt 'org.parceler:parceler:1.1.12'
     kapt 'org.parceler:parceler:1.1.12'
     implementation 'net.orange-box.storebox:storebox-lib:1.4.0'
     implementation 'net.orange-box.storebox:storebox-lib:1.4.0'
-    compileOnly 'org.projectlombok:lombok:1.18.8'
-    annotationProcessor "org.projectlombok:lombok:1.18.8"
+    compileOnly 'org.projectlombok:lombok:1.18.6'
+    annotationProcessor "org.projectlombok:lombok:1.18.6"
     implementation 'com.jakewharton:butterknife:10.1.0'
     implementation 'com.jakewharton:butterknife:10.1.0'
     kapt 'com.jakewharton:butterknife-compiler:10.1.0'
     kapt 'com.jakewharton:butterknife-compiler:10.1.0'
     implementation 'com.github.HITGIF:TextFieldBoxes:1.4.3'
     implementation 'com.github.HITGIF:TextFieldBoxes:1.4.3'
@@ -200,7 +201,7 @@ dependencies {
     implementation 'com.yarolegovich:lovelyinput:1.0.9'
     implementation 'com.yarolegovich:lovelyinput:1.0.9'
     implementation 'com.yarolegovich:mp:1.0.9'
     implementation 'com.yarolegovich:mp:1.0.9'
     implementation 'me.zhanghai.android.effortlesspermissions:library:1.1.0'
     implementation 'me.zhanghai.android.effortlesspermissions:library:1.1.0'
-    implementation 'org.apache.commons:commons-lang3:3.9'
+    implementation 'org.apache.commons:commons-lang3:3.8.1'
     implementation 'com.github.wooplr:Spotlight:1.3'
     implementation 'com.github.wooplr:Spotlight:1.3'
     implementation('com.github.mario:chatkit:d63d61db95', {
     implementation('com.github.mario:chatkit:d63d61db95', {
         exclude group: 'com.facebook.fresco'
         exclude group: 'com.facebook.fresco'
@@ -221,16 +222,16 @@ dependencies {
     implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
     implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
     implementation 'eu.medsea.mimeutil:mime-util:2.1.3'
     implementation 'eu.medsea.mimeutil:mime-util:2.1.3'
     testImplementation 'junit:junit:4.12'
     testImplementation 'junit:junit:4.12'
-    testImplementation 'org.mockito:mockito-core:2.28.2'
-    testImplementation 'org.powermock:powermock-core:2.0.2'
-    testImplementation 'org.powermock:powermock-module-junit4:2.0.2'
-    testImplementation 'org.powermock:powermock-api-mockito2:2.0.2'
+    testImplementation 'org.mockito:mockito-core:2.26.0'
+    testImplementation 'org.powermock:powermock-core:2.0.0'
+    testImplementation 'org.powermock:powermock-module-junit4:2.0.0'
+    testImplementation 'org.powermock:powermock-api-mockito2:2.0.0'
 
 
     androidTestImplementation ('androidx.test.espresso:espresso-core:3.1.0-alpha4', {
     androidTestImplementation ('androidx.test.espresso:espresso-core:3.1.0-alpha4', {
         exclude group: 'com.android.support', module: 'support-annotations'
         exclude group: 'com.android.support', module: 'support-annotations'
     })
     })
-    findbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.9.0'
-    findbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.4.5'
+    findbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.8.0'
+    findbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.4.3'
 }
 }
 
 
 gradle.projectsEvaluated {
 gradle.projectsEvaluated {

+ 11 - 14
app/src/main/java/com/nextcloud/talk/adapters/messages/MagicPreviewMessageViewHolder.java

@@ -27,8 +27,11 @@ import android.content.Intent;
 import android.graphics.drawable.Drawable;
 import android.graphics.drawable.Drawable;
 import android.graphics.drawable.LayerDrawable;
 import android.graphics.drawable.LayerDrawable;
 import android.net.Uri;
 import android.net.Uri;
+import android.os.Handler;
 import android.view.View;
 import android.view.View;
-
+import autodagger.AutoInjector;
+import butterknife.BindView;
+import butterknife.ButterKnife;
 import com.nextcloud.talk.R;
 import com.nextcloud.talk.R;
 import com.nextcloud.talk.application.NextcloudTalkApplication;
 import com.nextcloud.talk.application.NextcloudTalkApplication;
 import com.nextcloud.talk.components.filebrowser.models.BrowserFile;
 import com.nextcloud.talk.components.filebrowser.models.BrowserFile;
@@ -42,15 +45,7 @@ import com.nextcloud.talk.utils.DrawableUtils;
 import com.nextcloud.talk.utils.bundle.BundleKeys;
 import com.nextcloud.talk.utils.bundle.BundleKeys;
 import com.stfalcon.chatkit.messages.MessageHolders;
 import com.stfalcon.chatkit.messages.MessageHolders;
 import com.vanniktech.emoji.EmojiTextView;
 import com.vanniktech.emoji.EmojiTextView;
-
-import java.util.List;
-import java.util.concurrent.Callable;
-
-import javax.inject.Inject;
-
-import autodagger.AutoInjector;
-import butterknife.BindView;
-import butterknife.ButterKnife;
+import io.reactivex.Scheduler;
 import io.reactivex.Single;
 import io.reactivex.Single;
 import io.reactivex.SingleObserver;
 import io.reactivex.SingleObserver;
 import io.reactivex.android.schedulers.AndroidSchedulers;
 import io.reactivex.android.schedulers.AndroidSchedulers;
@@ -58,6 +53,10 @@ import io.reactivex.disposables.Disposable;
 import io.reactivex.schedulers.Schedulers;
 import io.reactivex.schedulers.Schedulers;
 import okhttp3.OkHttpClient;
 import okhttp3.OkHttpClient;
 
 
+import javax.inject.Inject;
+import java.util.List;
+import java.util.concurrent.Callable;
+
 @AutoInjector(NextcloudTalkApplication.class)
 @AutoInjector(NextcloudTalkApplication.class)
 public class MagicPreviewMessageViewHolder extends MessageHolders.IncomingImageMessageViewHolder<ChatMessage> {
 public class MagicPreviewMessageViewHolder extends MessageHolders.IncomingImageMessageViewHolder<ChatMessage> {
 
 
@@ -144,8 +143,7 @@ public class MagicPreviewMessageViewHolder extends MessageHolders.IncomingImageM
             public ReadFilesystemOperation call() {
             public ReadFilesystemOperation call() {
                 return new ReadFilesystemOperation(okHttpClient, activeUser, url, 0);
                 return new ReadFilesystemOperation(okHttpClient, activeUser, url, 0);
             }
             }
-        }).subscribeOn(AndroidSchedulers.mainThread())
-                .observeOn(Schedulers.io())
+        }).observeOn(Schedulers.io())
                 .subscribe(new SingleObserver<ReadFilesystemOperation>() {
                 .subscribe(new SingleObserver<ReadFilesystemOperation>() {
                     @Override
                     @Override
                     public void onSubscribe(Disposable d) {
                     public void onSubscribe(Disposable d) {
@@ -158,9 +156,8 @@ public class MagicPreviewMessageViewHolder extends MessageHolders.IncomingImageM
                         if (davResponse.getData() != null) {
                         if (davResponse.getData() != null) {
                             List<BrowserFile> browserFileList = (List<BrowserFile>) davResponse.getData();
                             List<BrowserFile> browserFileList = (List<BrowserFile>) davResponse.getData();
                             if (!browserFileList.isEmpty()) {
                             if (!browserFileList.isEmpty()) {
-                                image.getHierarchy().setPlaceholderImage(context.getDrawable(DrawableUtils.getDrawableResourceIdForMimeType(browserFileList.get(0).getMimeType())));
+                                new Handler(context.getMainLooper()).post(() -> image.getHierarchy().setPlaceholderImage(context.getDrawable(DrawableUtils.getDrawableResourceIdForMimeType(browserFileList.get(0).getMimeType()))));
                             }
                             }
-
                         }
                         }
                     }
                     }
 
 

+ 4 - 2
app/src/main/res/layout/rv_item_mention.xml

@@ -58,7 +58,8 @@
             android:layout_height="wrap_content"
             android:layout_height="wrap_content"
             android:ellipsize="middle"
             android:ellipsize="middle"
             android:singleLine="true"
             android:singleLine="true"
-            android:textAppearance="?android:attr/textAppearanceListItem"
+            android:textSize="16sp"
+            android:textColor="@color/nc_incoming_text_default"
             tools:text="Call item text" />
             tools:text="Call item text" />
 
 
         <TextView
         <TextView
@@ -67,7 +68,8 @@
             android:layout_height="wrap_content"
             android:layout_height="wrap_content"
             android:ellipsize="middle"
             android:ellipsize="middle"
             android:singleLine="true"
             android:singleLine="true"
-            android:textColor="?android:attr/textColorSecondary"
+            android:textSize="12sp"
+            android:textColor="@color/warm_grey_four"
             tools:text="A week ago" />
             tools:text="A week ago" />
 
 
     </LinearLayout>
     </LinearLayout>

+ 1 - 0
app/src/main/res/values/colors.xml

@@ -27,6 +27,7 @@
     <color name="nc_incoming_text_default">#37505D</color>
     <color name="nc_incoming_text_default">#37505D</color>
     <color name="nc_incoming_text_mention_you">#C98879</color>
     <color name="nc_incoming_text_mention_you">#C98879</color>
     <color name="nc_incoming_text_mention_others">#37505D</color>
     <color name="nc_incoming_text_mention_others">#37505D</color>
+    <color name="nc_text_color">@color/black</color>
 
 
     <color name="nc_darkRed">#D32F2F</color>
     <color name="nc_darkRed">#D32F2F</color>
     <color name="nc_darkGreen">#006400</color>
     <color name="nc_darkGreen">#006400</color>

+ 1 - 1
app/src/main/res/values/styles.xml

@@ -28,7 +28,7 @@
         <item name="colorAccent">@color/colorPrimary</item>
         <item name="colorAccent">@color/colorPrimary</item>
         <item name="android:panelFullBackground">@color/colorPrimary</item>
         <item name="android:panelFullBackground">@color/colorPrimary</item>
         <item name="android:itemBackground">@color/nc_outcoming_text_default</item>
         <item name="android:itemBackground">@color/nc_outcoming_text_default</item>
-        <item name="android:textColor">@color/black</item>
+        <item name="android:textColor">@color/nc_text_color</item>
     </style>
     </style>
 
 
     <style name="ErrorAppearance" parent="@android:style/TextAppearance">
     <style name="ErrorAppearance" parent="@android:style/TextAppearance">