Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

courses: better course step display (fixes #2771) #2782

Merged
merged 3 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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<RealmExamQuestion> questions = mRealm.where(RealmExamQuestion.class).equalTo("examId", first_step_id).findAll();
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/res/layout/fragment_course_step.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">

<Button
Expand Down Expand Up @@ -58,7 +59,9 @@
<TextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_10dp"
android:layout_marginEnd="@dimen/_10dp" />
</LinearLayout>
</LinearLayout>

Expand Down