Skip to content

Light mode fixes#26

Merged
Trosper3 merged 8 commits into
mainfrom
light-mode-fixes
Apr 30, 2026
Merged

Light mode fixes#26
Trosper3 merged 8 commits into
mainfrom
light-mode-fixes

Conversation

@jerrya-code

Copy link
Copy Markdown
Collaborator

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:

  • Added 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.
  • In 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:

  • Enhanced the settings dialog in HomeFragment to 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]
  • Added notification permission request for Android 13+ to support assignment reminders.

UI/UX Improvements in Schedule and Home Screens:

  • Refactored ScheduleActivity to 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]
  • Improved Home screen to show a personalized greeting, today's date, and quick views for assignments and recent scans. [1] [2]

Code Organization and Cleanup:

  • Removed unused imports and code from MainActivity, moving feature-specific logic (e.g., Canvas sync, notification helpers) out of the activity and into appropriate fragments.
  • Minor cleanup in AssignmentRepository to ensure correct structure.

Project Configuration:

  • Added .idea/planningMode.xml for IDE-specific project planning state.

Trosper3 and others added 8 commits April 9, 2026 08:44
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.
Copilot AI review requested due to automatic review settings April 30, 2026 05:37

@Trosper3 Trosper3 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Light / dark mode selection is cool. Nice work.

@Trosper3 Trosper3 merged commit f81f2c1 into main Apr 30, 2026
3 checks passed
@Trosper3 Trosper3 deleted the light-mode-fixes branch April 30, 2026 05:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 MainActivity into HomeFragment, 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.

Comment on lines 50 to 53
android:layout_height="wrap_content"
android:text="Pending Tasks"
android:textColor="@color/white"
android:textColor="?android:textColorPrimary"
android:textSize="18sp"

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

android:textColor is referencing ?android:textColorPrimary (missing attr/), which will fail resource linking. Use ?android:attr/textColorPrimary / ?attr/textColorPrimary.

Copilot uses AI. Check for mistakes.
Comment on lines 80 to 84
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"

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment on lines 49 to 52
private lateinit var viewModel: AssignmentViewModel
private var _view: View? = null

override fun onCreateView(

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.

<ImageButton
android:id="@+id/btnLogin"
android:contentDescription="Login"

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btnLogin’s contentDescription is hardcoded. For localization and accessibility, move it into strings.xml and reference it via @string/....

Suggested change
android:contentDescription="Login"
android:contentDescription="@string/login"

Copilot uses AI. Check for mistakes.
Comment on lines +84 to +86
val itemView = viewHolder.itemView
val background = android.graphics.drawable.ColorDrawable(android.graphics.Color.parseColor("#EF5350")) // Material Red

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines 76 to 80
android:layout_height="wrap_content"
android:text="Completed Tasks"
android:textColor="@color/isu_gray"
android:textColor="?android:textColorPrimary"
android:textSize="18sp"
android:textStyle="bold"

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

android:textColor is referencing ?android:textColorPrimary (missing attr/), which will fail resource linking. Use ?android:attr/textColorPrimary / ?attr/textColorPrimary.

Copilot uses AI. Check for mistakes.
Comment thread .idea/planningMode.xml
Comment on lines +1 to +10
<?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

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<?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>

Copilot uses AI. Check for mistakes.
import android.content.Intent
import android.os.Bundle
import android.widget.Button
import android.widget.TextView

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import: android.widget.Button is added but not referenced. Please remove to keep imports clean.

Suggested change
import android.widget.TextView

Copilot uses AI. Check for mistakes.

<ImageButton
android:id="@+id/btnSettings"
android:contentDescription="Settings"

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btnSettings’s contentDescription is hardcoded. For localization/accessibility, move it into strings.xml and reference it via @string/....

Suggested change
android:contentDescription="Settings"
android:contentDescription="@string/settings"

Copilot uses AI. Check for mistakes.
Comment on lines +81 to +85
) {
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

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants