2012-08-10 Santiago Munín <burning1@gmail.com>
* src/pandroid_event_viewer/pandorafms/Options.java: Removed url_changed in SharedPreferences. * src/pandroid_event_viewer/pandorafms/Main.java: Tags and groups are loading onResume. Also, they are always loaded (url_changed isn't used anymore). * src/pandroid_event_viewer/pandorafms/Core.java: Changed method visibility. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6853 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
60fc295dc9
commit
48988e0f49
|
@ -1,3 +1,8 @@
|
|||
2012-08-10 Santiago Munín <burning1@gmail.com>
|
||||
* src/pandroid_event_viewer/pandorafms/Options.java: Removed url_changed in SharedPreferences.
|
||||
* src/pandroid_event_viewer/pandorafms/Main.java: Tags and groups are loading onResume. Also, they are always loaded (url_changed isn't used anymore).
|
||||
* src/pandroid_event_viewer/pandorafms/Core.java: Changed method visibility.
|
||||
|
||||
2012-08-02 Santiago Munín <burning1@gmail.com>
|
||||
* src/pandroid_event_viewer/pandorafms/Core.java: Changed timeout from 10 to 5 seconds.
|
||||
* res/layout/item_list_event_layout.xml: Increased drawablePadding of timestamp textview.
|
||||
|
|
|
@ -88,7 +88,7 @@ public class Core {
|
|||
* @param is
|
||||
* @return A string with all data read.
|
||||
*/
|
||||
public static String convertStreamToString(InputStream is) {
|
||||
private static String convertStreamToString(InputStream is) {
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(is),
|
||||
8 * 1024);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
|
|
@ -114,22 +114,10 @@ public class Main extends Activity {
|
|||
this.getString(R.string.preferences_set_demo_pandora_str),
|
||||
Toast.LENGTH_LONG);
|
||||
toast.show();
|
||||
} else {
|
||||
buttonSearch.setEnabled(false);
|
||||
buttonSetAsFilterWatcher.setEnabled(false);
|
||||
buttonDeleteProfile.setEnabled(false);
|
||||
|
||||
new GetGroupsAsyncTask().execute();
|
||||
if (version402) {
|
||||
((EditText) findViewById(R.id.tag_text))
|
||||
.setVisibility(View.VISIBLE);
|
||||
((ProgressBar) findViewById(R.id.loading_tag))
|
||||
.setVisibility(View.GONE);
|
||||
((Spinner) findViewById(R.id.tag)).setVisibility(View.GONE);
|
||||
} else {
|
||||
new GetTagsAsyncTask().execute();
|
||||
}
|
||||
}
|
||||
buttonSearch.setEnabled(false);
|
||||
buttonSetAsFilterWatcher.setEnabled(false);
|
||||
buttonDeleteProfile.setEnabled(false);
|
||||
|
||||
comboSeverity = (Spinner) findViewById(R.id.severity_combo);
|
||||
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
|
||||
|
@ -277,20 +265,18 @@ public class Main extends Activity {
|
|||
}
|
||||
}
|
||||
|
||||
public void onRestart() {
|
||||
super.onRestart();
|
||||
SharedPreferences preferences = getSharedPreferences(
|
||||
this.getString(R.string.const_string_preferences),
|
||||
Activity.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editorPreferences = preferences.edit();
|
||||
if (preferences.getBoolean("url_changed", false)) {
|
||||
Log.i(TAG, "Getting groups and tags");
|
||||
new GetGroupsAsyncTask().execute();
|
||||
if (!version402) {
|
||||
new GetTagsAsyncTask().execute();
|
||||
}
|
||||
editorPreferences.putBoolean("url_changed", false);
|
||||
editorPreferences.commit();
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
Log.i(TAG, "Getting groups and tags");
|
||||
new GetGroupsAsyncTask().execute();
|
||||
if (version402) {
|
||||
((EditText) findViewById(R.id.tag_text))
|
||||
.setVisibility(View.VISIBLE);
|
||||
((ProgressBar) findViewById(R.id.loading_tag))
|
||||
.setVisibility(View.GONE);
|
||||
((Spinner) findViewById(R.id.tag)).setVisibility(View.GONE);
|
||||
} else {
|
||||
new GetTagsAsyncTask().execute();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ public class Options extends Activity {
|
|||
text = (EditText) findViewById(R.id.password);
|
||||
text.setText(preferences.getString("password", "demo"));
|
||||
text = (EditText) findViewById(R.id.api_password);
|
||||
text.setText(preferences.getString("api_password", ""));
|
||||
text.setText(preferences.getString("api_password", "doreik0"));
|
||||
|
||||
Spinner combo = (Spinner) findViewById(R.id.refresh_combo);
|
||||
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
|
||||
|
@ -193,9 +193,6 @@ public class Options extends Activity {
|
|||
url = url.substring(0, url.length() - 1);
|
||||
}
|
||||
editorPreferences.putString("url", url);
|
||||
// MainActivity uses this to know if it has to check tags and groups
|
||||
// again
|
||||
editorPreferences.putBoolean("url_changed", true);
|
||||
text = (EditText) findViewById(R.id.user);
|
||||
editorPreferences.putString("user", text.getText().toString());
|
||||
text = (EditText) findViewById(R.id.password);
|
||||
|
|
Loading…
Reference in New Issue