Add activity

This commit is contained in:
Victor Shcherb 2012-01-26 19:11:22 +01:00
parent fdfcd07506
commit 1e7ba3c729
2 changed files with 24 additions and 36 deletions

View file

@ -3,7 +3,6 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:paddingTop="0dip"
android:background="@color/color_white"
android:paddingBottom="0dip"
android:paddingLeft="5dip"
android:paddingRight="5dip"
@ -20,8 +19,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="15sp"
android:textColor="@color/color_black"/>
android:textSize="15sp"/>
<CheckBox
android:id="@+id/check_item"
android:layout_width="wrap_content"

View file

@ -354,16 +354,9 @@ public class MapActivityLayers {
mapView.refreshMap();
}
};
// final boolean[] selected = new boolean[selectedList.size()];
// for (int i = 0; i < selected.length; i++) {
// selected[i] = selectedList.get(i) != 0;
// }
//
// Builder builder = new AlertDialog.Builder(activity);
// final Dialog dlg = new Dialog(activity, android.R.style.Theme_Light);
Builder b = new AlertDialog.Builder(activity);
ListView list = new ListView(activity);
// dlg.setContentView(list);
ListView list = new ListView(activity, null, R.style.NiceActivity);
// list.setBackgroundColor(R.color.color_white);
b.setView(list);
final List<String> layerNames = new ArrayList<String>();
for (int i = 0; i < layers.size(); i++) {
@ -397,37 +390,34 @@ public class MapActivityLayers {
}
});
}
row.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(selectedList.get(position) >= 0) {
ch.setChecked(!ch.isChecked());
} else {
listener.onClick(dlg, position, selectedList.get(position) > 0);
}
}
});
// row.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// if(selectedList.get(position) >= 0) {
// ch.setChecked(!ch.isChecked());
// } else {
// listener.onClick(dlg, position, selectedList.get(position) > 0);
// }
// }
// });
return row;
}
};
list.setAdapter(adapter);
// list.setOnItemClickListener(new OnItemClickListener() {
// @Override
// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// listener.onClick(dlg, position, selectedList.get(position) > 0);
// }
// });
list.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if(selectedList.get(position) >= 0) {
CheckBox ch = ((CheckBox) view.findViewById(R.id.check_item));
ch.setChecked(!ch.isChecked());
} else {
listener.onClick(dlg, position, selectedList.get(position) > 0);
}
}
});
dlg.setCanceledOnTouchOutside(true);
dlg.show();
// String[] layersName = new String[layers.size()];
// for (int i = 0; i < layers.size(); i++) {
// layersName[i] = getString(layers.get(i));
//
// }
// builder.setMultiChoiceItems(layersName, selected, );
// builder.show();
}
public void showGPXFileLayer(final OsmandMapTileView mapView){