From 9d61dc434571021efcc79bcf6f9ec5d33f76e703 Mon Sep 17 00:00:00 2001 From: misaochan Date: Tue, 6 Sep 2016 18:49:39 +1200 Subject: [PATCH] Remove screenOrientation methods --- .../commons/nearby/NearbyListFragment.java | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyListFragment.java b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyListFragment.java index 732589697..f99899c86 100644 --- a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyListFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyListFragment.java @@ -117,7 +117,7 @@ public class NearbyListFragment extends ListFragment implements TaskListener { protected void onPreExecute() { super.onPreExecute(); listener.onTaskStarted(); - lockScreenOrientation(); + //lockScreenOrientation(); } @Override @@ -136,7 +136,7 @@ public class NearbyListFragment extends ListFragment implements TaskListener { protected void onPostExecute(List result) { super.onPostExecute(result); progressBar.setVisibility(View.GONE); - unlockScreenOrientation(); + //unlockScreenOrientation(); mAdapter = new NearbyAdapter(getActivity(), places); ListView listview = (ListView) getView().findViewById(R.id.listview); @@ -145,7 +145,6 @@ public class NearbyListFragment extends ListFragment implements TaskListener { listview.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView parent, View view, int position, long id) { - Place place = places.get(position); LatLng placeLatLng = place.location; @@ -168,23 +167,6 @@ public class NearbyListFragment extends ListFragment implements TaskListener { } } - private void lockScreenOrientation() { - int currentOrientation = getResources().getConfiguration().orientation; - if (currentOrientation == Configuration.ORIENTATION_PORTRAIT) { - getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); - } else { - getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); - } - } - - private void unlockScreenOrientation() { - try { - getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); - } catch (NullPointerException e){ - Log.e(TAG, "NPE: ", e); - } - } - private class NearbyAdapter extends ArrayAdapter { public List placesList;