From 1e55658dea2de6f8cb9f98710a156d42c124fdf3 Mon Sep 17 00:00:00 2001 From: ggkervran <73659505+Gabriel29306@users.noreply.github.com> Date: Thu, 13 Jun 2024 11:54:56 +0200 Subject: [PATCH 1/3] Enhancement: Modifiaction de l'interface de devoirs custom sur Android + Multiline pour les devoirs customs --- views/Devoirs/CreateHomeworkScreen.android.tsx | 7 +++++-- views/Devoirs/HwScreen.tsx | 10 +++++++--- views/DevoirsScreen.tsx | 6 +++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/views/Devoirs/CreateHomeworkScreen.android.tsx b/views/Devoirs/CreateHomeworkScreen.android.tsx index 7744c180..c93bc46f 100644 --- a/views/Devoirs/CreateHomeworkScreen.android.tsx +++ b/views/Devoirs/CreateHomeworkScreen.android.tsx @@ -386,12 +386,13 @@ function CreateHomeworkScreenAndroid({ route, navigation }: { setHomeworkContent(text)} ref={textInputRef} + multiligne={true} /> @@ -401,10 +402,12 @@ function CreateHomeworkScreenAndroid({ route, navigation }: { const styles = StyleSheet.create({ input: { - paddingVertical: 14, + paddingVertical: 1, paddingHorizontal: 16, fontFamily: 'Papillon-Medium', fontSize: 16, + minHeight: 100, + lineHeight: 16 }, inputSubject: { fontFamily: 'Papillon-Medium', diff --git a/views/Devoirs/HwScreen.tsx b/views/Devoirs/HwScreen.tsx index c951d355..5de8b17e 100644 --- a/views/Devoirs/HwScreen.tsx +++ b/views/Devoirs/HwScreen.tsx @@ -98,7 +98,7 @@ function HomeworkScreen({ route, navigation }: { navigation.navigate("CreateHomework", {homeworkLocalID: homeworkLocalID}); }} > - + - {convertHTML(homework.description)} + {convertHTML( + homework.custom ? homework.description + : homework.description.replace('\n', ' '), + { preserveNewlines: true } + )} {homework.difficulty !== PronoteApiHomeworkDifficulty.NONE && ( @@ -472,7 +476,7 @@ const styles = StyleSheet.create({ flexDirection: 'row', alignItems: 'center', justifyContent: 'center', - backgroundColor: '#0000ff22', + backgroundColor: '#3493eb22', borderRadius: 12, borderCurve: 'continuous', paddingVertical: 8, diff --git a/views/DevoirsScreen.tsx b/views/DevoirsScreen.tsx index 26518fcc..dee26ba6 100644 --- a/views/DevoirsScreen.tsx +++ b/views/DevoirsScreen.tsx @@ -400,7 +400,11 @@ function Hwitem({ homework, openURL, navigation }: { - {convertHTML(homework.description.replace('\n', ' '), { wordwrap: 130 })} + {convertHTML( + homework.custom ? homework.description + : homework.description.replace('\n', ' '), + { wordwrap: 130 } + )} From 8a90696a3abbe17cbc3b0d57b0761c48d50e78c2 Mon Sep 17 00:00:00 2001 From: ggkervran <73659505+Gabriel29306@users.noreply.github.com> Date: Thu, 13 Jun 2024 13:10:19 +0200 Subject: [PATCH 2/3] =?UTF-8?q?Mutliligne=20sur=20l'=C3=A9cran=20d'acceuil?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/HomeScreen.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/views/HomeScreen.tsx b/views/HomeScreen.tsx index 22516c99..75a70c64 100644 --- a/views/HomeScreen.tsx +++ b/views/HomeScreen.tsx @@ -1340,11 +1340,15 @@ function DevoirsContent({ styles.homeworksDevoirsContentContentDescription, { color: UIColors.text, - height: homework.description.length > 40 ? 38 : 20, + height: (homework.description.length > 40) || homework.custom ? 38 : 20, }, ]} > - {convertHTML(homework.description)} + {convertHTML( + homework.custom ? homework.description + : homework.description.replace('\n', ' '), + { preserveNewlines: true } + )} From 074d0cdb4462e5571d90dd9748d617781b025454 Mon Sep 17 00:00:00 2001 From: LeGeek01 <54872374+LeGeek01@users.noreply.github.com> Date: Fri, 14 Jun 2024 15:17:03 +0200 Subject: [PATCH 3/3] fix(createHomeworkScreenAndroid): type multiligne --> multiline --- views/Devoirs/CreateHomeworkScreen.android.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/Devoirs/CreateHomeworkScreen.android.tsx b/views/Devoirs/CreateHomeworkScreen.android.tsx index c93bc46f..298e9cd2 100644 --- a/views/Devoirs/CreateHomeworkScreen.android.tsx +++ b/views/Devoirs/CreateHomeworkScreen.android.tsx @@ -392,7 +392,7 @@ function CreateHomeworkScreenAndroid({ route, navigation }: { value={homeworkContent} onChangeText={text => setHomeworkContent(text)} ref={textInputRef} - multiligne={true} + multiline={true} />