mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Remove screenOrientation methods
This commit is contained in:
parent
38d4531f42
commit
9d61dc4345
1 changed files with 2 additions and 20 deletions
|
|
@ -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<Place> 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<Place> {
|
||||
|
||||
public List<Place> placesList;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue