Add activity
This commit is contained in:
parent
fdfcd07506
commit
1e7ba3c729
2 changed files with 24 additions and 36 deletions
|
@ -3,7 +3,6 @@
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingTop="0dip"
|
android:paddingTop="0dip"
|
||||||
android:background="@color/color_white"
|
|
||||||
android:paddingBottom="0dip"
|
android:paddingBottom="0dip"
|
||||||
android:paddingLeft="5dip"
|
android:paddingLeft="5dip"
|
||||||
android:paddingRight="5dip"
|
android:paddingRight="5dip"
|
||||||
|
@ -20,8 +19,7 @@
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:textSize="15sp"
|
android:textSize="15sp"/>
|
||||||
android:textColor="@color/color_black"/>
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/check_item"
|
android:id="@+id/check_item"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
|
@ -354,16 +354,9 @@ public class MapActivityLayers {
|
||||||
mapView.refreshMap();
|
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);
|
Builder b = new AlertDialog.Builder(activity);
|
||||||
ListView list = new ListView(activity);
|
ListView list = new ListView(activity, null, R.style.NiceActivity);
|
||||||
// dlg.setContentView(list);
|
// list.setBackgroundColor(R.color.color_white);
|
||||||
b.setView(list);
|
b.setView(list);
|
||||||
final List<String> layerNames = new ArrayList<String>();
|
final List<String> layerNames = new ArrayList<String>();
|
||||||
for (int i = 0; i < layers.size(); i++) {
|
for (int i = 0; i < layers.size(); i++) {
|
||||||
|
@ -397,37 +390,34 @@ public class MapActivityLayers {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
row.setOnClickListener(new View.OnClickListener() {
|
// row.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
// @Override
|
||||||
public void onClick(View v) {
|
// public void onClick(View v) {
|
||||||
if(selectedList.get(position) >= 0) {
|
// if(selectedList.get(position) >= 0) {
|
||||||
ch.setChecked(!ch.isChecked());
|
// ch.setChecked(!ch.isChecked());
|
||||||
} else {
|
// } else {
|
||||||
listener.onClick(dlg, position, selectedList.get(position) > 0);
|
// listener.onClick(dlg, position, selectedList.get(position) > 0);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
list.setAdapter(adapter);
|
list.setAdapter(adapter);
|
||||||
// list.setOnItemClickListener(new OnItemClickListener() {
|
list.setOnItemClickListener(new OnItemClickListener() {
|
||||||
// @Override
|
@Override
|
||||||
// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
// listener.onClick(dlg, position, selectedList.get(position) > 0);
|
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.setCanceledOnTouchOutside(true);
|
||||||
dlg.show();
|
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){
|
public void showGPXFileLayer(final OsmandMapTileView mapView){
|
||||||
|
|
Loading…
Reference in a new issue