sketchily | Embed SVG-edit in Rails HTML forms | Animation library
kandi X-RAY | sketchily Summary
kandi X-RAY | sketchily Summary
Sketchily allows the easy integration of [svg-edit] with any rails application. Currently supports and provides svg-edit-2.7.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Creates a new value
- Returns a readable sketch
sketchily Key Features
sketchily Examples and Code Snippets
Community Discussions
Trending Discussions on sketchily
QUESTION
Currently I have two fragments, one that shows the weather for a place and another that let's you select a point in a map and redirects you to the other fragment showing the weather for that point.
What I want to achieve is to have by default the user's location and give the option to the user by going to the map of selecting any other place. So I would like to:
- Get lat/lng via GPS and then "upload" it to somewhere that would share those values between this fragment and the map fragment (The activity maybe?)
- If a point in the map is selected update those values- Both fragments can read at any time, only map fragment can update
I believe I can do this sketchily adding getters/setters to my activity and then in the fragments cast the activity to my particular activity. But this just seems bad. What would be the correct way to do it? What I have now:
- MainActivity (connects both fragments through a bottom navigation bar)
- ForecastFragment (Shows the weather for lat/lng)
- ForecastViewModel
- MapFragment
- MapViewModel
- WeatherRepository
- WeatherAPI (through RetroFit updates values)
I'm using dagger and kotlin.
Thanks!
...ANSWER
Answered 2020-Apr-27 at 04:19Share a common view model between ForecastFragment
and MapFragment
using the activity scope
Take a look at the example provided here Share data between fragments
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sketchily
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page