From 9c7f249756b9e415f2718fb9ca892595faebee86 Mon Sep 17 00:00:00 2001 From: Mauricio Colli Date: Mon, 8 May 2017 10:28:33 -0300 Subject: [PATCH] Clean and move some classes --- .../org/schabi/newpipe/ThemableActivity.java | 28 ----------- .../search/SearchSuggestionListener.java | 49 ------------------- .../newpipe/{ => util}/Localization.java | 4 +- 3 files changed, 3 insertions(+), 78 deletions(-) delete mode 100644 app/src/main/java/org/schabi/newpipe/ThemableActivity.java delete mode 100644 app/src/main/java/org/schabi/newpipe/fragments/search/SearchSuggestionListener.java rename app/src/main/java/org/schabi/newpipe/{ => util}/Localization.java (98%) diff --git a/app/src/main/java/org/schabi/newpipe/ThemableActivity.java b/app/src/main/java/org/schabi/newpipe/ThemableActivity.java deleted file mode 100644 index 8b0d126be..000000000 --- a/app/src/main/java/org/schabi/newpipe/ThemableActivity.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.schabi.newpipe; - -import android.os.Bundle; -import android.preference.PreferenceManager; -import android.support.v7.app.AppCompatActivity; - -public class ThemableActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - if (PreferenceManager.getDefaultSharedPreferences(this) - .getString("theme", getResources().getString(R.string.light_theme_title)). - equals(getResources().getString(R.string.dark_theme_title))) { - setTheme(R.style.DarkTheme); - } - } - - @Override - protected void onResume() { - super.onResume(); - if (PreferenceManager.getDefaultSharedPreferences(this) - .getString("theme", getResources().getString(R.string.light_theme_title)). - equals(getResources().getString(R.string.dark_theme_title))) { - setTheme(R.style.DarkTheme); - } - } -} \ No newline at end of file diff --git a/app/src/main/java/org/schabi/newpipe/fragments/search/SearchSuggestionListener.java b/app/src/main/java/org/schabi/newpipe/fragments/search/SearchSuggestionListener.java deleted file mode 100644 index 9e2a74dad..000000000 --- a/app/src/main/java/org/schabi/newpipe/fragments/search/SearchSuggestionListener.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.schabi.newpipe.fragments.search; - -import android.support.v7.widget.SearchView; - -/** - * Created by Christian Schabesberger on 02.08.16. - * - * Copyright (C) Christian Schabesberger 2016 - * SearchSuggestionListener.java is part of NewPipe. - * - * NewPipe 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. - * - * NewPipe 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 NewPipe. If not, see . - */ - - -public class SearchSuggestionListener implements SearchView.OnSuggestionListener{ - - private final SearchView searchView; - private final SuggestionListAdapter adapter; - - public SearchSuggestionListener(SearchView searchView, SuggestionListAdapter adapter) { - this.searchView = searchView; - this.adapter = adapter; - } - - @Override - public boolean onSuggestionSelect(int position) { - String suggestion = adapter.getSuggestion(position); - searchView.setQuery(suggestion,true); - return false; - } - - @Override - public boolean onSuggestionClick(int position) { - String suggestion = adapter.getSuggestion(position); - searchView.setQuery(suggestion,true); - return false; - } -} \ No newline at end of file diff --git a/app/src/main/java/org/schabi/newpipe/Localization.java b/app/src/main/java/org/schabi/newpipe/util/Localization.java similarity index 98% rename from app/src/main/java/org/schabi/newpipe/Localization.java rename to app/src/main/java/org/schabi/newpipe/util/Localization.java index 2fa461129..f1eb50c6a 100644 --- a/app/src/main/java/org/schabi/newpipe/Localization.java +++ b/app/src/main/java/org/schabi/newpipe/util/Localization.java @@ -1,10 +1,12 @@ -package org.schabi.newpipe; +package org.schabi.newpipe.util; import android.content.Context; import android.content.SharedPreferences; import android.content.res.Resources; import android.preference.PreferenceManager; +import org.schabi.newpipe.R; + import java.text.DateFormat; import java.text.NumberFormat; import java.text.ParseException;