Convert SafeListView to Kotlin

This commit is contained in:
Billy Brawner 2019-08-17 13:49:31 -05:00 committed by William Brawner
parent 75ebd49aa5
commit 860407e5d0
2 changed files with 20 additions and 28 deletions

View file

@ -1,28 +0,0 @@
package com.wbrawner.simplemarkdown.view.overrides;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;
public class SafeListView extends ListView {
public SafeListView(Context context) {
super(context);
}
public SafeListView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public SafeListView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onDetachedFromWindow() {
try {
super.onDetachedFromWindow();
} catch (Exception ignored) {
// TODO: report this?
}
}
}

View file

@ -0,0 +1,20 @@
package com.wbrawner.simplemarkdown.view.overrides
import android.content.Context
import android.util.AttributeSet
import android.widget.ListView
class SafeListView : ListView {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
override fun onDetachedFromWindow() {
try {
super.onDetachedFromWindow()
} catch (ignored: Exception) {
}
}
}