From 59dd5e0edfe823bd33b97e222b1ee7b3c0fb6e72 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 16 Mar 2015 11:42:18 +0100 Subject: [PATCH] Removed top bar on tablets + added back button logic for phones --- res/layout-sw533dp-land/chat.xml | 159 +++++++++++++++++++++++++++++ src/org/linphone/ChatFragment.java | 18 ++-- 2 files changed, 169 insertions(+), 8 deletions(-) create mode 100644 res/layout-sw533dp-land/chat.xml diff --git a/res/layout-sw533dp-land/chat.xml b/res/layout-sw533dp-land/chat.xml new file mode 100644 index 000000000..2c2e5dd2c --- /dev/null +++ b/res/layout-sw533dp-land/chat.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/org/linphone/ChatFragment.java b/src/org/linphone/ChatFragment.java index d96168ed3..6c39652eb 100644 --- a/src/org/linphone/ChatFragment.java +++ b/src/org/linphone/ChatFragment.java @@ -187,12 +187,14 @@ public class ChatFragment extends Fragment implements OnClickListener, StateList } back = (TextView) view.findViewById(R.id.back); - back.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - //TODO - } - }); + if (back != null) { + back.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + getActivity().finish(); + } + }); + } cancelUpload = (ImageView) view.findViewById(R.id.cancelUpload); cancelUpload.setOnClickListener(new View.OnClickListener() { @@ -313,7 +315,7 @@ public class ChatFragment extends Fragment implements OnClickListener, StateList public void showKeyboardVisibleMode() { boolean isOrientationLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; - if (isOrientationLandscape) { + if (isOrientationLandscape && topBar != null) { topBar.setVisibility(View.GONE); } contactPicture.setVisibility(View.GONE); @@ -323,7 +325,7 @@ public class ChatFragment extends Fragment implements OnClickListener, StateList public void hideKeyboardVisibleMode() { boolean isOrientationLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; contactPicture.setVisibility(View.VISIBLE); - if (isOrientationLandscape) { + if (isOrientationLandscape && topBar != null) { topBar.setVisibility(View.VISIBLE); } scrollToEnd();