Skip to content

Commit 773ab37

Browse files
Merge pull request #555 from Accontech/incoming_call_controllers_over_rtt
VATRP-3998: show controllers of incoming call over rtt
2 parents 0bf7f36 + 055ca8f commit 773ab37

File tree

3 files changed

+72
-59
lines changed

3 files changed

+72
-59
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<merge xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent">
5+
6+
<include layout="@layout/item_in_call_second_flashing" />
7+
8+
<LinearLayout
9+
android:id="@+id/second_incoming_call_controllers"
10+
android:layout_height="wrap_content"
11+
android:layout_width="match_parent"
12+
android:layout_alignParentBottom="true"
13+
android:orientation="vertical"
14+
android:visibility="invisible">
15+
16+
<LinearLayout
17+
android:orientation="horizontal"
18+
android:layout_width="match_parent"
19+
android:layout_height="55dp">
20+
21+
<ImageView
22+
android:id="@+id/call_later_button"
23+
android:layout_width="match_parent"
24+
android:layout_height="match_parent"
25+
android:layout_weight="1"
26+
android:src="@drawable/ic_message_later"
27+
android:paddingTop="10dp"
28+
android:paddingBottom="10dp"
29+
android:background="@color/transparent_in_call_black_bg"/>
30+
31+
<ImageView
32+
android:id="@+id/decline_call_button"
33+
android:layout_width="match_parent"
34+
android:layout_height="match_parent"
35+
android:layout_weight="1"
36+
android:paddingTop="10dp"
37+
android:paddingBottom="10dp"
38+
android:src="@drawable/ic_decline_call"
39+
android:background="@color/transparent_in_call_black_bg"/>
40+
</LinearLayout>
41+
42+
<LinearLayout
43+
android:id="@+id/accept_call_button"
44+
android:layout_width="match_parent"
45+
android:layout_height="wrap_content"
46+
android:orientation="vertical"
47+
android:gravity="center"
48+
android:background="@color/main_app_color">
49+
50+
<ImageView
51+
android:layout_width="55dp"
52+
android:layout_height="45dp"
53+
android:src="@drawable/ic_accept_call"/>
54+
55+
<TextView
56+
android:layout_width="wrap_content"
57+
android:layout_height="wrap_content"
58+
android:paddingBottom="5dp"
59+
android:text="accept"
60+
android:textSize="18sp"
61+
android:textColor="@android:color/white"/>
62+
63+
</LinearLayout>
64+
</LinearLayout>
65+
</merge>

res/layout/new_incall.xml

Lines changed: 2 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -284,73 +284,17 @@
284284
</RelativeLayout>
285285
</LinearLayout>
286286

287-
<LinearLayout
288-
android:id="@+id/second_incoming_call_controllers"
289-
android:layout_height="wrap_content"
290-
android:layout_width="match_parent"
291-
android:layout_alignParentBottom="true"
292-
android:orientation="vertical"
293-
android:visibility="invisible">
294-
295-
<LinearLayout
296-
android:orientation="horizontal"
297-
android:layout_width="match_parent"
298-
android:layout_height="55dp">
299-
300-
<ImageView
301-
android:id="@+id/call_later_button"
302-
android:layout_width="match_parent"
303-
android:layout_height="match_parent"
304-
android:layout_weight="1"
305-
android:src="@drawable/ic_message_later"
306-
android:paddingTop="10dp"
307-
android:paddingBottom="10dp"
308-
android:background="@color/transparent_in_call_black_bg"/>
309-
310-
<ImageView
311-
android:id="@+id/decline_call_button"
312-
android:layout_width="match_parent"
313-
android:layout_height="match_parent"
314-
android:layout_weight="1"
315-
android:paddingTop="10dp"
316-
android:paddingBottom="10dp"
317-
android:src="@drawable/ic_decline_call"
318-
android:background="@color/transparent_in_call_black_bg"/>
319-
</LinearLayout>
320-
321-
<LinearLayout
322-
android:id="@+id/accept_call_button"
323-
android:layout_width="match_parent"
324-
android:layout_height="wrap_content"
325-
android:orientation="vertical"
326-
android:gravity="center"
327-
android:background="@color/main_app_color">
328287

329-
<ImageView
330-
android:layout_width="55dp"
331-
android:layout_height="45dp"
332-
android:src="@drawable/ic_accept_call"/>
333-
334-
<TextView
335-
android:layout_width="wrap_content"
336-
android:layout_height="wrap_content"
337-
android:paddingBottom="5dp"
338-
android:text="accept"
339-
android:textSize="18sp"
340-
android:textColor="@android:color/white"/>
341-
342-
</LinearLayout>
343-
</LinearLayout>
344288

345289
<!--<LinearLayout-->
346290
<!--android:id="@+id/layout_container_second_call_user_data"-->
347291
<!--android:layout_width="match_parent"-->
348292
<!--android:layout_height="wrap_content"-->
349293
<!--android:orientation="horizontal"-->
350294
<!--android:visibility="invisible"/>-->
351-
<include layout="@layout/item_in_call_second_flashing"/>
352-
<include layout="@layout/item_in_call_second_passive"/>
353295

354296

297+
<include layout="@layout/item_in_call_second_passive" />
355298

356299
</RelativeLayout>
300+

src/org/linphone/InCallActivity.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ protected void onCreate(Bundle savedInstanceState) {
276276
ViewGroup.LayoutParams.MATCH_PARENT,
277277
ViewGroup.LayoutParams.MATCH_PARENT);
278278

279+
280+
279281
linphone_core_stats_holder = inflator.inflate(R.layout.linphone_core_stats, null);
280282
linphone_core_stats_table = (TableLayout)linphone_core_stats_holder.findViewById(R.id.linphone_core_stats);
281283
show_extra_linphone_core_stats();
@@ -289,6 +291,8 @@ protected void onCreate(Bundle savedInstanceState) {
289291
// linphone_core_stats_table.setVisibility(View.GONE);
290292
mainLayout.addView(mViewsHolder);
291293
mainLayout.addView(rttHolder, paramss);
294+
//
295+
inflator.inflate(R.layout.incoming_call_controllers_container, mainLayout, true );
292296
mainLayout.addView(statusBar);
293297
mainLayout.addView(linphone_core_stats_holder, paramss);
294298

@@ -423,7 +427,7 @@ public void callState(LinphoneCore lc, final LinphoneCall call, LinphoneCall.Sta
423427
|| state == State.StreamsRunning){
424428

425429
if((state == State.CallEnd || state == State.Error)) {
426-
if (call.getErrorInfo() != null) {
430+
if (call.getErrorInfo() != null && call.getDirection() == CallDirection.Outgoing) {
427431
String call_end_reason = Utils.getReasonText(call.getErrorInfo().getReason(), InCallActivity.this);
428432
tv_sub_status.setText(call_end_reason);
429433
tv_sub_status.setVisibility(View.VISIBLE);

0 commit comments

Comments
 (0)