// Path: app/src/main/java/io/rapidpro/surveyor/fragment/SettingsFragment.java
// public class SettingsFragment extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
// 
//     public SettingsFragment() {
//         // Required empty public constructor
//     }
// 
//     @Override
//     public void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         // make sure we're editing the correct preferences
//         getPreferenceManager().setSharedPreferencesName(getSurveyor().getPreferencesName());
// 
//         // load the preference screen from an XML resource
//         addPreferencesFromResource(R.xml.preferences);
// 
//         Preference pref = findPreference(SurveyorPreferences.HOST);
//         pref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
//             @Override
//             public boolean onPreferenceChange(Preference preference, Object newValue) {
//                 if (!Patterns.WEB_URL.matcher((String) newValue).matches()) {
//                     Toast.makeText(getActivity(), getString(R.string.error_invalid_host), Toast.LENGTH_SHORT).show();
//                     return false;
//                 }
//                 return true;
//             }
//         });
//     }
// 
//     @Override
//     public void onResume() {
//         super.onResume();
// 
//         getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
//     }
// 
//     @Override
//     public void onPause() {
//         getPreferenceManager().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
// 
//         super.onPause();
//     }
// 
//     @Override
//     public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
//         if (key.equals(SurveyorPreferences.HOST)) {
//             getSurveyor().onTembaHostChanged();
//         }
//     }
// 
//     private SurveyorApplication getSurveyor() {
//         return ((BaseActivity) getActivity()).getSurveyor();
//     }
// }


import android.app.FragmentTransaction;
import android.os.Bundle;
import io.rapidpro.surveyor.fragment.SettingsFragment;
package io.rapidpro.surveyor.activity;




/**
 * Activity for modifying app settings
 */
public class SettingsActivity extends BaseActivity {

    public boolean requireLogin() {
        return false;
    }

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        FragmentTransaction ft = getFragmentManager().beginTransaction();
// Path: app/src/main/java/io/rapidpro/surveyor/fragment/SettingsFragment.java
// public class SettingsFragment extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
// 
//     public SettingsFragment() {
//         // Required empty public constructor
//     }
// 
//     @Override
//     public void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         // make sure we're editing the correct preferences
//         getPreferenceManager().setSharedPreferencesName(getSurveyor().getPreferencesName());
// 
//         // load the preference screen from an XML resource
//         addPreferencesFromResource(R.xml.preferences);
// 
//         Preference pref = findPreference(SurveyorPreferences.HOST);
//         pref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
//             @Override
//             public boolean onPreferenceChange(Preference preference, Object newValue) {
//                 if (!Patterns.WEB_URL.matcher((String) newValue).matches()) {
//                     Toast.makeText(getActivity(), getString(R.string.error_invalid_host), Toast.LENGTH_SHORT).show();
//                     return false;
//                 }
//                 return true;
//             }
//         });
//     }
// 
//     @Override
//     public void onResume() {
//         super.onResume();
// 
//         getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
//     }
// 
//     @Override
//     public void onPause() {
//         getPreferenceManager().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
// 
//         super.onPause();
//     }
// 
//     @Override
//     public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
//         if (key.equals(SurveyorPreferences.HOST)) {
//             getSurveyor().onTembaHostChanged();
//         }
//     }
// 
//     private SurveyorApplication getSurveyor() {
//         return ((BaseActivity) getActivity()).getSurveyor();
//     }
// }


// Path: app/src/main/java/io/rapidpro/surveyor/activity/SettingsActivity.java
import android.app.FragmentTransaction;
import android.os.Bundle;
import io.rapidpro.surveyor.fragment.SettingsFragment;

package io.rapidpro.surveyor.activity;




/**
 * Activity for modifying app settings
 */
public class SettingsActivity extends BaseActivity {

    public boolean requireLogin() {
        return false;
    }

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        FragmentTransaction ft = getFragmentManager().beginTransaction();
        ft.replace(android.R.id.content, new SettingsFragment()).commit();