rename design for CallActivity

move methods

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2021-10-28 12:20:04 +02:00
parent c7e38e4859
commit 3326b6a7f3
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
2 changed files with 40 additions and 38 deletions

View File

@ -54,7 +54,7 @@ import com.nextcloud.talk.adapters.ParticipantDisplayItem;
import com.nextcloud.talk.adapters.ParticipantsAdapter;
import com.nextcloud.talk.api.NcApi;
import com.nextcloud.talk.application.NextcloudTalkApplication;
import com.nextcloud.talk.databinding.ControllerCallBinding;
import com.nextcloud.talk.databinding.CallActivityBinding;
import com.nextcloud.talk.events.ConfigurationChangeEvent;
import com.nextcloud.talk.events.MediaStreamEvent;
import com.nextcloud.talk.events.NetworkEvent;
@ -242,7 +242,7 @@ public class CallActivity extends BaseActivity {
private Boolean isInPipMode = false;
private ControllerCallBinding binding;
private CallActivityBinding binding;
@Parcel
public enum CallStatus {
@ -262,7 +262,7 @@ public class CallActivity extends BaseActivity {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
binding = ControllerCallBinding.inflate(getLayoutInflater());
binding = CallActivityBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
Bundle extras = getIntent().getExtras();
@ -312,6 +312,43 @@ public class CallActivity extends BaseActivity {
initClickListeners();
}
@SuppressLint("ClickableViewAccessibility")
@Override
public void onStart() {
super.onStart();
// TODO: move some lines to onCreate!?!
binding.microphoneButton.setOnTouchListener(new MicrophoneButtonTouchListener());
pulseAnimation = PulseAnimation.create().with(binding.microphoneButton)
.setDuration(310)
.setRepeatCount(PulseAnimation.INFINITE)
.setRepeatMode(PulseAnimation.REVERSE);
try {
cache.evictAll();
} catch (IOException e) {
Log.e(TAG, "Failed to evict cache");
}
binding.callControls.setZ(100.0f);
basicInitialization();
participantDisplayItems = new HashMap<>();
initViews();
updateSelfVideoViewPosition();
if (!isConnectionEstablished()){
initiateCall();
}
}
public void onStop() {
super.onStop();
if (isInPipMode) {
finish();
}
}
private void initClickListeners() {
binding.pictureInPictureButton.setOnClickListener(l -> enterPipMode());
@ -2380,34 +2417,6 @@ public class CallActivity extends BaseActivity {
}
}
@SuppressLint("ClickableViewAccessibility")
@Override
public void onStart() {
super.onStart();
binding.microphoneButton.setOnTouchListener(new MicrophoneButtonTouchListener());
pulseAnimation = PulseAnimation.create().with(binding.microphoneButton)
.setDuration(310)
.setRepeatCount(PulseAnimation.INFINITE)
.setRepeatMode(PulseAnimation.REVERSE);
try {
cache.evictAll();
} catch (IOException e) {
Log.e(TAG, "Failed to evict cache");
}
binding.callControls.setZ(100.0f);
basicInitialization();
participantDisplayItems = new HashMap<>();
initViews();
updateSelfVideoViewPosition();
if (!isConnectionEstablished()){
initiateCall();
}
}
private class MicrophoneButtonTouchListener implements View.OnTouchListener {
@SuppressLint("ClickableViewAccessibility")
@ -2505,13 +2514,6 @@ public class CallActivity extends BaseActivity {
}
}
public void onStop() {
super.onStop();
if (isInPipMode) {
finish();
}
}
private class SelfVideoTouchListener implements View.OnTouchListener {
@SuppressLint("ClickableViewAccessibility")