fix: remove clear all media dialog for now
This commit is contained in:
parent
8250603cfc
commit
4e0d043a8c
|
@ -163,16 +163,7 @@ public class MediaOverviewActivity extends PassphraseRequiredActionBarActivity i
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (v.getId() == R.id.clearMedia) {
|
if (v.getId() == R.id.clearMedia) {
|
||||||
FragmentManager fm = getSupportFragmentManager();
|
// TODO: future chunk
|
||||||
ClearAllMediaDialog dialog = new ClearAllMediaDialog(() -> {
|
|
||||||
StorageProtocol storage = MessagingModuleConfiguration.getShared().getStorage();
|
|
||||||
Long threadId = storage.getThreadId(recipient);
|
|
||||||
if (threadId != null) {
|
|
||||||
storage.clearMedia(threadId, null);
|
|
||||||
}
|
|
||||||
return Unit.INSTANCE;
|
|
||||||
});
|
|
||||||
dialog.show(fm, "ClearAllMedia");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
package org.thoughtcrime.securesms.conversation.settings
|
|
||||||
|
|
||||||
import android.view.LayoutInflater
|
|
||||||
import android.view.View
|
|
||||||
import androidx.appcompat.app.AlertDialog
|
|
||||||
import network.loki.messenger.databinding.DialogClearAllMediaBinding
|
|
||||||
import org.thoughtcrime.securesms.conversation.v2.utilities.BaseDialog
|
|
||||||
|
|
||||||
class ClearAllMediaDialog(private val callback: ()->Unit): BaseDialog(), View.OnClickListener {
|
|
||||||
|
|
||||||
private lateinit var binding: DialogClearAllMediaBinding
|
|
||||||
|
|
||||||
override fun setContentView(builder: AlertDialog.Builder) {
|
|
||||||
super.setContentView(builder)
|
|
||||||
binding = DialogClearAllMediaBinding.inflate(LayoutInflater.from(requireContext()))
|
|
||||||
with (binding) {
|
|
||||||
clear.setOnClickListener(this@ClearAllMediaDialog)
|
|
||||||
cancel.setOnClickListener(this@ClearAllMediaDialog)
|
|
||||||
}
|
|
||||||
builder.setView(binding.root)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onClick(v: View) {
|
|
||||||
when {
|
|
||||||
v === binding.cancel -> dismiss()
|
|
||||||
v === binding.clear -> {
|
|
||||||
callback()
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue