From 7318f53a9e2516a2ca633debae0b4102606738ae Mon Sep 17 00:00:00 2001 From: Gideon Okuro Date: Mon, 4 Dec 2023 20:36:28 +0300 Subject: [PATCH] courses: better course step display (fixes #2771) (#2782) Co-authored-by: dogi --- app/build.gradle | 4 ++-- .../ole/planet/myplanet/ui/course/CourseStepFragment.java | 4 ++-- app/src/main/res/layout/fragment_course_step.xml | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 82ba6e6cce..1aeba4388f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 21 targetSdkVersion 34 - versionCode 1178 - versionName "0.11.78" + versionCode 1179 + versionName "0.11.79" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/course/CourseStepFragment.java b/app/src/main/java/org/ole/planet/myplanet/ui/course/CourseStepFragment.java index a8444ef703..da9d94242c 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/course/CourseStepFragment.java +++ b/app/src/main/java/org/ole/planet/myplanet/ui/course/CourseStepFragment.java @@ -142,7 +142,7 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) { fragmentCourseStepBinding.description.setMovementMethod(LinkMovementMethod.getInstance()); if (!RealmMyCourse.isMyCourse(user.getId(), step.getCourseId(), mRealm)) { - fragmentCourseStepBinding.btnTakeTest.setVisibility(View.INVISIBLE); + fragmentCourseStepBinding.btnTakeTest.setVisibility(View.GONE); } setListeners(); @@ -164,7 +164,7 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) { } private void hideTestIfNoQuestion() { - fragmentCourseStepBinding.btnTakeTest.setVisibility(View.INVISIBLE); + fragmentCourseStepBinding.btnTakeTest.setVisibility(View.GONE); if (stepExams != null && stepExams.size() > 0) { String first_step_id = stepExams.get(0).getId(); RealmResults questions = mRealm.where(RealmExamQuestion.class).equalTo("examId", first_step_id).findAll(); diff --git a/app/src/main/res/layout/fragment_course_step.xml b/app/src/main/res/layout/fragment_course_step.xml index aa52cb3ee9..d93988ee11 100644 --- a/app/src/main/res/layout/fragment_course_step.xml +++ b/app/src/main/res/layout/fragment_course_step.xml @@ -13,6 +13,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="right" + android:layout_marginEnd="@dimen/_10dp" android:gravity="right">