There is method called onDelete
in a Kotlin class.
override fun onDelete(position: Int) {
templates?.apply {
val deleteDialog = DeleteTemplateDialog(view.getViewContext())
deleteDialog.confirmListener = {
CustomTemplateRepository.getInstance().deleTemplate(this[position].templateId!!)
.subscribe({
deleteDialog.dismiss()
this.removeAt(position)
customTemplateAdapter?.notifyDataSetChanged()
view.showEmptyView(this.isEmpty())
}, {})
}
}
}
When I build release-apk, I enable proguard
but it failed because of below warning.
Warning: com.uniquestudio.android.iemoji.module.library.customtemplate.MyTemplatePresenter$onDelete$1$1$2: can't find referenced class com.uniquestudio.android.iemoji.module.library.customtemplate.MyTemplatePresenter$onDelete$1$1
When I use dex2jar to retrieve this class from debug-APK. I got this.
public void onDelete(final int paramInt)
{
final DeleteTemplateDialog localDeleteTemplateDialog = new DeleteTemplateDialog(this.view.getViewContext());
localDeleteTemplateDialog.setConfirmListenner((Function0)new Lambda(localArrayList)
{
public final Disposable invoke()
{
CustomTemplateRepository localCustomTemplateRepository = CustomTemplateRepository.Companion.getInstance();
String str = ((Template)this.receiver$0.get(paramInt)).getTemplateId();
if (str == null) {
Intrinsics.throwNpe();
}
localCustomTemplateRepository.deleTemplate(str).subscribe((Action)new Action()
{
public final void run()
{
this.this$0.$deleteDialog.dismiss();
this.this$0.receiver$0.remove(this.this$0.$position$inlined);
CustomTemplateAdapter localCustomTemplateAdapter = MyTemplatePresenter.access$getCustomTemplateAdapter$p(this.this$0.this$0);
if (localCustomTemplateAdapter != null) {
localCustomTemplateAdapter.notifyDataSetChanged();
}
this.this$0.this$0.getView().showEmptyView(this.this$0.receiver$0.isEmpty());
}
}, (Consumer)MyTemplatePresenter.onDelete.1.1.2.INSTANCE);
}
});
}
I don't know:
com.uniquestudio.android.iemoji.module.library.customtemplate.MyTemplatePresenter$onDelete$1$1$2
com.uniquestudio.android.iemoji.module.library.customtemplate.MyTemplatePresenter$onDelete$1$1
Seems to be a kotlin issue, the issue can be watched here: https://youtrack.jetbrains.com/issue/KT-16084
Rewrite the apply
and everything should work...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With