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

Move Add a meal to a new activity #93

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

roger-tan
Copy link
Contributor

What I've been done :

  • Removed some old fragment from the navhost.
  • Created a container of activities for the maps fragment and add a meal fragment as feature-add-meal and feature-find-meal should not know each other. Let me know about this.

Quick preview:
ezgif com-resize

super.onCreateOptionsMenu(menu, inflater)

inflater.inflate(R.menu.find_meal_container_menu, menu)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we're having the adding of a meal within a second tab of the bottom nav rather than this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the iOS side, it was a new modal from the map.

@@ -0,0 +1,54 @@
package com.kcc.kmmhackathon.androidHackathonApp.view
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused as to why you've created this file - please could you give some more context?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created this file because I don't think that the find MapsFragment should know when to create a new add meal activity

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point! But following that logic, the FindMeal also shouldn't know about creating new meals and creating a new container just for that seems a bit overkill.

I'd add this logic in the Activity holding the Fragments and BottomNavigation, maybe in a FloatingActionButton.

Either way, FAB or action in the Toolbar, the action belongs to the Activity, and then you have 3 independent Fragments to navigate to.

<item android:id="@+id/findMealFragment"
android:icon="@drawable/ic_baseline_list_24"
android:title="@string/title_switch_to_list"/>

<item
android:id="@+id/settingsFragment"
android:icon="@drawable/ic_baseline_settings_24"
Copy link
Contributor

@kirstybutler kirstybutler Dec 17, 2020

Choose a reason for hiding this comment

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

This is going to conflict with Fidel's PR with the refactoring of the FindMealFragment, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pretty sure that's going to be conflicted.

android:title="Add"
android:orderInCategory="100"
yourapp:showAsAction="always" />
</menu>
Copy link
Contributor

Choose a reason for hiding this comment

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

Again I think this should stay as a tab :)

@@ -23,7 +23,7 @@
<string name="hint_password">Enter Password</string>

//Headers
<string name="add_meal_activity_header">This is the add meal activity screen</string>
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need it as an Activity?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we want to have the toolbar yes!

val latLng = LatLng(it.latitude, it.longitude)
updateUserLocation(latLng)
updateMeals(latLng)
if (it != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this null check necessary? Would we get to startUpdatingLocation if there was no current location?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was crashing on my side without checking if it's null.

Copy link
Contributor

@fmontesino fmontesino left a comment

Choose a reason for hiding this comment

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

MapsFragment doesn't exist anymore 😕 it will definitely conflict with the open PR.
Also, as a general Android UX, having the Add button on the Toolbar is very confusing, I'd rather create a FAB on the Find A Meal fragment that opens the Add screen.

Copy link
Contributor

@kirstybutler kirstybutler left a comment

Choose a reason for hiding this comment

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

Also, just as a minor thing, when creating a PR please could you link it to an issue within the Projects? And also add a label as Android so that it's easy to keep track of which platform this is for? It will help make it easier for new people joining the project to understand more of what's going on and also for us to view the board in a more organised way 🙌 😃

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.

4 participants