Update plugins

This commit is contained in:
Victor Shcherb 2015-03-19 01:18:59 +01:00
parent a7c0717867
commit bef93375e7
5 changed files with 93 additions and 119 deletions

View file

@ -1,23 +1,34 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_fav" xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:background="?attr/card_bg" android:id="@+id/main_fav"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:background="?attr/card_bg"
<LinearLayout android:orientation="horizontal" android:orientation="vertical" >
android:layout_width="fill_parent"
android:layout_height="@dimen/dashHeaderHeight"> <LinearLayout
<TextView android:id="@+id/fav_text" android:layout_width="fill_parent"
android:text="@string/shared_string_my_places" android:layout_height="@dimen/dashHeaderHeight"
style="?attr/dashboardSubHeaderStyle"/> android:orientation="horizontal" >
<Button android:id="@+id/show_all"
android:text="@string/shared_string_show_all" <TextView
style="?attr/dashboardGeneralButtonStyle"/> android:id="@+id/fav_text"
</LinearLayout> style="?attr/dashboardSubHeaderStyle"
<LinearLayout android:id="@+id/items" android:text="@string/shared_string_my_places" />
android:orientation="vertical"
android:layout_width="fill_parent" <net.osmand.plus.widgets.ButtonEx
android:layout_height="wrap_content"/> android:id="@+id/show_all"
style="?attr/dashboardGeneralButtonStyle"
android:text="@string/shared_string_show_all"
osmand:textAllCapsCompat="true"
osmand:typeface="@string/font_roboto_medium" />
</LinearLayout>
<LinearLayout
android:id="@+id/items"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</LinearLayout> </LinearLayout>

View file

@ -31,6 +31,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:id="@+id/widget_text" android:id="@+id/widget_text"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/map_widget_text_bottom_margin" android:layout_marginBottom="@dimen/map_widget_text_bottom_margin"

View file

@ -1,95 +1,65 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:osmand="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:background="?attr/expandable_list_item_background"
android:paddingLeft="6dp" android:descendantFocusability="blocksDescendants"
android:paddingRight="6dp"> android:orientation="horizontal" >
<FrameLayout <ImageButton
android:layout_width="match_parent" android:id="@+id/plugin_logo"
android:layout_height="match_parent" android:layout_width="48dp"
android:background="?attr/card_bg" android:layout_height="48dp"
android:descendantFocusability="blocksDescendants" android:layout_margin="8dp"
android:padding="2dp"> android:background="@drawable/bg_plugin_logo_enabled"
android:layout_gravity="center"
android:scaleType="center"
tools:src="@drawable/ic_extension_dark" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:orientation="horizontal"> android:layout_marginBottom="8dp"
android:layout_marginRight="4dp"
android:layout_marginLeft="4dp"
android:layout_marginTop="8dp"
android:layout_weight="1"
android:orientation="vertical" >
<ImageButton <net.osmand.plus.widgets.TextViewEx
android:id="@+id/plugin_logo" android:id="@+id/plugin_name"
android:layout_width="64dp" android:layout_width="match_parent"
android:layout_height="64dp" android:layout_height="wrap_content"
android:layout_margin="8dp" android:layout_marginBottom="4dp"
android:background="@drawable/bg_plugin_logo_enabled" android:ellipsize="end"
android:scaleType="center" android:lines="1"
tools:src="@drawable/ic_extension_dark"/> android:maxLines="1"
android:text="@string/lorem_ipsum"
android:textColor="?android:textColorPrimary"
android:textSize="19sp"
osmand:typeface="@string/font_roboto_medium" />
<LinearLayout <net.osmand.plus.widgets.TextViewEx
android:layout_width="0dp" android:id="@+id/plugin_description"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:layout_marginBottom="8dp" android:layout_height="wrap_content"
android:layout_marginEnd="36dp" android:ellipsize="end"
android:layout_marginLeft="6dp" android:lines="2"
android:layout_marginRight="36dp" android:maxLines="2"
android:layout_marginStart="6dp" android:text="@string/lorem_ipsum"
android:layout_marginTop="8dp" android:textColor="?android:textColorSecondary"
android:layout_weight="1" android:textSize="14sp"
android:orientation="vertical"> osmand:typeface="@string/font_roboto_regular" />
</LinearLayout>
<net.osmand.plus.widgets.TextViewEx <ImageButton
android:id="@+id/plugin_name" android:id="@+id/plugin_options"
android:layout_width="match_parent" android:layout_width="@dimen/dashListItemHeight"
android:layout_height="wrap_content" android:layout_height="@dimen/dashListItemHeight"
android:layout_marginBottom="4dp" android:layout_gravity="center"
android:ellipsize="end" android:background="?attr/options_button_background"
android:lines="1" android:src="?attr/list_settings_icon" />
android:maxLines="1"
android:textColor="?android:textColorPrimary"
android:textSize="19sp"
osmand:typeface="@string/font_roboto_medium"
tools:text="@string/lorem_ipsum"/>
<net.osmand.plus.widgets.TextViewEx </LinearLayout>
android:id="@+id/plugin_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:lines="2"
android:maxLines="2"
android:textColor="?android:textColorSecondary"
android:textSize="14sp"
osmand:typeface="@string/font_roboto_regular"
tools:text="@string/lorem_ipsum"/>
</LinearLayout>
</LinearLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="top|end">
<ImageView
android:id="@+id/plugin_is_enabled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|top"
android:layout_marginTop="6dp"
android:src="?attr/ic_action_check"
android:visibility="invisible"
tools:visibility="visible"/>
<ImageButton
android:id="@+id/plugin_options"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_gravity="center_horizontal|bottom"
android:layout_marginTop="6dp"
android:background="?attr/ic_plugin_options"/>
</FrameLayout>
</FrameLayout>
</FrameLayout>

View file

@ -119,8 +119,6 @@ public class PluginsActivity extends OsmandListActivity {
TextView pluginDescription = (TextView)view.findViewById(R.id.plugin_description); TextView pluginDescription = (TextView)view.findViewById(R.id.plugin_description);
pluginDescription.setText(plugin.getDescription()); pluginDescription.setText(plugin.getDescription());
View pluginIsEnabled = view.findViewById(R.id.plugin_is_enabled);
pluginIsEnabled.setVisibility(plugin.isActive() ? View.VISIBLE : View.INVISIBLE);
View pluginOptions = view.findViewById(R.id.plugin_options); View pluginOptions = view.findViewById(R.id.plugin_options);
pluginOptions.setOnClickListener(new View.OnClickListener() { pluginOptions.setOnClickListener(new View.OnClickListener() {

View file

@ -519,12 +519,6 @@ public class MapControlsLayer extends OsmandMapLayer {
} }
private void updateMyLocation(RoutingHelper rh) { private void updateMyLocation(RoutingHelper rh) {
// final Drawable backToLoc = map.getResources().getDrawable(R.drawable.back_to_loc);
// final Drawable backToLocWhite = map.getResources().getDrawable(R.drawable.back_to_loc_white);
// final Drawable backToLocDisabled = map.getResources().getDrawable(R.drawable.la_backtoloc_disabled);
// final Drawable backToLocDisabledWhite = map.getResources().getDrawable(R.drawable.la_backtoloc_disabled_white);
// final Drawable backToLocTracked = map.getResources().getDrawable(R.drawable.back_to_loc_tracked);
// final Drawable backToLocTrackedWhite = map.getResources().getDrawable(R.drawable.back_to_loc_tracked_white);
boolean enabled = mapActivity.getMyApplication().getLocationProvider().getLastKnownLocation() != null; boolean enabled = mapActivity.getMyApplication().getLocationProvider().getLastKnownLocation() != null;
boolean tracked = mapActivity.getMapViewTrackingUtilities().isMapLinkedToLocation(); boolean tracked = mapActivity.getMapViewTrackingUtilities().isMapLinkedToLocation();
@ -532,12 +526,12 @@ public class MapControlsLayer extends OsmandMapLayer {
backToLocationControl.setBg(R.drawable.btn_circle, R.drawable.btn_circle_night); backToLocationControl.setBg(R.drawable.btn_circle, R.drawable.btn_circle_night);
backToLocationControl.setIconColorId(R.color.icon_color_light, 0); backToLocationControl.setIconColorId(R.color.icon_color_light, 0);
} else if (tracked) { } else if (tracked) {
backToLocationControl.setIconColorId(0);
backToLocationControl.setBg(R.drawable.btn_circle_blue);
} else {
// TODO different icon // TODO different icon
backToLocationControl.setIconColorId(R.color.map_widget_icon_color); backToLocationControl.setIconColorId(R.color.map_widget_icon_color);
backToLocationControl.setBg(R.drawable.btn_circle_blue); backToLocationControl.setBg(R.drawable.btn_circle_blue);
} else {
backToLocationControl.setIconColorId(0);
backToLocationControl.setBg(R.drawable.btn_circle_blue);
} }
boolean visible = !(tracked && rh.isFollowingMode()); boolean visible = !(tracked && rh.isFollowingMode());
backToLocationControl.updateVisibility(visible); backToLocationControl.updateVisibility(visible);