From ccda3faebdccf9decab76ff5d613b29624978de4 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 5 Dec 2013 11:28:34 +0000 Subject: [PATCH] 2013-12-05 Miguel de Dios * src/pandroid_event_viewer/pandorafms/Main.java: fixed to check the pandora version for 4 series, this is for to hidden the tag filter. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9166 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- extras/pandroid_event_viewer/ChangeLog | 5 ++++ .../pandorafms/Main.java | 26 ++++++++++++++----- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/extras/pandroid_event_viewer/ChangeLog b/extras/pandroid_event_viewer/ChangeLog index 36708fbd74..4fced2273c 100644 --- a/extras/pandroid_event_viewer/ChangeLog +++ b/extras/pandroid_event_viewer/ChangeLog @@ -1,3 +1,8 @@ +2013-12-05 Miguel de Dios + + * src/pandroid_event_viewer/pandorafms/Main.java: fixed to check the + pandora version for 4 series, this is for to hidden the tag filter. + 2013-12-05 Miguel de Dios * src/pandroid_event_viewer/pandorafms/API.java: fixed the offset diff --git a/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/Main.java b/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/Main.java index 4294cc9360..0f8ef690ab 100644 --- a/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/Main.java +++ b/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/Main.java @@ -54,6 +54,7 @@ import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.Spinner; import android.widget.SpinnerAdapter; +import android.widget.TextView; import android.widget.Toast; /** @@ -94,12 +95,6 @@ public class Main extends Activity { this.getString(R.string.const_string_preferences), Activity.MODE_PRIVATE); - if (preferences.getString("api_version", "") - .equals(VERSION_4_0_2_LABEL)) { - - version402 = true; - } - setContentView(R.layout.main); final Button buttonSetAsFilterWatcher = (Button) findViewById(R.id.button_set_as_filter_watcher); final ImageButton buttonSearch = (ImageButton) findViewById(R.id.refresh_icon_button_main); @@ -278,14 +273,31 @@ public class Main extends Activity { public void onResume() { super.onResume(); + final SharedPreferences preferences = getSharedPreferences( + this.getString(R.string.const_string_preferences), + Activity.MODE_PRIVATE); + Log.i(TAG, "Getting groups and tags"); GetGroupsAsyncTask task_group = new GetGroupsAsyncTask(); task_group.execute(); + // Get the short form of the version. I.E. "v4" for "v4.01" and others + // 4 versions + String api_version = preferences.getString("api_version", ""); + String[] api_version_short = api_version.split("\\."); + + if (api_version_short[0].equals("v4")) { + version402 = true; + } + if (version402) { ((EditText) findViewById(R.id.tag_text)) - .setVisibility(View.VISIBLE); + .setVisibility(View.GONE); ((Spinner) findViewById(R.id.tag)).setVisibility(View.GONE); + + ((TextView) findViewById(R.id.tag_textview)) + .setVisibility(View.GONE); + } else { new GetTagsAsyncTask().execute();