// Path: app/src/main/java/de/qspool/clementineremote/SharedPreferencesKeys.java
// public class SharedPreferencesKeys {
// 
//     public final static String SP_FIRST_CALL = "first_call";
// 
//     public final static String SP_KEY_IP = "save_clementine_ip";
// 
//     public final static String SP_KEY_AC = "pref_autoconnect";
// 
//     public final static String SP_KEY_USE_VOLUMEKEYS = "pref_volumekey";
// 
//     public final static String SP_KEY_PORT = "pref_port";
// 
//     public final static String SP_LAST_AUTH_CODE = "last_auth_code";
// 
//     public final static String SP_SHOW_TRACKNO = "pref_show_trackno";
// 
//     public final static String SP_LASTFM = "pref_show_lastfm";
// 
//     public final static String SP_KEEP_SCREEN_ON = "pref_keep_screen_on";
// 
//     public final static String SP_WAKE_LOCK = "pref_wake_lock";
// 
//     public final static String SP_LOWER_VOLUME = "pref_lower_volume";
// 
//     public final static String SP_CALL_VOLUME = "pref_call_volume";
// 
//     public final static String SP_VOLUME_INC = "pref_volume_inc";
// 
//     public final static String SP_LIBRARY_GROUPING = "pref_library_grouping";
// 
//     public final static String SP_LIBRARY_SORTING = "pref_library_sorting";
// 
//     public final static String SP_WIFI_ONLY = "pref_dl_wifi_only";
// 
//     public final static String SP_DOWNLOAD_DIR = "pref_dl_dir";
// 
//     public final static String SP_DOWNLOAD_OVERRIDE = "pref_dl_override";
// 
//     public final static String SP_DOWNLOAD_SAVE_OWN_DIR = "pref_dl_pl_save_own_dir";
// 
//     public final static String SP_DOWNLOAD_PLAYLIST_CRT_ARTIST_DIR = "pref_dl_artist_dir";
// 
//     public final static String SP_DOWNLOAD_PLAYLIST_CRT_ALBUM_DIR = "pref_dl_album_dir";
// 
//     public final static String SP_LAST_STACKTRACE = "last_stacktrace";
// 
//     public final static String SP_LAST_SEND_STACKTRACE = "last_send_stacktrace";
// 
//     public final static String SP_LIBRARY_IP = "library_ip";
// 
//     public final static String SP_KNOWN_IP = "known_ips";
// }


