Update plugins
This commit is contained in:
parent
a7c0717867
commit
bef93375e7
5 changed files with 93 additions and 119 deletions
|
@ -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"
|
||||||
|
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/main_fav"
|
android:id="@+id/main_fav"
|
||||||
android:background="?attr/card_bg"
|
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/card_bg"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical" >
|
||||||
<LinearLayout android:orientation="horizontal"
|
|
||||||
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="@dimen/dashHeaderHeight">
|
android:layout_height="@dimen/dashHeaderHeight"
|
||||||
<TextView android:id="@+id/fav_text"
|
android:orientation="horizontal" >
|
||||||
android:text="@string/shared_string_my_places"
|
|
||||||
style="?attr/dashboardSubHeaderStyle"/>
|
<TextView
|
||||||
<Button android:id="@+id/show_all"
|
android:id="@+id/fav_text"
|
||||||
|
style="?attr/dashboardSubHeaderStyle"
|
||||||
|
android:text="@string/shared_string_my_places" />
|
||||||
|
|
||||||
|
<net.osmand.plus.widgets.ButtonEx
|
||||||
|
android:id="@+id/show_all"
|
||||||
|
style="?attr/dashboardGeneralButtonStyle"
|
||||||
android:text="@string/shared_string_show_all"
|
android:text="@string/shared_string_show_all"
|
||||||
style="?attr/dashboardGeneralButtonStyle"/>
|
osmand:textAllCapsCompat="true"
|
||||||
|
osmand:typeface="@string/font_roboto_medium" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout android:id="@+id/items"
|
|
||||||
android:orientation="vertical"
|
<LinearLayout
|
||||||
|
android:id="@+id/items"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -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"
|
||||||
|
|
|
@ -1,31 +1,20 @@
|
||||||
<?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:paddingLeft="6dp"
|
android:background="?attr/expandable_list_item_background"
|
||||||
android:paddingRight="6dp">
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="?attr/card_bg"
|
|
||||||
android:descendantFocusability="blocksDescendants"
|
android:descendantFocusability="blocksDescendants"
|
||||||
android:padding="2dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="horizontal" >
|
android:orientation="horizontal" >
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/plugin_logo"
|
android:id="@+id/plugin_logo"
|
||||||
android:layout_width="64dp"
|
android:layout_width="48dp"
|
||||||
android:layout_height="64dp"
|
android:layout_height="48dp"
|
||||||
android:layout_margin="8dp"
|
android:layout_margin="8dp"
|
||||||
android:background="@drawable/bg_plugin_logo_enabled"
|
android:background="@drawable/bg_plugin_logo_enabled"
|
||||||
|
android:layout_gravity="center"
|
||||||
android:scaleType="center"
|
android:scaleType="center"
|
||||||
tools:src="@drawable/ic_extension_dark" />
|
tools:src="@drawable/ic_extension_dark" />
|
||||||
|
|
||||||
|
@ -33,10 +22,8 @@
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:layout_marginEnd="36dp"
|
android:layout_marginRight="4dp"
|
||||||
android:layout_marginLeft="6dp"
|
android:layout_marginLeft="4dp"
|
||||||
android:layout_marginRight="36dp"
|
|
||||||
android:layout_marginStart="6dp"
|
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical" >
|
||||||
|
@ -49,10 +36,10 @@
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:lines="1"
|
android:lines="1"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
|
android:text="@string/lorem_ipsum"
|
||||||
android:textColor="?android:textColorPrimary"
|
android:textColor="?android:textColorPrimary"
|
||||||
android:textSize="19sp"
|
android:textSize="19sp"
|
||||||
osmand:typeface="@string/font_roboto_medium"
|
osmand:typeface="@string/font_roboto_medium" />
|
||||||
tools:text="@string/lorem_ipsum"/>
|
|
||||||
|
|
||||||
<net.osmand.plus.widgets.TextViewEx
|
<net.osmand.plus.widgets.TextViewEx
|
||||||
android:id="@+id/plugin_description"
|
android:id="@+id/plugin_description"
|
||||||
|
@ -61,35 +48,18 @@
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:lines="2"
|
android:lines="2"
|
||||||
android:maxLines="2"
|
android:maxLines="2"
|
||||||
|
android:text="@string/lorem_ipsum"
|
||||||
android:textColor="?android:textColorSecondary"
|
android:textColor="?android:textColorSecondary"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
osmand:typeface="@string/font_roboto_regular"
|
osmand:typeface="@string/font_roboto_regular" />
|
||||||
tools:text="@string/lorem_ipsum"/>
|
|
||||||
</LinearLayout>
|
</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
|
<ImageButton
|
||||||
android:id="@+id/plugin_options"
|
android:id="@+id/plugin_options"
|
||||||
android:layout_width="36dp"
|
android:layout_width="@dimen/dashListItemHeight"
|
||||||
android:layout_height="36dp"
|
android:layout_height="@dimen/dashListItemHeight"
|
||||||
android:layout_gravity="center_horizontal|bottom"
|
android:layout_gravity="center"
|
||||||
android:layout_marginTop="6dp"
|
android:background="?attr/options_button_background"
|
||||||
android:background="?attr/ic_plugin_options"/>
|
android:src="?attr/list_settings_icon" />
|
||||||
</FrameLayout>
|
|
||||||
</FrameLayout>
|
</LinearLayout>
|
||||||
</FrameLayout>
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue