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

@ -140,7 +140,12 @@
<activity <activity
android:name=".nearby.NearbyTestActivity" android:name=".nearby.NearbyTestActivity"
android:label="@string/title_activity_nearbytest" /> android:label="@string/title_activity_nearby_test_activity" />
<activity
android:name=".nearby.NearbyTestFragment"
android:label="@string/title_activity_nearby_test_fragment" />
<service android:name=".upload.UploadService" /> <service android:name=".upload.UploadService" />
<service <service

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.explore.categories.ExploreActivity;
import fr.free.nrw.commons.nearby.NearbyTestActivity; 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.notification.NotificationActivity;
import fr.free.nrw.commons.review.ReviewActivity; import fr.free.nrw.commons.review.ReviewActivity;
import fr.free.nrw.commons.settings.SettingsActivity; import fr.free.nrw.commons.settings.SettingsActivity;
@ -71,4 +72,7 @@ public abstract class ActivityBuilderModule {
@ContributesAndroidInjector @ContributesAndroidInjector
abstract NearbyTestActivity bindNearbyTestActivity(); 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.kvstore.JsonKvStore;
import fr.free.nrw.commons.logging.CommonsLogSender; import fr.free.nrw.commons.logging.CommonsLogSender;
import fr.free.nrw.commons.nearby.NearbyTestActivity; 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.notification.NotificationActivity;
import fr.free.nrw.commons.review.ReviewActivity; import fr.free.nrw.commons.review.ReviewActivity;
import fr.free.nrw.commons.settings.SettingsActivity; import fr.free.nrw.commons.settings.SettingsActivity;
@ -182,7 +183,13 @@ public abstract class NavigationBaseActivity extends BaseActivity
case R.id.action_nearby_test_activity: case R.id.action_nearby_test_activity:
drawerLayout.closeDrawer(navigationView); drawerLayout.closeDrawer(navigationView);
startActivityWithFlags(this, NearbyTestActivity.class, Intent.FLAG_ACTIVITY_REORDER_TO_FRONT, 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: case R.id.action_feedback:
drawerLayout.closeDrawer(navigationView); drawerLayout.closeDrawer(navigationView);

View file

@ -55,6 +55,10 @@
android:icon="@drawable/ic_help_black_24dp" android:icon="@drawable/ic_help_black_24dp"
android:title="@string/navigation_item_nearby_test_activity" /> android:title="@string/navigation_item_nearby_test_activity" />
<item
android:id="@+id/action_nearby_test_fragment"
android:icon="@drawable/ic_help_black_24dp"
android:title="@string/navigation_item_nearby_test_fragment" />
</group> </group>

View file

@ -89,7 +89,8 @@
<string name="title_activity_featured_images">Featured Images</string> <string name="title_activity_featured_images">Featured Images</string>
<string name="title_activity_category_details">Category</string> <string name="title_activity_category_details">Category</string>
<string name="title_activity_review">Peer Review</string> <string name="title_activity_review">Peer Review</string>
<string name="title_activity_nearbytest">Nearby Test</string> <string name="title_activity_nearby_test_activity">Nearby Test Activity</string>
<string name="title_activity_nearby_test_fragment">Nearby Test Fragment</string>
<string name="menu_about">About</string> <string name="menu_about">About</string>
<string name="about_license">The Wikimedia Commons app is an open-source app created and maintained by grantees and volunteers of the Wikimedia community. The Wikimedia Foundation is not involved in the creation, development, or maintenance of the app. </string> <string name="about_license">The Wikimedia Commons app is an open-source app created and maintained by grantees and volunteers of the Wikimedia community. The Wikimedia Foundation is not involved in the creation, development, or maintenance of the app. </string>
<string name="trademarked_name" translatable="false">Wikimedia Commons</string> <string name="trademarked_name" translatable="false">Wikimedia Commons</string>
@ -235,6 +236,7 @@
<string name="navigation_item_featured_images">Featured</string> <string name="navigation_item_featured_images">Featured</string>
<string name="navigation_item_review">Review</string> <string name="navigation_item_review">Review</string>
<string name="navigation_item_nearby_test_activity">Nearby Test Activity</string> <string name="navigation_item_nearby_test_activity">Nearby Test Activity</string>
<string name="navigation_item_nearby_test_fragment">Nearby Test Fragment</string>
<string name="nearby_needs_permissions">Nearby places cannot be displayed without location permissions</string> <string name="nearby_needs_permissions">Nearby places cannot be displayed without location permissions</string>
<string name="no_description_found">no description found</string> <string name="no_description_found">no description found</string>
<string name="nearby_info_menu_commons_article">Commons file page</string> <string name="nearby_info_menu_commons_article">Commons file page</string>