Updated styles for android 2.3.3

This commit is contained in:
Bars107 2015-02-12 17:32:21 +02:00
parent 134cea1b80
commit 6ef9a76f27
8 changed files with 11 additions and 40 deletions

View file

@ -46,6 +46,7 @@
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:background="?attr/expandable_list_background"
android:divider="@drawable/divider"
android:dividerHeight="1dp" />

View file

@ -137,7 +137,7 @@ public class ContextMenuAdapter {
if (holoLight) {
return ctx.getResources().getColor(R.color.color_white);
} else {
return ctx.getResources().getColor(R.color.dark_drawer_bg_color);
return ctx.getResources().getColor(R.color.list_background_dark);
}
}

View file

@ -804,19 +804,6 @@ public class OsmandApplication extends Application {
}
setLanguage(c);
c.setTheme(t);
if (osmandSettings.OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_DARK_ACTIONBAR_THEME
&& Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
ActionBar ab = null;
if (c instanceof ActionBarActivity) {
ab = ((ActionBarActivity) c).getSupportActionBar();
}
if (ab != null) {
BitmapDrawable bg = (BitmapDrawable) getResources().getDrawable(R.drawable.bg_striped);
bg.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT);
ab.setBackgroundDrawable(bg);
}
}
}
public IBRouterService getBRouterService() {

View file

@ -1756,7 +1756,7 @@ public class OsmandSettings {
public static final int OSMAND_DARK_THEME = 0;
public static final int OSMAND_LIGHT_THEME = 1;
public static final int OSMAND_LIGHT_DARK_ACTIONBAR_THEME = 2;
public final CommonPreference<Integer> SEARCH_TAB =
new IntPreference("SEARCH_TAB", 0).makeGlobal().cache();
@ -1771,18 +1771,11 @@ public class OsmandSettings {
return OSMAND_THEME.get() == OSMAND_LIGHT_THEME;
}
public boolean isLightContentMenu(){
return OSMAND_THEME.get() != OSMAND_DARK_THEME || Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB;
}
public boolean isLightContent(){
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB){
return false;
}
return OSMAND_THEME.get() != OSMAND_DARK_THEME ;
}
public final CommonPreference<Boolean> FLUORESCENT_OVERLAYS =
new BooleanPreference("fluorescent_overlays", false).makeGlobal().cache();

View file

@ -317,7 +317,7 @@ public class MapActivityActions implements DialogProvider {
final Builder builder = new AlertDialog.Builder(mapActivity);
final ArrayAdapter<?> listAdapter =
adapter.createListAdapter(mapActivity, getMyApplication().getSettings().isLightContentMenu());
adapter.createListAdapter(mapActivity, getMyApplication().getSettings().isLightContent());
builder.setAdapter(listAdapter, new DialogInterface.OnClickListener() {
@Override
@ -641,12 +641,8 @@ public class MapActivityActions implements DialogProvider {
public void prepareOptionsMenu(final ContextMenuAdapter cm) {
refreshDrawer = false;
final ArrayAdapter<?> listAdapter =
cm.createListAdapter(mapActivity, getMyApplication().getSettings().isLightContentMenu());
cm.createListAdapter(mapActivity, getMyApplication().getSettings().isLightContent());
mDrawerList.setAdapter(listAdapter);
mDrawerList.setDivider(mapActivity.getResources().getDrawable(R.drawable.drawer_divider));
final int colorHint = cm.getBackgroundColor(mapActivity, getMyApplication().getSettings().isLightContentMenu());
mDrawerList.setBackgroundColor(colorHint);
mDrawerList.setCacheColorHint(colorHint);
mDrawerList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
@ -945,12 +941,6 @@ public class MapActivityActions implements DialogProvider {
ArrayAdapter<Object> listAdapter = waypointDialogHelper.getWaypointsDrawerAdapter(mapActivity, running, flat);
mDrawerList.setAdapter(listAdapter);
refreshDrawer = false;
mDrawerList.setDivider(mapActivity.getResources().getDrawable(R.drawable.drawer_divider));
final int color = getMyApplication().getSettings().isLightContentMenu() ? mapActivity
.getResources().getColor(R.color.color_white) : mapActivity.getResources().getColor(
R.color.dark_drawer_bg_color);
mDrawerList.setBackgroundColor(color);
mDrawerList.setCacheColorHint(color);
mDrawerList.setOnItemClickListener(waypointDialogHelper.getDrawerItemClickListener(mapActivity, running,
listAdapter, null));
}

View file

@ -292,7 +292,7 @@ public class MapActivityLayers {
it.reg();
}
Builder builder = new AlertDialog.Builder(activity);
ListAdapter listAdapter =adapter.createListAdapter(activity, app.getSettings().isLightContentMenu());
ListAdapter listAdapter =adapter.createListAdapter(activity, app.getSettings().isLightContent());
builder.setAdapter(listAdapter, new DialogInterface.OnClickListener(){
@Override

View file

@ -62,7 +62,7 @@ public class AvoidSpecificRoads {
}
final RouteDataObject obj = getItem(position);
v.findViewById(R.id.all_points).setVisibility(View.GONE);
((ImageView) v.findViewById(R.id.waypoint_icon)).setImageResource(app.getSettings().isLightContentMenu() ?
((ImageView) v.findViewById(R.id.waypoint_icon)).setImageResource(app.getSettings().isLightContent() ?
R.drawable.ic_action_road_works_light : R.drawable.ic_action_road_works_dark);
double dist = MapUtils.getDistance(mapLocation, MapUtils.get31LatitudeY(obj.getPoint31YTile(0)),
MapUtils.get31LongitudeX(obj.getPoint31XTile(0)));
@ -71,7 +71,7 @@ public class AvoidSpecificRoads {
((TextView) v.findViewById(R.id.waypoint_text)).setText(getText(obj));
ImageButton remove = (ImageButton) v.findViewById(R.id.info_close);
remove.setVisibility(View.VISIBLE);
remove.setImageResource(app.getSettings().isLightContentMenu() ?
remove.setImageResource(app.getSettings().isLightContent() ?
R.drawable.ic_action_gremove_light : R.drawable.ic_action_gremove_dark);
remove.setOnClickListener(new View.OnClickListener() {

View file

@ -232,7 +232,7 @@ public class GpxUiHelper {
final File dir = app.getAppPath(IndexConstants.GPX_INDEX_DIR);
Builder b = new AlertDialog.Builder(activity);
// final int padding = (int) (12 * activity.getResources().getDisplayMetrics().density + 0.5f);
final boolean light = app.getSettings().isLightContentMenu();
final boolean light = app.getSettings().isLightContent();
final int layout;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
layout = R.layout.list_menu_item;