Tidy up code

This commit is contained in:
misaochan 2017-06-02 18:27:39 +10:00
parent 6091cc7465
commit 8e059691f9
2 changed files with 2 additions and 14 deletions

View file

@ -120,13 +120,7 @@ public class NearbyActivity extends NavigationBaseActivity {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
startLookingForNearby();
} else {
//If permission not granted, display notification that Nearby Places cannot be displayed
/**
int duration = Toast.LENGTH_LONG;
Toast toast = Toast.makeText(this, R.string.no_location_permission, duration);
toast.show();
*/
//TODO: Open a fragment saying permissions not granted instead
//If permission not granted, go to page that says Nearby Places cannot be displayed
if (nearbyAsyncTask != null) {
nearbyAsyncTask.cancel(true);
}

View file

@ -1,6 +1,5 @@
package fr.free.nrw.commons.nearby;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
@ -12,24 +11,19 @@ import fr.free.nrw.commons.R;
import timber.log.Timber;
/**
* A simple {@link Fragment} subclass.
* Tells user that Nearby Places cannot be displayed if location permissions are denied
*/
public class NoPermissionsFragment extends Fragment {
public NoPermissionsFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
Timber.d("NoPermissionsFragment created");
View view = inflater.inflate(R.layout.fragment_no_permissions, container, false);
ButterKnife.bind(this, view);
return view;
}