Skip to content

fix design when keyboard is shown#1285

Merged
mahibi merged 34 commits intomasterfrom
bug/992/fixDesignWhenKeyboardShown
Feb 16, 2022
Merged

fix design when keyboard is shown#1285
mahibi merged 34 commits intomasterfrom
bug/992/fixDesignWhenKeyboardShown

Conversation

@mahibi
Copy link
Collaborator

@mahibi mahibi commented May 22, 2021

fix #992
might also be a fix for #1029

basically with this PR issue #992 is fixed by setting windowSoftInputMode to adjustResize and deleting the KeyboardUtils.
This in turn caused conflicts with https://github.com/Kennyc1012/BottomSheetMenu which was now replaced with androids BottomSheetDialog
The replacing of the bottom dialog lib led to quite some refactoring.

For now, while using the BottomSheetDialog there are some workarounds (=add more routers) to keep using the controllers from conductor.

fixed design in conversation conversation bottom dialog input dialog moved over keyboard
grafik grafik grafik

Signed-off-by: Marcel Hibbe dev@mhibbe.de

@AndyScherzinger AndyScherzinger added the 2. developing Work in progress label May 25, 2021
@mahibi
Copy link
Collaborator Author

mahibi commented Nov 2, 2021

deleting the KeyboardUtils will lead to a bug that the BottomSheet (https://github.com/Kennyc1012/BottomSheetMenu) is hidden under the keyboard (for example when entering a name for a new group).

I guess the best solution is to get rid of the BottomSheet lib. It even doesn't support customized views any more in newer versions, see https://github.com/Kennyc1012/BottomSheetMenu#upgrading-to-3x
The bug with the keyboard hiding the BottomSheet was known (see Kennyc1012/BottomSheetMenu#55) but there was never a solution by this lib, so that's where the KeyboardUtils made sense i guess.

So we should try to replace this lib with other solutions like android's BottomSheetDialogFragment
( https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetDialogFragment )

I remember we had the idea to unify the "creation of groups" between iOS and android at the hackweek meeting @nickvergessen
So if there are anyway any other ideas instead to have a menu at the bottom it might be a win win to also get rid of the bug that the Actionbar is partially hidden whenever keyboard is shown..

actionbarVisibleButBottomSheetHidden.mp4

@mahibi mahibi force-pushed the bug/992/fixDesignWhenKeyboardShown branch from e3f9f41 to 0d1db0c Compare November 2, 2021 19:44
@mahibi mahibi force-pushed the bug/992/fixDesignWhenKeyboardShown branch from b9aa5a8 to 3f4ccf6 Compare January 31, 2022 09:06
@mahibi mahibi mentioned this pull request Feb 8, 2022
@mahibi mahibi force-pushed the bug/992/fixDesignWhenKeyboardShown branch 5 times, most recently from cc43154 to 20ca8a6 Compare February 12, 2022 00:11
@AndyScherzinger AndyScherzinger force-pushed the bug/992/fixDesignWhenKeyboardShown branch from ef0ec5b to 080778b Compare February 12, 2022 14:07
@AndyScherzinger
Copy link
Member

@mahibi looking good, I did add some color improvements over the weekend for the bottom sheets for dark/light theming and improved the detekt/ktlint scores. Hope it helps. 💙

@mahibi
Copy link
Collaborator Author

mahibi commented Feb 14, 2022

@mahibi looking good, I did add some color improvements over the weekend for the bottom sheets for dark/light theming and improved the detekt/ktlint scores. Hope it helps. blue_heart

cool, thanks @AndyScherzinger 👍

@mahibi mahibi force-pushed the bug/992/fixDesignWhenKeyboardShown branch from 6a51b9c to 1bfdcc4 Compare February 14, 2022 16:51
@AndyScherzinger
Copy link
Member

AndyScherzinger commented Feb 15, 2022

@mahibi fixed detekt and 2 lint issues

@mahibi mahibi force-pushed the bug/992/fixDesignWhenKeyboardShown branch from 5346da3 to 1127fa7 Compare February 15, 2022 13:23
@mahibi mahibi added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Feb 15, 2022
@mahibi mahibi added this to the 13.1.0 milestone Feb 15, 2022
@AndyScherzinger
Copy link
Member

@mahibi looks good, one thing though (at least on Android 12 on my OP9Pro): i.e. when marking a conversation as a favorite, after the "success animation" the bottom sheet isn't closed automatically anymore. This has been working before, so maybe that part didn't get migrated?

@mahibi
Copy link
Collaborator Author

mahibi commented Feb 15, 2022

@mahibi looks good, one thing though (at least on Android 12 on my OP9Pro): i.e. when marking a conversation as a favorite, after the "success animation" the bottom sheet isn't closed automatically anymore. This has been working before, so maybe that part didn't get migrated?

indeed that was not migrated! fixed now

Copy link
Member

@AndyScherzinger AndyScherzinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mahibi works like a charm, just needs a single ktlint fix 👍

@mahibi
Copy link
Collaborator Author

mahibi commented Feb 16, 2022

@mahibi works like a charm, just needs a single ktlint fix +1

@AndyScherzinger well the klint warning is exactly about the wildcard import suggested by @timkrueger
#1285 (comment)

So should we

  • avoid wildcard imports?
  • change klint config to allow them?
  • import every single enum as static?
  • type ConversationOperationEnum.OPS_.... every time inside the code?
  • yolo and merge? :D

@timkrueger
Copy link
Contributor

import every single enum as static?

I would prefer to import every single enum value as static.

mahibi and others added 18 commits February 16, 2022 11:34
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
BottomSheetLockEvent was only used for old bottom dialog with "kennyc" lib

instead ConversationsListFetchDataEvent.kt is now used to fetch the data in ConversationsListController whenever needed

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
… [skip ci]

Signed-off-by: drone <drone@nextcloud.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
I can't reproduce or think of scenarios when this code was used. because bottom dialog is replaced it wouldn't work anymore anyway.
If there appear scenarios when the code would have executed, it should be fixed similar like ConversationsListBottomDialog was implemented.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
would otherwise break some dialog scenarios

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
…ip ci]

Signed-off-by: drone <drone@nextcloud.com>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
rename enums

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
@mahibi mahibi force-pushed the bug/992/fixDesignWhenKeyboardShown branch from 90d7efd to 0f6efab Compare February 16, 2022 10:34
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
@github-actions
Copy link
Contributor

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/1285-talk.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud Talk app.

@nextcloud-android-bot
Copy link
Collaborator

Lint

TypemasterPR
Warnings221218
Errors11

SpotBugs (new)

Warning Type Number
Bad practice Warnings 11
Correctness Warnings 117
Experimental Warnings 2
Internationalization Warnings 9
Malicious code vulnerability Warnings 167
Performance Warnings 29
Security Warnings 3
Dodgy code Warnings 205
Total 543

SpotBugs (master)

Warning Type Number
Bad practice Warnings 11
Correctness Warnings 121
Experimental Warnings 2
Internationalization Warnings 9
Malicious code vulnerability Warnings 167
Performance Warnings 29
Security Warnings 4
Dodgy code Warnings 209
Total 552

SpotBugs increased!

@mahibi mahibi merged commit db1071d into master Feb 16, 2022
@delete-merged-branch delete-merged-branch bot deleted the bug/992/fixDesignWhenKeyboardShown branch February 16, 2022 13:56
@mahibi
Copy link
Collaborator Author

mahibi commented Feb 16, 2022

we need to get rid of:

Could not load custom lint check jar file /root/.gradle/caches/transforms-2/files-2.1/e0e0d00b63718648d7473e1d0cc948ee/jetified-conductor-3.1.3/jars/lint.jar
--

java.lang.UnsupportedClassVersionError:
 com/bluelinelabs/conductor/lint/ControllerIssueDetector has been 
compiled by a more recent version of the Java Runtime (class file 
version 55.0), this version of the Java Runtime only recognizes class 
file versions up to 52.0

https://drone.nextcloud.com/nextcloud/talk-android/3014/4/2

@timkrueger
Copy link
Contributor

timkrueger commented Feb 16, 2022

we need to get rid of:

Could not load custom lint check jar file /root/.gradle/caches/transforms-2/files-2.1/e0e0d00b63718648d7473e1d0cc948ee/jetified-conductor-3.1.3/jars/lint.jar
--

java.lang.UnsupportedClassVersionError:
 com/bluelinelabs/conductor/lint/ControllerIssueDetector has been 
compiled by a more recent version of the Java Runtime (class file 
version 55.0), this version of the Java Runtime only recognizes class 
file versions up to 52.0

https://drone.nextcloud.com/nextcloud/talk-android/3014/4/2

To resolve that, we must only resolve #1125 ;-)

Class file version 55 is corresponding to Java 11.

@mahibi
Copy link
Collaborator Author

mahibi commented Feb 25, 2022

/backport to stable-13.0

@backportbot-nextcloud
Copy link

The backport to stable-13.0 failed. Please do this backport manually.

@mahibi mahibi mentioned this pull request Mar 2, 2022
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Top bar hides partially under status bar when typing

4 participants

Comments