diff --git a/app/src/main/java/eu/kanade/mangafeed/util/events/ChapterCountEvent.java b/app/src/main/java/eu/kanade/mangafeed/events/ChapterCountEvent.java similarity index 82% rename from app/src/main/java/eu/kanade/mangafeed/util/events/ChapterCountEvent.java rename to app/src/main/java/eu/kanade/mangafeed/events/ChapterCountEvent.java index f1f33df74..f5de50ec9 100644 --- a/app/src/main/java/eu/kanade/mangafeed/util/events/ChapterCountEvent.java +++ b/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; diff --git a/app/src/main/java/eu/kanade/mangafeed/util/events/SourceChapterEvent.java b/app/src/main/java/eu/kanade/mangafeed/events/SourceChapterEvent.java similarity index 91% rename from app/src/main/java/eu/kanade/mangafeed/util/events/SourceChapterEvent.java rename to app/src/main/java/eu/kanade/mangafeed/events/SourceChapterEvent.java index c033bdd71..9c9ed7560 100644 --- a/app/src/main/java/eu/kanade/mangafeed/util/events/SourceChapterEvent.java +++ b/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; diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/MangaChaptersPresenter.java b/app/src/main/java/eu/kanade/mangafeed/presenter/MangaChaptersPresenter.java index 5900784b2..fd94d5901 100644 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/MangaChaptersPresenter.java +++ b/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; diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/MangaInfoPresenter.java b/app/src/main/java/eu/kanade/mangafeed/presenter/MangaInfoPresenter.java index de4362889..29343770d 100644 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/MangaInfoPresenter.java +++ b/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 { diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/ReaderPresenter.java b/app/src/main/java/eu/kanade/mangafeed/presenter/ReaderPresenter.java index 56a8061e8..355c46eb2 100644 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/ReaderPresenter.java +++ b/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; diff --git a/app/src/main/java/eu/kanade/mangafeed/util/AndroidComponentUtil.java b/app/src/main/java/eu/kanade/mangafeed/util/AndroidComponentUtil.java deleted file mode 100644 index 3789160fe..000000000 --- a/app/src/main/java/eu/kanade/mangafeed/util/AndroidComponentUtil.java +++ /dev/null @@ -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; - } -} diff --git a/app/src/main/java/eu/kanade/mangafeed/util/DataUtils.java b/app/src/main/java/eu/kanade/mangafeed/util/DataUtils.java deleted file mode 100644 index 2e8a09120..000000000 --- a/app/src/main/java/eu/kanade/mangafeed/util/DataUtils.java +++ /dev/null @@ -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; - } - -} diff --git a/app/src/main/java/eu/kanade/mangafeed/util/DialogFactory.java b/app/src/main/java/eu/kanade/mangafeed/util/DialogFactory.java deleted file mode 100644 index c9b9ba171..000000000 --- a/app/src/main/java/eu/kanade/mangafeed/util/DialogFactory.java +++ /dev/null @@ -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)); - } - -} diff --git a/app/src/main/java/eu/kanade/mangafeed/util/SnackbarFactory.java b/app/src/main/java/eu/kanade/mangafeed/util/SnackbarFactory.java deleted file mode 100644 index 208798372..000000000 --- a/app/src/main/java/eu/kanade/mangafeed/util/SnackbarFactory.java +++ /dev/null @@ -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; - } -} \ No newline at end of file diff --git a/app/src/main/java/eu/kanade/mangafeed/util/ViewUtils.java b/app/src/main/java/eu/kanade/mangafeed/util/ViewUtils.java deleted file mode 100644 index 18ba0d533..000000000 --- a/app/src/main/java/eu/kanade/mangafeed/util/ViewUtils.java +++ /dev/null @@ -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); - } - -}