File tree 6 files changed +41
-4
lines changed
java/fr/free/nrw/commons/nearby
6 files changed +41
-4
lines changed Original file line number Diff line number Diff line change 9
9
import android .support .v4 .app .FragmentTransaction ;
10
10
import android .support .v7 .app .AppCompatActivity ;
11
11
import android .util .Log ;
12
+ import android .view .Menu ;
13
+ import android .view .MenuInflater ;
14
+ import android .view .MenuItem ;
12
15
13
16
import fr .free .nrw .commons .R ;
14
17
@@ -40,12 +43,32 @@ protected void onCreate(Bundle savedInstanceState) {
40
43
ft .add (R .id .container , fragment );
41
44
ft .commit ();
42
45
}
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
+ }
44
63
@ Override
45
64
protected void onResume (){
46
65
super .onResume ();
47
66
}
48
67
68
+ protected void refreshView ()
69
+ {
70
+ this .recreate ();
71
+ }
49
72
protected LatLng getmLatestLocation () {
50
73
return mLatestLocation ;
51
74
}
Original file line number Diff line number Diff line change
1
+ <menu xmlns : android =" http://schemas.android.com/apk/res/android"
2
+ xmlns : app =" http://schemas.android.com/apk/res-auto"
3
+ xmlns : tools =" http://schemas.android.com/tools" tools : context =" .MainActivity" >
4
+
5
+ <item
6
+ android : id =" @+id/action_refresh"
7
+ android : title =" @string/refresh_button"
8
+ android : icon =" @drawable/ic_action_refresh"
9
+ android : orderInCategory =" 1"
10
+ app : showAsAction =" ifRoom"
11
+ />
12
+
13
+ </menu >
Original file line number Diff line number Diff line change 49
49
<string name =" menu_upload_single" >Upload</string >
50
50
<string name =" categories_search_text_hint" >Search categories</string >
51
51
<string name =" menu_save_categories" >Save</string >
52
+ <string name =" refresh_button" >Refresh</string >
52
53
<plurals name =" contributions_subtitle" >
53
54
<item quantity =" zero" >No uploads yet</item >
54
55
<item quantity =" one" >1 upload</item >
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ buildscript {
5
5
mavenCentral()
6
6
}
7
7
dependencies {
8
- classpath ' com.android.tools.build:gradle:2.2.3 '
8
+ classpath ' com.android.tools.build:gradle:2.3.0 '
9
9
}
10
10
}
11
11
Original file line number Diff line number Diff line change 1
- # Wed Aug 17 16:02:52 NZST 2016
1
+ # Fri Mar 03 19:41:57 IST 2017
2
2
distributionBase =GRADLE_USER_HOME
3
3
distributionPath =wrapper/dists
4
4
zipStoreBase =GRADLE_USER_HOME
5
5
zipStorePath =wrapper/dists
6
- distributionUrl =https\://services.gradle.org/distributions/gradle-2.14.1 -all.zip
6
+ distributionUrl =https\://services.gradle.org/distributions/gradle-3.3 -all.zip
You can’t perform that action at this time.
0 commit comments