mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Add NearbyActivity
This commit is contained in:
parent
9f93b87a63
commit
9e13d644c5
3 changed files with 31 additions and 2 deletions
|
|
@ -30,6 +30,7 @@ import fr.free.nrw.commons.AboutActivity;
|
||||||
import fr.free.nrw.commons.CommonsApplication;
|
import fr.free.nrw.commons.CommonsApplication;
|
||||||
import fr.free.nrw.commons.R;
|
import fr.free.nrw.commons.R;
|
||||||
import fr.free.nrw.commons.SettingsActivity;
|
import fr.free.nrw.commons.SettingsActivity;
|
||||||
|
import fr.free.nrw.commons.nearby.NearbyActivity;
|
||||||
import fr.free.nrw.commons.upload.UploadService;
|
import fr.free.nrw.commons.upload.UploadService;
|
||||||
|
|
||||||
public class ContributionsListFragment extends Fragment {
|
public class ContributionsListFragment extends Fragment {
|
||||||
|
|
@ -142,15 +143,16 @@ public class ContributionsListFragment extends Fragment {
|
||||||
feedbackIntent.setType("message/rfc822");
|
feedbackIntent.setType("message/rfc822");
|
||||||
feedbackIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { CommonsApplication.FEEDBACK_EMAIL });
|
feedbackIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { CommonsApplication.FEEDBACK_EMAIL });
|
||||||
feedbackIntent.putExtra(Intent.EXTRA_SUBJECT, String.format(CommonsApplication.FEEDBACK_EMAIL_SUBJECT, CommonsApplication.APPLICATION_VERSION));
|
feedbackIntent.putExtra(Intent.EXTRA_SUBJECT, String.format(CommonsApplication.FEEDBACK_EMAIL_SUBJECT, CommonsApplication.APPLICATION_VERSION));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
startActivity(feedbackIntent);
|
startActivity(feedbackIntent);
|
||||||
}
|
}
|
||||||
catch (ActivityNotFoundException e) {
|
catch (ActivityNotFoundException e) {
|
||||||
Toast.makeText(getActivity(), R.string.no_email_client, Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), R.string.no_email_client, Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
case R.id.menu_nearby:
|
||||||
|
Intent nearbyIntent = new Intent(getActivity(), NearbyActivity.class);
|
||||||
|
startActivity(nearbyIntent);
|
||||||
case R.id.menu_refresh:
|
case R.id.menu_refresh:
|
||||||
((SourceRefresher)getActivity()).refreshSource();
|
((SourceRefresher)getActivity()).refreshSource();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package fr.free.nrw.commons.nearby;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import fr.free.nrw.commons.R;
|
||||||
|
|
||||||
|
public class NearbyActivity extends Activity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_nearby);
|
||||||
|
}
|
||||||
|
}
|
||||||
12
app/src/main/res/layout/activity_nearby.xml
Normal file
12
app/src/main/res/layout/activity_nearby.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
|
tools:context="fr.free.nrw.commons.nearby.NearbyActivity">
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue