diff --git a/malheur/src/main/java/de/kuschku/malheur/util/DisplayHelper.kt b/malheur/src/main/java/de/kuschku/malheur/util/DisplayHelper.kt deleted file mode 100644 index d5b058c5fb7cc92625516c742dd9e29f291fd032..0000000000000000000000000000000000000000 --- a/malheur/src/main/java/de/kuschku/malheur/util/DisplayHelper.kt +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Quasseldroid - Quassel client for Android - * - * Copyright (c) 2020 Janne Mareike Koschinski - * Copyright (c) 2020 The Quassel Project - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 3 as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -package de.kuschku.malheur.util - -import android.util.DisplayMetrics -import android.view.Display - -fun Display.getMetrics(): DisplayMetrics { - val metrics = DisplayMetrics() - getRealMetrics(metrics) - return metrics -} diff --git a/malheur/src/main/java/de/kuschku/malheur/util/ReflectionHelper.kt b/malheur/src/main/java/de/kuschku/malheur/util/ReflectionHelper.kt deleted file mode 100644 index 1009b395dde83ff4b9528358e460a1a4418c3f1b..0000000000000000000000000000000000000000 --- a/malheur/src/main/java/de/kuschku/malheur/util/ReflectionHelper.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Quasseldroid - Quassel client for Android - * - * Copyright (c) 2020 Janne Mareike Koschinski - * Copyright (c) 2020 The Quassel Project - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 3 as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -package de.kuschku.malheur.util - -fun <T> reflectionCollectGetters(klass: Class<T>?) = klass?.declaredMethods - ?.filter { it.parameterTypes.isEmpty() && it.returnType != Void::class.java } - ?.filter { it.name != "getClass" } - ?.filter { it.name.startsWith("get") || it.name.startsWith("is") } - ?.mapNotNull { - var result: Pair<String, Any?>? = null - try { - result = it.name to it.invoke(it) - } catch (e: IllegalAccessException) { - } catch (e: IllegalArgumentException) { - } - result - }?.toMap()