From 509222e2d2dd4def4b61bd2bae537ea16e75a0d0 Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Fri, 31 May 2019 12:47:49 +0200 Subject: [PATCH 1/3] MOBILE-3039 rte: Fix height calculation in Android --- src/components/rich-text-editor/rich-text-editor.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/rich-text-editor/rich-text-editor.ts b/src/components/rich-text-editor/rich-text-editor.ts index 5d2da5941..59fdabe77 100644 --- a/src/components/rich-text-editor/rich-text-editor.ts +++ b/src/components/rich-text-editor/rich-text-editor.ts @@ -148,7 +148,10 @@ export class CoreRichTextEditorComponent implements AfterContentInit, OnDestroy // Editor is ready, adjust Height if needed. let height; - if (this.platform.is('ios') && this.kbHeight > 0) { + if (this.platform.is('android')) { + // Android, ignore keyboard height because web view is resized. + height = this.domUtils.getContentHeight(this.content) - this.getSurroundingHeight(this.element); + } else if (this.platform.is('ios') && this.kbHeight > 0) { // Keyboard open in iOS. // In this case, the header disappears or is scrollable, so we need to adjust the calculations. height = window.innerHeight - this.getSurroundingHeight(this.element); From 55fe415c53050170e35e387ff014d23c61d74efe Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Mon, 3 Jun 2019 11:50:42 +0200 Subject: [PATCH 2/3] MOBILE-3039 styles: Fix text wrapping in block buttons --- src/app/app.scss | 51 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/src/app/app.scss b/src/app/app.scss index ed48ce3d0..41759e8ef 100644 --- a/src/app/app.scss +++ b/src/app/app.scss @@ -678,7 +678,7 @@ ion-app.app-root { > ion-icon { color: $color-base; position: absolute; - @include position(0, null, null, 16px) + @include position(0, null, null, 16px); height: 100%; font-size: 24px; display: flex; @@ -1103,3 +1103,52 @@ ion-app.platform-desktop { } } } + +// Fix text wrapping in block buttons. +.button-block[text-wrap] { + height: auto; + + // Changed from "strict" because the size depends on child elements. + contain: content; + + // Add vertical padding, we cannot rely on a fixed height + centering like in normal buttons. + .item-md & { + padding-top: .5357em; + padding-bottom: .5357em; + } + .item-md &.item-button { + padding-top: .6em; + padding-bottom: .6em; + } + .item-ios & { + padding-top: .9em; + padding-bottom: .9em; + } + .item-ios &.item-button { + padding-top: .7846em; + padding-bottom: .7846em; + } + + // Keep a consistent height with normal buttons if text does not wrap. + display: flex; + flex-flow: row; + align-items: center; + &.button-md { + min-height: $button-md-height; + } + &.button-large-md { + min-height: $button-md-large-height; + } + &.button-small-md { + min-height: $button-md-small-height; + } + &.button-ios { + min-height: $button-ios-height; + } + &.button-large-ios { + min-height: $button-ios-large-height; + } + &.button-small-ios { + min-height: $button-ios-small-height; + } +} From 35656ab1e0ad767d6b72904301239e345f5f03c9 Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Mon, 3 Jun 2019 11:54:00 +0200 Subject: [PATCH 3/3] MOBILE-3039 lesson: Wrap text in buttons --- src/addon/mod/lesson/pages/player/player.html | 10 +++++----- .../mod/lesson/pages/user-retake/user-retake.html | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/addon/mod/lesson/pages/player/player.html b/src/addon/mod/lesson/pages/player/player.html index 0c2e2ac0b..6c83c1f4b 100644 --- a/src/addon/mod/lesson/pages/player/player.html +++ b/src/addon/mod/lesson/pages/player/player.html @@ -108,7 +108,7 @@ - + @@ -175,7 +175,7 @@ - + @@ -185,7 +185,7 @@ - + @@ -212,8 +212,8 @@ - {{ 'addon.mod_lesson.finish' | translate }} - {{ button.label | translate }} + {{ 'addon.mod_lesson.finish' | translate }} + {{ button.label | translate }} diff --git a/src/addon/mod/lesson/pages/user-retake/user-retake.html b/src/addon/mod/lesson/pages/user-retake/user-retake.html index 3b35e37e4..60c19802b 100644 --- a/src/addon/mod/lesson/pages/user-retake/user-retake.html +++ b/src/addon/mod/lesson/pages/user-retake/user-retake.html @@ -78,7 +78,7 @@ - +