diff --git a/app/app.iml b/app/app.iml index fe31142..33a7364 100644 --- a/app/app.iml +++ b/app/app.iml @@ -66,14 +66,6 @@ - - - - - - - - @@ -82,8 +74,17 @@ + + + + + + + + + diff --git a/app/src/main/java/org/openlp/android2/dialogs/SearchSelectionDialog.java b/app/src/main/java/org/openlp/android2/dialogs/SearchSelectionDialog.java index 2ec6b03..76810bc 100644 --- a/app/src/main/java/org/openlp/android2/dialogs/SearchSelectionDialog.java +++ b/app/src/main/java/org/openlp/android2/dialogs/SearchSelectionDialog.java @@ -112,7 +112,7 @@ public class SearchSelectionDialog extends OpenLPDialog { String request = JsonHelpers.createRequestJSON("id", text); String url = String.format(Api.SEARCH_PLUGIN_LIVE, plugin.toLowerCase()); triggerTextRequest(String.format("%s%s", url, request)); - Log.d(LOG_TAG, String.format("Setting list data. apiBase(%s), text(%s)", Api.SEARCH_PLUGIN_LIVE, text)); + Log.d(LOG_TAG, String.format("Setting list data. apiBase(%s), text(%s)", Api.SEARCH_PLUGIN_LIVE, request)); } catch (JsonHelpers.JSONHandlerException e) { e.printStackTrace(); Toast.makeText(context, "Request Failed", Toast.LENGTH_SHORT).show(); diff --git a/app/src/main/java/org/openlp/android2/fragments/LiveListFragment.java b/app/src/main/java/org/openlp/android2/fragments/LiveListFragment.java index ec89048..441f155 100644 --- a/app/src/main/java/org/openlp/android2/fragments/LiveListFragment.java +++ b/app/src/main/java/org/openlp/android2/fragments/LiveListFragment.java @@ -128,6 +128,8 @@ public class LiveListFragment extends OpenLPFragment { text1.setTextSize(TypedValue.COMPLEX_UNIT_SP, size); TextView text2 = (TextView) view.findViewById(R.id.liveListNormal); text2.setTextSize(TypedValue.COMPLEX_UNIT_SP, size); + Log.i(LOG_TAG, "aaa " + selected +" "+ position); + if (selected == position) { text2.setTypeface(null, Typeface.BOLD_ITALIC); } else{ diff --git a/app/src/main/java/org/openlp/android2/fragments/SearchFragment.java b/app/src/main/java/org/openlp/android2/fragments/SearchFragment.java index c044bf9..3485a9c 100644 --- a/app/src/main/java/org/openlp/android2/fragments/SearchFragment.java +++ b/app/src/main/java/org/openlp/android2/fragments/SearchFragment.java @@ -264,7 +264,7 @@ public class SearchFragment extends Fragment { String it = ""; try { Log.i(LOG_TAG, "list.setOnItemClickListener" + item); - it = (String) item.get(0); + it = item.get(0).toString(); } catch (JSONException e) { e.printStackTrace(); } diff --git a/app/src/main/java/org/openlp/android2/fragments/ServiceListFragment.java b/app/src/main/java/org/openlp/android2/fragments/ServiceListFragment.java index aecc7d3..42db064 100644 --- a/app/src/main/java/org/openlp/android2/fragments/ServiceListFragment.java +++ b/app/src/main/java/org/openlp/android2/fragments/ServiceListFragment.java @@ -138,10 +138,10 @@ public class ServiceListFragment extends OpenLPFragment { } // Keys used in Hashmap - String[] from = {"icon", "title"}; + String[] from = {"line","icon", "title"}; // Ids of views in service_list_fragment - int[] to = {R.id.icon, R.id.serviceListText}; + int[] to = {R.id.servicelistLine, R.id.icon, R.id.serviceListText}; SharedPreferences prefs = context.getSharedPreferences( context.getString(R.string.key_shared_preferences), @@ -155,19 +155,27 @@ public class ServiceListFragment extends OpenLPFragment { // Instantiating an adapter to store each items ListAdapter adapter = new SimpleAdapter(getActivity().getBaseContext(), aList, R.layout.fragment_service_list, from, to) { + public View getView(int position, View convertView, ViewGroup parent) { + View view = super.getView(position, convertView, parent); + + TextView line = (TextView) view.findViewById(R.id.servicelistLine); TextView text1 = (TextView) view.findViewById(R.id.serviceListText); text1.setTextSize(TypedValue.COMPLEX_UNIT_SP, size); + Log.i(LOG_TAG, "bbb " + selected +" "+ position); + if (selected == position) { text1.setTextColor(Color.parseColor("#000000")); text1.setTypeface(null, Typeface.BOLD_ITALIC); } else{ text1.setTypeface(null, Typeface.NORMAL); + line.setBackgroundColor(0xffffff); } return view; } }; + setListAdapter(adapter); SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); diff --git a/app/src/main/res/layout/fragment_livelist_list.xml b/app/src/main/res/layout/fragment_livelist_list.xml index 1cabec9..9f13d27 100644 --- a/app/src/main/res/layout/fragment_livelist_list.xml +++ b/app/src/main/res/layout/fragment_livelist_list.xml @@ -10,8 +10,8 @@ android:clickable="false" android:longClickable="false" android:background="@drawable/custom_border"> - - diff --git a/app/src/main/res/layout/fragment_service_list.xml b/app/src/main/res/layout/fragment_service_list.xml index 1262401..56d6025 100644 --- a/app/src/main/res/layout/fragment_service_list.xml +++ b/app/src/main/res/layout/fragment_service_list.xml @@ -10,10 +10,22 @@ android:clickable="false" android:longClickable="false" android:background="@drawable/custom_border"> + + + - - - - - - -