use appbarlayout in RtpSessionActivity

This commit is contained in:
Daniel Gultsch 2020-04-07 16:17:29 +02:00
parent 0e88b56eb4
commit 4c6ee9693a
2 changed files with 29 additions and 27 deletions

View File

@ -29,12 +29,8 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
private ActivityRtpSessionBinding binding;
@Override
public void onCreate(Bundle savedInstanceState) {
getWindow().addFlags(
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
| WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
| WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
super.onCreate(savedInstanceState);
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_rtp_session);
this.binding.rejectCall.setOnClickListener(this::rejectCall);
@ -42,6 +38,12 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
this.binding.acceptCall.setOnClickListener(this::acceptCall);
}
@Override
public void onStart() {
super.onStart();
Log.d(Config.LOGTAG,"RtpSessionActivity.onStart()");
}
private void endCall(View view) {
requireRtpConnection().endCall();
}

View File

@ -7,33 +7,33 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:background="?colorPrimary"
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="32dp"
android:paddingBottom="32dp"
android:orientation="vertical"
android:gravity="center_vertical">
android:paddingRight="16dp"
android:paddingBottom="32dp">
<TextView
android:id="@+id/status"
tools:text="Incoming call"
android:textColor="@color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.Conversations.Title"/>
android:textAppearance="@style/TextAppearance.Conversations.Title"
android:textColor="@color/white"
tools:text="Incoming call" />
<TextView
android:id="@+id/with"
android:textColor="@color/white"
android:layout_below="@id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/status"
android:textAppearance="@style/TextAppearance.Conversations.Display2"
android:textColor="@color/white"
tools:text="Juliet Capulet" />
</LinearLayout>
</android.support.design.widget.AppBarLayout>
<RelativeLayout
android:layout_width="288dp"
@ -45,46 +45,46 @@
<android.support.design.widget.FloatingActionButton
android:id="@+id/reject_call"
android:layout_width="wrap_content"
android:layout_margin="16dp"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_margin="16dp"
android:src="@drawable/ic_call_end_white_48dp"
android:visibility="gone"
app:backgroundTint="@color/red700"
app:elevation="4dp"
app:fabCustomSize="72dp"
app:maxImageSize="36dp"
android:visibility="gone"
tools:visibility="visible" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/end_call"
android:layout_width="wrap_content"
android:layout_margin="16dp"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_margin="16dp"
android:src="@drawable/ic_call_end_white_48dp"
android:visibility="gone"
app:backgroundTint="@color/red700"
app:elevation="4dp"
app:fabCustomSize="72dp"
app:maxImageSize="36dp"
android:visibility="gone"/>
app:maxImageSize="36dp" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/accept_call"
android:layout_width="wrap_content"
android:layout_margin="16dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_margin="16dp"
android:src="@drawable/ic_call_white_48dp"
android:visibility="gone"
app:backgroundTint="@color/green700"
app:elevation="4dp"
app:fabCustomSize="72dp"
app:maxImageSize="36dp"
android:visibility="gone"
tools:visibility="visible" />
</RelativeLayout>