17 package eu.intermodalics.tango_ros_streamer.android;
19 import android.app.DialogFragment;
20 import android.content.Context;
21 import android.os.Bundle;
22 import android.view.LayoutInflater;
23 import android.view.View;
24 import android.view.ViewGroup;
25 import android.widget.AdapterView;
26 import android.widget.ArrayAdapter;
27 import android.widget.Button;
28 import android.widget.ListView;
29 import android.widget.TextView;
48 super.onAttach(context);
54 public View
onCreateView(LayoutInflater inflator, ViewGroup container,
55 Bundle savedInstanceState) {
56 View dialogView = inflator.inflate(R.layout.dialog_load_occupancy_grid, null);
57 getDialog().setTitle(R.string.load_occupancy_grid_dialog_title);
59 Button cancelButton = (Button) dialogView.findViewById(R.id.load_occupancy_grid_cancel);
60 cancelButton.setOnClickListener(
new View.OnClickListener() {
62 public void onClick(View view) {
67 Bundle bundle = getArguments();
68 if(bundle.getBoolean(getString(R.string.show_load_occupancy_grid_empty_key))) {
69 TextView errorTextView = (TextView) dialogView.findViewById(R.id.load_occupancy_grid_empty_message);
70 errorTextView.setVisibility(View.VISIBLE);
73 if(bundle.getBoolean(getString(R.string.show_load_occupancy_grid_error_key))) {
74 TextView errorTextView = (TextView) dialogView.findViewById(R.id.load_occupancy_grid_error_message);
75 errorTextView.setVisibility(View.VISIBLE);
78 java.util.ArrayList<java.lang.String> nameList = bundle.getStringArrayList(getString(R.string.list_names_occupancy_grid_key));
79 ListView listView = (ListView) dialogView.findViewById(R.id.load_occupancy_grid_list);
80 ArrayAdapter<String> adapter =
new ArrayAdapter<String>(mContext, R.layout.custom_list_item, nameList);
81 listView.setAdapter(adapter);
82 listView.setOnItemClickListener(
new AdapterView.OnItemClickListener() {
84 public void onItemClick(AdapterView<?> adapterView, View view,
int i,
long l) {
86 adapterView.getItemAtPosition(i).toString());
void onAttach(Context context)
void onClickItemLoadOccupancyGridDialog(String name)
View onCreateView(LayoutInflater inflator, ViewGroup container, Bundle savedInstanceState)