From 51ff8dbb94ea863f92cec9ba5a1e41bb43c309cd Mon Sep 17 00:00:00 2001 From: Tamas Kozmer Date: Thu, 7 Apr 2022 15:24:06 +0200 Subject: [PATCH 01/48] Updated version number. --- apps/student/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/student/build.gradle b/apps/student/build.gradle index bffe3ae6df..72073199a4 100644 --- a/apps/student/build.gradle +++ b/apps/student/build.gradle @@ -54,8 +54,8 @@ android { applicationId "com.instructure.candroid" minSdkVersion Versions.MIN_SDK targetSdkVersion Versions.TARGET_SDK - versionCode = 236 - versionName = '6.16.2' + versionCode = 237 + versionName = '6.17.0' vectorDrawables.useSupportLibrary = true multiDexEnabled = true From f06ace179ddd9ca8897a7a4582790eee76552e50 Mon Sep 17 00:00:00 2001 From: Kristof Deak <92309696+kdeakinstructure@users.noreply.github.com> Date: Mon, 11 Apr 2022 11:33:27 +0200 Subject: [PATCH 02/48] Remove unnecessary class. (#1551) refs: MBL-15879 affects: Student, Teacher release note: none --- .../ui/interaction/CommentsInteractionTest.kt | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 apps/student/src/androidTest/java/com/instructure/student/ui/interaction/CommentsInteractionTest.kt diff --git a/apps/student/src/androidTest/java/com/instructure/student/ui/interaction/CommentsInteractionTest.kt b/apps/student/src/androidTest/java/com/instructure/student/ui/interaction/CommentsInteractionTest.kt deleted file mode 100644 index 65fd96f8db..0000000000 --- a/apps/student/src/androidTest/java/com/instructure/student/ui/interaction/CommentsInteractionTest.kt +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2019 - present Instructure, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.instructure.student.ui.interaction - -import com.instructure.canvas.espresso.Stub -import com.instructure.panda_annotations.FeatureCategory -import com.instructure.panda_annotations.Priority -import com.instructure.panda_annotations.TestCategory -import com.instructure.panda_annotations.TestMetaData -import com.instructure.student.ui.utils.StudentTest -import dagger.hilt.android.testing.HiltAndroidTest -import org.junit.Test - -@HiltAndroidTest -class CommentsInteractionTest: StudentTest() { - override fun displaysPageObjects() = Unit // Not used for interaction tests - - @Stub - @Test - @TestMetaData(Priority.P0, FeatureCategory.ASSIGNMENTS, TestCategory.INTERACTION, true, FeatureCategory.COMMENTS) - fun testComments_addComment() { - // Test adding a comment to an assignment comment stream - } - -} \ No newline at end of file From a126e867bdee3cfdee89bfcf86ba8b491fff5042 Mon Sep 17 00:00:00 2001 From: Tamas Kozmer Date: Mon, 11 Apr 2022 12:53:53 +0200 Subject: [PATCH 03/48] Updated version number. --- apps/student/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/student/build.gradle b/apps/student/build.gradle index 72073199a4..bf0f74afac 100644 --- a/apps/student/build.gradle +++ b/apps/student/build.gradle @@ -54,8 +54,8 @@ android { applicationId "com.instructure.candroid" minSdkVersion Versions.MIN_SDK targetSdkVersion Versions.TARGET_SDK - versionCode = 237 - versionName = '6.17.0' + versionCode = 238 + versionName = '6.17.1' vectorDrawables.useSupportLibrary = true multiDexEnabled = true From 483b24a02f3bf0797272c606f94c06f2a989acad Mon Sep 17 00:00:00 2001 From: Tamas Kozmer Date: Mon, 11 Apr 2022 12:54:41 +0200 Subject: [PATCH 04/48] Changed manifests to remove not required features. --- apps/student/src/main/AndroidManifest.xml | 2 ++ libs/DocumentScanner/src/main/AndroidManifest.xml | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/student/src/main/AndroidManifest.xml b/apps/student/src/main/AndroidManifest.xml index 87783ec4cf..6ff1e69930 100644 --- a/apps/student/src/main/AndroidManifest.xml +++ b/apps/student/src/main/AndroidManifest.xml @@ -47,6 +47,8 @@ + + - From 53f9376a7847ffb20e83a73dc6809daf8889c4b0 Mon Sep 17 00:00:00 2001 From: Tamas Kozmer <72397075+tamaskozmer@users.noreply.github.com> Date: Tue, 12 Apr 2022 13:52:54 +0200 Subject: [PATCH 05/48] [MBL-15960][Student] Direct links to modules navigate to the top of modules page refs: MBL-15960 affects: Student release note: Fixed a bug where modules links would always navigate to the first module. --- .../layout/panda_recycler_refresh_layout.xml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/apps/student/src/main/res/layout/panda_recycler_refresh_layout.xml b/apps/student/src/main/res/layout/panda_recycler_refresh_layout.xml index 2dd3bc5f45..2906b59734 100644 --- a/apps/student/src/main/res/layout/panda_recycler_refresh_layout.xml +++ b/apps/student/src/main/res/layout/panda_recycler_refresh_layout.xml @@ -20,21 +20,13 @@ + android:layout_height="wrap_content"> - - - - - + android:layout_height="wrap_content" + android:cacheColorHint="@android:color/transparent" /> From ed43a03328b06fec872978c3e7bb2b10730a4a5d Mon Sep 17 00:00:00 2001 From: Kristof Deak <92309696+kdeakinstructure@users.noreply.github.com> Date: Wed, 13 Apr 2022 11:12:14 +0200 Subject: [PATCH 06/48] Implement Bookmarks E2E test + some refactor. (#1555) refs: MBL-15987 affects: Student release note: none --- .../student/ui/e2e/BookmarksE2ETest.kt | 122 ++++++++++++++++++ .../AssignmentDetailsInteractionTest.kt | 7 - .../ui/interaction/BookmarkInteractionTest.kt | 2 +- .../student/ui/pages/AssignmentDetailsPage.kt | 2 +- .../student/ui/pages/BookmarkPage.kt | 29 ++++- 5 files changed, 146 insertions(+), 16 deletions(-) create mode 100644 apps/student/src/androidTest/java/com/instructure/student/ui/e2e/BookmarksE2ETest.kt diff --git a/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/BookmarksE2ETest.kt b/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/BookmarksE2ETest.kt new file mode 100644 index 0000000000..cf67bd8d06 --- /dev/null +++ b/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/BookmarksE2ETest.kt @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2019 - present Instructure, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package com.instructure.student.ui.e2e + +import android.util.Log +import androidx.test.espresso.Espresso +import com.instructure.canvas.espresso.E2E +import com.instructure.canvas.espresso.refresh +import com.instructure.dataseeding.api.AssignmentsApi +import com.instructure.dataseeding.model.GradingType +import com.instructure.dataseeding.model.SubmissionType +import com.instructure.dataseeding.util.days +import com.instructure.dataseeding.util.fromNow +import com.instructure.dataseeding.util.iso8601 +import com.instructure.panda_annotations.FeatureCategory +import com.instructure.panda_annotations.Priority +import com.instructure.panda_annotations.TestCategory +import com.instructure.panda_annotations.TestMetaData +import com.instructure.student.ui.utils.StudentTest +import com.instructure.student.ui.utils.seedData +import com.instructure.student.ui.utils.tokenLogin +import dagger.hilt.android.testing.HiltAndroidTest +import org.junit.Test + +private const val STEP_TAG = "BookmarksE2ETest #STEP# " +private const val PREPARATION_TAG = "BookmarksE2ETest #PREPARATION# " + +@HiltAndroidTest +class BookmarksE2ETest : StudentTest() { + override fun displaysPageObjects() { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + + @E2E + @Test + @TestMetaData(Priority.P0, FeatureCategory.BOOKMARKS, TestCategory.E2E) + fun testBookmarksE2E() { + + Log.d(PREPARATION_TAG,"Seeding data.") + val data = seedData(students = 1, teachers = 1, courses = 2) + val student = data.studentsList[0] + val teacher = data.teachersList[0] + val course = data.coursesList[0] + + Log.d(PREPARATION_TAG,"Preparing an assignment which will be saved as a bookmark.") + val assignment = AssignmentsApi.createAssignment( + AssignmentsApi.CreateAssignmentRequest( + courseId = course.id, + submissionTypes = listOf(SubmissionType.ONLINE_TEXT_ENTRY), + gradingType = GradingType.POINTS, + teacherToken = teacher.token, + pointsPossible = 15.0, + dueAt = 1.days.fromNow.iso8601 + )) + + Log.d(STEP_TAG,"Login with user: ${student.name}, login id: ${student.loginId} , password: ${student.password}") + tokenLogin(student) + dashboardPage.waitForRender() + + Log.d(STEP_TAG, "Navigate to assignments page and click on the prepared assignment.") + dashboardPage.selectCourse(course) + courseBrowserPage.selectAssignments() + assignmentListPage.clickAssignment(assignment) + + val bookmarkName = "Assignment Details BM" + Log.d(STEP_TAG,"Add a new bookmark with name: $bookmarkName") + assignmentDetailsPage.addBookmark(bookmarkName) + + Log.d(STEP_TAG,"Navigate back to Bookmarks page and assert if the newly created bookmark has displayed.") + Espresso.pressBack() + Espresso.pressBack() + Espresso.pressBack() + dashboardPage.gotoBookmarks() + bookmarkPage.assertBookmarkDisplayed(bookmarkName) + + Log.d(STEP_TAG,"Click on $bookmarkName bookmark and assert if it's navigating to the assignment details page.") + bookmarkPage.clickBookmark(bookmarkName) + assignmentDetailsPage.verifyAssignmentTitle(assignment.name) + + Log.d(STEP_TAG,"Navigate back to bookmark page.") + Espresso.pressBack() + dashboardPage.gotoBookmarks() + bookmarkPage.assertBookmarkDisplayed(bookmarkName) + + val newName = "Assignment Details BM Modified" + Log.d(STEP_TAG,"Change bookmark's name from $bookmarkName to $newName.") + bookmarkPage.changeBookmarkName(bookmarkName, newName) + + Log.d(STEP_TAG,"Refresh bookmark page and assert if the bookmark's name has been changed.") + refresh() + bookmarkPage.assertBookmarkDisplayed(newName) + + Log.d(STEP_TAG,"Click on the previously renamed bookmark and assert if it's still navigating to the corresponding assignment's details page.") + bookmarkPage.clickBookmark(newName) + assignmentDetailsPage.verifyAssignmentTitle(assignment.name) + + Log.d(STEP_TAG,"Navigate back to the bookmark page.") + Espresso.pressBack() + dashboardPage.gotoBookmarks() + + Log.d(STEP_TAG, "Delete bookmark: $newName.") + bookmarkPage.deleteBookmark(newName) + + Log.d(STEP_TAG,"Assert that empty view is displayed, so the bookmark has been deleted.") + bookmarkPage.assertEmptyView() + } + +} \ No newline at end of file diff --git a/apps/student/src/androidTest/java/com/instructure/student/ui/interaction/AssignmentDetailsInteractionTest.kt b/apps/student/src/androidTest/java/com/instructure/student/ui/interaction/AssignmentDetailsInteractionTest.kt index 3ee24c2e4a..47f63e80b5 100644 --- a/apps/student/src/androidTest/java/com/instructure/student/ui/interaction/AssignmentDetailsInteractionTest.kt +++ b/apps/student/src/androidTest/java/com/instructure/student/ui/interaction/AssignmentDetailsInteractionTest.kt @@ -111,13 +111,6 @@ class AssignmentDetailsInteractionTest : StudentTest() { */ } - @Stub - @Test - @TestMetaData(Priority.P2, FeatureCategory.ASSIGNMENTS, TestCategory.INTERACTION, true, FeatureCategory.BOOKMARKS) - fun testAssignments_createBookmark() { - // Student can bookmark the assignment - } - private fun goToAssignmentFromList() { // Test clicking on the Submission and Rubric button to load the Submission Details Page val data = MockCanvas.init( diff --git a/apps/student/src/androidTest/java/com/instructure/student/ui/interaction/BookmarkInteractionTest.kt b/apps/student/src/androidTest/java/com/instructure/student/ui/interaction/BookmarkInteractionTest.kt index 5ac9d0a61e..31ae0ac1fa 100644 --- a/apps/student/src/androidTest/java/com/instructure/student/ui/interaction/BookmarkInteractionTest.kt +++ b/apps/student/src/androidTest/java/com/instructure/student/ui/interaction/BookmarkInteractionTest.kt @@ -49,7 +49,7 @@ class BookmarkInteractionTest : StudentTest() { courseBrowserPage.selectAssignments() assignmentListPage.clickAssignment(assignment) val bookmarkName = "Bookmark name 1" - assignmentDetailsPage.bookmark(bookmarkName) + assignmentDetailsPage.addBookmark(bookmarkName) Espresso.pressBack() // to assignment list Espresso.pressBack() // to course Espresso.pressBack() // to main dashboard diff --git a/apps/student/src/androidTest/java/com/instructure/student/ui/pages/AssignmentDetailsPage.kt b/apps/student/src/androidTest/java/com/instructure/student/ui/pages/AssignmentDetailsPage.kt index 7db66aa049..697651736d 100644 --- a/apps/student/src/androidTest/java/com/instructure/student/ui/pages/AssignmentDetailsPage.kt +++ b/apps/student/src/androidTest/java/com/instructure/student/ui/pages/AssignmentDetailsPage.kt @@ -109,7 +109,7 @@ open class AssignmentDetailsPage : BasePage(R.id.assignmentDetailsPage) { waitForMatcherWithSleeps(withId(R.id.descriptionWebView), waitMs = 30000, sleepMs = 1000).scrollTo() } - fun bookmark(bookmarkName: String) { + fun addBookmark(bookmarkName: String) { Espresso.onView( allOf( ViewMatchers.withContentDescription(stringContainsTextCaseInsensitive("More options")), diff --git a/apps/student/src/androidTest/java/com/instructure/student/ui/pages/BookmarkPage.kt b/apps/student/src/androidTest/java/com/instructure/student/ui/pages/BookmarkPage.kt index d8fd12ecd8..54c6b73b47 100644 --- a/apps/student/src/androidTest/java/com/instructure/student/ui/pages/BookmarkPage.kt +++ b/apps/student/src/androidTest/java/com/instructure/student/ui/pages/BookmarkPage.kt @@ -29,6 +29,8 @@ import com.instructure.espresso.assertDisplayed import com.instructure.espresso.clearText import com.instructure.espresso.click import com.instructure.espresso.page.BasePage +import com.instructure.espresso.page.plus +import com.instructure.espresso.page.withAncestor import com.instructure.espresso.typeText import com.instructure.student.R import org.hamcrest.Matchers.allOf @@ -41,6 +43,10 @@ class BookmarkPage : BasePage() { onView(matcher).assertDisplayed() } + fun assertEmptyView() { + onView(withText(R.string.no_bookmarks)).assertDisplayed() + } + fun clickBookmark(bookmarkName: String) { val matcher = allOf(withId(R.id.title), withText(bookmarkName)) scrollRecyclerView(R.id.listView, matcher) @@ -50,13 +56,7 @@ class BookmarkPage : BasePage() { fun changeBookmarkName(originalName: String, newName: String) { // Open the overflow menu for the bookmark - val matcher = allOf( - withId(R.id.overflow), - hasSibling(withText(originalName)) - ) - scrollRecyclerView(R.id.listView, matcher) - onView(matcher).click() - + clickOnMoreMenu(originalName) // Click on "Edit" onView(allOf(withId(R.id.title), withText("Edit"), isDisplayed())).click() @@ -67,4 +67,19 @@ class BookmarkPage : BasePage() { // Save onView(allOf(isAssignableFrom(AppCompatButton::class.java), containsTextCaseInsensitive("DONE"))).click() } + + fun clickOnMoreMenu(bookmarkName: String) { + val matcher = allOf( + withId(R.id.overflow), + hasSibling(withText(bookmarkName)) + ) + scrollRecyclerView(R.id.listView, matcher) + onView(matcher).click() + } + + fun deleteBookmark(bookmarkName: String) { + clickOnMoreMenu(bookmarkName) + onView(allOf(withId(R.id.title), withText("Delete"), isDisplayed())).click() + onView(withText(R.string.ok) + withAncestor(R.id.buttonPanel)).click() + } } \ No newline at end of file From 2b50405f0bdd326e4ca91426ed85ced31efdc5d7 Mon Sep 17 00:00:00 2001 From: Kristof Deak <92309696+kdeakinstructure@users.noreply.github.com> Date: Thu, 14 Apr 2022 11:17:45 +0200 Subject: [PATCH 07/48] Fix assertion for seeding user with e-mail. (#1556) refs: MBL-15466 affects: Teacher release note: none --- .../com/instructure/teacher/ui/pages/StudentContextPage.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/pages/StudentContextPage.kt b/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/pages/StudentContextPage.kt index 4a1ee7c639..37fca73c90 100644 --- a/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/pages/StudentContextPage.kt +++ b/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/pages/StudentContextPage.kt @@ -17,13 +17,11 @@ package com.instructure.teacher.ui.pages -import androidx.test.espresso.matcher.ViewMatchers.withContentDescription import com.instructure.dataseeding.model.CanvasUserApiModel import com.instructure.dataseeding.model.CourseApiModel import com.instructure.espresso.WaitForViewWithId import com.instructure.espresso.assertDisplayed import com.instructure.espresso.assertHasText -import com.instructure.espresso.click import com.instructure.espresso.page.* import com.instructure.teacher.R @@ -40,9 +38,8 @@ class StudentContextPage : BasePage(R.id.studentContextPage) { fun assertDisplaysStudentInfo(student: CanvasUserApiModel) { waitForView(withParent(R.id.toolbar) + withText(student.shortName)).assertDisplayed() studentName.assertHasText(student.shortName) - // MBL-14665: Seeding an email address for a user apparently no longer works. - // We'll need to fix that before we can un-comment this code. - //studentEmail.assertHasText(student.loginId) + studentEmail.assertHasText(student.loginId) + onView(withId(R.id.gradeItems)).assertDisplayed() } fun assertDisplaysCourseInfo(course: CourseApiModel) { From ee27bb79afb1ae70e6221cd59882f6165f64cf55 Mon Sep 17 00:00:00 2001 From: Akos Hermann <72087159+hermannakos@users.noreply.github.com> Date: Thu, 14 Apr 2022 15:37:29 +0200 Subject: [PATCH 08/48] [MBL-15975][All] LaTex equations rendering (#1554) refs: MBL-15964 affects: All release note: Rendering LaTex equations. test plan: See ticket. --- .../lib/utils/web_view_utils.dart | 11 +++++++++++ .../pandautils/views/CanvasWebView.kt | 2 +- .../java/instructure/rceditor/RCETextEditor.kt | 17 ----------------- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/apps/flutter_parent/lib/utils/web_view_utils.dart b/apps/flutter_parent/lib/utils/web_view_utils.dart index fca6ab5e22..1a8bfe49a6 100644 --- a/apps/flutter_parent/lib/utils/web_view_utils.dart +++ b/apps/flutter_parent/lib/utils/web_view_utils.dart @@ -33,6 +33,7 @@ extension WebViewUtils on WebViewController { String fileText = await rootBundle.loadString('assets/html/html_wrapper.html'); html = _applyWorkAroundForDoubleSlashesAsUrlSource(html); html = _addProtocolToLinks(html); + html = _checkForMathTags(html); html = fileText.replaceAll('{CANVAS_CONTENT}', html); html = html.replaceAll('{PADDING}', horizontalPadding.toString()); this.loadData(baseUrl, html, 'text/html', 'utf-8'); @@ -47,6 +48,16 @@ extension WebViewUtils on WebViewController { } } +String _checkForMathTags(String html) { + if ((RegExp('\$\$.+\$\$|\\\(.+\\\)').hasMatch(html) || html.contains(' + $html"""; + } else { + return html; + } +} + String _applyWorkAroundForDoubleSlashesAsUrlSource(String html) { if (html.isEmpty) return ''; // Fix for embedded videos that have // instead of http:// diff --git a/libs/pandautils/src/main/java/com/instructure/pandautils/views/CanvasWebView.kt b/libs/pandautils/src/main/java/com/instructure/pandautils/views/CanvasWebView.kt index 3a94ceb843..cfbac99646 100644 --- a/libs/pandautils/src/main/java/com/instructure/pandautils/views/CanvasWebView.kt +++ b/libs/pandautils/src/main/java/com/instructure/pandautils/views/CanvasWebView.kt @@ -520,7 +520,7 @@ class CanvasWebView @JvmOverloads constructor( // If this html that we're about to load has a math tag and isn't just an image we want to parse it with MathJax. // This is the version that web currently uses (the 2.7.1 is the version number) and this is the check that they do to // decide if they'll run the MathJax script on the webview - if (content.contains(" $content""" diff --git a/libs/rceditor/src/main/java/instructure/rceditor/RCETextEditor.kt b/libs/rceditor/src/main/java/instructure/rceditor/RCETextEditor.kt index 5885fdfb1c..6fdcd05e5d 100644 --- a/libs/rceditor/src/main/java/instructure/rceditor/RCETextEditor.kt +++ b/libs/rceditor/src/main/java/instructure/rceditor/RCETextEditor.kt @@ -38,29 +38,12 @@ class RCETextEditor @JvmOverloads constructor( loadCSS("rce_style.css") } - private fun checkForMathTags(content: String) { - // If this html that we're about to load has a math tag and isn't just an image we want to parse it with MathJax. - // This is the version that web currently uses (the 2.7.1 is the version number) and this is the check that they do to - // decide if they'll run the MathJax script on the webview - if (content.contains(" Date: Wed, 20 Apr 2022 13:55:55 +0200 Subject: [PATCH 09/48] Fix breaking landscape and tablet nightly tests. (#1560) refs: MBL-16025 affects: Student, Teacher release note: none --- .../java/com/instructure/student/ui/pages/ModulesPage.kt | 2 +- .../com/instructure/teacher/ui/pages/StudentContextPage.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/student/src/androidTest/java/com/instructure/student/ui/pages/ModulesPage.kt b/apps/student/src/androidTest/java/com/instructure/student/ui/pages/ModulesPage.kt index 9037179366..ec7b425f03 100644 --- a/apps/student/src/androidTest/java/com/instructure/student/ui/pages/ModulesPage.kt +++ b/apps/student/src/androidTest/java/com/instructure/student/ui/pages/ModulesPage.kt @@ -109,7 +109,7 @@ class ModulesPage : BasePage(R.id.modulesPage) { // Assert that a module item is displayed and, optionally, click it private fun assertAndClickModuleItem(moduleName: String, itemTitle: String, clickItem: Boolean = false) { try { - onView(withText(itemTitle)).scrollTo() + scrollRecyclerView(R.id.listView, withText(itemTitle)) if(clickItem) { onView(withText(itemTitle)).click() } diff --git a/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/pages/StudentContextPage.kt b/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/pages/StudentContextPage.kt index 37fca73c90..9c1669166b 100644 --- a/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/pages/StudentContextPage.kt +++ b/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/pages/StudentContextPage.kt @@ -23,6 +23,7 @@ import com.instructure.espresso.WaitForViewWithId import com.instructure.espresso.assertDisplayed import com.instructure.espresso.assertHasText import com.instructure.espresso.page.* +import com.instructure.espresso.scrollTo import com.instructure.teacher.R class StudentContextPage : BasePage(R.id.studentContextPage) { @@ -39,7 +40,7 @@ class StudentContextPage : BasePage(R.id.studentContextPage) { waitForView(withParent(R.id.toolbar) + withText(student.shortName)).assertDisplayed() studentName.assertHasText(student.shortName) studentEmail.assertHasText(student.loginId) - onView(withId(R.id.gradeItems)).assertDisplayed() + onView(withId(R.id.gradeItems)).scrollTo().assertDisplayed() } fun assertDisplaysCourseInfo(course: CourseApiModel) { From f69a626b98a6f7d85e0594cfa59d5496c5aec39b Mon Sep 17 00:00:00 2001 From: Kristof Deak <92309696+kdeakinstructure@users.noreply.github.com> Date: Wed, 20 Apr 2022 14:57:33 +0200 Subject: [PATCH 10/48] Course Settings E2E test implementation. (#1558) refs: MBL-15988 affects: Teacher release note: none --- .../student/ui/e2e/BookmarksE2ETest.kt | 4 + .../teacher/ui/e2e/CourseSettingsE2ETest.kt | 142 ++++++++++++++++++ .../teacher/ui/pages/CourseBrowserPage.kt | 22 +-- .../teacher/ui/pages/CoursesListPage.kt | 20 +++ 4 files changed, 170 insertions(+), 18 deletions(-) create mode 100644 apps/teacher/src/androidTest/java/com/instructure/teacher/ui/e2e/CourseSettingsE2ETest.kt diff --git a/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/BookmarksE2ETest.kt b/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/BookmarksE2ETest.kt index cf67bd8d06..ada2a9d8a3 100644 --- a/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/BookmarksE2ETest.kt +++ b/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/BookmarksE2ETest.kt @@ -45,6 +45,10 @@ class BookmarksE2ETest : StudentTest() { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } + override fun enableAndConfigureAccessibilityChecks() { + //Intentionally empty, because we don't check accessibility in E2E tests. + } + @E2E @Test @TestMetaData(Priority.P0, FeatureCategory.BOOKMARKS, TestCategory.E2E) diff --git a/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/e2e/CourseSettingsE2ETest.kt b/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/e2e/CourseSettingsE2ETest.kt new file mode 100644 index 0000000000..55526e7e03 --- /dev/null +++ b/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/e2e/CourseSettingsE2ETest.kt @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2020 - present Instructure, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package com.instructure.teacher.ui.e2e + +import android.util.Log +import androidx.test.espresso.Espresso +import com.instructure.canvas.espresso.E2E +import com.instructure.canvas.espresso.refresh +import com.instructure.panda_annotations.FeatureCategory +import com.instructure.panda_annotations.Priority +import com.instructure.panda_annotations.TestCategory +import com.instructure.panda_annotations.TestMetaData +import com.instructure.teacher.ui.utils.TeacherTest +import com.instructure.teacher.ui.utils.seedData +import com.instructure.teacher.ui.utils.tokenLogin +import dagger.hilt.android.testing.HiltAndroidTest +import org.junit.Test + +private const val STEP_TAG = "CourseSettingsE2ETest #STEP# " +private const val PREPARATION_TAG = "CourseSettingsE2ETest #PREPARATION# " + +@HiltAndroidTest +class CourseSettingsE2ETest : TeacherTest() { + + override fun displaysPageObjects() { + TODO("not implemented") + } + + override fun enableAndConfigureAccessibilityChecks() { + //Intentionally empty, because we don't check accessibility in E2E tests. + } + + @E2E + @Test + @TestMetaData(Priority.P0, FeatureCategory.COURSE, TestCategory.E2E) + fun testCourseSettingsE2E() { + + Log.d(PREPARATION_TAG, "Seeding data.") + val data = seedData(teachers = 1, courses = 2) + val teacher = data.teachersList[0] + val firstCourse = data.coursesList[0] + val secondCourse = data.coursesList[1] + + Log.d( + STEP_TAG, + "Login with user: ${teacher.name}, login id: ${teacher.loginId} , password: ${teacher.password}" + ) + tokenLogin(teacher) + + Log.d(STEP_TAG, "Open ${firstCourse.name} course and click on Course Settings button.") + dashboardPage.waitForRender() + coursesListPage.openCourse(firstCourse) + courseBrowserPage.clickSettingsButton() + + Log.d( + STEP_TAG, + "Click on 'Set Home Page' menu and select another page as home page. Assert if home page has been changed." + ) + courseSettingsPage.assertPageObjects() + courseSettingsPage.clickSetHomePage() + val newCourseHomePage: String = courseSettingsPage.selectNewHomePage() + courseSettingsPage.assertHomePageChanged(newCourseHomePage) + + val newCourseName = "New Course Name" + Log.d( + STEP_TAG, + "Click on 'Course Name' menu and edit course's name to be $newCourseName. Assert that the course's name has been changed." + ) + courseSettingsPage.clickCourseName() + courseSettingsPage.editCourseName(newCourseName) + courseSettingsPage.assertCourseNameChanged(newCourseName) + + Log.d( + STEP_TAG, + "Go back to course browser page and assert that the course's name has been changed there as well." + ) + Espresso.pressBack() + courseBrowserPage.assertCourseBrowserPageDisplayed() + courseBrowserPage.assertCourseTitle(newCourseName) + + Log.d( + STEP_TAG, + "Navigate back to the courses list page and assert if the name of the first course's name has been changed there as well." + ) + Espresso.pressBack() + dashboardPage.waitForRender() + coursesListPage.assertDisplaysCourse(newCourseName) + + Log.d(STEP_TAG, "Open ${secondCourse.name} course and click on Course Settings button.") + dashboardPage.waitForRender() + coursesListPage.openCourse(secondCourse) + courseBrowserPage.clickSettingsButton() + + Log.d( + STEP_TAG, + "Click on 'Set Home Page' menu and select another page as home page. Assert if home page has been changed." + ) + courseSettingsPage.assertPageObjects() + courseSettingsPage.clickSetHomePage() + val secondCourseNewHomePage: String = courseSettingsPage.selectNewHomePage() + courseSettingsPage.assertHomePageChanged(secondCourseNewHomePage) + + Log.d( + STEP_TAG, + "Go back to course browser page and assert that the course's name has NOT been changed there." + ) + Espresso.pressBack() + courseBrowserPage.assertCourseBrowserPageDisplayed() + courseBrowserPage.assertCourseTitle(secondCourse.name) + + Log.d( + STEP_TAG, + "Navigate back to the courses list page and assert if the name of the second course's name has NOT been changed there as well." + ) + Espresso.pressBack() + dashboardPage.waitForRender() + coursesListPage.assertDisplaysCourse(secondCourse.name) + + Log.d( + STEP_TAG, + "Refresh the courses list page and assert if the corresponding course names are displayed (new course name for first course and the original course name of the second course)." + ) + refresh() + dashboardPage.waitForRender() + coursesListPage.assertDisplaysCourse(newCourseName) + coursesListPage.assertDisplaysCourse(secondCourse.name) + } +} \ No newline at end of file diff --git a/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/pages/CourseBrowserPage.kt b/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/pages/CourseBrowserPage.kt index 6a527df2b4..5e98c063fa 100644 --- a/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/pages/CourseBrowserPage.kt +++ b/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/pages/CourseBrowserPage.kt @@ -80,24 +80,6 @@ class CourseBrowserPage : BasePage() { courseSettingsMenuButton.click() } - /** - * Taken from https://stackoverflow.com/questions/37736616/espresso-how-to-find-a-specific-item-in-a-recycler-view-order-is-random - * - * This allows us to match a specific view with specific text in a specific RecyclerView.Holder - */ - fun withTitle(title: String): Matcher = - object: BoundedMatcher(CourseBrowserViewHolder::class.java) { - override fun matchesSafely(item: CourseBrowserViewHolder?): Boolean { - return item?.let { - it.labelText.text.toString().equals(title, true) - } ?: false - } - - override fun describeTo(description: Description?) { - description?.appendText("view holder with title: " + title) - } - } - fun openPagesTab() { scrollDownToCourseBrowser(scrollPosition = magicNumberForScroll) waitForViewWithText(R.string.tab_pages).click() @@ -141,4 +123,8 @@ class CourseBrowserPage : BasePage() { fun waitForRender() { onView(withId(R.id.menu_course_browser_settings)).waitForCheck(ViewAssertions.matches(ViewMatchers.isDisplayed())) } + + fun assertCourseTitle(courseTitle: String) { + onView(withId(R.id.courseBrowserTitle) + withText(courseTitle)).assertDisplayed() + } } diff --git a/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/pages/CoursesListPage.kt b/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/pages/CoursesListPage.kt index 71cbeeff26..0c49b12029 100644 --- a/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/pages/CoursesListPage.kt +++ b/apps/teacher/src/androidTest/java/com/instructure/teacher/ui/pages/CoursesListPage.kt @@ -17,6 +17,7 @@ package com.instructure.teacher.ui.pages +import android.view.View import androidx.recyclerview.widget.RecyclerView import androidx.test.espresso.Espresso.onView import androidx.test.espresso.action.ViewActions.click @@ -28,8 +29,14 @@ import com.instructure.dataseeding.model.FavoriteApiModel import com.instructure.espresso.* import com.instructure.espresso.page.BasePage import com.instructure.espresso.page.callOnClick +import com.instructure.espresso.page.onView +import com.instructure.espresso.page.withAncestor +import com.instructure.espresso.page.withId +import com.instructure.espresso.page.withText import com.instructure.teacher.R import com.instructure.teacher.ui.utils.WaitForToolbarTitle +import org.hamcrest.CoreMatchers +import org.hamcrest.Matcher @Suppress("unused") class CoursesListPage : BasePage() { @@ -67,6 +74,19 @@ class CoursesListPage : BasePage() { for (course in mCourses) onView(withText(course.name)).assertDisplayed() } + fun assertDisplaysCourse(courseName: String) { + val matcher = CoreMatchers.allOf( + withText(courseName), + withId(R.id.titleTextView), + withAncestor(R.id.swipeRefreshLayout) + ) + scrollAndAssertDisplayed(matcher) + } + + private fun scrollAndAssertDisplayed(matcher: Matcher) { + onView(matcher).assertDisplayed() + } + fun openAllCoursesList() { seeAllCoursesLabel.click() } From 41b27a352caf672a74fbc52aacd2014d587c90a8 Mon Sep 17 00:00:00 2001 From: Akos Hermann <72087159+hermannakos@users.noreply.github.com> Date: Fri, 22 Apr 2022 12:13:14 +0200 Subject: [PATCH 11/48] [MBL-16006][Teacher] Crash fix when editing media files (#1564) refs: MBL-16006 affects: Teacher release note: Fixed a crash when trying to edit media files. test plan: See ticket. --- .../com/instructure/teacher/activities/ViewMediaActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/teacher/src/main/java/com/instructure/teacher/activities/ViewMediaActivity.kt b/apps/teacher/src/main/java/com/instructure/teacher/activities/ViewMediaActivity.kt index b5db81a008..e804d54b5f 100644 --- a/apps/teacher/src/main/java/com/instructure/teacher/activities/ViewMediaActivity.kt +++ b/apps/teacher/src/main/java/com/instructure/teacher/activities/ViewMediaActivity.kt @@ -33,7 +33,7 @@ class ViewMediaActivity : BaseViewMediaActivity() { override fun allowCopyingUrl() = true override fun handleEditing(editableFile: EditableFile) { val args = EditFileFolderFragment.makeBundle(editableFile.file, editableFile.usageRights, editableFile.licenses, editableFile.canvasContext!!.id) - RouteMatcher.route(applicationContext, Route(EditFileFolderFragment::class.java, editableFile.canvasContext, args)) + RouteMatcher.route(this, Route(EditFileFolderFragment::class.java, editableFile.canvasContext, args)) } companion object { From ce2e820b0f94ac5174ae7baf14c54e4fa45dc7a3 Mon Sep 17 00:00:00 2001 From: Akos Hermann <72087159+hermannakos@users.noreply.github.com> Date: Fri, 22 Apr 2022 12:13:28 +0200 Subject: [PATCH 12/48] [MBL-16003][Student] Fixed infinite loading on Notifications (#1563) refs: MBL-16003 affects: Student release note: Fixed a bug where the loading would not finish on the Notifications screen. test plan: See ticket. --- .../student/adapter/NotificationListRecyclerAdapter.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/student/src/main/java/com/instructure/student/adapter/NotificationListRecyclerAdapter.kt b/apps/student/src/main/java/com/instructure/student/adapter/NotificationListRecyclerAdapter.kt index a57e35d8c8..b6d5845683 100644 --- a/apps/student/src/main/java/com/instructure/student/adapter/NotificationListRecyclerAdapter.kt +++ b/apps/student/src/main/java/com/instructure/student/adapter/NotificationListRecyclerAdapter.kt @@ -245,9 +245,7 @@ class NotificationListRecyclerAdapter( if (!isNoNetwork) { // Double negative, only happens when there is network adapterToRecyclerViewCallback.setDisplayNoConnection(false) // We check mStreamItems here as onCallbackFinished is called prior to populating the adapter - if (streamItems != null) { - adapterToRecyclerViewCallback.setIsEmpty(isAllPagesLoaded && streamItems!!.isEmpty()) - } + adapterToRecyclerViewCallback.setIsEmpty(isAllPagesLoaded && (streamItems?.isEmpty() ?: true)) } } } From 95382574c19c373d3a1e132ba9d1626ab7cf819d Mon Sep 17 00:00:00 2001 From: Akos Hermann <72087159+hermannakos@users.noreply.github.com> Date: Fri, 22 Apr 2022 14:01:42 +0200 Subject: [PATCH 13/48] [MBL-16002][Student] Fixed section filtering on Edit Dashboard (#1561) refs: MBL-16002 affects: Student release note: Fixed a bug where course on the edit dashboard screen would show up multiple times. test plan: See ticket. --- .../dashboard/edit/EditDashboardViewModel.kt | 4 +- .../edit/EditDashboardViewModelTest.kt | 131 ++++++++++++++++++ 2 files changed, 133 insertions(+), 2 deletions(-) diff --git a/apps/student/src/main/java/com/instructure/student/features/dashboard/edit/EditDashboardViewModel.kt b/apps/student/src/main/java/com/instructure/student/features/dashboard/edit/EditDashboardViewModel.kt index ea82d04825..c80a370ddc 100644 --- a/apps/student/src/main/java/com/instructure/student/features/dashboard/edit/EditDashboardViewModel.kt +++ b/apps/student/src/main/java/com/instructure/student/features/dashboard/edit/EditDashboardViewModel.kt @@ -336,7 +336,7 @@ class EditDashboardViewModel @Inject constructor(private val courseManager: Cour } private fun getPastCourses(courses: List): List { - val pastCourses = courses.filter { it.isPastEnrolment() } + val pastCourses = courses.filter { it.isPastEnrolment() && !it.isCurrentEnrolment() && !it.isFutureEnrolment() } return pastCourses.map { EditDashboardCourseItemViewModel( id = it.id, @@ -351,7 +351,7 @@ class EditDashboardViewModel @Inject constructor(private val courseManager: Cour } private fun getFutureCourses(courses: List): List { - val futureCourses = courses.filter { it.isFutureEnrolment() } + val futureCourses = courses.filter { it.isFutureEnrolment() && !it.isCurrentEnrolment() } favoriteCourseMap.putAll(futureCourses.filter { it.isFavorite }.associateBy { it.id }) return futureCourses.map { EditDashboardCourseItemViewModel( diff --git a/apps/student/src/test/java/com/instructure/student/features/dashboard/edit/EditDashboardViewModelTest.kt b/apps/student/src/test/java/com/instructure/student/features/dashboard/edit/EditDashboardViewModelTest.kt index a64f7e683f..1f4c232aa0 100644 --- a/apps/student/src/test/java/com/instructure/student/features/dashboard/edit/EditDashboardViewModelTest.kt +++ b/apps/student/src/test/java/com/instructure/student/features/dashboard/edit/EditDashboardViewModelTest.kt @@ -844,6 +844,137 @@ class EditDashboardViewModelTest { assertEquals("Future section past term course", futureCourseItemViewModel.name) } + @Test + fun `Course with past and current section only shows up in the current`() { + val courses = listOf( + createCourse( + id = 1L, + name = "Course with past and current enrollment", + isFavorite = false, + term = createTerm( + startAt = OffsetDateTime.now().withYear(OffsetDateTime.now().year - 1).toApiString(), + endAt = OffsetDateTime.now().withYear(OffsetDateTime.now().year + 1).toApiString()), + sections = listOf( + createSection(endAt = OffsetDateTime.now().withYear(OffsetDateTime.now().year - 1).toApiString()), + createSection(startAt = OffsetDateTime.now().withYear(OffsetDateTime.now().year - 1).toApiString(), + endAt = OffsetDateTime.now().withYear(OffsetDateTime.now().year + 1).toApiString()) + ), + restrictEnrolmentsToCourseDate = false + ) + ) + + every { courseManager.getCoursesWithConcludedAsync(any()) } returns mockk { + coEvery { await() } returns DataResult.Success(courses) + } + + every { groupManager.getAllGroupsAsync(any()) } returns mockk { + coEvery { await() } returns DataResult.Success(emptyList()) + } + + viewModel = EditDashboardViewModel(courseManager, groupManager) + viewModel.data.observe(lifecycleOwner, Observer {}) + + val data = viewModel.data.value?.items ?: emptyList() + + assertEquals(4, data.size) + + assert(data[2] is EditDashboardEnrollmentItemViewModel) + val currentHeader = data[2] as EditDashboardEnrollmentItemViewModel + assertEquals(R.string.current_enrollments, currentHeader.title) + + assert(data[3] is EditDashboardCourseItemViewModel) + val currentCourseItemViewModel = data[3] as EditDashboardCourseItemViewModel + assertEquals("Course with past and current enrollment", currentCourseItemViewModel.name) + } + + @Test + fun `Course with current and future section only shows up as current`() { + val courses = listOf( + createCourse( + id = 1L, + name = "Course with current and future enrollment", + isFavorite = false, + term = createTerm( + startAt = OffsetDateTime.now().withYear(OffsetDateTime.now().year - 1).toApiString(), + endAt = OffsetDateTime.now().withYear(OffsetDateTime.now().year + 1).toApiString()), + sections = listOf( + createSection(startAt = OffsetDateTime.now().withYear(OffsetDateTime.now().year - 1).toApiString(), + endAt = OffsetDateTime.now().withYear(OffsetDateTime.now().year + 1).toApiString()), + createSection(startAt = OffsetDateTime.now().withYear(OffsetDateTime.now().year + 1).toApiString(), + endAt = OffsetDateTime.now().withYear(OffsetDateTime.now().year + 2).toApiString()) + ), + restrictEnrolmentsToCourseDate = false + ) + ) + + every { courseManager.getCoursesWithConcludedAsync(any()) } returns mockk { + coEvery { await() } returns DataResult.Success(courses) + } + + every { groupManager.getAllGroupsAsync(any()) } returns mockk { + coEvery { await() } returns DataResult.Success(emptyList()) + } + + viewModel = EditDashboardViewModel(courseManager, groupManager) + viewModel.data.observe(lifecycleOwner, Observer {}) + + val data = viewModel.data.value?.items ?: emptyList() + + assertEquals(4, data.size) + + assert(data[2] is EditDashboardEnrollmentItemViewModel) + val currentHeader = data[2] as EditDashboardEnrollmentItemViewModel + assertEquals(R.string.current_enrollments, currentHeader.title) + + assert(data[3] is EditDashboardCourseItemViewModel) + val currentCourseItemViewModel = data[3] as EditDashboardCourseItemViewModel + assertEquals("Course with current and future enrollment", currentCourseItemViewModel.name) + } + + @Test + fun `Course with past and future section only shows up as future`() { + val courses = listOf( + createCourse( + id = 1L, + name = "Course with past and future enrollment", + isFavorite = false, + term = createTerm( + startAt = OffsetDateTime.now().withYear(OffsetDateTime.now().year - 1).toApiString(), + endAt = OffsetDateTime.now().withYear(OffsetDateTime.now().year + 1).toApiString()), + sections = listOf( + createSection(startAt = OffsetDateTime.now().withYear(OffsetDateTime.now().year - 2).toApiString(), + endAt = OffsetDateTime.now().withYear(OffsetDateTime.now().year - 1).toApiString()), + createSection(startAt = OffsetDateTime.now().withYear(OffsetDateTime.now().year + 1).toApiString(), + endAt = OffsetDateTime.now().withYear(OffsetDateTime.now().year + 2).toApiString()) + ), + restrictEnrolmentsToCourseDate = false + ) + ) + + every { courseManager.getCoursesWithConcludedAsync(any()) } returns mockk { + coEvery { await() } returns DataResult.Success(courses) + } + + every { groupManager.getAllGroupsAsync(any()) } returns mockk { + coEvery { await() } returns DataResult.Success(emptyList()) + } + + viewModel = EditDashboardViewModel(courseManager, groupManager) + viewModel.data.observe(lifecycleOwner, Observer {}) + + val data = viewModel.data.value?.items ?: emptyList() + + assertEquals(4, data.size) + + assert(data[2] is EditDashboardEnrollmentItemViewModel) + val currentHeader = data[2] as EditDashboardEnrollmentItemViewModel + assertEquals(R.string.future_enrollments, currentHeader.title) + + assert(data[3] is EditDashboardCourseItemViewModel) + val currentCourseItemViewModel = data[3] as EditDashboardCourseItemViewModel + assertEquals("Course with past and future enrollment", currentCourseItemViewModel.name) + } + private fun createCourse( id: Long, name: String, From 18db7a5a00b76a2ab66799433cff764fc2dd58e7 Mon Sep 17 00:00:00 2001 From: Kristof Deak <92309696+kdeakinstructure@users.noreply.github.com> Date: Tue, 26 Apr 2022 13:57:58 +0200 Subject: [PATCH 14/48] Implement Student Announcements E2E test. (#1566) refs: MBL-16019 affects: Student release note: none --- .../student/ui/e2e/AnnouncementsE2ETest.kt | 128 ++++++++++++++++++ .../student/ui/e2e/BookmarksE2ETest.kt | 2 +- .../student/ui/pages/DiscussionDetailsPage.kt | 12 ++ 3 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 apps/student/src/androidTest/java/com/instructure/student/ui/e2e/AnnouncementsE2ETest.kt diff --git a/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/AnnouncementsE2ETest.kt b/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/AnnouncementsE2ETest.kt new file mode 100644 index 0000000000..784ec41a7a --- /dev/null +++ b/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/AnnouncementsE2ETest.kt @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2019 - present Instructure, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package com.instructure.student.ui.e2e + +import android.util.Log +import androidx.test.espresso.Espresso +import com.instructure.canvas.espresso.E2E +import com.instructure.canvas.espresso.refresh +import com.instructure.canvasapi2.models.DiscussionEntry +import com.instructure.panda_annotations.FeatureCategory +import com.instructure.panda_annotations.Priority +import com.instructure.panda_annotations.TestCategory +import com.instructure.panda_annotations.TestMetaData +import com.instructure.student.ui.utils.StudentTest +import com.instructure.student.ui.utils.seedData +import com.instructure.student.ui.utils.tokenLogin +import dagger.hilt.android.testing.HiltAndroidTest +import org.junit.Test +import java.lang.Thread.sleep + +private const val STEP_TAG = "AnnouncementsE2ETest #STEP# " +private const val PREPARATION_TAG = "AnnouncementsE2ETest #PREPARATION# " + +@HiltAndroidTest +class AnnouncementsE2ETest : StudentTest() { + override fun displaysPageObjects() = Unit + + override fun enableAndConfigureAccessibilityChecks() { + //We don't want to see accessibility errors on E2E tests + } + + @E2E + @Test + @TestMetaData(Priority.P0, FeatureCategory.ANNOUNCEMENTS, TestCategory.E2E) + fun testAnnouncementsE2E() { + + Log.d(PREPARATION_TAG,"Seeding data.") + val data = seedData(students = 1, teachers = 1, courses = 1, announcements = 2) + val student = data.studentsList[0] + val course = data.coursesList[0] + val announcement = data.announcementsList[0] + val secondAnnouncement = data.announcementsList[1] + + Log.d(STEP_TAG,"Login with user: ${student.name}, login id: ${student.loginId} , password: ${student.password}") + tokenLogin(student) + dashboardPage.waitForRender() + + Log.d(STEP_TAG,"Navigate to ${course.name} course's announcements page.") + dashboardPage.assertDisplaysCourse(course) + dashboardPage.selectCourse(course) + courseBrowserPage.selectAnnouncements() + + Log.d(STEP_TAG,"Assert that ${announcement.title} announcement is displayed.") + discussionListPage.assertTopicDisplayed(announcement.title) + + Log.d(STEP_TAG,"Select ${announcement.title} announcement and assert if we are landing on the Discussion Details Page.") + discussionListPage.selectTopic(announcement.title) + discussionDetailsPage.assertTitleText(announcement.title) + + val replyMessage = "Reply text" + Log.d(STEP_TAG,"Send a reply to the selected announcement with message: $replyMessage.") + discussionDetailsPage.sendReply(replyMessage) + discussionDetailsPage.assertPageObjects() + + Log.d(STEP_TAG,"Assert that the previously sent reply has been displayed.") + val announcementReply = DiscussionEntry(message = replyMessage) + discussionDetailsPage.assertIfThereIsAReply() + discussionDetailsPage.assertReplyDisplayed(announcementReply) + + Log.d(STEP_TAG,"Click on Search button and type ${announcement.title} to the search input field.") + Espresso.pressBack() + discussionListPage.clickOnSearchButton() + discussionListPage.typeToSearchBar(announcement.title) + + Log.d(STEP_TAG,"Assert that only the matching announcement is displayed on the Discussion List Page.") + discussionListPage.pullToUpdate() + discussionListPage.assertTopicDisplayed(announcement.title) + discussionListPage.assertTopicNotDisplayed(secondAnnouncement.title) + + Log.d(STEP_TAG,"Clear search input field value and assert if all the announcements are displayed again on the Discussion List Page.") + discussionListPage.clickOnClearSearchButton() + discussionListPage.waitForDiscussionTopicToDisplay(secondAnnouncement.title) + discussionListPage.assertTopicDisplayed(announcement.title) + + Log.d(STEP_TAG,"Type a search value to the search input field which does not much with any of the existing announcements.") + discussionListPage.typeToSearchBar("Non existing announcement title") + sleep(3000) //We need this wait here to let make sure the search process has finished. + + Log.d(STEP_TAG,"Assert that the empty view is displayed and none of the announcements are appearing on the page.") + discussionListPage.assertEmpty() + discussionListPage.assertTopicNotDisplayed(announcement.title) + discussionListPage.assertTopicNotDisplayed(secondAnnouncement.title) + + Log.d(STEP_TAG,"Clear search input field value and assert if all the announcements are displayed again on the Discussion List Page.") + discussionListPage.clickOnClearSearchButton() + discussionListPage.waitForDiscussionTopicToDisplay(secondAnnouncement.title) + discussionListPage.assertTopicDisplayed(announcement.title) + + Log.d(STEP_TAG,"Refresh the page and assert that after refresh, still all the announcements are displayed.") + refresh() + discussionListPage.assertTopicDisplayed(announcement.title) + discussionListPage.assertTopicDisplayed(secondAnnouncement.title) + + Log.d(STEP_TAG,"Create a 'valid' announcement and assert that it has been displayed on the Discussion List Page after creation.") + discussionListPage.createAnnouncement("Announcement Topic", "Awesome announcement topic", true) + + Log.d(STEP_TAG,"Create an 'invalid' announcement with missing title. Assert that an announcement will be created with 'No Title' title.") + discussionListPage.createAnnouncement("", "Missing title announcement", true) + + Log.d(STEP_TAG,"Create an 'invalid' announcement with missing description. Assert that the announcement cannot be created without a description and the user remains on the New Announcement Page.") + discussionListPage.createAnnouncement("Missing description announcement", "", false) + discussionListPage.assertOnNewAnnouncementPage() + } +} \ No newline at end of file diff --git a/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/BookmarksE2ETest.kt b/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/BookmarksE2ETest.kt index ada2a9d8a3..f0ae46c518 100644 --- a/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/BookmarksE2ETest.kt +++ b/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/BookmarksE2ETest.kt @@ -46,7 +46,7 @@ class BookmarksE2ETest : StudentTest() { } override fun enableAndConfigureAccessibilityChecks() { - //Intentionally empty, because we don't check accessibility in E2E tests. + //We don't want to see accessibility errors on E2E tests } @E2E diff --git a/apps/student/src/androidTest/java/com/instructure/student/ui/pages/DiscussionDetailsPage.kt b/apps/student/src/androidTest/java/com/instructure/student/ui/pages/DiscussionDetailsPage.kt index 6c63b0d547..09bfe982d5 100644 --- a/apps/student/src/androidTest/java/com/instructure/student/ui/pages/DiscussionDetailsPage.kt +++ b/apps/student/src/androidTest/java/com/instructure/student/ui/pages/DiscussionDetailsPage.kt @@ -24,6 +24,7 @@ import androidx.test.espresso.action.ViewActions.swipeUp import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.matcher.ViewMatchers.isDisplayingAtLeast import androidx.test.espresso.matcher.ViewMatchers.withId +import androidx.test.espresso.web.assertion.WebViewAssertions import androidx.test.espresso.web.assertion.WebViewAssertions.webMatches import androidx.test.espresso.web.sugar.Web.onWebView import androidx.test.espresso.web.webdriver.DriverAtoms.findElement @@ -142,6 +143,17 @@ class DiscussionDetailsPage : BasePage(R.id.discussionDetailsPage) { .check(webMatches(getText(),containsString(reply.message))) } + fun assertReplyDisplayed(reply: DiscussionEntry) { + onWebView(withId(R.id.discussionRepliesWebView)) + .withElement(findElement(Locator.TAG_NAME, "html")) + .check(webMatches(getText(), containsString(reply.message))) + } + + fun assertIfThereIsAReply() { + onView(withId(R.id.discussionTopicRepliesTitle)).assertDisplayed() + onView(withId(R.id.discussionRepliesWebView)).assertDisplayed() + } + fun assertFavoritingEnabled(reply: DiscussionEntry) { try { onWebView(withId(R.id.discussionRepliesWebView)) From 9311a8d04a843bbea62d3c8bd723f4664c25c031 Mon Sep 17 00:00:00 2001 From: Tamas Kozmer <72397075+tamaskozmer@users.noreply.github.com> Date: Tue, 26 Apr 2022 15:03:20 +0200 Subject: [PATCH 15/48] [MBL-15984][Student][Teacher] InstUI color unifying (#1562) refs: MBL-15984 affects: Student, Teacher release note: none * Added new colors, replaced student specific colors. * Replaced colors that are the same for both color modes with inst UI colors. * Replaced login colors and dark text/background colors. * Replaced dark text/background colors. * Replaced medium text/background colors. * Replaced light text/background colors. * Replaced lightest text/background colors. * Replaced colors that are similar to the medium color. * Replaced colors that are similar to the darkest color. * Replaced remaining gray colors. * Removed some transparent colors and replaced some annotation colors wher other colors should have been used. * Fixed Panda avatar screen colors and added comments. * Replaced white colors. * Replaced white colors. * Changed flutter student colors for inst UI colors. * Changed back calendar colors to fix contrast. --- .../AnnotationCommentListFragment.kt | 2 +- .../student/activity/NavigationActivity.kt | 6 +- .../student/activity/PandaAvatarActivity.kt | 2 +- .../fragment/AccountPreferencesFragment.kt | 2 +- .../student/fragment/CalendarEventFragment.kt | 2 +- .../fragment/CreateAnnouncementFragment.kt | 2 +- .../fragment/CreateDiscussionFragment.kt | 2 +- .../fragment/DiscussionDetailsFragment.kt | 2 +- .../fragment/EditPageDetailsFragment.kt | 2 +- .../student/fragment/GradesListFragment.kt | 2 +- .../fragment/MasteryPathSelectionFragment.kt | 2 +- .../holders/CanvasContextViewHolder.kt | 4 +- .../student/holders/DiscussionListHolder.kt | 2 +- .../student/holders/GradeViewHolder.kt | 6 +- .../student/holders/InboxViewHolder.kt | 2 +- .../student/holders/ModuleHeaderViewHolder.kt | 2 +- .../student/holders/ModuleViewHolder.kt | 6 +- .../student/holders/NotificationViewHolder.kt | 4 +- .../student/holders/TodoViewHolder.kt | 6 +- .../AssignmentDetailsPresenter.kt | 6 +- .../file/UploadStatusSubmissionPresenter.kt | 4 +- .../file/ui/UploadStatusSubmissionView.kt | 4 +- .../comments/ui/PendingCommentBinder.kt | 2 +- .../comments/ui/SubmissionCommentsView.kt | 2 +- .../drawer/comments/ui/views/CommentView.kt | 6 +- .../drawer/rubric/ui/CriterionRatingButton.kt | 4 +- .../ui/SubmissionDetailsView.kt | 2 +- .../ui/gradeCell/DonutChartView.kt | 4 +- .../ui/gradeCell/GradeCellViewState.kt | 2 +- .../ui/gradeCell/GradeStatisticsView.kt | 8 +- .../ConferenceListPresenter.kt | 6 +- .../student/util/BaseAppManager.kt | 2 +- .../student/view/AttachmentDogEarLayout.kt | 2 +- .../student/widget/BaseRemoteViewsService.kt | 2 +- .../widget/NotificationViewWidgetService.kt | 2 +- .../student/widget/TodoViewWidgetService.kt | 2 +- .../res/drawable/bg_comment_attachment.xml | 2 +- .../student/src/main/res/drawable/divider.xml | 2 +- .../drawable/favoriting_icon_background.xml | 2 +- .../main/res/drawable/grade_background.xml | 2 +- .../src/main/res/drawable/ic_circle.xml | 2 +- .../main/res/drawable/item_decorator_gray.xml | 2 +- .../src/main/res/drawable/line_divider.xml | 2 +- .../src/main/res/drawable/listview_states.xml | 6 +- .../res/drawable/rounded_corner_tiara_bg.xml | 2 +- .../res/drawable/rounded_corner_white_bg.xml | 4 +- .../res/drawable/row_background_white.xml | 4 +- .../res/drawable/status_indicator_blue.xml | 2 +- .../src/main/res/drawable/widget_dark_bg.xml | 2 +- .../src/main/res/drawable/widget_light_bg.xml | 2 +- .../layout-sw720dp/dialog_color_picker.xml | 2 +- .../fragment_elementary_course.xml | 16 +- .../fragment_elementary_dashboard.xml | 14 +- .../res/layout/activity_document_scanning.xml | 10 +- .../main/res/layout/activity_navigation.xml | 6 +- .../src/main/res/layout/activity_settings.xml | 2 +- .../layout/activity_student_view_starter.xml | 2 +- .../main/res/layout/activity_widget_setup.xml | 12 +- .../res/layout/adapter_conference_header.xml | 2 +- .../res/layout/adapter_conference_item.xml | 4 +- .../layout/adapter_conference_list_empty.xml | 4 +- .../layout/adapter_conference_list_error.xml | 6 +- .../adapter_conference_recording_item.xml | 6 +- .../layout/adapter_course_browser_home.xml | 4 +- .../adapter_course_browser_web_view.xml | 2 +- .../res/layout/adapter_rubric_criterion.xml | 12 +- .../main/res/layout/adapter_rubric_empty.xml | 2 +- .../main/res/layout/adapter_rubric_grade.xml | 2 +- .../adapter_submission_comment_pending.xml | 10 +- .../adapter_submission_comments_empty.xml | 2 +- .../res/layout/adapter_submission_file.xml | 6 +- .../res/layout/assignment_list_layout.xml | 8 +- .../main/res/layout/calendar_event_layout.xml | 10 +- .../res/layout/course_module_progression.xml | 12 +- .../main/res/layout/dialog_color_picker.xml | 2 +- .../res/layout/dialog_comment_file_picker.xml | 12 +- .../main/res/layout/dialog_file_upload.xml | 8 +- apps/student/src/main/res/layout/divider.xml | 2 +- .../main/res/layout/empty_courses_view.xml | 6 +- .../src/main/res/layout/empty_inbox_view.xml | 2 +- .../res/layout/exo_player_control_view.xml | 4 +- .../layout/fragment_account_preferences.xml | 2 +- .../fragment_annotation_comment_list.xml | 10 +- .../layout/fragment_application_settings.xml | 4 +- .../main/res/layout/fragment_assignment.xml | 4 +- .../res/layout/fragment_assignment_basic.xml | 6 +- .../layout/fragment_assignment_details.xml | 68 ++--- .../layout/fragment_bookmarks_fragment.xml | 2 +- .../src/main/res/layout/fragment_calendar.xml | 2 +- .../res/layout/fragment_calendar_event.xml | 4 +- .../layout/fragment_conference_details.xml | 16 +- .../res/layout/fragment_conference_list.xml | 2 +- .../res/layout/fragment_course_browser.xml | 2 +- .../res/layout/fragment_course_grades.xml | 8 +- .../main/res/layout/fragment_course_grid.xml | 4 +- .../main/res/layout/fragment_course_pages.xml | 4 +- .../res/layout/fragment_course_settings.xml | 4 +- .../layout/fragment_create_announcement.xml | 10 +- .../res/layout/fragment_create_discussion.xml | 16 +- .../layout/fragment_discussions_details.xml | 24 +- .../res/layout/fragment_discussions_reply.xml | 2 +- .../layout/fragment_discussions_update.xml | 2 +- .../main/res/layout/fragment_edit_page.xml | 2 +- .../res/layout/fragment_elementary_course.xml | 14 +- .../layout/fragment_elementary_dashboard.xml | 12 +- .../res/layout/fragment_feature_flags.xml | 4 +- .../main/res/layout/fragment_file_details.xml | 8 +- .../main/res/layout/fragment_file_list.xml | 6 +- .../main/res/layout/fragment_file_search.xml | 6 +- .../src/main/res/layout/fragment_inbox.xml | 12 +- .../layout/fragment_inbox_compose_message.xml | 18 +- .../layout/fragment_inbox_conversation.xml | 8 +- .../src/main/res/layout/fragment_list.xml | 2 +- .../res/layout/fragment_list_notification.xml | 6 +- .../main/res/layout/fragment_list_todo.xml | 10 +- .../layout/fragment_lti_submission_view.xml | 4 +- .../layout/fragment_master_paths_locked.xml | 4 +- .../layout/fragment_mastery_paths_options.xml | 1 + .../layout/fragment_media_submission_view.xml | 6 +- .../main/res/layout/fragment_module_list.xml | 4 +- .../layout/fragment_module_quiz_decider.xml | 6 +- .../layout/fragment_nothing_to_see_here.xml | 6 +- .../res/layout/fragment_pair_observer.xml | 12 +- .../res/layout/fragment_people_details.xml | 2 +- .../main/res/layout/fragment_people_list.xml | 4 +- .../fragment_picker_submission_upload.xml | 22 +- .../res/layout/fragment_profile_settings.xml | 2 +- .../layout/fragment_submission_comments.xml | 6 +- .../layout/fragment_submission_details.xml | 10 +- ...gment_submission_details_empty_content.xml | 2 +- .../res/layout/fragment_submission_files.xml | 2 +- .../layout/fragment_submission_message.xml | 4 +- ...fragment_submission_rubric_description.xml | 2 +- .../fragment_submission_view_online_url.xml | 6 +- .../src/main/res/layout/fragment_syllabus.xml | 2 +- .../res/layout/fragment_syllabus_events.xml | 6 +- .../fragment_text_submission_upload.xml | 2 +- .../layout/fragment_unsupported_feature.xml | 4 +- .../layout/fragment_unsupported_file_type.xml | 4 +- .../fragment_upload_status_submission.xml | 18 +- .../layout/fragment_url_submission_upload.xml | 4 +- .../layout/fragment_url_submission_view.xml | 4 +- .../main/res/layout/fragment_view_image.xml | 4 +- .../src/main/res/layout/fragment_webview.xml | 4 +- .../layout/item_document_scanning_filter.xml | 4 +- apps/student/src/main/res/layout/legal.xml | 6 +- .../listview_widget_grades_item_row.xml | 4 +- ...istview_widget_grades_minimum_item_row.xml | 2 +- ...listview_widget_notifications_item_row.xml | 6 +- ..._widget_notifications_minimum_item_row.xml | 4 +- .../layout/listview_widget_todo_item_row.xml | 6 +- .../listview_widget_todo_minimum_item_row.xml | 4 +- .../src/main/res/layout/navigation_drawer.xml | 42 +-- .../src/main/res/layout/panda_image.xml | 6 +- .../src/main/res/layout/progress_dialog.xml | 2 +- .../src/main/res/layout/quiz_list_layout.xml | 4 +- .../src/main/res/layout/settings_spinner.xml | 4 +- .../main/res/layout/spinner_row_courses.xml | 2 +- .../res/layout/spinner_row_grading_period.xml | 2 +- .../layout/spinner_submission_versions.xml | 2 +- .../spinner_submission_versions_dropdown.xml | 2 +- .../src/main/res/layout/term_spinner_view.xml | 2 +- .../src/main/res/layout/toolbar_layout.xml | 2 +- .../src/main/res/layout/unknown_item.xml | 8 +- .../src/main/res/layout/unread_count.xml | 2 +- .../res/layout/upload_file_destination.xml | 6 +- .../res/layout/view_assignment_override.xml | 16 +- .../src/main/res/layout/view_comment.xml | 6 +- .../res/layout/view_comment_attachment.xml | 4 +- .../view_comment_submission_attachment.xml | 2 +- .../src/main/res/layout/view_divider.xml | 2 +- .../layout/view_pdf_student_submission.xml | 2 +- .../res/layout/view_student_grade_cell.xml | 26 +- .../layout/viewholder_annotation_comment.xml | 6 +- .../main/res/layout/viewholder_bookmark.xml | 2 +- .../viewholder_canvas_context_dialog.xml | 2 +- .../res/layout/viewholder_card_generic.xml | 2 +- .../res/layout/viewholder_course_card.xml | 10 +- .../res/layout/viewholder_course_header.xml | 2 +- .../viewholder_course_header_favorites.xml | 2 +- .../main/res/layout/viewholder_discussion.xml | 4 +- .../viewholder_discussion_group_header.xml | 2 +- .../viewholder_edit_dashboard_course.xml | 8 +- .../viewholder_edit_dashboard_description.xml | 2 +- .../viewholder_edit_dashboard_enrollment.xml | 4 +- .../viewholder_edit_dashboard_group.xml | 10 +- .../viewholder_edit_dashboard_header.xml | 8 +- .../src/main/res/layout/viewholder_file.xml | 4 +- .../res/layout/viewholder_file_upload.xml | 6 +- .../src/main/res/layout/viewholder_grade.xml | 2 +- .../main/res/layout/viewholder_group_card.xml | 6 +- .../res/layout/viewholder_group_header.xml | 2 +- .../viewholder_group_header_favorites.xml | 2 +- .../layout/viewholder_header_expandable.xml | 2 +- .../res/layout/viewholder_header_module.xml | 6 +- .../res/layout/viewholder_header_people.xml | 4 +- .../src/main/res/layout/viewholder_inbox.xml | 2 +- .../viewholder_mastery_paths_assignment.xml | 2 +- .../main/res/layout/viewholder_message.xml | 16 +- .../src/main/res/layout/viewholder_module.xml | 2 +- .../res/layout/viewholder_module_empty.xml | 2 +- .../src/main/res/layout/viewholder_people.xml | 2 +- .../main/res/layout/viewholder_recipient.xml | 4 +- .../layout/viewholder_sub_header_module.xml | 2 +- .../src/main/res/layout/widget_homescreen.xml | 2 +- .../main/res/layout/widget_not_logged_in.xml | 2 +- apps/student/src/main/res/values/styles.xml | 38 +-- .../main/res/values/themes_canvastheme.xml | 8 +- .../UploadStatusSubmissionPresenterTest.kt | 14 +- .../ConferenceListPresenterTest.kt | 6 +- .../AnnotationCommentListFragment.kt | 2 +- .../teacher/activities/InitActivity.kt | 8 +- .../teacher/activities/SpeedGraderActivity.kt | 2 +- .../adapters/CanvasContextSpinnerAdapter.kt | 4 +- .../teacher/dialog/DiscussionsMoveToDialog.kt | 4 +- .../teacher/dialog/RadioButtonDialog.kt | 2 +- .../calendar/event/CalendarEventFragment.kt | 2 +- .../postpolicies/ui/PostPolicyFragment.kt | 2 +- .../teacher/fragments/AssigneeListFragment.kt | 4 +- .../fragments/AssignmentDetailsFragment.kt | 8 +- .../fragments/CreateDiscussionFragment.kt | 2 +- .../CreateOrEditAnnouncementFragment.kt | 2 +- .../CreateOrEditPageDetailsFragment.kt | 2 +- .../fragments/DiscussionsDetailsFragment.kt | 10 +- .../EditAssignmentDetailsFragment.kt | 6 +- .../fragments/EditQuizDetailsFragment.kt | 4 +- .../teacher/fragments/InboxFragment.kt | 2 +- .../teacher/fragments/ProfileEditFragment.kt | 4 +- .../teacher/fragments/ProfileFragment.kt | 4 +- .../teacher/fragments/QuizDetailsFragment.kt | 8 +- .../fragments/SpeedGraderCommentsFragment.kt | 2 +- .../fragments/SpeedGraderGradeFragment.kt | 4 +- .../teacher/holders/AssigneeViewHolder.kt | 2 +- .../teacher/holders/AttendanceViewHolder.kt | 8 +- .../holders/CanvasContextViewHolder.kt | 4 +- .../GradeableStudentSubmissionViewHolder.kt | 4 +- .../holders/PeopleListFilterViewHolder.kt | 4 +- .../holders/SpeedGraderCommentHolder.kt | 6 +- .../receivers/TeacherPushExternalReceiver.kt | 2 +- .../teacher/utils/AssignmentExtensions.kt | 26 +- .../teacher/utils/BaseAppManager.kt | 2 +- .../teacher/view/CommentSubmissionView.kt | 2 +- .../instructure/teacher/view/DonutChart.kt | 6 +- .../view/FileFolderPublishedStatusIconView.kt | 6 +- .../teacher/view/LinearProgressBar.kt | 2 +- .../teacher/view/PublishedStatusIconView.kt | 4 +- .../instructure/teacher/view/TooltipView.kt | 2 +- .../teacher/view/TutorialSwipeView.kt | 2 +- .../view/edit_rubric/CriterionRatingButton.kt | 8 +- .../view/edit_rubric/RubricEditView.kt | 2 +- .../view/grade_slider/PossiblePointView.kt | 2 +- .../res/color/selector_disabled_text_view.xml | 4 +- .../main/res/drawable/bg_button_rounded.xml | 2 +- .../res/drawable/bg_comment_attachment.xml | 2 +- .../drawable/bg_criterion_button_selected.xml | 2 +- .../bg_criterion_button_unselected.xml | 2 +- .../src/main/res/drawable/bg_generic_pill.xml | 2 +- .../main/res/drawable/bg_pill_filled_gray.xml | 4 +- .../main/res/drawable/bg_published_icon.xml | 2 +- .../bg_student_context_course_info.xml | 4 +- .../src/main/res/drawable/ic_circle.xml | 2 +- .../main/res/drawable/item_decorator_gray.xml | 2 +- .../profile_icon_camera_background.xml | 2 +- .../res/drawable/shape_ungraded_bubble.xml | 2 +- .../res/drawable/status_indicator_blue.xml | 2 +- .../layout-sw760dp/dialog_color_picker.xml | 2 +- .../view_floating_media_recorder_audio.xml | 2 +- .../view_submission_content.xml | 18 +- .../view_submissions_donut_group.xml | 8 +- .../src/main/res/layout/activity_feedback.xml | 2 +- .../src/main/res/layout/activity_init.xml | 18 +- .../res/layout/activity_master_detail.xml | 8 +- .../main/res/layout/activity_speedgrader.xml | 4 +- .../main/res/layout/activity_view_media.xml | 6 +- .../res/layout/adapter_annotation_comment.xml | 6 +- .../src/main/res/layout/adapter_assignee.xml | 6 +- .../res/layout/adapter_assignee_header.xml | 2 +- .../main/res/layout/adapter_assignment.xml | 6 +- .../layout/adapter_assignment_due_date.xml | 12 +- .../adapter_assignment_group_header.xml | 2 +- .../res/layout/adapter_course_browser.xml | 2 +- .../src/main/res/layout/adapter_courses.xml | 8 +- .../main/res/layout/adapter_discussion.xml | 6 +- .../main/res/layout/adapter_file_folder.xml | 6 +- .../adapter_gradeable_student_submission.xml | 2 +- .../src/main/res/layout/adapter_inbox.xml | 4 +- .../src/main/res/layout/adapter_message.xml | 16 +- .../src/main/res/layout/adapter_module.xml | 8 +- .../main/res/layout/adapter_module_item.xml | 10 +- .../res/layout/adapter_module_list_empty.xml | 4 +- .../layout/adapter_module_list_error_full.xml | 6 +- .../adapter_module_list_error_inline.xml | 6 +- .../src/main/res/layout/adapter_page.xml | 6 +- .../layout/adapter_post_policy_section.xml | 2 +- .../src/main/res/layout/adapter_quiz.xml | 6 +- .../adapter_speed_grader_group_member.xml | 4 +- .../adapter_student_context_submission.xml | 4 +- .../res/layout/adapter_submission_comment.xml | 8 +- .../src/main/res/layout/adapter_todo.xml | 4 +- .../src/main/res/layout/adapter_users.xml | 2 +- .../canvas_context_spinner_adapter_item.xml | 2 +- .../res/layout/comment_attachment_view.xml | 4 +- .../comment_submission_attachment_view.xml | 2 +- .../main/res/layout/dialog_color_picker.xml | 2 +- .../res/layout/dialog_customize_grade.xml | 2 +- .../res/layout/dialog_delete_conversation.xml | 2 +- .../main/res/layout/dialog_delete_message.xml | 2 +- .../dialog_filter_submission_by_points.xml | 2 +- .../src/main/res/layout/dialog_legal.xml | 6 +- .../res/layout/dialog_move_discussion_to.xml | 4 +- .../res/layout/dialog_pass_fail_grade.xml | 2 +- .../layout/dialog_post_graded_everyone.xml | 4 +- .../dialog_sg_add_attachment_comment.xml | 8 +- .../main/res/layout/empty_courses_view.xml | 6 +- .../src/main/res/layout/empty_inbox_view.xml | 2 +- .../res/layout/exo_player_control_view.xml | 4 +- .../main/res/layout/fragment_add_message.xml | 16 +- .../main/res/layout/fragment_all_courses.xml | 2 +- .../fragment_annotation_comment_list.xml | 8 +- .../res/layout/fragment_assignee_list.xml | 4 +- .../layout/fragment_assignment_details.xml | 28 +- .../res/layout/fragment_assignment_list.xml | 4 +- .../fragment_assignment_submission_list.xml | 6 +- .../res/layout/fragment_attendance_list.xml | 6 +- .../res/layout/fragment_calendar_event.xml | 10 +- .../res/layout/fragment_comment_library.xml | 12 +- .../res/layout/fragment_course_browser.xml | 2 +- .../layout/fragment_course_browser_empty.xml | 6 +- .../res/layout/fragment_course_settings.xml | 2 +- .../src/main/res/layout/fragment_courses.xml | 8 +- .../res/layout/fragment_create_discussion.xml | 32 +-- .../fragment_create_or_edit_announcement.xml | 24 +- .../layout/fragment_create_or_edit_page.xml | 18 +- .../layout/fragment_discussions_details.xml | 30 +-- .../res/layout/fragment_discussions_edit.xml | 2 +- .../res/layout/fragment_discussions_reply.xml | 2 +- .../fragment_edit_assignment_details.xml | 22 +- .../res/layout/fragment_edit_filefolder.xml | 28 +- .../res/layout/fragment_edit_quiz_details.xml | 24 +- .../res/layout/fragment_edit_syllabus.xml | 10 +- .../src/main/res/layout/fragment_empty.xml | 6 +- .../res/layout/fragment_feature_flags.xml | 4 +- .../main/res/layout/fragment_file_search.xml | 6 +- .../src/main/res/layout/fragment_inbox.xml | 8 +- .../res/layout/fragment_internal_webview.xml | 4 +- .../res/layout/fragment_message_thread.xml | 6 +- .../res/layout/fragment_not_a_teacher.xml | 4 +- .../main/res/layout/fragment_page_details.xml | 4 +- .../layout/fragment_people_list_layout.xml | 4 +- .../main/res/layout/fragment_post_grade.xml | 12 +- .../layout/fragment_post_policy_settings.xml | 4 +- .../src/main/res/layout/fragment_profile.xml | 10 +- .../main/res/layout/fragment_profile_edit.xml | 8 +- .../main/res/layout/fragment_quiz_details.xml | 26 +- .../src/main/res/layout/fragment_settings.xml | 16 +- .../fragment_speed_grader_lti_submission.xml | 6 +- .../layout/fragment_speed_grader_media.xml | 6 +- .../fragment_speed_grader_quiz_submission.xml | 6 +- .../layout/fragment_speedgrader_comments.xml | 2 +- .../res/layout/fragment_speedgrader_empty.xml | 4 +- .../res/layout/fragment_speedgrader_grade.xml | 10 +- .../fragment_speedgrader_url_submission.xml | 4 +- .../res/layout/fragment_student_context.xml | 22 +- .../src/main/res/layout/fragment_syllabus.xml | 2 +- .../res/layout/fragment_syllabus_events.xml | 6 +- .../layout/fragment_unsupported_file_type.xml | 4 +- .../main/res/layout/fragment_view_image.xml | 4 +- .../layout/item_comment_library_comment.xml | 4 +- .../src/main/res/layout/navigation_drawer.xml | 34 +-- .../res/layout/people_filter_adapter_item.xml | 2 +- .../speed_grader_comment_input_view.xml | 6 +- .../layout/spinner_item_nothing_selected.xml | 2 +- .../src/main/res/layout/spinner_long_text.xml | 2 +- .../src/main/res/layout/toolbar_layout.xml | 2 +- .../src/main/res/layout/unread_count.xml | 2 +- .../res/layout/view_assignment_override.xml | 16 +- .../src/main/res/layout/view_comment.xml | 6 +- .../src/main/res/layout/view_divider.xml | 2 +- .../res/layout/view_edit_grade_comment.xml | 8 +- .../src/main/res/layout/view_edit_rubric.xml | 6 +- .../res/layout/view_quiz_setting_item.xml | 4 +- .../res/layout/view_rubric_criterion_item.xml | 10 +- .../res/layout/view_speed_grader_slider.xml | 6 +- .../res/layout/view_submission_content.xml | 16 +- .../layout/view_submissions_donut_group.xml | 8 +- .../layout/viewholder_header_expandable.xml | 2 +- .../main/res/layout/viewholder_recipient.xml | 4 +- .../menu/menu_compose_message_activity.xml | 2 +- apps/teacher/src/main/res/values/styles.xml | 38 +-- .../annotations/AnnotationConverter.kt | 8 +- .../annotations/PdfSubmissionView.kt | 2 +- .../res/drawable/bg_annotation_comments.xml | 2 +- .../lib/utils/design/student_colors.dart | 2 +- .../activities/BaseLoginFindSchoolActivity.kt | 6 +- .../BaseLoginLandingPageActivity.kt | 2 +- .../login/activities/LoginWithQRActivity.kt | 2 +- .../main/res/drawable/bg_button_rounded.xml | 2 +- .../drawable/bg_button_rounded_outline.xml | 4 +- .../src/main/res/drawable/login_cursor.xml | 2 +- .../drawable/masquerade_input_background.xml | 2 +- .../main/res/drawable/masquerade_outline.xml | 2 +- .../activity_login_landing_page.xml | 18 +- .../layout-w720dp/activity_find_school.xml | 10 +- .../main/res/layout/accounts_adapter_item.xml | 4 +- .../main/res/layout/activity_find_school.xml | 10 +- .../main/res/layout/activity_init_login.xml | 2 +- .../layout/activity_login_landing_page.xml | 20 +- .../res/layout/activity_login_with_qr.xml | 4 +- .../src/main/res/layout/activity_sign_in.xml | 4 +- .../src/main/res/layout/adapter_account.xml | 2 +- .../res/layout/adapter_account_footer.xml | 4 +- .../res/layout/adapter_previous_users.xml | 6 +- .../main/res/layout/dialog_error_report.xml | 10 +- .../main/res/layout/dialog_masquerading.xml | 12 +- .../layout/layout_masquerade_notification.xml | 2 +- .../src/main/res/values/styles.xml | 14 +- .../main/res/color/tab_layout_icon_tint.xml | 4 +- .../src/main/res/drawable/ic_record_media.xml | 4 +- .../res/drawable/ic_stop_record_media.xml | 4 +- .../main/res/drawable/tab_bar_indicator.xml | 2 +- libs/pandares/src/main/res/values/colors.xml | 243 ++++-------------- .../activities/BaseViewMediaActivity.kt | 2 +- .../pandautils/discussions/DiscussionUtils.kt | 10 +- .../DashboardNotificationsViewModel.kt | 4 +- .../elementary/homeroom/CourseCardCreator.kt | 2 +- .../elementary/schedule/ScheduleViewData.kt | 14 +- .../pandautils/utils/ColorKeeper.kt | 2 +- .../pandautils/utils/ProfileUtils.kt | 2 +- .../pandautils/utils/ThemePrefs.kt | 14 +- .../pandautils/utils/ViewExtensions.kt | 2 +- .../pandautils/utils/ViewStyler.kt | 14 +- .../views/AttachmentDogEarLayout.kt | 2 +- .../pandautils/views/CanvasWebView.kt | 2 +- .../pandautils/views/NestedIconView.kt | 19 -- .../schedule_checkbox_color_selector.xml | 4 +- .../drawable/announcement_card_background.xml | 2 +- .../announcement_card_icon_background.xml | 2 +- .../main/res/drawable/bg_button_rounded.xml | 2 +- .../src/main/res/drawable/bg_nested_icon.xml | 2 +- .../src/main/res/drawable/button_disabled.xml | 27 -- .../src/main/res/drawable/button_normal.xml | 27 -- .../src/main/res/drawable/button_pressed.xml | 27 -- .../src/main/res/drawable/button_states.xml | 25 -- ...course_invite_accept_button_background.xml | 2 +- ...ourse_invite_decline_button_background.xml | 2 +- .../drawable/recipient_avatar_placeholder.xml | 2 +- .../item_schedule_planner_item.xml | 10 +- .../fragment_important_dates.xml | 2 +- .../res/layout-sw720dp/item_grade_row.xml | 12 +- .../main/res/layout/activity_view_media.xml | 6 +- .../main/res/layout/adapter_file_uploads.xml | 8 +- .../adapter_recipient_search_result.xml | 2 +- .../main/res/layout/dialog_files_upload.xml | 16 +- .../src/main/res/layout/empty_view.xml | 2 +- .../res/layout/exo_player_control_view.xml | 4 +- .../src/main/res/layout/fragment_homeroom.xml | 6 +- .../layout/fragment_remote_config_params.xml | 4 +- .../main/res/layout/fragment_resources.xml | 2 +- .../res/layout/fragment_schedule_pager.xml | 6 +- .../src/main/res/layout/item_announcement.xml | 8 +- .../src/main/res/layout/item_contact_info.xml | 6 +- .../src/main/res/layout/item_course_card.xml | 14 +- .../layout/item_dashboard_announcement.xml | 8 +- .../res/layout/item_dashboard_conference.xml | 12 +- .../res/layout/item_dashboard_invitation.xml | 12 +- .../src/main/res/layout/item_grade_row.xml | 10 +- .../layout/item_grading_period_selector.xml | 6 +- .../main/res/layout/item_important_dates.xml | 12 +- .../layout/item_important_dates_header.xml | 2 +- .../main/res/layout/item_important_links.xml | 4 +- .../main/res/layout/item_lti_application.xml | 4 +- .../res/layout/item_notification_header.xml | 2 +- .../layout/item_notification_preference.xml | 2 +- .../main/res/layout/item_resources_header.xml | 4 +- .../res/layout/item_schedule_day_header.xml | 8 +- .../main/res/layout/item_schedule_empty.xml | 4 +- .../layout/item_schedule_missing_header.xml | 4 +- .../res/layout/item_schedule_missing_item.xml | 10 +- .../res/layout/item_schedule_planner_item.xml | 10 +- .../src/main/res/layout/loading_lame.xml | 2 +- .../src/main/res/layout/toolbar_layout.xml | 2 +- .../layout/view_floating_media_recorder.xml | 4 +- .../view_floating_media_recorder_audio.xml | 2 +- .../src/main/res/layout/view_help_link.xml | 4 +- .../src/main/res/values/font_styles.xml | 2 +- .../pandautils/src/main/res/values/styles.xml | 32 +-- .../main/res/values/themes_canvasthemes.xml | 28 +- .../DashboardNotificationsViewModelTest.kt | 12 +- 488 files changed, 1520 insertions(+), 1777 deletions(-) delete mode 100644 libs/pandautils/src/main/res/drawable/button_disabled.xml delete mode 100644 libs/pandautils/src/main/res/drawable/button_normal.xml delete mode 100644 libs/pandautils/src/main/res/drawable/button_pressed.xml delete mode 100644 libs/pandautils/src/main/res/drawable/button_states.xml diff --git a/apps/student/src/main/java/com/instructure/student/AnnotationComments/AnnotationCommentListFragment.kt b/apps/student/src/main/java/com/instructure/student/AnnotationComments/AnnotationCommentListFragment.kt index babe285816..b683428a00 100644 --- a/apps/student/src/main/java/com/instructure/student/AnnotationComments/AnnotationCommentListFragment.kt +++ b/apps/student/src/main/java/com/instructure/student/AnnotationComments/AnnotationCommentListFragment.kt @@ -137,7 +137,7 @@ class AnnotationCommentListFragment : ParentFragment() { commentInputContainer.setVisible(false) } else { sendCommentButton.imageTintList = ViewStyler.generateColorStateList( - intArrayOf(-android.R.attr.state_enabled) to ContextCompat.getColor(requireContext(), R.color.defaultTextGray), + intArrayOf(-android.R.attr.state_enabled) to ContextCompat.getColor(requireContext(), R.color.textDark), intArrayOf() to ThemePrefs.buttonColor ) diff --git a/apps/student/src/main/java/com/instructure/student/activity/NavigationActivity.kt b/apps/student/src/main/java/com/instructure/student/activity/NavigationActivity.kt index 2ad389eb1c..3f6f85c891 100644 --- a/apps/student/src/main/java/com/instructure/student/activity/NavigationActivity.kt +++ b/apps/student/src/main/java/com/instructure/student/activity/NavigationActivity.kt @@ -389,7 +389,7 @@ class NavigationActivity : BaseRouterActivity(), Navigation, MasqueradingDialog. if(ProfileUtils.shouldLoadAltAvatarImage(user.avatarUrl)) { val initials = ProfileUtils.getUserInitials(user.shortName ?: "") - val color = ContextCompat.getColor(context, R.color.avatarGray) + val color = ContextCompat.getColor(context, R.color.textDark) val drawable = TextDrawable.builder() .beginConfig() .height(context.resources.getDimensionPixelSize(R.dimen.profileAvatarSize)) @@ -594,7 +594,7 @@ class NavigationActivity : BaseRouterActivity(), Navigation, MasqueradingDialog. private fun setupBottomNavigation() { Logger.d("NavigationActivity:setupBottomNavigation()") - bottomBar.applyTheme(ThemePrefs.brandColor, ContextCompat.getColor(this, R.color.bottomBarUnselectedItemColor)) + bottomBar.applyTheme(ThemePrefs.brandColor, ContextCompat.getColor(this, R.color.textDarkest)) bottomBar.setOnNavigationItemSelectedListener(bottomBarItemSelectedListener) bottomBar.setOnNavigationItemReselectedListener(bottomBarItemReselectedListener) updateBottomBarContentDescriptions() @@ -1048,7 +1048,7 @@ class NavigationActivity : BaseRouterActivity(), Navigation, MasqueradingDialog. .inflate(R.layout.unread_count, bottomBar, false) (badge as TextView).text = unreadCountDisplay - ColorUtils.colorIt(ContextCompat.getColor(context, R.color.electricBlueBadge), badge.background) + ColorUtils.colorIt(ContextCompat.getColor(context, R.color.backgroundInfo), badge.background) addView(badge) } } diff --git a/apps/student/src/main/java/com/instructure/student/activity/PandaAvatarActivity.kt b/apps/student/src/main/java/com/instructure/student/activity/PandaAvatarActivity.kt index 1aba1e9bdc..c755d7d236 100644 --- a/apps/student/src/main/java/com/instructure/student/activity/PandaAvatarActivity.kt +++ b/apps/student/src/main/java/com/instructure/student/activity/PandaAvatarActivity.kt @@ -159,7 +159,7 @@ class PandaAvatarActivity : ParentActivity() { } private fun setAsAvatar() { - val file = saveImageAsPNG(false, ContextCompat.getColor(this, R.color.canvasBackgroundMedium), false) ?: return + val file = saveImageAsPNG(false, ContextCompat.getColor(this, R.color.backgroundMedium), false) ?: return val data = Intent() data.putExtra(Const.PATH, file.path) data.putExtra(Const.SIZE, file.length()) diff --git a/apps/student/src/main/java/com/instructure/student/fragment/AccountPreferencesFragment.kt b/apps/student/src/main/java/com/instructure/student/fragment/AccountPreferencesFragment.kt index 3733a1e983..035fa1fc52 100644 --- a/apps/student/src/main/java/com/instructure/student/fragment/AccountPreferencesFragment.kt +++ b/apps/student/src/main/java/com/instructure/student/fragment/AccountPreferencesFragment.kt @@ -101,7 +101,7 @@ class AccountPreferencesFragment : ParentFragment() { override fun getView(position: Int, convertView: View?, parent: ViewGroup): View { val view: View = convertView ?: inflater.inflate(R.layout.settings_spinner, parent, false) view.indicator.setImageDrawable(ColorKeeper.getColoredDrawable(requireContext(), R.drawable.ic_expand, Color.WHITE)) - view.indicator.setColorFilter(ContextCompat.getColor(requireContext(), R.color.defaultTextGray)) + view.indicator.setColorFilter(ContextCompat.getColor(requireContext(), R.color.textDark)) view.title.text = getItem(position).toString() return view } diff --git a/apps/student/src/main/java/com/instructure/student/fragment/CalendarEventFragment.kt b/apps/student/src/main/java/com/instructure/student/fragment/CalendarEventFragment.kt index 8f21a1f48b..25a2ead04a 100644 --- a/apps/student/src/main/java/com/instructure/student/fragment/CalendarEventFragment.kt +++ b/apps/student/src/main/java/com/instructure/student/fragment/CalendarEventFragment.kt @@ -236,7 +236,7 @@ class CalendarEventFragment : ParentFragment() { private fun loadCalendarHtml(html: String, contentDescription: String?) { calendarEventWebView.setVisible() - calendarEventWebView.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.canvasBackgroundLight)) + calendarEventWebView.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.backgroundLightest)) calendarEventWebView.loadHtml(html, contentDescription) } diff --git a/apps/student/src/main/java/com/instructure/student/fragment/CreateAnnouncementFragment.kt b/apps/student/src/main/java/com/instructure/student/fragment/CreateAnnouncementFragment.kt index 724bae0739..1a36ecf5bf 100644 --- a/apps/student/src/main/java/com/instructure/student/fragment/CreateAnnouncementFragment.kt +++ b/apps/student/src/main/java/com/instructure/student/fragment/CreateAnnouncementFragment.kt @@ -188,7 +188,7 @@ class CreateAnnouncementFragment : ParentFragment() { ThemePrefs.brandColor, ThemePrefs.buttonColor ) // when the RCE editor has focus we want the label to be darker so it matches the title's functionality - announcementRCEView.setLabel(announcementDescLabel, R.color.defaultTextDark, R.color.defaultTextGray) + announcementRCEView.setLabel(announcementDescLabel, R.color.textDarkest, R.color.textDark) } private fun enableUsersMustPostSwitch(enabled: Boolean) { diff --git a/apps/student/src/main/java/com/instructure/student/fragment/CreateDiscussionFragment.kt b/apps/student/src/main/java/com/instructure/student/fragment/CreateDiscussionFragment.kt index 1f3e278110..711851bb25 100644 --- a/apps/student/src/main/java/com/instructure/student/fragment/CreateDiscussionFragment.kt +++ b/apps/student/src/main/java/com/instructure/student/fragment/CreateDiscussionFragment.kt @@ -190,7 +190,7 @@ class CreateDiscussionFragment : ParentFragment() { descriptionRCEView.actionUploadImageCallback = { MediaUploadUtils.showPickImageDialog(this) } // When the RCE editor has focus we want the label to be darker so it matches the title's functionality - descriptionRCEView.setLabel(discussionDescLabel, R.color.defaultTextDark, R.color.defaultTextGray) + descriptionRCEView.setLabel(discussionDescLabel, R.color.textDarkest, R.color.textDark) if (!hasLoadedDataForEdit) discussionTopicHeader?.let { editDiscussionName.setText(it.title) diff --git a/apps/student/src/main/java/com/instructure/student/fragment/DiscussionDetailsFragment.kt b/apps/student/src/main/java/com/instructure/student/fragment/DiscussionDetailsFragment.kt index 226ab62695..5ff16d82da 100644 --- a/apps/student/src/main/java/com/instructure/student/fragment/DiscussionDetailsFragment.kt +++ b/apps/student/src/main/java/com/instructure/student/fragment/DiscussionDetailsFragment.kt @@ -350,7 +350,7 @@ class DiscussionDetailsFragment : ParentFragment(), Bookmarkable { private fun updateDiscussionLikedState(discussionEntry: DiscussionEntry, methodName: String) { val likingSum = if (discussionEntry.ratingSum == 0) "" else "(${discussionEntry.ratingSum})" val likingSumAllyText = DiscussionEntryHtmlConverter.getLikeCountText(requireContext(), discussionEntry) - val likingColor = DiscussionUtils.getHexColorString(if (discussionEntry._hasRated) ThemePrefs.brandColor else ContextCompat.getColor(requireContext(), R.color.discussionLiking)) + val likingColor = DiscussionUtils.getHexColorString(if (discussionEntry._hasRated) ThemePrefs.brandColor else ContextCompat.getColor(requireContext(), R.color.textDark)) activity?.runOnUiThread { discussionRepliesWebView.loadUrl("javascript:$methodName('${discussionEntry.id}')") discussionRepliesWebView.loadUrl("javascript:updateLikedCount('${discussionEntry.id}','$likingSum','$likingColor','$likingSumAllyText')") diff --git a/apps/student/src/main/java/com/instructure/student/fragment/EditPageDetailsFragment.kt b/apps/student/src/main/java/com/instructure/student/fragment/EditPageDetailsFragment.kt index a46e95bbfd..0f5475ac47 100644 --- a/apps/student/src/main/java/com/instructure/student/fragment/EditPageDetailsFragment.kt +++ b/apps/student/src/main/java/com/instructure/student/fragment/EditPageDetailsFragment.kt @@ -123,7 +123,7 @@ class EditPageDetailsFragment : ParentFragment() { ThemePrefs.brandColor, ThemePrefs.buttonColor ) // when the RCE editor has focus we want the label to be darker so it matches the title's functionality - pageRCEView.setLabel(pageDescLabel, R.color.defaultTextDark, R.color.defaultTextGray) + pageRCEView.setLabel(pageDescLabel, R.color.textDarkest, R.color.textDark) } private fun savePage() { diff --git a/apps/student/src/main/java/com/instructure/student/fragment/GradesListFragment.kt b/apps/student/src/main/java/com/instructure/student/fragment/GradesListFragment.kt index 153557067a..bbdb70afd5 100644 --- a/apps/student/src/main/java/com/instructure/student/fragment/GradesListFragment.kt +++ b/apps/student/src/main/java/com/instructure/student/fragment/GradesListFragment.kt @@ -131,7 +131,7 @@ class GradesListFragment : ParentFragment(), Bookmarkable { private fun configureViews(rootView: View) { val appBarLayout = rootView.findViewById(R.id.appbar) - val lockDrawable = ColorKeeper.getColoredDrawable(requireContext(), R.drawable.ic_lock, ContextCompat.getColor(requireContext(), R.color.canvasTextDark)) + val lockDrawable = ColorKeeper.getColoredDrawable(requireContext(), R.drawable.ic_lock, ContextCompat.getColor(requireContext(), R.color.textDarkest)) lockedGradeImage.setImageDrawable(lockDrawable) setupListeners() diff --git a/apps/student/src/main/java/com/instructure/student/fragment/MasteryPathSelectionFragment.kt b/apps/student/src/main/java/com/instructure/student/fragment/MasteryPathSelectionFragment.kt index aa121dcb91..0cd580c0d1 100644 --- a/apps/student/src/main/java/com/instructure/student/fragment/MasteryPathSelectionFragment.kt +++ b/apps/student/src/main/java/com/instructure/student/fragment/MasteryPathSelectionFragment.kt @@ -143,7 +143,7 @@ class MasteryPathSelectionFragment : ParentFragment() { private fun setupTabLayoutColors() { val color = ColorKeeper.getOrGenerateColor(canvasContext) tabLayout.setBackgroundColor(color) - tabLayout.setTabTextColors(ContextCompat.getColor(requireContext(), R.color.glassWhite), Color.WHITE) + tabLayout.setTabTextColors(ContextCompat.getColor(requireContext(), R.color.transparentWhite), Color.WHITE) } //endregion diff --git a/apps/student/src/main/java/com/instructure/student/holders/CanvasContextViewHolder.kt b/apps/student/src/main/java/com/instructure/student/holders/CanvasContextViewHolder.kt index 8f8c272eda..b51c0df07a 100644 --- a/apps/student/src/main/java/com/instructure/student/holders/CanvasContextViewHolder.kt +++ b/apps/student/src/main/java/com/instructure/student/holders/CanvasContextViewHolder.kt @@ -37,10 +37,10 @@ class CanvasContextViewHolder(view: View) : RecyclerView.ViewHolder(view) { if (canvasContext.id == -1L) { // This is a header, so we want it a gray color title.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14f) - title.setTextColor(ContextCompat.getColor(context, R.color.defaultTextGray)) + title.setTextColor(ContextCompat.getColor(context, R.color.textDark)) } else { title.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16f) - title.setTextColor(ContextCompat.getColor(context, R.color.defaultTextDark)) + title.setTextColor(ContextCompat.getColor(context, R.color.textDarkest)) } onClick { diff --git a/apps/student/src/main/java/com/instructure/student/holders/DiscussionListHolder.kt b/apps/student/src/main/java/com/instructure/student/holders/DiscussionListHolder.kt index 0bc3a57a86..494dbc831a 100644 --- a/apps/student/src/main/java/com/instructure/student/holders/DiscussionListHolder.kt +++ b/apps/student/src/main/java/com/instructure/student/holders/DiscussionListHolder.kt @@ -73,7 +73,7 @@ class DiscussionListHolder(view: View) : RecyclerView.ViewHolder(view) { } if(discussionTopicHeader.lockedForUser) { - discussionIcon.setNestedIcon(R.drawable.ic_lock, ContextCompat.getColor(context, R.color.lockedDiscussionColor)) + discussionIcon.setNestedIcon(R.drawable.ic_lock, ContextCompat.getColor(context, R.color.textDark)) discussionIcon.setNestedIconContentDescription(context.getString(R.string.locked)) } else { discussionIcon.hideNestedIcon() diff --git a/apps/student/src/main/java/com/instructure/student/holders/GradeViewHolder.kt b/apps/student/src/main/java/com/instructure/student/holders/GradeViewHolder.kt index 1bd598ab01..96fb694e24 100644 --- a/apps/student/src/main/java/com/instructure/student/holders/GradeViewHolder.kt +++ b/apps/student/src/main/java/com/instructure/student/holders/GradeViewHolder.kt @@ -76,7 +76,7 @@ class GradeViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { // Configures whatIf editing boxes and listener for dialog edit.setVisible(isEdit) if (isEdit) { - edit.setImageDrawable(ColorKeeper.getColoredDrawable(context, R.drawable.ic_edit, ContextCompat.getColor(context, R.color.defaultTextDark))) + edit.setImageDrawable(ColorKeeper.getColoredDrawable(context, R.drawable.ic_edit, ContextCompat.getColor(context, R.color.textDarkest))) edit.setOnClickListener { whatIfDialogCallback.onClick(assignment, adapterPosition) } } @@ -89,11 +89,11 @@ class GradeViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { if (assignment.isMissing() && !isEdit && assignment.submission?.grade == null) { submissionState.text = context.getString(R.string.missingAssignment) - submissionState.setTextColor(ContextCompat.getColor(context, R.color.canvasRed)) + submissionState.setTextColor(ContextCompat.getColor(context, R.color.textDanger)) submissionState.setVisible() } else if (!assignment.isSubmitted && !isEdit) { submissionState.text = context.getString(R.string.notSubmitted) - submissionState.setTextColor(ContextCompat.getColor(context, R.color.defaultTextGray)) + submissionState.setTextColor(ContextCompat.getColor(context, R.color.textDark)) submissionState.setVisible() } else { submissionState.setGone() diff --git a/apps/student/src/main/java/com/instructure/student/holders/InboxViewHolder.kt b/apps/student/src/main/java/com/instructure/student/holders/InboxViewHolder.kt index f5f73ea8fb..631f14c7d0 100644 --- a/apps/student/src/main/java/com/instructure/student/holders/InboxViewHolder.kt +++ b/apps/student/src/main/java/com/instructure/student/holders/InboxViewHolder.kt @@ -43,7 +43,7 @@ class InboxViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { message.setVisible(message.text.isNotBlank()) if (conversation.hasAttachments() || conversation.hasMedia()) { - attachment.setImageDrawable(ColorUtils.colorIt(ContextCompat.getColor(context, R.color.canvasTextMedium), attachment.drawable)) + attachment.setImageDrawable(ColorUtils.colorIt(ContextCompat.getColor(context, R.color.textDark), attachment.drawable)) attachment.setVisible() } else { attachment.setGone() diff --git a/apps/student/src/main/java/com/instructure/student/holders/ModuleHeaderViewHolder.kt b/apps/student/src/main/java/com/instructure/student/holders/ModuleHeaderViewHolder.kt index 072e20808f..ad09eae5f0 100644 --- a/apps/student/src/main/java/com/instructure/student/holders/ModuleHeaderViewHolder.kt +++ b/apps/student/src/main/java/com/instructure/student/holders/ModuleHeaderViewHolder.kt @@ -43,7 +43,7 @@ class ModuleHeaderViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) isExpanded = expanded expandCollapse.rotation = if (isExpanded) 180f else 0f divider.setVisible(!isExpanded) - val color = ContextCompat.getColor(context, R.color.canvasTextMedium) + val color = ContextCompat.getColor(context, R.color.textDark) itemView.setOnClickListener { v -> viewHolderHeaderClicked.viewClicked(v, moduleObject) val animationType: Int diff --git a/apps/student/src/main/java/com/instructure/student/holders/ModuleViewHolder.kt b/apps/student/src/main/java/com/instructure/student/holders/ModuleViewHolder.kt index 802c58ad03..4ee969b14a 100644 --- a/apps/student/src/main/java/com/instructure/student/holders/ModuleViewHolder.kt +++ b/apps/student/src/main/java/com/instructure/student/holders/ModuleViewHolder.kt @@ -60,10 +60,10 @@ class ModuleViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { || ModuleItem.Type.ChooseAssignmentGroup.toString().equals(moduleItem.type, ignoreCase = true) ) { title.setTypeface(null, Typeface.ITALIC) - title.setTextColor(ContextCompat.getColor(context, R.color.secondaryText)) + title.setTextColor(ContextCompat.getColor(context, R.color.textDark)) } else { title.setTypeface(null, Typeface.NORMAL) - title.setTextColor(ContextCompat.getColor(context, R.color.primaryText)) + title.setTextColor(ContextCompat.getColor(context, R.color.textDarkest)) } // Description @@ -71,7 +71,7 @@ class ModuleViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { val requirement = moduleItem.completionRequirement!! val complete = requirement.completed description.setVisible() - description.setTextColor(ContextCompat.getColor(context, R.color.canvasTextMedium)) + description.setTextColor(ContextCompat.getColor(context, R.color.textDark)) val text: String? = when (ModuleObject.State.values().firstOrNull { it.apiString == requirement.type }) { ModuleObject.State.MustSubmit -> { if (complete) description.setTextColor(courseColor) diff --git a/apps/student/src/main/java/com/instructure/student/holders/NotificationViewHolder.kt b/apps/student/src/main/java/com/instructure/student/holders/NotificationViewHolder.kt index 04ac95e963..10c978c857 100644 --- a/apps/student/src/main/java/com/instructure/student/holders/NotificationViewHolder.kt +++ b/apps/student/src/main/java/com/instructure/student/holders/NotificationViewHolder.kt @@ -81,9 +81,9 @@ class NotificationViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) } if (item.isChecked) { - setBackgroundColor(ContextCompat.getColor(context, R.color.lightGray)) + setBackgroundColor(ContextCompat.getColor(context, R.color.backgroundMedium)) } else { - setBackgroundColor(ContextCompat.getColor(context, R.color.canvasBackgroundWhite)) + setBackgroundColor(ContextCompat.getColor(context, R.color.backgroundLightest)) } // Icon diff --git a/apps/student/src/main/java/com/instructure/student/holders/TodoViewHolder.kt b/apps/student/src/main/java/com/instructure/student/holders/TodoViewHolder.kt index 1a68e2db98..d63156f529 100644 --- a/apps/student/src/main/java/com/instructure/student/holders/TodoViewHolder.kt +++ b/apps/student/src/main/java/com/instructure/student/holders/TodoViewHolder.kt @@ -55,12 +55,12 @@ class TodoViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { } // Get courseColor - val courseColor = item.canvasContext?.color ?: ContextCompat.getColor(context, R.color.defaultPrimary) + val courseColor = item.canvasContext?.color ?: ContextCompat.getColor(context, R.color.textDarkest) if (item.isChecked) { - setBackgroundColor(ContextCompat.getColor(context, R.color.lightGray)) + setBackgroundColor(ContextCompat.getColor(context, R.color.backgroundMedium)) } else { - setBackgroundColor(ContextCompat.getColor(context, R.color.canvasBackgroundWhite)) + setBackgroundColor(ContextCompat.getColor(context, R.color.backgroundLightest)) } var todoDetails: String? = "" diff --git a/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/AssignmentDetailsPresenter.kt b/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/AssignmentDetailsPresenter.kt index 9f457ca93d..fef59aa445 100644 --- a/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/AssignmentDetailsPresenter.kt +++ b/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/AssignmentDetailsPresenter.kt @@ -87,7 +87,7 @@ object AssignmentDetailsPresenter : Presenter { var icon: Int - var color: Int = R.color.defaultActionColor + var color: Int = R.color.textInfo var canDelete = false return model.files.mapIndexed { index, file -> if (file.errorFlag && failedIcon != null) { icon = failedIcon - color = R.color.destructive + color = R.color.textDanger canDelete = deletableIfError } else { icon = FileUtils.getFileIcon(file.name ?: "", file.contentType ?: "") diff --git a/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/submission/file/ui/UploadStatusSubmissionView.kt b/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/submission/file/ui/UploadStatusSubmissionView.kt index 217b98014c..77d58a0164 100644 --- a/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/submission/file/ui/UploadStatusSubmissionView.kt +++ b/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/submission/file/ui/UploadStatusSubmissionView.kt @@ -148,8 +148,8 @@ class UploadStatusSubmissionView(inflater: LayoutInflater, parent: ViewGroup) : .setNegativeButton(R.string.no, null) .create() dialog?.setOnShowListener { - dialog?.getButton(AlertDialog.BUTTON_POSITIVE)?.setTextColor(ContextCompat.getColor(context, R.color.destructive)) - dialog?.getButton(AlertDialog.BUTTON_NEGATIVE)?.setTextColor(ContextCompat.getColor(context, R.color.gray)) + dialog?.getButton(AlertDialog.BUTTON_POSITIVE)?.setTextColor(ContextCompat.getColor(context, R.color.textDanger)) + dialog?.getButton(AlertDialog.BUTTON_NEGATIVE)?.setTextColor(ContextCompat.getColor(context, R.color.textDark)) } dialog?.setOnCancelListener { dialog = null diff --git a/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/submissionDetails/drawer/comments/ui/PendingCommentBinder.kt b/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/submissionDetails/drawer/comments/ui/PendingCommentBinder.kt index 1b9b7e3949..10fba7785b 100644 --- a/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/submissionDetails/drawer/comments/ui/PendingCommentBinder.kt +++ b/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/submissionDetails/drawer/comments/ui/PendingCommentBinder.kt @@ -84,7 +84,7 @@ class PendingCommentBinder : BasicItemBinder { - setCommentBubbleColor(ContextCompat.getColor(context, R.color.commentBubbleIncoming)) - ContextCompat.getColor(context, R.color.defaultTextDark) + setCommentBubbleColor(ContextCompat.getColor(context, R.color.backgroundLight)) + ContextCompat.getColor(context, R.color.textDarkest) } CommentDirection.OUTGOING -> { - setCommentBubbleColor(ContextCompat.getColor(context, R.color.commentBubbleOutgoing)) + setCommentBubbleColor(ContextCompat.getColor(context, R.color.backgroundInfo)) Color.WHITE } } diff --git a/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/submissionDetails/drawer/rubric/ui/CriterionRatingButton.kt b/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/submissionDetails/drawer/rubric/ui/CriterionRatingButton.kt index cb5fc483b1..24a3982367 100644 --- a/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/submissionDetails/drawer/rubric/ui/CriterionRatingButton.kt +++ b/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/submissionDetails/drawer/rubric/ui/CriterionRatingButton.kt @@ -66,7 +66,7 @@ class CriterionRatingButton(context: Context, data: RatingData, val tint: Int) : intArrayOf(android.R.attr.state_activated) to Color.WHITE, intArrayOf(android.R.attr.state_selected) to tint, intArrayOf(android.R.attr.state_pressed) to tint, - intArrayOf() to ContextCompat.getColor(context, R.color.defaultTextGray) + intArrayOf() to ContextCompat.getColor(context, R.color.textDark) ) ) @@ -139,7 +139,7 @@ class RatingButtonDrawable(context: Context, val tint: Int) : Drawable() { intArrayOf() to AnimState( padding = context.DP(2), backgroundColor = Color.TRANSPARENT, - strokeColor = ContextCompat.getColor(context, R.color.defaultTrackColor) + strokeColor = ContextCompat.getColor(context, R.color.backgroundMedium) ) ) diff --git a/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/submissionDetails/ui/SubmissionDetailsView.kt b/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/submissionDetails/ui/SubmissionDetailsView.kt index 825724e16d..2d7656a539 100644 --- a/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/submissionDetails/ui/SubmissionDetailsView.kt +++ b/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/submissionDetails/ui/SubmissionDetailsView.kt @@ -107,7 +107,7 @@ class SubmissionDetailsView( // Tint the tab with the course color val tint = canvasContext.color drawerTabLayout.setSelectedTabIndicatorColor(tint) - drawerTabLayout.setTabTextColors(ContextCompat.getColor(context, R.color.defaultTextDark), tint) + drawerTabLayout.setTabTextColors(ContextCompat.getColor(context, R.color.textDarkest), tint) // Use 90% luminance to ensure a 'light' ripple effect that doesn't overpower the tab text val rippleTint = tint.withLuminance(0.90f).asStateList() diff --git a/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/ui/gradeCell/DonutChartView.kt b/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/ui/gradeCell/DonutChartView.kt index 0eaece4041..0a601995d4 100644 --- a/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/ui/gradeCell/DonutChartView.kt +++ b/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/ui/gradeCell/DonutChartView.kt @@ -53,7 +53,7 @@ class DonutChartView(context: Context, attrs: AttributeSet) : View(context, attr /** The color of the background arc */ private val bgColor: Int = ContextCompat.getColor( context, - R.color.defaultThumbColor + R.color.textLight ) /** The animator used to animated the foreground arc from its current progress value to a new progress value. */ @@ -65,7 +65,7 @@ class DonutChartView(context: Context, attrs: AttributeSet) : View(context, attr progress = 0.65f color = ContextCompat.getColor( context, - R.color.canvasDefaultAccent + R.color.backgroundInfo ) } } diff --git a/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/ui/gradeCell/GradeCellViewState.kt b/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/ui/gradeCell/GradeCellViewState.kt index c4ca61c27f..a2dcbf71f3 100644 --- a/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/ui/gradeCell/GradeCellViewState.kt +++ b/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/ui/gradeCell/GradeCellViewState.kt @@ -107,7 +107,7 @@ sealed class GradeCellViewState { showCompleteIcon = isComplete, showIncompleteIcon = !isComplete, grade = context.getString(if (isComplete) R.string.gradeComplete else R.string.gradeIncomplete), - accentColor = if (isComplete) accentColor else ContextCompat.getColor(context, R.color.defaultTextGray), + accentColor = if (isComplete) accentColor else ContextCompat.getColor(context, R.color.textDark), outOf = outOfText, outOfContentDescription = outOfContentDescriptionText, graphPercent = 1.0f diff --git a/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/ui/gradeCell/GradeStatisticsView.kt b/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/ui/gradeCell/GradeStatisticsView.kt index 2346becf07..d50e5ff43e 100644 --- a/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/ui/gradeCell/GradeStatisticsView.kt +++ b/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/ui/gradeCell/GradeStatisticsView.kt @@ -25,7 +25,7 @@ class GradeStatisticsView(context: Context, attrs: AttributeSet) : View(context, strokeCap = Paint.Cap.ROUND isAntiAlias = true strokeWidth = context.DP(2) - color = ContextCompat.getColor(context, R.color.defaultTrackColor) + color = ContextCompat.getColor(context, R.color.backgroundMedium) } private val darkLinePaint: Paint = Paint(Paint.ANTI_ALIAS_FLAG).apply { @@ -33,7 +33,7 @@ class GradeStatisticsView(context: Context, attrs: AttributeSet) : View(context, strokeCap = Paint.Cap.ROUND isAntiAlias = true strokeWidth = context.DP(3) - color = ContextCompat.getColor(context, R.color.gray) + color = ContextCompat.getColor(context, R.color.textDark) } private val meanLinePaint: Paint = Paint(Paint.ANTI_ALIAS_FLAG).apply { @@ -41,11 +41,11 @@ class GradeStatisticsView(context: Context, attrs: AttributeSet) : View(context, strokeCap = Paint.Cap.ROUND isAntiAlias = true strokeWidth = context.DP(3) - color = ContextCompat.getColor(context, R.color.darkerGray) + color = ContextCompat.getColor(context, R.color.textDarkest) } private val circlePaint: Paint = Paint(Paint.ANTI_ALIAS_FLAG).apply { - color = ContextCompat.getColor(context, R.color.canvasDefaultAccent) + color = ContextCompat.getColor(context, R.color.backgroundInfo) style = Paint.Style.FILL } diff --git a/apps/student/src/main/java/com/instructure/student/mobius/conferences/conference_list/ConferenceListPresenter.kt b/apps/student/src/main/java/com/instructure/student/mobius/conferences/conference_list/ConferenceListPresenter.kt index b6f2fb868b..6dff778f60 100644 --- a/apps/student/src/main/java/com/instructure/student/mobius/conferences/conference_list/ConferenceListPresenter.kt +++ b/apps/student/src/main/java/com/instructure/student/mobius/conferences/conference_list/ConferenceListPresenter.kt @@ -104,16 +104,16 @@ object ConferenceListPresenter : Presenter { isJoinable = true label = context.getString(R.string.inProgress) - labelTint = ContextCompat.getColor(context, R.color.publishedGreen) + labelTint = ContextCompat.getColor(context, R.color.textSuccess) } else -> { label = context.getString(R.string.notStarted) - labelTint = ContextCompat.getColor(context, R.color.defaultTextGray) + labelTint = ContextCompat.getColor(context, R.color.textDark) } } diff --git a/apps/student/src/main/java/com/instructure/student/util/BaseAppManager.kt b/apps/student/src/main/java/com/instructure/student/util/BaseAppManager.kt index fbe973da56..002b8497b0 100644 --- a/apps/student/src/main/java/com/instructure/student/util/BaseAppManager.kt +++ b/apps/student/src/main/java/com/instructure/student/util/BaseAppManager.kt @@ -82,7 +82,7 @@ open class BaseAppManager : com.instructure.canvasapi2.AppManager(), AnalyticsEv FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true) } - ColorKeeper.defaultColor = ContextCompat.getColor(this, R.color.defaultPrimary) + ColorKeeper.defaultColor = ContextCompat.getColor(this, R.color.textDarkest) // There appears to be a bug when the user is installing/updating the android webview stuff. // http://code.google.com/p/android/issues/detail?id=175124 diff --git a/apps/student/src/main/java/com/instructure/student/view/AttachmentDogEarLayout.kt b/apps/student/src/main/java/com/instructure/student/view/AttachmentDogEarLayout.kt index 1abbcd0b97..ae0e03dd3f 100644 --- a/apps/student/src/main/java/com/instructure/student/view/AttachmentDogEarLayout.kt +++ b/apps/student/src/main/java/com/instructure/student/view/AttachmentDogEarLayout.kt @@ -39,7 +39,7 @@ class AttachmentDogEarLayout @JvmOverloads constructor( } private val dogEarPaint: Paint by lazy { - Paint(Paint.ANTI_ALIAS_FLAG).apply { color = ContextCompat.getColor(context, R.color.lightGray) } + Paint(Paint.ANTI_ALIAS_FLAG).apply { color = ContextCompat.getColor(context, R.color.backgroundMedium) } } private val dogEarShadowPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply { color = 0x33000000 } diff --git a/apps/student/src/main/java/com/instructure/student/widget/BaseRemoteViewsService.kt b/apps/student/src/main/java/com/instructure/student/widget/BaseRemoteViewsService.kt index 0ca81fdfe9..1863b747ee 100644 --- a/apps/student/src/main/java/com/instructure/student/widget/BaseRemoteViewsService.kt +++ b/apps/student/src/main/java/com/instructure/student/widget/BaseRemoteViewsService.kt @@ -32,7 +32,7 @@ abstract class BaseRemoteViewsService : RemoteViewsService() { fun getWidgetTextColor(widgetId: Int, context: Context): Int { val widgetBackgroundPref = getWidgetBackgroundPref(widgetId) return if (widgetBackgroundPref.equals(WidgetSetupActivity.WIDGET_BACKGROUND_COLOR_LIGHT, ignoreCase = true)) - ContextCompat.getColor(context, R.color.canvasTextDark) else ContextCompat.getColor(context, R.color.white) + ContextCompat.getColor(context, R.color.textDarkest) else ContextCompat.getColor(context, R.color.textLightest) } fun getWidgetBackgroundResourceId(widgetId: Int): Int { diff --git a/apps/student/src/main/java/com/instructure/student/widget/NotificationViewWidgetService.kt b/apps/student/src/main/java/com/instructure/student/widget/NotificationViewWidgetService.kt index 033dc29c81..6c63b27a39 100644 --- a/apps/student/src/main/java/com/instructure/student/widget/NotificationViewWidgetService.kt +++ b/apps/student/src/main/java/com/instructure/student/widget/NotificationViewWidgetService.kt @@ -82,7 +82,7 @@ class NotificationViewWidgetService : BaseRemoteViewsService(), Serializable { row.setInt(R.id.icon, "setColorFilter", color) } else { val color = if(streamItem.canvasContext != null) ColorKeeper.getOrGenerateColor(streamItem.canvasContext) - else ContextCompat.getColor(applicationContext, R.color.canvasRed) + else ContextCompat.getColor(applicationContext, R.color.textDanger) row.setInt(R.id.icon, "setColorFilter", color) } diff --git a/apps/student/src/main/java/com/instructure/student/widget/TodoViewWidgetService.kt b/apps/student/src/main/java/com/instructure/student/widget/TodoViewWidgetService.kt index e442ae0088..f15f4e0f1e 100644 --- a/apps/student/src/main/java/com/instructure/student/widget/TodoViewWidgetService.kt +++ b/apps/student/src/main/java/com/instructure/student/widget/TodoViewWidgetService.kt @@ -72,7 +72,7 @@ class TodoViewWidgetService : BaseRemoteViewsService(), Serializable { if (streamItem.canvasContext != null && streamItem.canvasContext!!.type != CanvasContext.Type.USER) { row.setInt(R.id.icon, "setColorFilter", ColorKeeper.getOrGenerateColor(streamItem.canvasContext)) } else { - row.setInt(R.id.icon, "setColorFilter", R.color.canvasRed) + row.setInt(R.id.icon, "setColorFilter", R.color.textDanger) } val appWidgetId = BaseRemoteViewsService.getAppWidgetId(intent) diff --git a/apps/student/src/main/res/drawable/bg_comment_attachment.xml b/apps/student/src/main/res/drawable/bg_comment_attachment.xml index ae81aa7482..e7e8ada3c6 100644 --- a/apps/student/src/main/res/drawable/bg_comment_attachment.xml +++ b/apps/student/src/main/res/drawable/bg_comment_attachment.xml @@ -29,7 +29,7 @@ - + diff --git a/apps/student/src/main/res/drawable/divider.xml b/apps/student/src/main/res/drawable/divider.xml index e18caf1939..cbe8447dd4 100644 --- a/apps/student/src/main/res/drawable/divider.xml +++ b/apps/student/src/main/res/drawable/divider.xml @@ -16,5 +16,5 @@ --> - + diff --git a/apps/student/src/main/res/drawable/favoriting_icon_background.xml b/apps/student/src/main/res/drawable/favoriting_icon_background.xml index 3a59ed57c2..9d476dd50b 100644 --- a/apps/student/src/main/res/drawable/favoriting_icon_background.xml +++ b/apps/student/src/main/res/drawable/favoriting_icon_background.xml @@ -18,6 +18,6 @@ - + \ No newline at end of file diff --git a/apps/student/src/main/res/drawable/grade_background.xml b/apps/student/src/main/res/drawable/grade_background.xml index 9c04b03d7f..6d1e5721f7 100644 --- a/apps/student/src/main/res/drawable/grade_background.xml +++ b/apps/student/src/main/res/drawable/grade_background.xml @@ -18,7 +18,7 @@ - + \ No newline at end of file diff --git a/apps/student/src/main/res/drawable/ic_circle.xml b/apps/student/src/main/res/drawable/ic_circle.xml index 999d04d385..219dc59fdf 100644 --- a/apps/student/src/main/res/drawable/ic_circle.xml +++ b/apps/student/src/main/res/drawable/ic_circle.xml @@ -17,6 +17,6 @@ - + diff --git a/apps/student/src/main/res/drawable/item_decorator_gray.xml b/apps/student/src/main/res/drawable/item_decorator_gray.xml index f5c2c27659..c4d1f10d9f 100644 --- a/apps/student/src/main/res/drawable/item_decorator_gray.xml +++ b/apps/student/src/main/res/drawable/item_decorator_gray.xml @@ -17,5 +17,5 @@ - + diff --git a/apps/student/src/main/res/drawable/line_divider.xml b/apps/student/src/main/res/drawable/line_divider.xml index e4ec0780e3..4728c4ff12 100644 --- a/apps/student/src/main/res/drawable/line_divider.xml +++ b/apps/student/src/main/res/drawable/line_divider.xml @@ -23,6 +23,6 @@ android:width="1dp" android:height=".5dp" /> - + \ No newline at end of file diff --git a/apps/student/src/main/res/drawable/listview_states.xml b/apps/student/src/main/res/drawable/listview_states.xml index 972a319b53..b35261769c 100644 --- a/apps/student/src/main/res/drawable/listview_states.xml +++ b/apps/student/src/main/res/drawable/listview_states.xml @@ -19,12 +19,12 @@ + android:drawable="@color/backgroundMedium"/> + android:drawable="@color/transparent"/> - + \ No newline at end of file diff --git a/apps/student/src/main/res/drawable/rounded_corner_tiara_bg.xml b/apps/student/src/main/res/drawable/rounded_corner_tiara_bg.xml index ea3ad5e7bd..7dd49c5522 100644 --- a/apps/student/src/main/res/drawable/rounded_corner_tiara_bg.xml +++ b/apps/student/src/main/res/drawable/rounded_corner_tiara_bg.xml @@ -21,7 +21,7 @@ android:shape="rectangle"> + android:color="@color/backgroundLightest" > + android:color="@color/backgroundLightest" > + android:drawable="@color/backgroundMedium" /> + android:drawable="@color/backgroundLightest" /> \ No newline at end of file diff --git a/apps/student/src/main/res/drawable/status_indicator_blue.xml b/apps/student/src/main/res/drawable/status_indicator_blue.xml index 22714ef204..dde03e4013 100644 --- a/apps/student/src/main/res/drawable/status_indicator_blue.xml +++ b/apps/student/src/main/res/drawable/status_indicator_blue.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/apps/student/src/main/res/drawable/widget_dark_bg.xml b/apps/student/src/main/res/drawable/widget_dark_bg.xml index 4a605978e8..35b1292a2e 100644 --- a/apps/student/src/main/res/drawable/widget_dark_bg.xml +++ b/apps/student/src/main/res/drawable/widget_dark_bg.xml @@ -18,7 +18,7 @@ - + - + diff --git a/apps/student/src/main/res/layout-sw720dp/fragment_elementary_course.xml b/apps/student/src/main/res/layout-sw720dp/fragment_elementary_course.xml index bb96ab95bc..997415dc81 100644 --- a/apps/student/src/main/res/layout-sw720dp/fragment_elementary_course.xml +++ b/apps/student/src/main/res/layout-sw720dp/fragment_elementary_course.xml @@ -36,7 +36,7 @@ android:id="@+id/elementaryCoursePage" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/white"> + android:background="@color/backgroundLightest"> @@ -56,29 +56,29 @@ android:id="@+id/courseTabLayout" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@color/white" + android:background="@color/backgroundLightest" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/toolbar" app:tabContentStart="16dp" app:tabIconTint="@color/tab_layout_icon_tint" app:tabIndicator="@drawable/tab_bar_indicator" - app:tabIndicatorColor="@color/blueAnnotation" + app:tabIndicatorColor="@color/textInfo" app:tabIndicatorFullWidth="false" app:tabIndicatorHeight="3dp" app:tabInlineLabel="true" app:tabMode="scrollable" app:tabPaddingEnd="12dp" app:tabPaddingStart="8dp" - app:tabSelectedTextColor="@color/blueAnnotation" + app:tabSelectedTextColor="@color/textInfo" app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget" - app:tabTextColor="@color/defaultTextDark" + app:tabTextColor="@color/textDarkest" app:tabs="@{viewModel.data.tabs}" /> + tools:background="@color/backgroundWarning" /> @@ -58,23 +58,23 @@ android:id="@+id/dashboardTabLayout" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@color/white" + android:background="@color/backgroundLightest" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/toolbar" app:tabContentStart="8dp" app:tabIconTint="@color/tab_layout_icon_tint" app:tabIndicator="@drawable/tab_bar_indicator" - app:tabIndicatorColor="@color/blueAnnotation" + app:tabIndicatorColor="@color/textInfo" app:tabIndicatorFullWidth="false" app:tabIndicatorHeight="3dp" app:tabInlineLabel="true" app:tabMode="scrollable" app:tabPaddingEnd="12dp" app:tabPaddingStart="8dp" - app:tabSelectedTextColor="@color/blueAnnotation" + app:tabSelectedTextColor="@color/textInfo" app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget" - app:tabTextColor="@color/defaultTextDark"> + app:tabTextColor="@color/textDarkest"> + app:titleTextColor="@color/textDarkest"> @@ -64,7 +64,7 @@ android:id="@+id/imageView" android:layout_width="0dp" android:layout_height="0dp" - android:background="@color/canvasBackgroundMedium" + android:background="@color/backgroundMedium" app:bitmap="@{viewModel.data.selectedBitmap}" app:layout_constraintBottom_toTopOf="@+id/filters" app:layout_constraintEnd_toEndOf="parent" @@ -75,7 +75,7 @@ android:id="@+id/filters" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/white" + android:background="@color/backgroundLightest" android:orientation="horizontal" app:itemViewModels="@{viewModel.data.filterItemViewModels}" app:layout_constraintBottom_toBottomOf="parent" /> diff --git a/apps/student/src/main/res/layout/activity_navigation.xml b/apps/student/src/main/res/layout/activity_navigation.xml index 6423d17983..d5946e1ec2 100644 --- a/apps/student/src/main/res/layout/activity_navigation.xml +++ b/apps/student/src/main/res/layout/activity_navigation.xml @@ -21,7 +21,7 @@ android:id="@+id/drawerLayout" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/canvasBackgroundWhite"> + android:background="@color/backgroundLightest"> diff --git a/apps/student/src/main/res/layout/activity_settings.xml b/apps/student/src/main/res/layout/activity_settings.xml index 7fb4e6b362..0a10a2ed51 100644 --- a/apps/student/src/main/res/layout/activity_settings.xml +++ b/apps/student/src/main/res/layout/activity_settings.xml @@ -19,7 +19,7 @@ android:id="@+id/fragmentContainer" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/canvasBackgroundWhite"> + android:background="@color/backgroundLightest"> + android:background="@color/backgroundLightest"> @@ -63,7 +63,7 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/light" - android:textColor="@color/black" /> + android:textColor="@color/textDarkest" /> @@ -73,7 +73,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:foreground="?android:attr/selectableItemBackground" - app:cardBackgroundColor="@color/widgetDarkColor" + app:cardBackgroundColor="@color/backgroundDarkest" app:cardElevation="8dp" app:cardUseCompatPadding="true" app:contentPadding="8dp"> @@ -83,7 +83,7 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/dark" - android:textColor="@color/widgetLightColor" /> + android:textColor="@color/backgroundLightest" /> @@ -95,7 +95,7 @@ android:layout_height="wrap_content" android:checked="false" android:text="@string/widgetMinimumStyle" - app:backgroundTint="@color/widgetDarkColor" /> + app:backgroundTint="@color/backgroundDarkest" /> diff --git a/apps/student/src/main/res/layout/adapter_conference_header.xml b/apps/student/src/main/res/layout/adapter_conference_header.xml index db54bf374e..1b3e831814 100644 --- a/apps/student/src/main/res/layout/adapter_conference_header.xml +++ b/apps/student/src/main/res/layout/adapter_conference_header.xml @@ -30,7 +30,7 @@ android:ellipsize="end" android:maxLines="2" android:textSize="12sp" - android:textColor="@color/defaultTextGray" + android:textColor="@color/textDark" tools:text="New Conferences" /> diff --git a/apps/student/src/main/res/layout/adapter_conference_item.xml b/apps/student/src/main/res/layout/adapter_conference_item.xml index efe5d03b74..1f60cadb02 100644 --- a/apps/student/src/main/res/layout/adapter_conference_item.xml +++ b/apps/student/src/main/res/layout/adapter_conference_item.xml @@ -50,7 +50,7 @@ style="@style/TextFont.Regular" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textColor="@color/defaultTextGray" + android:textColor="@color/textDark" tools:text="Not Started" /> diff --git a/apps/student/src/main/res/layout/adapter_conference_list_empty.xml b/apps/student/src/main/res/layout/adapter_conference_list_empty.xml index f8bb3b74d0..187078251f 100644 --- a/apps/student/src/main/res/layout/adapter_conference_list_empty.xml +++ b/apps/student/src/main/res/layout/adapter_conference_list_empty.xml @@ -37,7 +37,7 @@ android:layout_marginTop="32dp" android:gravity="center" android:text="@string/noConferencesTitle" - android:textColor="@color/defaultTextDark" + android:textColor="@color/textDarkest" android:textSize="20sp" android:textStyle="bold"/> @@ -48,7 +48,7 @@ android:layout_marginTop="8dp" android:gravity="center" android:text="@string/noConferencesMessage" - android:textColor="@color/defaultTextGray" + android:textColor="@color/textDark" android:textSize="16sp"/> diff --git a/apps/student/src/main/res/layout/adapter_conference_list_error.xml b/apps/student/src/main/res/layout/adapter_conference_list_error.xml index 83af673105..b9e4327bb1 100644 --- a/apps/student/src/main/res/layout/adapter_conference_list_error.xml +++ b/apps/student/src/main/res/layout/adapter_conference_list_error.xml @@ -27,7 +27,7 @@ android:layout_gravity="center_horizontal" android:importantForAccessibility="no" android:src="@drawable/ic_warning" - android:tint="@color/alertRed" /> + android:tint="@color/textDanger" />