Commit 6f6e110d authored by Nastuzzi Samy's avatar Nastuzzi Samy
Browse files

Better listing

parent c77ebbbd
package fr.utc.simde.jessy.adapters;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
......@@ -13,6 +14,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import fr.utc.simde.jessy.R;
/**
* Created by Samy on 29/10/2017.
*/
......@@ -31,13 +34,11 @@ public class LocationsAdapter extends BaseAdapter {
@Override
public View getView(int position, View view, ViewGroup viewGroup) {
if (view == null) {
view = new LinearLayout(this.activity);
TextView textView = new TextView(this.activity);
textView.setText(getLocationName(position));
LayoutInflater layoutInflater = LayoutInflater.from(this.activity);
view = layoutInflater.inflate(R.layout.fragment_list, null);
((LinearLayout) view).addView(textView);
}
TextView textView = view.findViewById(R.id.text_element);
textView.setText(getLocationName(position));
return view;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment