Skip to content

Commit 1df98ef

Browse files
committed
Merge remote-tracking branch 'upstream/master' into addThemeToggle
2 parents 5603808 + 816a234 commit 1df98ef

File tree

63 files changed

+203
-13
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+203
-13
lines changed

app/src/main/java/fr/free/nrw/commons/nearby/NearbyActivity.java

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
import android.os.Bundle;
99
import android.support.v4.app.FragmentTransaction;
1010
import android.util.Log;
11+
import android.view.Menu;
12+
import android.view.MenuInflater;
13+
import android.view.MenuItem;
1114

1215
import fr.free.nrw.commons.BaseAppCompatActivity;
1316
import fr.free.nrw.commons.R;
@@ -40,12 +43,33 @@ protected void onCreate(Bundle savedInstanceState) {
4043
ft.add(R.id.container, fragment);
4144
ft.commit();
4245
}
43-
46+
@Override
47+
public boolean onCreateOptionsMenu (Menu menu) {
48+
MenuInflater inflater = getMenuInflater();
49+
inflater.inflate(R.menu.menu_nearby, menu);
50+
return super.onCreateOptionsMenu(menu);
51+
}
52+
@Override
53+
public boolean onOptionsItemSelected(MenuItem item) {
54+
// Handle item selection
55+
switch (item.getItemId()) {
56+
case R.id.action_refresh:
57+
refreshView();
58+
return true;
59+
default:
60+
return super.onOptionsItemSelected(item);
61+
}
62+
}
4463
@Override
4564
protected void onResume(){
4665
super.onResume();
4766
}
4867

68+
protected void refreshView()
69+
{
70+
getSupportFragmentManager().beginTransaction()
71+
.replace(R.id.container, new NearbyListFragment()).commit();
72+
}
4973
protected LatLng getmLatestLocation() {
5074
return mLatestLocation;
5175
}
364 Bytes
261 Bytes
247 Bytes
251 Bytes
274 Bytes
-1.42 KB
Binary file not shown.
255 Bytes
-640 Bytes
Binary file not shown.
207 Bytes

0 commit comments

Comments
 (0)