Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add scroll position saving #2019

Merged
merged 12 commits into from
Sep 25, 2024

Conversation

tkiyohar
Copy link
Contributor

@tkiyohar tkiyohar commented Feb 5, 2024

Summary

-- Reimplementation of previous PR that was wrongly repealed: "Add scroll position saving #1935" --
-- Additionally includes some code changes and improvements to the original scroll position saving code --
Adds scroll position saving to the Home and Notifications app screens, fixes resizing error with home screen web cards (needed for scroll position saving), and adds loading screens to home screen web cards (prevents content flickering + looks much nice with scroll position saving).

Changelog

[General] [Add] - Adds scroll position saving to home and notifications pages (also includes code from Gradle update PR: "Update Gradle Version and Settings #2017")

Test Plan

Test the home page and notifications page for any bugs and to see if their scroll position is maintained when switching between screens using the bottom nav bar after messing around on either screen (e.g., hiding or unhiding cards on the home screen from either the home screen itself or the profile screen, toggling "I'm going" on certain free food events, etc).

Also test logging in and out of student, guest and employee accounts to make sure the scroll position on both the home and notifications pages are reset when logging in/out of an account.

If this PR is successful, the scroll position should be seamlessly saved on the notifications and home screens without any jumpy behavior when reloading these screens. Additionally, web cards (e.g., "Campus Information" and "Health & Well-being" cards) should now display a loading screen while their contents are loading in. No other behavior of the app should be affected.

@@ -16,6 +17,8 @@ import 'package:pointycastle/asymmetric/api.dart';
import 'package:pointycastle/asymmetric/oaep.dart';
import 'package:pointycastle/pointycastle.dart' as pc;

import '../../ui/home/home.dart';
Copy link
Contributor

Choose a reason for hiding this comment

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

TODO (later): Refactor scroll controller reset methods to campus mobile core

@@ -335,6 +336,10 @@ class CardsDataProvider extends ChangeNotifier {
}

void toggleCard(String card) {
debugPrint("THIS IS THE CURRENT CARD BEING TOGGLED: " + card);
if ((card == "student_health_wellbeing" || card == "student_info" || card == "campus_info") && _cardStates![card]!) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Explore dynamically applying resetCardHeight

Copy link
Contributor

@c3bryant c3bryant left a comment

Choose a reason for hiding this comment

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

Explore dynamically applying resetCardHeight in cards provider

Copy link
Contributor

@morebytes morebytes left a comment

Choose a reason for hiding this comment

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

Looks good, fully tested

@morebytes morebytes assigned tkiyohar and unassigned tkiyohar Sep 25, 2024
@morebytes morebytes merged commit 000cb74 into UCSD:experimental Sep 25, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: On Experimental Branch
Development

Successfully merging this pull request may close these issues.

3 participants