// Path: app/src/main/java/pw/thedrhax/util/Util.java
// public final class Util {
//     private Util() {}
// 
//     // Source: https://stackoverflow.com/a/26779342
//     public static int countLines(String input) {
//         LineNumberReader reader = new LineNumberReader(new StringReader(input));
//         try {
//             reader.skip(Long.MAX_VALUE);
//         } catch (IOException ignored) {}
//         return reader.getLineNumber();
//     }
// 
//     // TODO: Store Integers instead of Strings in SharedPreferences
//     public static int getIntPreference (Context context, String name, int def_value) {
//         final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
//         try {
//             return Integer.parseInt(settings.getString(name, Integer.valueOf(def_value).toString()));
//         } catch (NumberFormatException|ClassCastException ignored) {}
// 
//         try {
//             return settings.getInt(name, def_value);
//         } catch (ClassCastException ignored) {}
// 
//         return def_value;
//     }
// 
//     // Source: https://stackoverflow.com/a/34836992
//     public static String readAsset(Context context, String filename) throws IOException {
//         BufferedReader reader = new BufferedReader(
//                 new InputStreamReader(context.getAssets().open(filename), "UTF-8"));
//         StringBuilder sb = new StringBuilder();
//         String mLine = reader.readLine();
//         while (mLine != null) {
//             sb.append(mLine).append('\n');
//             mLine = reader.readLine();
//         }
//         reader.close();
//         return sb.toString();
//     }
// }


import com.edmodo.rangebar.RangeBar;
import pw.thedrhax.mosmetro.R;
import pw.thedrhax.util.Util;
import android.annotation.TargetApi;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.content.res.TypedArray;
import android.preference.DialogPreference;
import android.preference.PreferenceManager;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;
/**
 * Wi-Fi в метро (pw.thedrhax.mosmetro, Moscow Wi-Fi autologin)
 * Copyright © 2015 Dmitry Karikh <the.dr.hax@gmail.com>
 *
 * 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 <http://www.gnu.org/licenses/>.
 */

package pw.thedrhax.mosmetro.preferences;




public class RangeBarPreference extends DialogPreference {

    @TargetApi(21)
    public RangeBarPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
        init(context, attrs);
    }

    public RangeBarPreference(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
// Path: app/src/main/java/pw/thedrhax/util/Util.java
// public final class Util {
//     private Util() {}
// 
//     // Source: https://stackoverflow.com/a/26779342
//     public static int countLines(String input) {
//         LineNumberReader reader = new LineNumberReader(new StringReader(input));
//         try {
//             reader.skip(Long.MAX_VALUE);
//         } catch (IOException ignored) {}
//         return reader.getLineNumber();
//     }
// 
//     // TODO: Store Integers instead of Strings in SharedPreferences
//     public static int getIntPreference (Context context, String name, int def_value) {
//         final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
//         try {
//             return Integer.parseInt(settings.getString(name, Integer.valueOf(def_value).toString()));
//         } catch (NumberFormatException|ClassCastException ignored) {}
// 
//         try {
//             return settings.getInt(name, def_value);
//         } catch (ClassCastException ignored) {}
// 
//         return def_value;
//     }
// 
//     // Source: https://stackoverflow.com/a/34836992
//     public static String readAsset(Context context, String filename) throws IOException {
//         BufferedReader reader = new BufferedReader(
//                 new InputStreamReader(context.getAssets().open(filename), "UTF-8"));
//         StringBuilder sb = new StringBuilder();
//         String mLine = reader.readLine();
//         while (mLine != null) {
//             sb.append(mLine).append('\n');
//             mLine = reader.readLine();
//         }
//         reader.close();
//         return sb.toString();
//     }
// }


// Path: app/src/main/java/pw/thedrhax/mosmetro/preferences/RangeBarPreference.java
import com.edmodo.rangebar.RangeBar;
import pw.thedrhax.mosmetro.R;
import pw.thedrhax.util.Util;
import android.annotation.TargetApi;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.content.res.TypedArray;
import android.preference.DialogPreference;
import android.preference.PreferenceManager;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;

/**
 * Wi-Fi в метро (pw.thedrhax.mosmetro, Moscow Wi-Fi autologin)
 * Copyright © 2015 Dmitry Karikh <the.dr.hax@gmail.com>
 *
 * 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 <http://www.gnu.org/licenses/>.
 */

package pw.thedrhax.mosmetro.preferences;




public class RangeBarPreference extends DialogPreference {

    @TargetApi(21)
    public RangeBarPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
        init(context, attrs);
    }

    public RangeBarPreference(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(context, attrs);