From 1ab96016ac8d005518bce7f7e0ede300e2f69415 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Wed, 21 Apr 2021 21:46:30 +0200 Subject: [PATCH 1/6] optimize lock-screen layout/colors Signed-off-by: Andy Scherzinger --- .../talk/controllers/LockedController.java | 15 ++++-- app/src/main/res/layout/controller_locked.xml | 54 +++++++++++-------- scripts/analysis/lint-results.txt | 2 +- 3 files changed, 44 insertions(+), 27 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/controllers/LockedController.java b/app/src/main/java/com/nextcloud/talk/controllers/LockedController.java index 98220d561..8fc7084b1 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/LockedController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/LockedController.java @@ -34,12 +34,14 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.RequiresApi; import androidx.biometric.BiometricPrompt; +import androidx.core.content.res.ResourcesCompat; import androidx.fragment.app.FragmentActivity; import autodagger.AutoInjector; import butterknife.OnClick; import com.nextcloud.talk.R; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.controllers.base.BaseController; +import com.nextcloud.talk.utils.DisplayUtils; import com.nextcloud.talk.utils.SecurityUtils; import com.nextcloud.talk.utils.preferences.AppPreferences; @@ -64,20 +66,21 @@ public class LockedController extends BaseController { protected void onViewBound(@NonNull View view) { super.onViewBound(view); NextcloudTalkApplication.Companion.getSharedApplication().getComponentApplication().inject(this); - if (getActionBar() != null) { - getActionBar().hide(); - } } @RequiresApi(api = Build.VERSION_CODES.M) @Override protected void onAttach(@NonNull View view) { super.onAttach(view); + if (getActivity() != null && getResources() != null) { + DisplayUtils.applyColorToStatusBar(getActivity(), ResourcesCompat.getColor(getResources(), R.color.colorPrimary, null)); + DisplayUtils.applyColorToNavigationBar(getActivity().getWindow(), ResourcesCompat.getColor(getResources(), R.color.colorPrimary, null)); + } checkIfWeAreSecure(); } @RequiresApi(api = Build.VERSION_CODES.M) - @OnClick(R.id.unlockTextView) + @OnClick(R.id.unlockContainer) void unlock() { checkIfWeAreSecure(); } @@ -167,4 +170,8 @@ public class LockedController extends BaseController { } } } + + public AppBarLayoutType getAppBarLayoutType() { + return AppBarLayoutType.EMPTY; + } } diff --git a/app/src/main/res/layout/controller_locked.xml b/app/src/main/res/layout/controller_locked.xml index cdd1c5d17..510479a50 100644 --- a/app/src/main/res/layout/controller_locked.xml +++ b/app/src/main/res/layout/controller_locked.xml @@ -18,36 +18,46 @@ ~ along with this program. If not, see . --> - - + - + + + + + - + android:textColor="@color/white" + android:textSize="22sp" /> + + diff --git a/scripts/analysis/lint-results.txt b/scripts/analysis/lint-results.txt index c205f5007..01773d406 100644 --- a/scripts/analysis/lint-results.txt +++ b/scripts/analysis/lint-results.txt @@ -1,2 +1,2 @@ DO NOT TOUCH; GENERATED BY DRONE - Lint Report: 3 errors and 117 warnings + Lint Report: 3 errors and 116 warnings From 12a5f763881b713658285de45798497abac1803a Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Wed, 21 Apr 2021 22:48:07 +0200 Subject: [PATCH 2/6] bump mockito to 3.8.0 Signed-off-by: Andy Scherzinger --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index bbad8c61a..4fe55bbc3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -255,7 +255,7 @@ dependencies { implementation 'com.elyeproj.libraries:loaderviewlibrary:2.0.0' testImplementation 'junit:junit:4.13' - testImplementation 'org.mockito:mockito-core:3.0.0' + testImplementation 'org.mockito:mockito-core:3.8.0' testImplementation "org.powermock:powermock-core:${powermockVersion}" testImplementation "org.powermock:powermock-module-junit4:${powermockVersion}" testImplementation "org.powermock:powermock-api-mockito2:${powermockVersion}" From d28192557a3c893a8e1e1f0c4f4ffd61ea2e8c79 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Wed, 21 Apr 2021 22:57:01 +0200 Subject: [PATCH 3/6] unify coil lib version number Signed-off-by: Andy Scherzinger --- app/build.gradle | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 4fe55bbc3..7f0ddf56e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -126,6 +126,7 @@ android { } ext { + coilKtVersion = "0.9.1" daggerVersion = "2.34.1" powermockVersion = "2.0.9" workVersion = "2.3.0" @@ -223,9 +224,9 @@ dependencies { implementation 'com.github.mario.fresco:animated-gif:111' implementation 'com.github.mario.fresco:imagepipeline-okhttp3:111' implementation group: 'joda-time', name: 'joda-time', version: '2.10.3' - implementation 'io.coil-kt:coil:0.9.1' - implementation("io.coil-kt:coil-gif:0.9.1") - implementation("io.coil-kt:coil-svg:0.9.1") + implementation "io.coil-kt:coil:${coilKtVersion}" + implementation("io.coil-kt:coil-gif:${coilKtVersion}") + implementation("io.coil-kt:coil-svg:${coilKtVersion}") implementation 'com.github.natario1:Autocomplete:v1.1.0' implementation 'com.github.cotechde.hwsecurity:hwsecurity-fido:2.4.5' From f8319b663d619b4c3bfc2785f3eb51284d883fa9 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Wed, 21 Apr 2021 23:08:04 +0200 Subject: [PATCH 4/6] add contribution info Signed-off-by: Andy Scherzinger --- .../com/nextcloud/talk/controllers/LockedController.java | 5 +++++ app/src/main/res/layout/controller_locked.xml | 2 ++ 2 files changed, 7 insertions(+) diff --git a/app/src/main/java/com/nextcloud/talk/controllers/LockedController.java b/app/src/main/java/com/nextcloud/talk/controllers/LockedController.java index 8fc7084b1..637d8eefe 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/LockedController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/LockedController.java @@ -2,6 +2,8 @@ * Nextcloud Talk application * * @author Mario Danic + * @author Andy Scherzinger + * Copyright (C) 2021 Andy Scherzinger * Copyright (C) 2017-2018 Mario Danic * * This program is free software: you can redistribute it and/or modify @@ -45,6 +47,8 @@ import com.nextcloud.talk.utils.DisplayUtils; import com.nextcloud.talk.utils.SecurityUtils; import com.nextcloud.talk.utils.preferences.AppPreferences; +import org.jetbrains.annotations.NotNull; + import javax.inject.Inject; import java.util.concurrent.Executor; import java.util.concurrent.Executors; @@ -57,6 +61,7 @@ public class LockedController extends BaseController { @Inject AppPreferences appPreferences; + @NotNull @Override protected View inflateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container) { return inflater.inflate(R.layout.controller_locked, container, false); diff --git a/app/src/main/res/layout/controller_locked.xml b/app/src/main/res/layout/controller_locked.xml index 510479a50..387acb48f 100644 --- a/app/src/main/res/layout/controller_locked.xml +++ b/app/src/main/res/layout/controller_locked.xml @@ -2,6 +2,8 @@ ~ Nextcloud Talk application ~ ~ @author Mario Danic + ~ @author Andy Scherzinger + ~ Copyright (C) 2021 Andy Scherzinger ~ Copyright (C) 2017-2018 Mario Danic ~ ~ This program is free software: you can redistribute it and/or modify From c2ac2705a3dfef72fa06a8de41cb8595bdb65daa Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Tue, 27 Apr 2021 08:27:08 +0200 Subject: [PATCH 5/6] use textColorOnPrimaryBackground Signed-off-by: Andy Scherzinger --- app/src/main/res/layout/controller_locked.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/layout/controller_locked.xml b/app/src/main/res/layout/controller_locked.xml index 387acb48f..92079e9c3 100644 --- a/app/src/main/res/layout/controller_locked.xml +++ b/app/src/main/res/layout/controller_locked.xml @@ -59,7 +59,7 @@ android:paddingBottom="56dp" android:text="@string/nc_locked" android:textAlignment="center" - android:textColor="@color/white" + android:textColor="@color/textColorOnPrimaryBackground" android:textSize="22sp" /> From 5322df89dd1202b07e229d957eb9cae570470998 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Tue, 27 Apr 2021 09:47:53 +0200 Subject: [PATCH 6/6] proper quote coloring in dark mode Signed-off-by: Andy Scherzinger --- app/src/main/res/layout/item_message_quote.xml | 1 + app/src/main/res/values-night/colors.xml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/layout/item_message_quote.xml b/app/src/main/res/layout/item_message_quote.xml index 12a538d68..b3aa65456 100644 --- a/app/src/main/res/layout/item_message_quote.xml +++ b/app/src/main/res/layout/item_message_quote.xml @@ -45,6 +45,7 @@ android:layout_marginEnd="8dp" android:layout_toEndOf="@id/quoteColoredView" android:ellipsize="end" + android:textColor="@color/textColorMaxContrast" android:textSize="12sp" tools:text="Jane Doe" /> diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index d965cd058..3c8e97869 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -52,7 +52,6 @@ #484848 - @android:color/holo_purple #121212 #484848 #66484848