From e0fac74f4360fbb7cd778bf8c2217d1e8366b22f Mon Sep 17 00:00:00 2001 From: Mariotaku Lee Date: Thu, 25 Aug 2016 01:11:53 +0800 Subject: [PATCH] removed unused classes --- twidere/build.gradle | 1 + .../mariotaku/twidere/util/ListViewUtils.java | 43 ---------------- .../mariotaku/twidere/util/RegexMatcher.java | 50 ------------------- 3 files changed, 1 insertion(+), 93 deletions(-) delete mode 100644 twidere/src/main/java/org/mariotaku/twidere/util/ListViewUtils.java delete mode 100644 twidere/src/main/java/org/mariotaku/twidere/util/RegexMatcher.java diff --git a/twidere/build.gradle b/twidere/build.gradle index 17fc4e272..83090145e 100644 --- a/twidere/build.gradle +++ b/twidere/build.gradle @@ -167,6 +167,7 @@ dependencies { compile 'com.github.mariotaku:AbstractTask:0.9.4' compile 'com.github.mariotaku.CommonsLibrary:parcel:0.9.8' compile 'com.github.mariotaku.CommonsLibrary:io:0.9.8' + compile 'com.github.mariotaku:KPreferences:0.9.1' compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" compile 'nl.komponents.kovenant:kovenant:3.3.0' compile 'nl.komponents.kovenant:kovenant-android:3.3.0' diff --git a/twidere/src/main/java/org/mariotaku/twidere/util/ListViewUtils.java b/twidere/src/main/java/org/mariotaku/twidere/util/ListViewUtils.java deleted file mode 100644 index 5289ac717..000000000 --- a/twidere/src/main/java/org/mariotaku/twidere/util/ListViewUtils.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Twidere - Twitter client for Android - * - * Copyright (C) 2012-2015 Mariotaku Lee - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * 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 . - */ - -package org.mariotaku.twidere.util; - -import android.view.View; -import android.widget.ListView; - -/** - * Created by mariotaku on 15/4/22. - */ -public class ListViewUtils { - - private ListViewUtils() { - } - - public static int getFirstFullyVisiblePosition(final ListView listView) { - final int firstVisiblePosition = listView.getFirstVisiblePosition(); - final View firstVisibleChild = listView.getChildAt(0); - if (firstVisibleChild != null && firstVisibleChild.getTop() < 0 - && firstVisiblePosition + 1 < listView.getCount()) { - return firstVisiblePosition + 1; - } - return firstVisiblePosition; - } - -} diff --git a/twidere/src/main/java/org/mariotaku/twidere/util/RegexMatcher.java b/twidere/src/main/java/org/mariotaku/twidere/util/RegexMatcher.java deleted file mode 100644 index a5ea75a9e..000000000 --- a/twidere/src/main/java/org/mariotaku/twidere/util/RegexMatcher.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Twidere - Twitter client for Android - * - * Copyright (C) 2012-2015 Mariotaku Lee - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * 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 . - */ - -package org.mariotaku.twidere.util; - -import android.support.v4.util.Pair; - -import java.util.ArrayList; -import java.util.regex.Pattern; - -/** - * Created by mariotaku on 15/9/22. - */ -public class RegexMatcher { - public static final int NO_MATCH = -1; - private final ArrayList> patternsList; - private final int defaultCode; - - public RegexMatcher(int code) { - defaultCode = code; - patternsList = new ArrayList<>(); - } - - public void addPattern(String pattern, int code) { - patternsList.add(Pair.create(Pattern.compile(pattern), code)); - } - - public int match(String path) { - for (Pair item : patternsList) { - if (item.first.matcher(path).matches()) return item.second; - } - return defaultCode; - } -}