Added hard coded boolean to disable chat + incoming header using res value for text
This commit is contained in:
parent
6d45c9eb6d
commit
68eb47ac67
7 changed files with 40 additions and 6 deletions
|
@ -4,12 +4,8 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/background">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="75dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/header_incoming" />
|
||||
|
||||
<include layout="@layout/incoming_header" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
23
res/layout/incoming_header.xml
Normal file
23
res/layout/incoming_header.xml
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:linphone="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="75dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@drawable/cell_call_first">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|left"
|
||||
android:paddingBottom="20dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="10dp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/text_header"
|
||||
android:text="@string/incoming"
|
||||
android:textSize="26dp" />
|
||||
|
||||
</LinearLayout>
|
|
@ -202,6 +202,7 @@
|
|||
|
||||
<string name="addressHint">Numéro ou adresse</string>
|
||||
<string name="conference">Conférence</string>
|
||||
<string name="incoming">Appel entrant</string>
|
||||
<string name="draft">Brouillon</string>
|
||||
<string name="new_fast_chat">Entrez une adresse SIP…</string>
|
||||
<string name="no_call_history">Aucun appel dans votre historique.</string>
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
<bool name="allow_transfers">true</bool>
|
||||
<bool name="allow_edit_in_dialer">true</bool>
|
||||
<bool name="forbid_self_call">false</bool>
|
||||
<bool name="disable_chat">false</bool>
|
||||
|
||||
<string name="about_bugreport_email">linphone-android@belledonne-communications.com</string>
|
||||
</resources>
|
||||
|
|
|
@ -252,6 +252,7 @@
|
|||
|
||||
<string name="addressHint">Number or address</string>
|
||||
<string name="conference">Conference</string>
|
||||
<string name="incoming">Incoming call</string>
|
||||
<string name="draft">Draft</string>
|
||||
<string name="new_fast_chat">Enter a SIP address to chat with…</string>
|
||||
<string name="no_call_history">No call in your history.</string>
|
||||
|
|
|
@ -156,6 +156,10 @@ public class ContactFragment extends Fragment implements OnClickListener {
|
|||
}
|
||||
}
|
||||
|
||||
if (getResources().getBoolean(R.bool.disable_chat)) {
|
||||
v.findViewById(R.id.chat).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
controls.addView(v);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -476,6 +476,10 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
|||
}
|
||||
|
||||
public void displayChat(String sipUri) {
|
||||
if (getResources().getBoolean(R.bool.disable_chat)) {
|
||||
return;
|
||||
}
|
||||
|
||||
LinphoneAddress lAddress = LinphoneCoreFactory.instance().createLinphoneAddress(sipUri);
|
||||
Uri uri = LinphoneUtils.findUriPictureOfContactAndSetDisplayName(lAddress, getContentResolver());
|
||||
String displayName = lAddress.getDisplayName();
|
||||
|
@ -684,6 +688,10 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
|||
|
||||
@Override
|
||||
public void onMessageReceived(LinphoneAddress from, LinphoneChatMessage message) {
|
||||
if (getResources().getBoolean(R.bool.disable_chat)) {
|
||||
return;
|
||||
}
|
||||
|
||||
String textMessage = message.getMessage();
|
||||
String url = message.getExternalBodyUrl();
|
||||
String notificationText = null;
|
||||
|
|
Loading…
Reference in a new issue