Add base codes for testing mapbox activity in a single fragment inside activity

This commit is contained in:
neslihanturan 2019-08-24 10:56:01 +03:00
parent 7356044ad9
commit dbd1ad2ff1
6 changed files with 31 additions and 3 deletions

View file

@ -15,6 +15,7 @@ import fr.free.nrw.commons.explore.SearchActivity;
import fr.free.nrw.commons.explore.categories.ExploreActivity;
import fr.free.nrw.commons.nearby.NearbyTestActivity;
import fr.free.nrw.commons.nearby.NearbyTestFragment;
import fr.free.nrw.commons.notification.NotificationActivity;
import fr.free.nrw.commons.review.ReviewActivity;
import fr.free.nrw.commons.settings.SettingsActivity;
@ -71,4 +72,7 @@ public abstract class ActivityBuilderModule {
@ContributesAndroidInjector
abstract NearbyTestActivity bindNearbyTestActivity();
@ContributesAndroidInjector
abstract NearbyTestFragment bindNearbyTestFragment();
}

View file

@ -0,0 +1,6 @@
package fr.free.nrw.commons.nearby;
import fr.free.nrw.commons.theme.NavigationBaseActivity;
public class NearbyTestFragment extends NavigationBaseActivity {
}

View file

@ -40,6 +40,7 @@ import fr.free.nrw.commons.explore.categories.ExploreActivity;
import fr.free.nrw.commons.kvstore.JsonKvStore;
import fr.free.nrw.commons.logging.CommonsLogSender;
import fr.free.nrw.commons.nearby.NearbyTestActivity;
import fr.free.nrw.commons.nearby.NearbyTestFragment;
import fr.free.nrw.commons.notification.NotificationActivity;
import fr.free.nrw.commons.review.ReviewActivity;
import fr.free.nrw.commons.settings.SettingsActivity;
@ -182,7 +183,13 @@ public abstract class NavigationBaseActivity extends BaseActivity
case R.id.action_nearby_test_activity:
drawerLayout.closeDrawer(navigationView);
startActivityWithFlags(this, NearbyTestActivity.class, Intent.FLAG_ACTIVITY_REORDER_TO_FRONT,
Intent.FLAG_ACTIVITY_SINGLE_TOP); return true;
Intent.FLAG_ACTIVITY_SINGLE_TOP);
return true;
case R.id.action_nearby_test_fragment:
drawerLayout.closeDrawer(navigationView);
startActivityWithFlags(this, NearbyTestFragment.class, Intent.FLAG_ACTIVITY_REORDER_TO_FRONT,
Intent.FLAG_ACTIVITY_SINGLE_TOP);
return true;
case R.id.action_feedback:
drawerLayout.closeDrawer(navigationView);