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

Update presets #193

Merged
merged 10 commits into from
Mar 27, 2020
Merged

Update presets #193

merged 10 commits into from
Mar 27, 2020

Conversation

geohacker
Copy link
Member

@geohacker geohacker commented Feb 24, 2020

This PR adds all presets from iD and updates existing ones along with their schema. This needs thorough testing. cc @developmentseed/observe

  • Check map rendering and icons -- I think we might have to update te-maki + maki
  • Check parent preset fetching and feature detail screens
  • Check being able to search and add features

@LanesGood
Copy link
Member

@geohacker in this same PR, can we add more presets on the initial "Select Feature Type" screen? This will help users see that there are multiple types available.

Will the parent preset types have a nested accordion/list style functionality, like in id?

@sethvincent
Copy link
Contributor

From the limited testing I've been able to do this is working alright so far.

There are definitely bugs with the logic for determining a best guess at a preset, but I don't think that's new (and is definitely my fault). For example, there's no way this node in downtown seattle is what observe thinks it is:

Screen Shot 2020-02-26 at 8 19 38 PM

@geohacker
Copy link
Member Author

I just pushed a script to fetch and update icons. And fixed a bunch of tests that were failing because of unavailable icons, which are now resolved. This should be ready to merge, but needs another round of testing. @sethvincent @LanesGood @batpad

@geohacker
Copy link
Member Author

The icons are bundled into iOS and Android for performance. This means apart from updating app/assets we have to symlink them to android/app/src/main/res and ios/Observe/Images.xcassets.

Android

It's as easy as creating a symlink:

  • cd android/app/src/main/res/drawable-
  • ln -s ~/observe/app/assets/temaki/*.png . - do this for maki and fontawesome

iOS

iOS is tricky because adding them via xcode makes direct copies instead of symlinks, and also adds them a 1x resolution. We want to add them as symlinks and 3x resolution. Looks like we'll have to write a script to do this. I had some luck using https://github.com/angelvasa/AVXCAssets-Generator, but it again creates a copy instead of symlinks and also changes the resolution. This means map icon sizes will become inconsistent between Android and iOS.

@geohacker
Copy link
Member Author

So android is fixed now. For iOS I think we should write a script that generates Image.xcassets for each icon like https://github.com/developmentseed/observe/tree/develop/ios/Observe/Images.xcassets/fas_bacon.imageset.

@sethvincent I probably won't get to this today or tomorrow, so if you have time, it'll be great to wrap this up.

@sethvincent
Copy link
Contributor

@geohacker I added the script for symlinking to android and ios. Did some testing on both to make sure images are still showing up alright and things are looking good.

… go away. add link to the update icons script
@geohacker
Copy link
Member Author

@sethvincent Thank you! I made some minor changes to the script to remove the asset folders and create it from scratch so we take out dead links. update-icons.sh not only adds but removes obsolete icons.

This is ready for merge I think. @LanesGood if you have sometime it'll be great if you test!

@LanesGood
Copy link
Member

@geohacker @sethvincent both iOS and Android builds failing for me.

Main iOS error message:

The following build commands failed:

CompileAssetCatalog /Users/lane/Github/observe/ios/build/Observe/Build/Products/Debug-iphonesimulator/Observe.app /Users/lane/Github/observe/ios/Observe/Images.xcassets

Main Android error message:

Execution failed for task ':app:mergeDebugResources'.
> Could not list contents of '/Users/lane/Github/observe/android/app/src/main/res/drawable-xxhdpi/temaki_chairlift.png'. Couldn't follow symbolic link.

@sethvincent
Copy link
Contributor

I revised the script to use relative paths and ran the script again to update the symlinks. The icons should now work as expected.

@LanesGood
Copy link
Member

@sethvincent iOS now works for me! Android still errors, though I've applied the scripts in @geohacker's comment above

Error:

Execution failed for task ':app:mergeDebugResources'.
> Could not list contents of '/Users/lane/Github/observe/android/app/src/main/res/drawable-xxhdpi/*.png'. Couldn't follow symbolic link.```

Any issues that I should be resolving on my end, or is this still on the branch?

@sethvincent
Copy link
Contributor

sethvincent commented Mar 23, 2020

@LanesGood it took me awhile to figure out that the script at some point had a bug where it created a symlink with a filepath of /Users/lane/Github/observe/android/app/src/main/res/drawable-xxhdpi/*.png (note the filename *.png) that doesn't link to a real file.

You could try re-running ./scripts/link-icons.sh to make sure it works locally for you and that should also remove the offending file. Alternately take a look in Finder to see if a file named *.png exists and delete it. A quick way to open the directory in Finder:

open /Users/lane/Github/observe/android/app/src/main/res/drawable-xxhdpi/

Also: you only need to run ./scripts/link-icons.sh and it will take care of icons for both android and ios.

@sethvincent
Copy link
Contributor

@geohacker I think this might be ready to merge. I haven't done any testing of searching for presets and adding features, but that might be best as a follow-up pr.

@sethvincent sethvincent merged commit 48a3daf into edit-ways Mar 27, 2020
@geohacker geohacker deleted the way-presets branch March 30, 2020 05:33
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