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; private ActivityRtpSessionBinding binding;
@Override
public void onCreate(Bundle savedInstanceState) { 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); super.onCreate(savedInstanceState);
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_rtp_session); this.binding = DataBindingUtil.setContentView(this, R.layout.activity_rtp_session);
this.binding.rejectCall.setOnClickListener(this::rejectCall); this.binding.rejectCall.setOnClickListener(this::rejectCall);
@ -42,6 +38,12 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
this.binding.acceptCall.setOnClickListener(this::acceptCall); this.binding.acceptCall.setOnClickListener(this::acceptCall);
} }
@Override
public void onStart() {
super.onStart();
Log.d(Config.LOGTAG,"RtpSessionActivity.onStart()");
}
private void endCall(View view) { private void endCall(View view) {
requireRtpConnection().endCall(); requireRtpConnection().endCall();
} }

View file

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