From 586b269311433a92dadef4ef9a23dd01e6675c2b Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 3 Jan 2016 09:25:13 +0000 Subject: [PATCH] handle results --- .../android2/fragments/SearchFragment.java | 22 ++++++------------- app/src/main/res/layout/search_result_row.xml | 13 +++++++---- 2 files changed, 16 insertions(+), 19 deletions(-) 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 b7252d1..47a0b69 100644 --- a/app/src/main/java/org/openlp/android2/fragments/SearchFragment.java +++ b/app/src/main/java/org/openlp/android2/fragments/SearchFragment.java @@ -211,25 +211,16 @@ public class SearchFragment extends Fragment { android.R.layout.simple_list_item_1, listitems); list.setAdapter(adapter); -/* list.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, final View view, int position, long id) { - final String item = (String) parent.getItemAtPosition(position); - Toast.makeText(context, "Item Pressed " + String.valueOf(position), Toast.LENGTH_SHORT).show(); - view.animate().setDuration(2000).alpha(0) - .withEndAction(new Runnable() { - @Override - public void run() { - list.remove(item); - adapter.notifyDataSetChanged(); - view.setAlpha(1); - } - }); + final JSONArray item = (JSONArray) parent.getItemAtPosition(position); + Toast.makeText(context, "Item Pressed " + String.valueOf(position) + item, + Toast.LENGTH_SHORT).show(); } - }); */ + }); Log.i(LOG_TAG, "populateListDisplay - exit"); } @@ -263,10 +254,11 @@ public class SearchFragment extends Fragment { } // Check if an existing view is being reused, otherwise inflate the view if (convertView == null) { - convertView = LayoutInflater.from(getContext()).inflate(R.layout.search_result_row, parent, false); + convertView = LayoutInflater.from(getContext()).inflate(R.layout.search_result_row, + parent, false); } // Lookup view for data population - TextView tvItem = (TextView) convertView.findViewById(R.id.searchlistRow); + TextView tvItem = (TextView) convertView.findViewById(R.id.searchListRow); // Populate the data into the template view using the data object tvItem.setText(item); // Return the completed view to render on screen diff --git a/app/src/main/res/layout/search_result_row.xml b/app/src/main/res/layout/search_result_row.xml index 20160eb..105f166 100644 --- a/app/src/main/res/layout/search_result_row.xml +++ b/app/src/main/res/layout/search_result_row.xml @@ -6,8 +6,13 @@ + android:textStyle="bold" + android:textColor="#000000" + android:textSize="40sp" + android:paddingTop="10dp" + android:paddingRight="5dp" + android:paddingLeft="5dp" + android:paddingEnd="5dp" + android:paddingBottom="10dp" + android:id="@+id/searchListRow"/> \ No newline at end of file