handle results

This commit is contained in:
Tim Bentley 2016-01-03 09:25:13 +00:00
parent 9f896175b3
commit 586b269311
2 changed files with 16 additions and 19 deletions

View File

@ -211,25 +211,16 @@ public class SearchFragment extends Fragment {
android.R.layout.simple_list_item_1, listitems); android.R.layout.simple_list_item_1, listitems);
list.setAdapter(adapter); list.setAdapter(adapter);
/*
list.setOnItemClickListener(new AdapterView.OnItemClickListener() { list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override @Override
public void onItemClick(AdapterView<?> parent, final View view, public void onItemClick(AdapterView<?> parent, final View view,
int position, long id) { int position, long id) {
final String item = (String) parent.getItemAtPosition(position); final JSONArray item = (JSONArray) parent.getItemAtPosition(position);
Toast.makeText(context, "Item Pressed " + String.valueOf(position), Toast.LENGTH_SHORT).show(); Toast.makeText(context, "Item Pressed " + String.valueOf(position) + item,
view.animate().setDuration(2000).alpha(0) Toast.LENGTH_SHORT).show();
.withEndAction(new Runnable() {
@Override
public void run() {
list.remove(item);
adapter.notifyDataSetChanged();
view.setAlpha(1);
}
});
} }
}); */ });
Log.i(LOG_TAG, "populateListDisplay - exit"); 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 // Check if an existing view is being reused, otherwise inflate the view
if (convertView == null) { 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 // 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 // Populate the data into the template view using the data object
tvItem.setText(item); tvItem.setText(item);
// Return the completed view to render on screen // Return the completed view to render on screen

View File

@ -6,8 +6,13 @@
<TextView android:layout_width="wrap_content" <TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Header" android:textStyle="bold"
android:textSize="40px" android:textColor="#000000"
android:height="70px" android:textSize="40sp"
android:id="@+id/searchlistRow"/> android:paddingTop="10dp"
android:paddingRight="5dp"
android:paddingLeft="5dp"
android:paddingEnd="5dp"
android:paddingBottom="10dp"
android:id="@+id/searchListRow"/>
</LinearLayout> </LinearLayout>