From 860407e5d01d6f97c57b8605c25fa43c4ef3e618 Mon Sep 17 00:00:00 2001 From: Billy Brawner Date: Sat, 17 Aug 2019 13:49:31 -0500 Subject: [PATCH] Convert SafeListView to Kotlin --- .../view/overrides/SafeListView.java | 28 ------------------- .../view/overrides/SafeListView.kt | 20 +++++++++++++ 2 files changed, 20 insertions(+), 28 deletions(-) delete mode 100644 app/src/main/java/com/wbrawner/simplemarkdown/view/overrides/SafeListView.java create mode 100644 app/src/main/java/com/wbrawner/simplemarkdown/view/overrides/SafeListView.kt diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/view/overrides/SafeListView.java b/app/src/main/java/com/wbrawner/simplemarkdown/view/overrides/SafeListView.java deleted file mode 100644 index 52ca59f..0000000 --- a/app/src/main/java/com/wbrawner/simplemarkdown/view/overrides/SafeListView.java +++ /dev/null @@ -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? - } - } -} diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/view/overrides/SafeListView.kt b/app/src/main/java/com/wbrawner/simplemarkdown/view/overrides/SafeListView.kt new file mode 100644 index 0000000..d645a7c --- /dev/null +++ b/app/src/main/java/com/wbrawner/simplemarkdown/view/overrides/SafeListView.kt @@ -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) { + } + } +}