Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@nackko
Copy link
Owner

@nackko nackko commented Sep 13, 2020

Summary:

This is a big one.
This PR contains changes to get to Android alpha. Mainly consist in the first somewhat complete UX/UI.
Also some major updates like switching to Kotlin 1.4 and updating all libraries versions as well as targeting Android API level 29.
Connecting to cozy (login) activates physical activity tracking and optional user controlled geotrac(k)ing. Disconnecting from Cozy (logout) stops all trac(k)ing.
Geotrac(k)ing status is displayed both in text form in a permanent notification as well as in the app interface itself.

Login flow

Runtime Permissions (app start for now)

User controls for activity geotrac(k)ing automatic activation

Notification

View cloud folder content and logout

Please make sure these boxes are checked before submitting your pull request - thanks!

- [ ] Run the unit tests with gradle test to make sure you didn't break anything

  • Format the title like "Fix #<issue_number> - " (for example - "Fix #1111 - Check for null value before using field")
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

ElectricMammal and others added 30 commits August 26, 2020 18:42
- lock screen orientation to portrait
- rework drivesetup fragment layout
  - use https://material.io/develop/android/components/text-fields for stack input
- add roboto font
- initialize login status from cache in start fragment model init
- navigate to new HerdrFragment if cache initialization was successful
- add HerdrFragment model
- setup remote directory in HerdrFragment model (instead of temporary in DriveLogin model)
- add user activity icons and highlight current user activity
- add drive edit feature
  - add button to HerdrFragment
  - add related views to display drive info tp HerdrFragment
  - add DriveEditFragment and viewmodel
- alter navigation to handle editing drive as well as log out
- add location tracking switches for each user activity
- add recording icons for each user activity
- clean up DriveLoginViewModel
- navigate to HerdrFragment when logged in
- move logout feature to driveEditViewModel
- navigate to StartFragment on logout
Common
- extend UserActivityTracking repo
  - add a way to set and save in SecureDateStore the desired tracking setting
  - add a way to observe said tracking status
  - load from SecureDataStore on repo construction
- add use cases to expose new feature
  - a use case to update the desired tracking setting
  - a use case to observe the setting

Android
- implement observer updating UI status
- implement updating desired tracking status when user taps UI
- add persisting code for run, bike and vehicle user activities
- add observing code for run, bike and vehicle user activity

- some indentation fight in xml layout
  - also some cosmetic adjustments
- extend headless repo to provide a way to know user activities geo tracking setting
- implement use case calling new repo feature
- update transitionRecognitionIntentService
  - retrieve user settings instead of hard coded values
  - start/stop trac(k)ing after retrieving the value through use case
- deactivate switch for current user activity
- implement TouchLab Koin workaround from KaMPKit
- fix deprecated serialization code
- accessing moko liveData in model from xml layout broke
  - implement workaround by observing data in fragment (the old way)
- cut login flow screens out on login
- cut start fragment when launched while logged in
- cut navigate back to herdr fragment after logging out
…ew-login-ui

� Conflicts:
�	app/src/main/res/navigation/navigation.xml
- Convert fragment_herdr constraint layout to motion layout
- Add motion scene xml resource
  - Define KeyTimeCycle for blinking animation
  - Set visibility mode to ignore to control visibility in HerdrFragment
- Add visibility control to HerdrFragment dependent on switch state
- Add imageViews for alternative icons in fragment_herdr
- Control visibility of icons when switch is off in HerdrFragment
- Add color resource for disabled icon color
- Convert all switches to material version
- Remove top margins for switches to maintain alignment
- Commit colors that were forgotten in last commit
- Fix fragment_herdr_scene to include start constraints for disabled icons
Common
- add dependency on newly added Kotlin Date&Time library
- add timer class interface definition
- add SecureDataStore Long and Boolean types save and retrieval
- log timestamp of User Activity changes
- make current User Activity observable
- HerdrFragmentViewModel
  - expose strings for UI display in Fragment
  - use Timer to recompute all strings periodically

Android
- add Timer implementation
- add SecureDataStore implementation to store and retrieve
  - Long
  - Boolean

iOS
- add Timer implementation
…ew-login-ui

� Conflicts:
�	app/src/main/res/layout/fragment_herdr.xml
- expose folder name and base url in viewmodel
  - both taken from folder setup server reply
- extend headless repo to have a way to check for login status
- add use case to check for login status
- bootreceiver launches foreground service if use case response data is true
- add runtime permission request for physical activity on devices running 29+
  - see: https://developers.google.com/codelabs/while-in-use-location#4
- describe current detected physical activity as notification title
- describe current geolocation tracking status as notification text (subtitle)
(probably a timing issue, when fragment view is created, MaterialSwitch is not checked, only later when securedatastore deserialization happens)

- adjust icons visibility
  - when observing willTrack change to true
  - if disabled icon is visible
    - make it invisible
    - make animated blink recording icon visible
- update layout so that transition from herdrFragment is seamless
- pass data through when navigating via Bundle
  - stack url
  - folder name
  - folder id
- rework logout button to make it a themed floating action button
- add themed floating action button to view cloud folder content in a CustomTab
  - folder url computation is quite cozy cloud specific
See: https://github.com/f8full/findmybikes/blob/be3e9504d2441e0c0a661bee88bf6ca7276d2c14/app/src/main/java/com/ludoscity/findmybikes/ui/settings/SettingsActivityViewModel.kt#L215
https://material.io/develop/android/components/floating-action-button#theming-fabs
…rial.FloatingActionButton

- replace both 'view cloud folder' and 'logout' FAB
- adjust attributes to get a centered icon (iconPadding="0dp")
- remove FAB theming from styles.xml
@nackko nackko requested a review from RossGertzen September 13, 2020 16:55
Copy link
Collaborator

@RossGertzen RossGertzen left a comment

Choose a reason for hiding this comment

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

A lot of work! Looks good.

@nackko
Copy link
Owner Author

nackko commented Sep 14, 2020

A lot of work indeed. Just needs a fresh new launcher icon and to the Play Store the alpha Android version goes!

@nackko nackko merged commit 6e94596 into master Sep 14, 2020
@nackko nackko deleted the new-login-ui branch September 14, 2020 01:24
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="@{driveLoginViewModel.finalUrl.ld}"
Copy link
Owner Author

Choose a reason for hiding this comment

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

@Alex009 this was somewhat funky syntax 😅 and then it broke ^^

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