Convert SafeListView to Kotlin
This commit is contained in:
parent
75ebd49aa5
commit
860407e5d0
2 changed files with 20 additions and 28 deletions
|
@ -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?
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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) {
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue