Commit b46fd325 authored by Adrien Béraud's avatar Adrien Béraud

callfragment: remove from stack on finish, check for null binding

Change-Id: Ia63b257d49624165e53b9ecd00e373f07098405d
parent 0c52ff26
......@@ -68,7 +68,6 @@ import android.view.inputmethod.InputMethodManager;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
......@@ -380,6 +379,8 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
animation.setDuration(150);
animation.addUpdateListener(valueAnimator -> {
if (binding == null)
return;
int upBy = (int) valueAnimator.getAnimatedValue();
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) binding.previewContainer.getLayoutParams();
layoutParams.setMargins(0, 0, 0, (int) (upBy * dpRatio));
......@@ -1244,18 +1245,13 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
public void finish() {
Activity activity = getActivity();
if (activity != null) {
activity.finishAndRemoveTask();
if (mBackstackLost) {
activity.finishAndRemoveTask();
startActivity(
Intent.makeMainActivity(
new ComponentName(activity, HomeActivity.class)).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
} else {
activity.finish();
startActivity(Intent.makeMainActivity(new ComponentName(activity, HomeActivity.class)).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
}
}
public void speakerClicked() {
presenter.speakerClick(binding.callSpeakerBtn.isChecked());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment