<string name="preference_password">Password</string>
<string name="preference_password_summary">Enter your account password</string>
<string name="preference_server_information_title">Server settings</string>
- <string name="preference_server_information_summary">Library server settings</string>
- <string name="preference_library_url_address">Library URL</string>
- <string name="preference_library_url_address_summary">Please enter the URL in format http://</string>
<string name="preference_notification_preference_screen_title">Notification settings</string>
<string name="preference_notification_preference_screen_summary">Configure notifications and reminders for checkout items</string>
<string name="preference_enable_notifications">Enable notifications</string>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
- <PreferenceCategory
- android:title="@string/preference_server_information_title" >
- <EditTextPreference
- android:key="library_url"
- android:summary="@string/preference_library_url_address_summary"
- android:title="@string/preference_library_url_address"
- android:defaultValue="@string/ou_library_url"/>
- </PreferenceCategory>
-
<PreferenceCategory
android:title="@string/preference_notifications_title" >
<CheckBoxPreference
private Context context;
- private Thread connectionThread = null;
-
private Thread coreFilesDownload = null;
@Override
context = this;
reference = this;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
- // register preference listener
prefs.registerOnSharedPreferenceChangeListener(this);
-
}
@Override
boolean httpAddressChange = false;
- connectionThread = new Thread(new Runnable() {
-
- @Override
- public void run() {
- }
- });
-
boolean checkConnection = false;
- if (key.equals(Const.KEY_LIBRARY_URL)) {
- checkConnection = true;
- GlobalConfigs.httpAddress = sharedPreferences.getString(Const.KEY_LIBRARY_URL, "");
-
- httpAddressChange = true;
- System.out.println("Show dialog");
-
- progressDialog = ProgressDialog.show(context, "Core files",
- "Downloading FM_IDL and OrgTree");
-
- coreFilesDownload = new Thread(new Runnable() {
-
- @Override
- public void run() {
- System.out.println("FM idl download");
- GlobalConfigs sg = GlobalConfigs.getGlobalConfigs(context);
- sg.loadIDLFile(context);
- sg.getOrganisations();
- sg.getCopyStatusesAvailable((ConnectivityManager) context
- .getSystemService(Context.CONNECTIVITY_SERVICE));
- runOnUiThread(new Runnable() {
- public void run() {
- progressDialog.dismiss();
- }
- });
-
- connectionThread.start();
- }
- });
-
- coreFilesDownload.start();
-
- // wait for execution
-
- }
if (key.equals("notifications_enabled")) {
if (sharedPreferences.getBoolean("notifications_enabled", false)) {
}
}
- /*
- * Dialog interface for starting the network settings
- */
- DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- switch (which) {
- case DialogInterface.BUTTON_POSITIVE:
- // Yes button clicked
-
- context.startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
-
- break;
-
- case DialogInterface.BUTTON_NEGATIVE:
- // No button clicked
-
- break;
- }
- }
- };
-
}