Search in sources :

Example 1 with AbstractQuestAnswerFragment

use of de.westnordost.streetcomplete.quests.AbstractQuestAnswerFragment in project StreetComplete by westnordost.

the class MainActivity method onMapOrientation.

@AnyThread
@Override
public void onMapOrientation(float rotation, float tilt) {
    mapRotation = rotation;
    mapTilt = tilt;
    AbstractQuestAnswerFragment f = getQuestDetailsFragment();
    if (f != null) {
        f.onMapOrientation(rotation, tilt);
    }
}
Also used : AbstractQuestAnswerFragment(de.westnordost.streetcomplete.quests.AbstractQuestAnswerFragment) AnyThread(android.support.annotation.AnyThread)

Example 2 with AbstractQuestAnswerFragment

use of de.westnordost.streetcomplete.quests.AbstractQuestAnswerFragment in project StreetComplete by westnordost.

the class MainActivity method showQuestDetails.

@UiThread
private void showQuestDetails(final Quest quest, final QuestGroup group, final Element element) {
    if (getBottomSheetFragment() != null) {
        closeBottomSheet();
    }
    lastLocation = mapFragment.getDisplayedLocation();
    mapFragment.addQuestGeometry(quest.getGeometry());
    AbstractQuestAnswerFragment f = quest.getType().createForm();
    Bundle args = QuestAnswerComponent.createArguments(quest.getId(), group);
    if (group == QuestGroup.OSM) {
        args.putSerializable(AbstractQuestAnswerFragment.ARG_ELEMENT, (OsmElement) element);
    }
    args.putSerializable(AbstractQuestAnswerFragment.ARG_GEOMETRY, quest.getGeometry());
    args.putString(AbstractQuestAnswerFragment.ARG_QUESTTYPE, quest.getType().getClass().getSimpleName());
    args.putFloat(AbstractQuestAnswerFragment.ARG_MAP_ROTATION, mapRotation);
    args.putFloat(AbstractQuestAnswerFragment.ARG_MAP_TILT, mapTilt);
    f.setArguments(args);
    showInBottomSheet(f);
}
Also used : Bundle(android.os.Bundle) AbstractQuestAnswerFragment(de.westnordost.streetcomplete.quests.AbstractQuestAnswerFragment) UiThread(android.support.annotation.UiThread)

Aggregations

AbstractQuestAnswerFragment (de.westnordost.streetcomplete.quests.AbstractQuestAnswerFragment)2 Bundle (android.os.Bundle)1 AnyThread (android.support.annotation.AnyThread)1 UiThread (android.support.annotation.UiThread)1