Light mode fixes#26
Conversation
Update agp version in gradle/libs.versions.toml from 9.0.1 to 9.1.0 to adopt the newer Android Gradle Plugin release. Keeps build tooling up-to-date and includes upstream fixes and improvements.
…d a notification system.
Trosper3
left a comment
There was a problem hiding this comment.
Light / dark mode selection is cool. Nice work.
There was a problem hiding this comment.
Pull request overview
Updates UI resources and Home/Schedule logic to better support light mode, while also expanding Home settings (theme selection, greeting/login) and enhancing Schedule list interactions.
Changes:
- Switched multiple layouts from hardcoded dark colors to theme-derived background/text colors for light mode support.
- Moved Home header/login/settings behavior from
MainActivityintoHomeFragment, including theme selection and Canvas sync entry points. - Refactored Schedule list handling (pending vs completed sections) and improved swipe-to-delete visuals.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/res/values/strings.xml | Adds a new string resource used by Video Lectures UI. |
| app/src/main/res/layout/item_saved_pdf.xml | Uses theme-based background/text colors for PDF list items. |
| app/src/main/res/layout/item_assignment.xml | Uses theme-based background/text colors for assignment cards. |
| app/src/main/res/layout/fragment_schedule.xml | Moves Schedule fragment to theme-based background/text colors. |
| app/src/main/res/layout/fragment_home.xml | Adds Home header/login/settings UI and theme-based colors. |
| app/src/main/res/layout/activity_video_lecture.xml | Uses theme-based colors and string resource for URL hint. |
| app/src/main/res/layout/activity_schedule.xml | Updates Schedule activity styling and structure for two lists. |
| app/src/main/res/layout/activity_pdf_hub.xml | Sets activity background to theme-derived background. |
| app/src/main/res/layout/activity_main.xml | Simplifies container view and applies theme-derived background. |
| app/src/main/res/layout/activity_campus_map.xml | Sets activity background to theme-derived background. |
| app/src/main/java/com/example/studentproductivityapp/features/home/MainActivity.kt | Removes Home header/settings logic from activity; adds light status-bar icon handling. |
| app/src/main/java/com/example/studentproductivityapp/features/home/HomeFragment.kt | Implements header/login/settings dialog, theme selection, Canvas sync, and quick views. |
| app/src/main/java/com/example/studentproductivityapp/features/assignments/database/AssignmentRepository.kt | Minor formatting cleanup. |
| app/src/main/java/com/example/studentproductivityapp/ScheduleActivity.kt | Splits pending/completed adapters and custom swipe-to-delete drawing. |
| app/src/main/java/com/example/studentproductivityapp/CanvasAPI.kt | Adds a Canvas Retrofit client/models (currently duplicated elsewhere). |
| .idea/planningMode.xml | Adds IDE planning state file. |
Files not reviewed (1)
- .idea/planningMode.xml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| android:layout_height="wrap_content" | ||
| android:text="Pending Tasks" | ||
| android:textColor="@color/white" | ||
| android:textColor="?android:textColorPrimary" | ||
| android:textSize="18sp" |
There was a problem hiding this comment.
android:textColor is referencing ?android:textColorPrimary (missing attr/), which will fail resource linking. Use ?android:attr/textColorPrimary / ?attr/textColorPrimary.
| android:layout_height="wrap_content" | ||
| android:layout_margin="12dp" | ||
| android:text="Completed Tasks" | ||
| android:textColor="@color/isu_gray" | ||
| android:textColor="@color/white" | ||
| android:textSize="18sp" |
There was a problem hiding this comment.
In light mode this header text is forced to @color/white while the screen background is ?android:attr/colorBackground, which can make the title unreadable. Use a theme-derived color (e.g., ?attr/textColorPrimary).
| private lateinit var viewModel: AssignmentViewModel | ||
| private var _view: View? = null | ||
|
|
||
| override fun onCreateView( |
There was a problem hiding this comment.
The fragment stores the inflated view in _view, but there’s no corresponding cleanup. Add onDestroyView() to set _view = null to avoid leaking the view hierarchy.
|
|
||
| <ImageButton | ||
| android:id="@+id/btnLogin" | ||
| android:contentDescription="Login" |
There was a problem hiding this comment.
btnLogin’s contentDescription is hardcoded. For localization and accessibility, move it into strings.xml and reference it via @string/....
| android:contentDescription="Login" | |
| android:contentDescription="@string/login" |
| val itemView = viewHolder.itemView | ||
| val background = android.graphics.drawable.ColorDrawable(android.graphics.Color.parseColor("#EF5350")) // Material Red | ||
|
|
There was a problem hiding this comment.
onChildDraw allocates a new ColorDrawable and parses the color on every draw call, which can cause jank during swipes. Create and reuse the drawable/color outside the callback (e.g., as a property) instead of allocating per-frame.
| android:layout_height="wrap_content" | ||
| android:text="Completed Tasks" | ||
| android:textColor="@color/isu_gray" | ||
| android:textColor="?android:textColorPrimary" | ||
| android:textSize="18sp" | ||
| android:textStyle="bold" |
There was a problem hiding this comment.
android:textColor is referencing ?android:textColorPrimary (missing attr/), which will fail resource linking. Use ?android:attr/textColorPrimary / ?attr/textColorPrimary.
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project version="4"> | ||
| <component name="PlanningModeManager"> | ||
| <option name="approvalStates"> | ||
| <map> | ||
| <entry key="20260429-230545-8911ad2b-5419-49bd-ab3c-14b52c8c0972" value="true" /> | ||
| </map> | ||
| </option> | ||
| </component> | ||
| </project> No newline at end of file |
There was a problem hiding this comment.
This .idea planning mode file is IDE/user-specific state and shouldn’t be committed. Remove it from the repo and add an ignore rule to prevent it from being re-added.
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project version="4"> | |
| <component name="PlanningModeManager"> | |
| <option name="approvalStates"> | |
| <map> | |
| <entry key="20260429-230545-8911ad2b-5419-49bd-ab3c-14b52c8c0972" value="true" /> | |
| </map> | |
| </option> | |
| </component> | |
| </project> |
| import android.content.Intent | ||
| import android.os.Bundle | ||
| import android.widget.Button | ||
| import android.widget.TextView |
There was a problem hiding this comment.
Unused import: android.widget.Button is added but not referenced. Please remove to keep imports clean.
| import android.widget.TextView |
|
|
||
| <ImageButton | ||
| android:id="@+id/btnSettings" | ||
| android:contentDescription="Settings" |
There was a problem hiding this comment.
btnSettings’s contentDescription is hardcoded. For localization/accessibility, move it into strings.xml and reference it via @string/....
| android:contentDescription="Settings" | |
| android:contentDescription="@string/settings" |
| ) { | ||
| super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | ||
|
|
||
| val itemView = viewHolder.itemView | ||
| val background = android.graphics.drawable.ColorDrawable(android.graphics.Color.parseColor("#EF5350")) // Material Red |
There was a problem hiding this comment.
super.onChildDraw(...) is called before drawing the swipe background. That can paint the red background over the item content; draw the background first (or use ItemTouchHelper’s default UI util / a decorator) so the item remains visible while swiping.
This pull request introduces several new features and improvements, most notably adding Canvas LMS integration for assignment import, enhancing user settings, and improving the user interface and experience in both the Home and Schedule screens. The major themes are Canvas API integration, user personalization, UI/UX improvements, and code organization.
Canvas LMS Integration and Assignment Sync:
CanvasAPI.kt, implementing a Retrofit client and data models to fetch the user's Canvas "to-do" assignments from Idaho State University's Canvas instance. This enables importing assignments directly into the app.HomeFragment, added UI and logic to allow users to enter their Canvas personal access token in the settings dialog and trigger assignment sync. Synced assignments are inserted into the local database and notifications are scheduled for them. [1] [2]User Personalization and Settings:
HomeFragmentto allow changing the display name, selecting app theme (system, light, dark), and entering a Canvas token for assignment sync. Greeting text and login/logout button update dynamically based on user state. [1] [2]UI/UX Improvements in Schedule and Home Screens:
ScheduleActivityto use two separate RecyclerViews and adapters for pending and completed assignments, with improved swipe-to-delete functionality featuring a red background. Added clear comments and better organization. [1] [2] [3] [4] [5]Code Organization and Cleanup:
MainActivity, moving feature-specific logic (e.g., Canvas sync, notification helpers) out of the activity and into appropriate fragments.AssignmentRepositoryto ensure correct structure.Project Configuration:
.idea/planningMode.xmlfor IDE-specific project planning state.