import android.annotation.SuppressLint;
import android.app.Fragment;
import android.content.SharedPreferences;
import android.net.TrafficStats;
import android.os.Bundle;
import android.os.Message;
import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.SeekBar;
import android.widget.TextView;
import java.util.Date;
import java.util.Locale;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.TimeUnit;
import de.qspool.clementineremote.App;
import de.qspool.clementineremote.R;
import de.qspool.clementineremote.SharedPreferencesKeys;
import de.qspool.clementineremote.backend.pb.ClementineMessage;
import de.qspool.clementineremote.backend.pb.ClementineMessageFactory;
import de.qspool.clementineremote.ui.interfaces.BackPressHandleable;
import de.qspool.clementineremote.ui.interfaces.NameableTitle;
import de.qspool.clementineremote.ui.interfaces.RemoteDataReceiver;
import de.qspool.clementineremote.utils.Utilities;
/* T
his file is part of the Android Clementine Remote.
 * Copyright (C) 2013, Andreas Muttscheller <asfa194@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 de.qspool.clementineremote.ui.fragments.playerpages;




public class ConnectionFragment extends Fragment
        implements BackPressHandleable, RemoteDataReceiver, NameableTitle {

    private TextView tv_ip;

    private TextView tv_version;

    private TextView tv_time;

    private TextView tv_traffic;

    private SeekBar sb_volume;

    private SharedPreferences mSharedPref;

    private Timer mUpdateTimer;

    private boolean mUserChangesVolume;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Get the shared preferences
        mSharedPref = PreferenceManager.getDefaultSharedPreferences(getActivity());

        setHasOptionsMenu(true);
    }

    @SuppressLint("SetTextI18n")
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_player_connection,
                container, false);

        tv_ip = (TextView) view.findViewById(R.id.cn_ip);
        tv_time = (TextView) view.findViewById(R.id.cn_time);
        tv_version = (TextView) view.findViewById(R.id.cn_version);
        tv_traffic = (TextView) view.findViewById(R.id.cn_traffic);

        updateData();

// Path: app/src/main/java/de/qspool/clementineremote/SharedPreferencesKeys.java
// public class SharedPreferencesKeys {
// 
//     public final static String SP_FIRST_CALL = "first_call";
// 
//     public final static String SP_KEY_IP = "save_clementine_ip";
// 
//     public final static String SP_KEY_AC = "pref_autoconnect";
// 
//     public final static String SP_KEY_USE_VOLUMEKEYS = "pref_volumekey";
// 
//     public final static String SP_KEY_PORT = "pref_port";
// 
//     public final static String SP_LAST_AUTH_CODE = "last_auth_code";
// 
//     public final static String SP_SHOW_TRACKNO = "pref_show_trackno";
// 
//     public final static String SP_LASTFM = "pref_show_lastfm";
// 
//     public final static String SP_KEEP_SCREEN_ON = "pref_keep_screen_on";
// 
//     public final static String SP_WAKE_LOCK = "pref_wake_lock";
// 
//     public final static String SP_LOWER_VOLUME = "pref_lower_volume";
// 
//     public final static String SP_CALL_VOLUME = "pref_call_volume";
// 
//     public final static String SP_VOLUME_INC = "pref_volume_inc";
// 
//     public final static String SP_LIBRARY_GROUPING = "pref_library_grouping";
// 
//     public final static String SP_LIBRARY_SORTING = "pref_library_sorting";
// 
//     public final static String SP_WIFI_ONLY = "pref_dl_wifi_only";
// 
//     public final static String SP_DOWNLOAD_DIR = "pref_dl_dir";
// 
//     public final static String SP_DOWNLOAD_OVERRIDE = "pref_dl_override";
// 
//     public final static String SP_DOWNLOAD_SAVE_OWN_DIR = "pref_dl_pl_save_own_dir";
// 
//     public final static String SP_DOWNLOAD_PLAYLIST_CRT_ARTIST_DIR = "pref_dl_artist_dir";
// 
//     public final static String SP_DOWNLOAD_PLAYLIST_CRT_ALBUM_DIR = "pref_dl_album_dir";
// 
//     public final static String SP_LAST_STACKTRACE = "last_stacktrace";
// 
//     public final static String SP_LAST_SEND_STACKTRACE = "last_send_stacktrace";
// 
//     public final static String SP_LIBRARY_IP = "library_ip";
// 
//     public final static String SP_KNOWN_IP = "known_ips";
// }


// Path: app/src/main/java/de/qspool/clementineremote/ui/fragments/playerpages/ConnectionFragment.java
import android.annotation.SuppressLint;
import android.app.Fragment;
import android.content.SharedPreferences;
import android.net.TrafficStats;
import android.os.Bundle;
import android.os.Message;
import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.SeekBar;
import android.widget.TextView;
import java.util.Date;
import java.util.Locale;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.TimeUnit;
import de.qspool.clementineremote.App;
import de.qspool.clementineremote.R;
import de.qspool.clementineremote.SharedPreferencesKeys;
import de.qspool.clementineremote.backend.pb.ClementineMessage;
import de.qspool.clementineremote.backend.pb.ClementineMessageFactory;
import de.qspool.clementineremote.ui.interfaces.BackPressHandleable;
import de.qspool.clementineremote.ui.interfaces.NameableTitle;
import de.qspool.clementineremote.ui.interfaces.RemoteDataReceiver;
import de.qspool.clementineremote.utils.Utilities;

/* T
his file is part of the Android Clementine Remote.
 * Copyright (C) 2013, Andreas Muttscheller <asfa194@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 de.qspool.clementineremote.ui.fragments.playerpages;




public class ConnectionFragment extends Fragment
        implements BackPressHandleable, RemoteDataReceiver, NameableTitle {

    private TextView tv_ip;

    private TextView tv_version;

    private TextView tv_time;

    private TextView tv_traffic;

    private SeekBar sb_volume;

    private SharedPreferences mSharedPref;

    private Timer mUpdateTimer;

    private boolean mUserChangesVolume;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Get the shared preferences
        mSharedPref = PreferenceManager.getDefaultSharedPreferences(getActivity());

        setHasOptionsMenu(true);
    }

    @SuppressLint("SetTextI18n")
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_player_connection,
                container, false);

        tv_ip = (TextView) view.findViewById(R.id.cn_ip);
        tv_time = (TextView) view.findViewById(R.id.cn_time);
        tv_version = (TextView) view.findViewById(R.id.cn_version);
        tv_traffic = (TextView) view.findViewById(R.id.cn_traffic);

        updateData();

        tv_ip.setText(mSharedPref.getString(SharedPreferencesKeys.SP_KEY_IP, "") + ":" + mSharedPref