Remove back button on tablet fragment
This commit is contained in:
parent
25dc639ded
commit
6b90adf155
4 changed files with 59 additions and 52 deletions
|
@ -54,8 +54,8 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_below="@id/top_bar" android:layout_toRightOf="@+id/footer"
|
android:layout_below="@id/top_bar"
|
||||||
android:layout_toEndOf="@+id/footer">
|
android:layout_above="@id/footer">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -89,21 +89,21 @@
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/footer"
|
android:id="@+id/footer"
|
||||||
android:layout_width="60dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="60dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:orientation="vertical">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/history"
|
android:id="@+id/history"
|
||||||
android:background="@drawable/footer_button"
|
android:background="@drawable/footer_button"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_width="60dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:src="@drawable/footer_history"
|
android:src="@drawable/footer_history"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="15dp"
|
android:padding="15dp"
|
||||||
android:layout_centerInParent="true"/>
|
android:layout_centerInParent="true"/>
|
||||||
|
@ -111,18 +111,18 @@
|
||||||
<View
|
<View
|
||||||
android:id="@+id/history_select"
|
android:id="@+id/history_select"
|
||||||
android:background="@color/colorA"
|
android:background="@color/colorA"
|
||||||
android:layout_width="5dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="5dp"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/missed_calls"
|
android:id="@+id/missed_calls"
|
||||||
android:background="@drawable/history_chat_indicator"
|
android:background="@drawable/history_chat_indicator"
|
||||||
style="@style/font18"
|
style="@style/font18"
|
||||||
android:layout_width="25dp"
|
android:layout_width="20dp"
|
||||||
android:layout_height="25dp"
|
android:layout_height="20dp"
|
||||||
android:layout_margin="12dp"
|
android:layout_margin="15dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
@ -132,8 +132,8 @@
|
||||||
android:id="@+id/contacts"
|
android:id="@+id/contacts"
|
||||||
android:background="@drawable/footer_button"
|
android:background="@drawable/footer_button"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_width="60dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:src="@drawable/footer_contacts"
|
android:src="@drawable/footer_contacts"
|
||||||
|
@ -145,9 +145,9 @@
|
||||||
<View
|
<View
|
||||||
android:id="@+id/contacts_select"
|
android:id="@+id/contacts_select"
|
||||||
android:background="@color/colorA"
|
android:background="@color/colorA"
|
||||||
android:layout_width="5dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="5dp"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
@ -155,8 +155,8 @@
|
||||||
android:id="@+id/dialer"
|
android:id="@+id/dialer"
|
||||||
android:background="@drawable/footer_button"
|
android:background="@drawable/footer_button"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_width="60dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:src="@drawable/footer_dialer"
|
android:src="@drawable/footer_dialer"
|
||||||
|
@ -168,9 +168,9 @@
|
||||||
<View
|
<View
|
||||||
android:id="@+id/dialer_select"
|
android:id="@+id/dialer_select"
|
||||||
android:background="@color/colorA"
|
android:background="@color/colorA"
|
||||||
android:layout_width="5dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="5dp"
|
||||||
android:layout_alignParentLeft="true"/>
|
android:layout_alignParentBottom="true"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
@ -178,8 +178,8 @@
|
||||||
android:id="@+id/chat"
|
android:id="@+id/chat"
|
||||||
android:background="@drawable/footer_button"
|
android:background="@drawable/footer_button"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_width="60dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:src="@drawable/footer_chat"
|
android:src="@drawable/footer_chat"
|
||||||
|
@ -191,20 +191,20 @@
|
||||||
<View
|
<View
|
||||||
android:id="@+id/chat_select"
|
android:id="@+id/chat_select"
|
||||||
android:background="@color/colorA"
|
android:background="@color/colorA"
|
||||||
android:visibility="gone"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="5dp"
|
android:layout_height="5dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_alignParentLeft="true"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/missed_chats"
|
android:id="@+id/missed_chats"
|
||||||
android:background="@drawable/history_chat_indicator"
|
android:background="@drawable/history_chat_indicator"
|
||||||
style="@style/font18"
|
style="@style/font18"
|
||||||
android:layout_width="25dp"
|
android:layout_width="20dp"
|
||||||
android:layout_height="25dp"
|
android:layout_height="20dp"
|
||||||
android:layout_margin="12dp"
|
android:layout_margin="15dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:visibility="gone" />
|
android:visibility="gone"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -217,15 +217,12 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
}
|
}
|
||||||
|
|
||||||
back = (ImageView) view.findViewById(R.id.back);
|
back = (ImageView) view.findViewById(R.id.back);
|
||||||
if (back != null) {
|
if(getResources().getBoolean(R.bool.isTablet)){
|
||||||
back.setOnClickListener(new OnClickListener() {
|
back.setVisibility(View.INVISIBLE);
|
||||||
@Override
|
} else {
|
||||||
public void onClick(View v) {
|
back.setOnClickListener(this);
|
||||||
getFragmentManager().popBackStackImmediate();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mListener = new LinphoneCoreListenerBase(){
|
mListener = new LinphoneCoreListenerBase(){
|
||||||
@Override
|
@Override
|
||||||
public void messageReceived(LinphoneCore lc, LinphoneChatRoom cr, LinphoneChatMessage message) {
|
public void messageReceived(LinphoneCore lc, LinphoneChatRoom cr, LinphoneChatMessage message) {
|
||||||
|
@ -704,6 +701,9 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
if(id == R.id.start_call){
|
if(id == R.id.start_call){
|
||||||
LinphoneActivity.instance().setAddresGoToDialerAndCall(sipUri, LinphoneUtils.getUsernameFromAddress(sipUri), null);
|
LinphoneActivity.instance().setAddresGoToDialerAndCall(sipUri, LinphoneUtils.getUsernameFromAddress(sipUri), null);
|
||||||
}
|
}
|
||||||
|
if (id == R.id.back) {
|
||||||
|
getFragmentManager().popBackStackImmediate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendTextMessage() {
|
private void sendTextMessage() {
|
||||||
|
|
|
@ -102,14 +102,13 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
||||||
deleteContact = (ImageView) view.findViewById(R.id.deleteContact);
|
deleteContact = (ImageView) view.findViewById(R.id.deleteContact);
|
||||||
deleteContact.setOnClickListener(this);
|
deleteContact.setOnClickListener(this);
|
||||||
|
|
||||||
ImageView back = (ImageView) view.findViewById(R.id.back);
|
back = (ImageView) view.findViewById(R.id.back);
|
||||||
back.setOnClickListener(new OnClickListener() {
|
if(getResources().getBoolean(R.bool.isTablet)){
|
||||||
@Override
|
back.setVisibility(View.INVISIBLE);
|
||||||
public void onClick(View v) {
|
} else {
|
||||||
getFragmentManager().popBackStackImmediate();
|
back.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +236,8 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
||||||
|
|
||||||
if (id == R.id.editContact) {
|
if (id == R.id.editContact) {
|
||||||
LinphoneActivity.instance().editContact(contact);
|
LinphoneActivity.instance().editContact(contact);
|
||||||
} else if (id == R.id.deleteContact) {
|
}
|
||||||
|
if (id == R.id.deleteContact) {
|
||||||
final Dialog dialog = LinphoneActivity.instance().displayDialog(getString(R.string.delete_text));
|
final Dialog dialog = LinphoneActivity.instance().displayDialog(getString(R.string.delete_text));
|
||||||
Button delete = (Button) dialog.findViewById(R.id.delete);
|
Button delete = (Button) dialog.findViewById(R.id.delete);
|
||||||
Button cancel = (Button) dialog.findViewById(R.id.cancel);
|
Button cancel = (Button) dialog.findViewById(R.id.cancel);
|
||||||
|
@ -261,6 +261,9 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
||||||
});
|
});
|
||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
if (id == R.id.back) {
|
||||||
|
getFragmentManager().popBackStackImmediate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteExistingContact() {
|
private void deleteExistingContact() {
|
||||||
|
|
|
@ -61,7 +61,11 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener {
|
||||||
dialBack.setOnClickListener(this);
|
dialBack.setOnClickListener(this);
|
||||||
|
|
||||||
back = (ImageView) view.findViewById(R.id.back);
|
back = (ImageView) view.findViewById(R.id.back);
|
||||||
back.setOnClickListener(this);
|
if(getResources().getBoolean(R.bool.isTablet)){
|
||||||
|
back.setVisibility(View.INVISIBLE);
|
||||||
|
} else {
|
||||||
|
back.setOnClickListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
chat = (ImageView) view.findViewById(R.id.chat);
|
chat = (ImageView) view.findViewById(R.id.chat);
|
||||||
chat.setOnClickListener(this);
|
chat.setOnClickListener(this);
|
||||||
|
|
Loading…
Reference in a new issue