mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 13:23:58 +01:00
MainActivity: Add methods to pass extras between Nearby and Explore
This commit is contained in:
parent
5d506ac321
commit
42efa9b782
1 changed files with 38 additions and 0 deletions
|
|
@ -432,6 +432,44 @@ public class MainActivity extends BaseActivity
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch the Explore fragment from Nearby fragment. This method is called when a user clicks
|
||||
* the 'Show in Explore' option in the 3-dots menu in Nearby.
|
||||
*
|
||||
* @param zoom current zoom of Nearby map
|
||||
* @param latitude current latitude of Nearby map
|
||||
* @param longitude current longitude of Nearby map
|
||||
**/
|
||||
public void loadExploreMapFromNearby(double zoom, double latitude, double longitude) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putDouble("prev_zoom", zoom);
|
||||
bundle.putDouble("prev_latitude", latitude);
|
||||
bundle.putDouble("prev_longitude", longitude);
|
||||
|
||||
loadFragment(ExploreFragment.newInstance(), false);
|
||||
exploreFragment.setArguments(bundle);
|
||||
setSelectedItemId(NavTab.EXPLORE.code());
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch the Nearby fragment from Explore fragment. This method is called when a user clicks
|
||||
* the 'Show in Nearby' option in the 3-dots menu in Explore.
|
||||
*
|
||||
* @param zoom current zoom of Explore map
|
||||
* @param latitude current latitude of Explore map
|
||||
* @param longitude current longitude of Explore map
|
||||
**/
|
||||
public void loadNearbyMapFromExplore(double zoom, double latitude, double longitude) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putDouble("prev_zoom", zoom);
|
||||
bundle.putDouble("prev_latitude", latitude);
|
||||
bundle.putDouble("prev_longitude", longitude);
|
||||
|
||||
loadFragment(NearbyParentFragment.newInstance(), false);
|
||||
nearbyParentFragment.setArguments(bundle);
|
||||
setSelectedItemId(NavTab.NEARBY.code());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue