remove deprecated half-camera dependency

This commit is contained in:
adbenitez 2025-02-04 18:40:02 +01:00
parent cd07f3de96
commit 5ce1f415ce
11 changed files with 3 additions and 1448 deletions

View file

@ -88,9 +88,6 @@ import org.thoughtcrime.securesms.components.InputPanel;
import org.thoughtcrime.securesms.components.KeyboardAwareLinearLayout.OnKeyboardShownListener;
import org.thoughtcrime.securesms.components.ScaleStableImageView;
import org.thoughtcrime.securesms.components.SendButton;
import org.thoughtcrime.securesms.components.camera.QuickAttachmentDrawer;
import org.thoughtcrime.securesms.components.camera.QuickAttachmentDrawer.AttachmentDrawerListener;
import org.thoughtcrime.securesms.components.camera.QuickAttachmentDrawer.DrawerState;
import org.thoughtcrime.securesms.components.emoji.MediaKeyboard;
import org.thoughtcrime.securesms.connect.AccountManager;
import org.thoughtcrime.securesms.connect.DcEventCenter;
@ -142,7 +139,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
SearchView.OnQueryTextListener,
DcEventCenter.DcEventDelegate,
OnKeyboardShownListener,
AttachmentDrawerListener,
InputPanel.Listener,
InputPanel.MediaListener
{
@ -181,7 +177,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
private FrameLayout emojiPickerContainer;
private MediaKeyboard emojiPicker;
protected HidingLinearLayout quickAttachmentToggle;
private QuickAttachmentDrawer quickAttachmentDrawer;
private InputPanel inputPanel;
private ApplicationContext context;
@ -291,7 +286,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
@Override
protected void onResume() {
super.onResume();
quickAttachmentDrawer.onResume();
initializeEnabledCheck();
composeText.setTransport(sendButton.getSelectedTransport());
@ -311,7 +305,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
DcHelper.getNotificationCenter(this).clearVisibleChat();
if (isFinishing()) overridePendingTransition(R.anim.fade_scale_in, R.anim.slide_to_right);
quickAttachmentDrawer.onPause();
inputPanel.onPause();
AudioSlidePlayer.stopAll();
}
@ -321,7 +314,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
Log.i(TAG, "onConfigurationChanged(" + newConfig.orientation + ")");
super.onConfigurationChanged(newConfig);
composeText.setTransport(sendButton.getSelectedTransport());
quickAttachmentDrawer.onConfigurationChanged();
if (emojiPicker != null && container.getCurrentInput() == emojiPicker) {
container.hideAttachedInput(true);
@ -817,7 +809,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
emojiPickerContainer = ViewUtil.findById(this, R.id.emoji_picker_container);
composePanel = ViewUtil.findById(this, R.id.bottom_panel);
container = ViewUtil.findById(this, R.id.layout_container);
quickAttachmentDrawer = ViewUtil.findById(this, R.id.quick_attachment_drawer);
quickAttachmentToggle = ViewUtil.findById(this, R.id.quick_attachment_toggle);
inputPanel = ViewUtil.findById(this, R.id.bottom_panel);
backgroundView = ViewUtil.findById(this, R.id.conversation_background);
@ -857,8 +848,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
composeText.setOnClickListener(composeKeyPressedListener);
composeText.setOnFocusChangeListener(composeKeyPressedListener);
quickAttachmentDrawer.setListener(this);
quickCameraToggle.setOnClickListener(new QuickCameraToggleListener());
quickCameraToggle.setOnClickListener(v -> attachmentManager.capturePhoto(ConversationActivity.this, TAKE_PHOTO));
initializeBackground();
}
@ -1159,43 +1149,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
}
}
@Override
public void onAttachmentDrawerStateChanged(DrawerState drawerState) {
ActionBar supportActionBar = getSupportActionBar();
if (supportActionBar == null) throw new AssertionError();
if (drawerState == DrawerState.FULL_EXPANDED) {
supportActionBar.hide();
} else {
supportActionBar.show();
}
if (drawerState == DrawerState.COLLAPSED) {
container.hideAttachedInput(true);
}
}
@Override
public void onImageCapture(@NonNull final byte[] imageBytes) {
setMedia(PersistentBlobProvider.getInstance()
.create(this, imageBytes, MediaUtil.IMAGE_JPEG, "image.jpeg"),
MediaType.IMAGE);
quickAttachmentDrawer.hide(false);
}
@Override
public void onCameraFail() {
Toast.makeText(this, R.string.chat_camera_unavailable, Toast.LENGTH_SHORT).show();
quickAttachmentDrawer.hide(false);
quickAttachmentToggle.disable();
}
@Override
public void onCameraStart() {}
@Override
public void onCameraStop() {}
@Override
public void onRecorderPermissionRequired() {
Permissions.with(this)
@ -1350,31 +1303,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
}
}
private class QuickCameraToggleListener implements OnClickListener {
@Override
public void onClick(View v) {
fragment.hideAddReactionView();
if (Prefs.isBuiltInCameraPreferred(ConversationActivity.this)
&& QuickAttachmentDrawer.isDeviceSupported(ConversationActivity.this)) {
if (!quickAttachmentDrawer.isShowing()) {
Permissions.with(ConversationActivity.this)
.request(Manifest.permission.CAMERA)
.ifNecessary()
.withPermanentDenialDialog(getString(R.string.perm_explain_access_to_camera_denied))
.onAllGranted(() -> {
composeText.clearFocus();
container.show(composeText, quickAttachmentDrawer);
})
.execute();
} else {
container.hideAttachedInput(false);
}
} else {
attachmentManager.capturePhoto(ConversationActivity.this, TAKE_PHOTO);
}
}
}
private class SendButtonListener implements OnClickListener, TextView.OnEditorActionListener {
@Override
public void onClick(View v) {