mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Tidy up code
This commit is contained in:
parent
6091cc7465
commit
8e059691f9
2 changed files with 2 additions and 14 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue