Browse Source

Remove unused util classes

inorichi 9 years ago
parent
commit
57290a5395

+ 1 - 1
app/src/main/java/eu/kanade/mangafeed/util/events/ChapterCountEvent.java → app/src/main/java/eu/kanade/mangafeed/events/ChapterCountEvent.java

@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.util.events;
+package eu.kanade.mangafeed.events;
 
 public class ChapterCountEvent {
     private int count;

+ 1 - 1
app/src/main/java/eu/kanade/mangafeed/util/events/SourceChapterEvent.java → app/src/main/java/eu/kanade/mangafeed/events/SourceChapterEvent.java

@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.util.events;
+package eu.kanade.mangafeed.events;
 
 import eu.kanade.mangafeed.data.models.Chapter;
 import eu.kanade.mangafeed.sources.Source;

+ 2 - 2
app/src/main/java/eu/kanade/mangafeed/presenter/MangaChaptersPresenter.java

@@ -16,8 +16,8 @@ import eu.kanade.mangafeed.data.models.Manga;
 import eu.kanade.mangafeed.sources.Source;
 import eu.kanade.mangafeed.ui.fragment.MangaChaptersFragment;
 import eu.kanade.mangafeed.util.EventBusHook;
-import eu.kanade.mangafeed.util.events.ChapterCountEvent;
-import eu.kanade.mangafeed.util.events.SourceChapterEvent;
+import eu.kanade.mangafeed.events.ChapterCountEvent;
+import eu.kanade.mangafeed.events.SourceChapterEvent;
 import rx.Observable;
 import rx.android.schedulers.AndroidSchedulers;
 import rx.schedulers.Schedulers;

+ 1 - 1
app/src/main/java/eu/kanade/mangafeed/presenter/MangaInfoPresenter.java

@@ -8,7 +8,7 @@ import eu.kanade.mangafeed.data.helpers.DatabaseHelper;
 import eu.kanade.mangafeed.data.models.Manga;
 import eu.kanade.mangafeed.ui.fragment.MangaInfoFragment;
 import eu.kanade.mangafeed.util.EventBusHook;
-import eu.kanade.mangafeed.util.events.ChapterCountEvent;
+import eu.kanade.mangafeed.events.ChapterCountEvent;
 import rx.Observable;
 
 public class MangaInfoPresenter extends BasePresenter<MangaInfoFragment> {

+ 1 - 1
app/src/main/java/eu/kanade/mangafeed/presenter/ReaderPresenter.java

@@ -13,7 +13,7 @@ import eu.kanade.mangafeed.data.models.Page;
 import eu.kanade.mangafeed.sources.Source;
 import eu.kanade.mangafeed.ui.activity.ReaderActivity;
 import eu.kanade.mangafeed.util.EventBusHook;
-import eu.kanade.mangafeed.util.events.SourceChapterEvent;
+import eu.kanade.mangafeed.events.SourceChapterEvent;
 import icepick.State;
 import rx.Observable;
 import rx.android.schedulers.AndroidSchedulers;

+ 0 - 33
app/src/main/java/eu/kanade/mangafeed/util/AndroidComponentUtil.java

@@ -1,33 +0,0 @@
-package eu.kanade.mangafeed.util;
-
-import android.app.ActivityManager;
-import android.app.ActivityManager.RunningServiceInfo;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.pm.PackageManager;
-
-import timber.log.Timber;
-
-public class AndroidComponentUtil {
-
-    public static void toggleComponent(Context context, Class componentClass, boolean enable) {
-        Timber.i((enable ? "Enabling " : "Disabling ") + componentClass.getSimpleName());
-        ComponentName componentName = new ComponentName(context, componentClass);
-        PackageManager pm = context.getPackageManager();
-        pm.setComponentEnabledSetting(componentName,
-                enable ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED :
-                        PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
-                PackageManager.DONT_KILL_APP);
-    }
-
-    public static boolean isServiceRunning(Context context, Class serviceClass) {
-        ActivityManager manager =
-                (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
-        for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
-            if (serviceClass.getName().equals(service.service.getClassName())) {
-                return true;
-            }
-        }
-        return false;
-    }
-}

+ 0 - 13
app/src/main/java/eu/kanade/mangafeed/util/DataUtils.java

@@ -1,13 +0,0 @@
-package eu.kanade.mangafeed.util;
-
-import android.content.Context;
-import android.net.ConnectivityManager;
-
-public class DataUtils {
-
-    public static boolean isNetworkAvailable(Context context) {
-        ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
-        return connectivityManager.getActiveNetworkInfo() != null;
-    }
-
-}

+ 0 - 39
app/src/main/java/eu/kanade/mangafeed/util/DialogFactory.java

@@ -1,39 +0,0 @@
-package eu.kanade.mangafeed.util;
-
-import android.app.Dialog;
-import android.app.ProgressDialog;
-import android.content.Context;
-import android.support.annotation.StringRes;
-import android.support.v7.app.AlertDialog;
-
-import eu.kanade.mangafeed.R;
-
-public class DialogFactory {
-
-    public static Dialog createSimpleOkErrorDialog(Context context, String title, String message) {
-        AlertDialog.Builder alertDialog = new AlertDialog.Builder(context)
-                .setTitle(title)
-                .setMessage(message)
-                .setNeutralButton(R.string.dialog_action_ok, null);
-        return alertDialog.create();
-    }
-
-    public static Dialog createSimpleErrorDialog(Context context) {
-        AlertDialog.Builder alertDialog = new AlertDialog.Builder(context)
-                .setTitle(context.getString(R.string.dialog_error_title))
-                .setMessage(context.getString(R.string.dialog_general_error_Message))
-                .setNeutralButton(R.string.dialog_action_ok, null);
-        return alertDialog.create();
-    }
-
-    public static ProgressDialog createProgressDialog(Context context, String message) {
-        ProgressDialog progressDialog = new ProgressDialog(context);
-        progressDialog.setMessage(message);
-        return progressDialog;
-    }
-
-    public static ProgressDialog createProgressDialog(Context context, @StringRes int messageResoruce) {
-        return createProgressDialog(context, context.getString(messageResoruce));
-    }
-
-}

+ 0 - 18
app/src/main/java/eu/kanade/mangafeed/util/SnackbarFactory.java

@@ -1,18 +0,0 @@
-package eu.kanade.mangafeed.util;
-
-import android.content.Context;
-import android.support.design.widget.Snackbar;
-import android.view.View;
-import android.view.ViewGroup;
-
-import eu.kanade.mangafeed.R;
-
-public class SnackbarFactory {
-
-    public static Snackbar createSnackbar(Context context, View view, String message) {
-        Snackbar snackbar = Snackbar.make(view, message, Snackbar.LENGTH_SHORT);
-        ViewGroup group = (ViewGroup) snackbar.getView();
-        group.setBackgroundColor(context.getResources().getColor(R.color.primary));
-        return snackbar;
-    }
-}

+ 0 - 13
app/src/main/java/eu/kanade/mangafeed/util/ViewUtils.java

@@ -1,13 +0,0 @@
-package eu.kanade.mangafeed.util;
-
-import android.content.Context;
-import android.util.DisplayMetrics;
-
-public class ViewUtils {
-
-    public static float convertPixelsToDp(float px, Context context){
-        DisplayMetrics metrics = context.getResources().getDisplayMetrics();
-        return px / (metrics.densityDpi / 160f);
-    }
-
-}