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) {
|
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||||
startLookingForNearby();
|
startLookingForNearby();
|
||||||
} else {
|
} else {
|
||||||
//If permission not granted, display notification that Nearby Places cannot be displayed
|
//If permission not granted, go to page that says 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 (nearbyAsyncTask != null) {
|
if (nearbyAsyncTask != null) {
|
||||||
nearbyAsyncTask.cancel(true);
|
nearbyAsyncTask.cancel(true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package fr.free.nrw.commons.nearby;
|
package fr.free.nrw.commons.nearby;
|
||||||
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
|
@ -12,24 +11,19 @@ import fr.free.nrw.commons.R;
|
||||||
import timber.log.Timber;
|
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 class NoPermissionsFragment extends Fragment {
|
||||||
|
|
||||||
|
|
||||||
public NoPermissionsFragment() {
|
public NoPermissionsFragment() {
|
||||||
// Required empty public constructor
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
// Inflate the layout for this fragment
|
|
||||||
Timber.d("NoPermissionsFragment created");
|
Timber.d("NoPermissionsFragment created");
|
||||||
View view = inflater.inflate(R.layout.fragment_no_permissions, container, false);
|
View view = inflater.inflate(R.layout.fragment_no_permissions, container, false);
|
||||||
ButterKnife.bind(this, view);
|
ButterKnife.bind(this, view);
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue