Merge remote-tracking branch 'upstream/master' into addThemeToggle

This commit is contained in:
Neslihan 2017-03-16 15:19:58 +03:00
commit 1df98efb27
63 changed files with 203 additions and 13 deletions

View file

@ -8,6 +8,9 @@ import android.location.LocationManager;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import fr.free.nrw.commons.BaseAppCompatActivity;
import fr.free.nrw.commons.R;
@ -40,12 +43,33 @@ public class NearbyActivity extends BaseAppCompatActivity {
ft.add(R.id.container, fragment);
ft.commit();
}
@Override
public boolean onCreateOptionsMenu (Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_nearby, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.action_refresh:
refreshView();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
@Override
protected void onResume(){
super.onResume();
}
protected void refreshView()
{
getSupportFragmentManager().beginTransaction()
.replace(R.id.container, new NearbyListFragment()).commit();
}
protected LatLng getmLatestLocation() {
return mLatestLocation;
}