CHanged icons of expandable list and fixed add gpx dialog

This commit is contained in:
Denis 2015-02-06 16:37:15 +02:00
parent 8939e88ea6
commit b81c55f2a1
8 changed files with 28 additions and 17 deletions

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:id="@android:id/edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>

View file

@ -783,7 +783,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
v = inflater.inflate(net.osmand.plus.R.layout.expandable_list_item_category, parent, false);
}
StringBuilder t = new StringBuilder(group);
adjustIndicator(groupPosition, isExpanded, v);
adjustIndicator(groupPosition, isExpanded, v, getMyApplication().getSettings().isLightContent());
TextView nameView = ((TextView) v.findViewById(R.id.category_name));
List<GpxInfo> list = data.get(group);
int size = 0;

View file

@ -708,7 +708,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
R.layout.expandable_list_item_category_btn, parent, false);
fixBackgroundRepeat(row);
}
adjustIndicator(groupPosition, isExpanded, row);
adjustIndicator(groupPosition, isExpanded, row, getMyApplication().getSettings().isLightContent());
TextView label = (TextView) row.findViewById(R.id.category_name);
final FavoriteGroup model = getGroup(groupPosition);
label.setText(model.name.length() == 0? getString(R.string.favourites_activity) : model.name);

View file

@ -131,12 +131,9 @@ public class MapActivityActions implements DialogProvider {
private Dialog createAddWaypointDialog(final Bundle args) {
Builder builder = new AlertDialog.Builder(mapActivity);
builder.setTitle(R.string.add_waypoint_dialog_title);
FrameLayout parent = new FrameLayout(mapActivity);
final EditText editText = new EditText(mapActivity);
editText.setId(android.R.id.edit);
parent.setPadding(15, 0, 15, 0);
parent.addView(editText);
builder.setView(parent);
View view = mapActivity.getLayoutInflater().inflate(R.layout.add_gpx_point_dialog, null);
final EditText editText = (EditText) view.findViewById(android.R.id.edit);
builder.setView(view);
builder.setNegativeButton(R.string.default_buttons_cancel, null);
builder.setPositiveButton(R.string.default_buttons_add, new DialogInterface.OnClickListener() {
@Override

View file

@ -7,16 +7,16 @@ import android.widget.ImageView;
public abstract class OsmandBaseExpandableListAdapter extends BaseExpandableListAdapter {
protected void adjustIndicator(int groupPosition, boolean isExpanded, View row) {
protected void adjustIndicator(int groupPosition, boolean isExpanded, View row, boolean light) {
ImageView indicator = (ImageView) row.findViewById(R.id.explist_indicator);
if (!isExpanded) {
if (getChildrenCount(groupPosition) == 0) {
indicator.setImageResource(R.drawable.expandable_category_empty);
indicator.setImageResource(light ? R.drawable.expandable_category_empty_light : R.drawable.expandable_category_empty_dark);
} else {
indicator.setImageResource(R.drawable.expandable_category_unpushed);
indicator.setImageResource(light ? R.drawable.expandable_category_unpushed_light : R.drawable.expandable_category_unpushed_dark);
}
} else {
indicator.setImageResource(R.drawable.expandable_category_pushed);
indicator.setImageResource(light ? R.drawable.expandable_category_pushed_light : R.drawable.expandable_category_pushed_dark);
}
}

View file

@ -522,7 +522,7 @@ public class SelectedGPXFragment extends OsmandExpandableListFragment {
if(isArgumentTrue(ARG_TO_EXPAND_TRACK_INFO)) {
row.findViewById(R.id.explist_indicator).setVisibility(View.GONE);
} else {
adjustIndicator(groupPosition, isExpanded, row);
adjustIndicator(groupPosition, isExpanded, row, app.getSettings().isLightContent());
}
TextView label = (TextView) row.findViewById(R.id.category_name);
final GpxDisplayGroup model = getGroup(groupPosition);

View file

@ -221,7 +221,7 @@ public class DownloadIndexAdapter extends OsmandBaseExpandableListAdapter implem
TextView item = (TextView) row.findViewById(R.id.category_name);
item.setText(group.name);
item.setLinkTextColor(Color.YELLOW);
adjustIndicator(groupPosition, isExpanded, v);
adjustIndicator(groupPosition, isExpanded, v, app.getSettings().isLightContent());
return row;
}

View file

@ -1142,8 +1142,8 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
row = inflater.inflate(R.layout.osmo_group_item, parent, false);
//fixBackgroundRepeat(row);
}
adjustIndicator(groupPosition, isExpanded, row);
boolean light = getMyApplication().getSettings().isLightContent();
adjustIndicator(groupPosition, isExpanded, row, light);
TextView label = (TextView) row.findViewById(R.id.category_name);
final OsMoGroup model = getGroup(groupPosition);
if(selectedObject == model) {
@ -1161,7 +1161,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
if(model.isMainGroup()) {
v.setVisibility(View.GONE);
} else {
if (getMyApplication().getSettings().isLightContent()){
if (light){
v.setImageResource(R.drawable.ic_action_settings_enabled_light);
} else {
v.setImageResource(R.drawable.ic_action_settings_enabled_dark);