Merge remote-tracking branch 'origin/master'
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:state_checked="false" android:color="#ffffff" />
|
<item android:state_checked="false" android:state_pressed="false" android:color="#77848c" />
|
||||||
<item android:state_checked="true" android:state_pressed="false" android:color="#77848c" />
|
|
||||||
<item android:state_checked="false" android:state_pressed="true" android:color="#ffffff" />
|
<item android:state_checked="false" android:state_pressed="true" android:color="#ffffff" />
|
||||||
|
<item android:state_checked="true" android:color="#ffffff" />
|
||||||
</selector>
|
</selector>
|
||||||
|
|
BIN
OsmAnd/res/drawable-hdpi/ic_action_settings_disabled_dark.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
OsmAnd/res/drawable-hdpi/ic_action_settings_disabled_light.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
OsmAnd/res/drawable-mdpi/ic_action_settings_disabled_dark.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
OsmAnd/res/drawable-mdpi/ic_action_settings_disabled_light.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
BIN
OsmAnd/res/drawable-xhdpi/ic_action_settings_disabled_dark.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
OsmAnd/res/drawable-xhdpi/ic_action_settings_disabled_light.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
BIN
OsmAnd/res/drawable-xxhdpi/ic_action_settings_disabled_dark.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
OsmAnd/res/drawable-xxhdpi/ic_action_settings_disabled_light.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
14
OsmAnd/res/drawable/extension_stub.xml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape>
|
||||||
|
<size
|
||||||
|
android:width="360dp"
|
||||||
|
android:height="144dp"/>
|
||||||
|
<solid android:color="#ff8f00"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<bitmap android:src="@drawable/ic_extension_dark" android:gravity="center" />
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
7
OsmAnd/res/drawable/ic_action_settings_dark.xml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_enabled="true"
|
||||||
|
android:drawable="@drawable/ic_action_settings_enabled_dark" />
|
||||||
|
<item android:state_enabled="false"
|
||||||
|
android:drawable="@drawable/ic_action_settings_disabled_dark" />
|
||||||
|
</selector>
|
7
OsmAnd/res/drawable/ic_action_settings_light.xml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_enabled="true"
|
||||||
|
android:drawable="@drawable/ic_action_settings_enabled_light" />
|
||||||
|
<item android:state_enabled="false"
|
||||||
|
android:drawable="@drawable/ic_action_settings_disabled_light" />
|
||||||
|
</selector>
|
|
@ -1,25 +1,25 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:state_checked="false" android:state_pressed="false">
|
<item android:state_checked="true" android:state_pressed="false">
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<corners android:radius="2dp" />
|
<corners android:radius="2dp" />
|
||||||
<solid android:color="#ff8f00" />
|
<solid android:color="#ff8f00" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item android:state_checked="false" android:state_pressed="true">
|
<item android:state_checked="true" android:state_pressed="true">
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<corners android:radius="2dp" />
|
<corners android:radius="2dp" />
|
||||||
<solid android:color="#ffb24c" />
|
<solid android:color="#ffb24c" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item android:state_checked="true" android:state_pressed="false">
|
<item android:state_checked="false" android:state_pressed="false">
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<corners android:radius="2dp" />
|
<corners android:radius="2dp" />
|
||||||
<solid android:color="@null" />
|
<solid android:color="@null" />
|
||||||
<stroke android:width="1.5dp" android:color="#77848c" />
|
<stroke android:width="1.5dp" android:color="#77848c" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item android:state_checked="true" android:state_pressed="true">
|
<item android:state_checked="false" android:state_pressed="true">
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<corners android:radius="2dp" />
|
<corners android:radius="2dp" />
|
||||||
<solid android:color="#66ff8f00" />
|
<solid android:color="#66ff8f00" />
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:state_checked="false" android:state_pressed="false">
|
<item android:state_checked="true" android:state_pressed="false">
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<corners android:radius="2dp" />
|
<corners android:radius="2dp" />
|
||||||
<solid android:color="#ff8f00" />
|
<solid android:color="#ff8f00" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item android:state_checked="false" android:state_pressed="true">
|
<item android:state_checked="true" android:state_pressed="true">
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<corners android:radius="2dp" />
|
<corners android:radius="2dp" />
|
||||||
<solid android:color="#ffb24c" />
|
<solid android:color="#ffb24c" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item android:state_checked="true" android:state_pressed="false">
|
<item android:state_checked="false" android:state_pressed="false">
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<corners android:radius="2dp" />
|
<corners android:radius="2dp" />
|
||||||
<solid android:color="@null" />
|
<solid android:color="@null" />
|
||||||
<stroke android:width="1.5dp" android:color="#727272" />
|
<stroke android:width="1.5dp" android:color="#727272" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item android:state_checked="true" android:state_pressed="true">
|
<item android:state_checked="false" android:state_pressed="true">
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<corners android:radius="2dp" />
|
<corners android:radius="2dp" />
|
||||||
<solid android:color="#66ff8f00" />
|
<solid android:color="#66ff8f00" />
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/dash_plugin_item"
|
||||||
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:id="@+id/dash_plugin_item"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
@ -42,28 +42,56 @@
|
||||||
osmand:typeface="@string/font_roboto_regular"
|
osmand:typeface="@string/font_roboto_regular"
|
||||||
tools:text="@string/lorem_ipsum"/>
|
tools:text="@string/lorem_ipsum"/>
|
||||||
|
|
||||||
<net.osmand.plus.widgets.SwitchEx
|
<FrameLayout
|
||||||
android:id="@+id/check_item"
|
|
||||||
android:layout_width="90dp"
|
android:layout_width="90dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:layout_marginBottom="6dp"
|
android:layout_marginBottom="6dp"
|
||||||
android:layout_marginLeft="6dp"
|
|
||||||
android:layout_marginStart="6dp"
|
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:background="?attr/switch_ex_background"
|
android:layout_marginLeft="6dp"
|
||||||
android:minHeight="0dp"
|
android:layout_marginRight="16dp"
|
||||||
android:paddingTop="8dp"
|
android:layout_marginStart="6dp"
|
||||||
android:paddingBottom="8dp"
|
android:layout_marginTop="6dp">
|
||||||
android:paddingLeft="9.5dp"
|
|
||||||
android:paddingRight="9.5dp"
|
<net.osmand.plus.widgets.SwitchEx
|
||||||
osmand:textAllCapsCompat="true"
|
android:id="@+id/plugin_enable_disable"
|
||||||
android:textColor="?attr/switch_ex_text_color"
|
android:layout_width="match_parent"
|
||||||
android:textOff="@string/enable_plugin"
|
android:layout_height="wrap_content"
|
||||||
android:textOn="@string/disable_plugin"
|
android:background="?attr/switch_ex_background"
|
||||||
android:textSize="12sp"
|
android:minHeight="0dp"
|
||||||
osmand:typeface="@string/font_roboto_medium"/>
|
android:paddingBottom="8dp"
|
||||||
|
android:paddingLeft="9.5dp"
|
||||||
|
android:paddingRight="9.5dp"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:textColor="?attr/switch_ex_text_color"
|
||||||
|
android:textOff="@string/enable_plugin"
|
||||||
|
android:textOn="@string/disable_plugin"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
osmand:textAllCapsCompat="true"
|
||||||
|
osmand:typeface="@string/font_roboto_medium"/>
|
||||||
|
|
||||||
|
<net.osmand.plus.widgets.ButtonEx
|
||||||
|
android:id="@+id/get_plugin"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/get_button_background"
|
||||||
|
android:minHeight="0dp"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
|
android:paddingLeft="9.5dp"
|
||||||
|
android:paddingRight="9.5dp"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:textColor="@color/get_button_text"
|
||||||
|
android:text="@string/get_plugin"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
osmand:textAllCapsCompat="true"
|
||||||
|
osmand:typeface="@string/font_roboto_medium"/>
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
android:id="@+id/check_item"
|
android:id="@+id/check_item"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/ic_action_settings_dark"
|
android:src="@drawable/ic_action_settings_enabled_dark"
|
||||||
android:focusable="false"
|
android:focusable="false"
|
||||||
android:gravity="center_vertical" />
|
android:gravity="center_vertical" />
|
||||||
|
|
||||||
|
|
|
@ -13,68 +13,100 @@
|
||||||
tools:context=".activities.PluginActivity">
|
tools:context=".activities.PluginActivity">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="144dp"
|
android:layout_height="wrap_content"
|
||||||
android:background="#ff8f00"
|
android:maxHeight="144dp"
|
||||||
android:scaleType="center"
|
android:maxWidth="360dp"
|
||||||
android:src="@drawable/ic_extension_dark"/>
|
android:scaleType="centerInside"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:src="@drawable/extension_stub"/>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/plugin_header"
|
android:id="@+id/plugin_header"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="66dp"
|
android:layout_height="66dp"
|
||||||
|
android:background="?attr/plugin_details_header_bg"
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
android:paddingRight="16dp"
|
android:paddingRight="16dp">
|
||||||
android:background="?attr/plugin_details_header_bg">
|
|
||||||
|
|
||||||
<net.osmand.plus.widgets.ButtonEx
|
<net.osmand.plus.widgets.ButtonEx
|
||||||
android:id="@+id/plugin_settings"
|
android:id="@+id/plugin_settings"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical|start"
|
||||||
android:layout_marginBottom="9dp"
|
android:layout_marginBottom="9dp"
|
||||||
android:layout_marginTop="9dp"
|
android:layout_marginTop="9dp"
|
||||||
android:layout_gravity="center_vertical|start"
|
|
||||||
android:textSize="12sp"
|
|
||||||
osmand:textAllCapsCompat="true"
|
|
||||||
android:textColor="?android:textColorPrimary"
|
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:drawableLeft="?attr/ic_action_settings"
|
android:drawableLeft="?attr/ic_action_settings"
|
||||||
android:drawableStart="?attr/ic_action_settings"
|
|
||||||
android:drawablePadding="10dp"
|
android:drawablePadding="10dp"
|
||||||
|
android:drawableStart="?attr/ic_action_settings"
|
||||||
android:paddingLeft="0dp"
|
android:paddingLeft="0dp"
|
||||||
android:paddingRight="16dp"
|
android:paddingRight="16dp"
|
||||||
android:text="@string/plugin_settings_button_caption"
|
android:text="@string/plugin_settings_button_caption"
|
||||||
|
android:textColor="?android:textColorPrimary"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
osmand:textAllCapsCompat="true"
|
||||||
osmand:typeface="@string/font_roboto_medium"/>
|
osmand:typeface="@string/font_roboto_medium"/>
|
||||||
|
|
||||||
<net.osmand.plus.widgets.SwitchEx
|
<FrameLayout
|
||||||
android:id="@+id/plugin_enable_disable"
|
|
||||||
android:layout_width="139dp"
|
android:layout_width="139dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical|end"
|
android:layout_gravity="center_vertical|end"
|
||||||
android:layout_marginBottom="16dp"
|
android:layout_marginBottom="16dp"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp">
|
||||||
android:background="?attr/switch_ex_background"
|
|
||||||
android:paddingBottom="8dp"
|
<net.osmand.plus.widgets.SwitchEx
|
||||||
android:paddingLeft="9.5dp"
|
android:id="@+id/plugin_enable_disable"
|
||||||
android:paddingRight="9.5dp"
|
android:layout_width="match_parent"
|
||||||
android:paddingTop="8dp"
|
android:layout_height="wrap_content"
|
||||||
osmand:textAllCapsCompat="true"
|
android:background="?attr/switch_ex_background"
|
||||||
android:textColor="?attr/switch_ex_text_color"
|
android:paddingBottom="8dp"
|
||||||
android:textOff="@string/enable_plugin"
|
android:paddingLeft="9.5dp"
|
||||||
android:textOn="@string/disable_plugin"
|
android:paddingRight="9.5dp"
|
||||||
android:textSize="12sp"
|
android:paddingTop="8dp"
|
||||||
osmand:typeface="@string/font_roboto_medium"/>
|
android:textColor="?attr/switch_ex_text_color"
|
||||||
|
android:textOff="@string/enable_plugin"
|
||||||
|
android:textOn="@string/disable_plugin"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
osmand:textAllCapsCompat="true"
|
||||||
|
osmand:typeface="@string/font_roboto_medium"/>
|
||||||
|
|
||||||
|
<net.osmand.plus.widgets.ButtonEx
|
||||||
|
android:id="@+id/plugin_get"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/get_button_background"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
|
android:paddingLeft="9.5dp"
|
||||||
|
android:paddingRight="9.5dp"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:textColor="@color/get_button_text"
|
||||||
|
android:text="@string/get_plugin"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
osmand:textAllCapsCompat="true"
|
||||||
|
osmand:typeface="@string/font_roboto_medium"/>
|
||||||
|
</FrameLayout>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/plugin_header2"
|
android:id="@+id/plugin_install_header"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="66dp"
|
android:layout_height="66dp"
|
||||||
|
android:background="?attr/plugin_details_install_header_bg"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
android:paddingRight="16dp"
|
android:paddingRight="16dp"
|
||||||
android:orientation="horizontal"
|
|
||||||
android:background="?attr/plugin_details_header2_bg"
|
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:visibility="visible">
|
tools:visibility="visible">
|
||||||
|
|
||||||
|
@ -88,6 +120,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
android:paddingRight="16dp"
|
android:paddingRight="16dp"
|
||||||
|
android:textColor="?attr/plugin_description_header_text_color"
|
||||||
android:text="@string/plugin_install_needs_network"
|
android:text="@string/plugin_install_needs_network"
|
||||||
osmand:typeface="@string/font_roboto_regular"/>
|
osmand:typeface="@string/font_roboto_regular"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -99,6 +132,8 @@
|
||||||
android:layout_marginRight="16dp"
|
android:layout_marginRight="16dp"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:text="@string/plugin_description_title"
|
android:text="@string/plugin_description_title"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textColor="?attr/plugin_description_header_text_color"
|
||||||
osmand:textAllCapsCompat="true"
|
osmand:textAllCapsCompat="true"
|
||||||
osmand:typeface="@string/font_roboto_medium"/>
|
osmand:typeface="@string/font_roboto_medium"/>
|
||||||
|
|
||||||
|
@ -109,6 +144,8 @@
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_marginLeft="16dp"
|
||||||
android:layout_marginRight="16dp"
|
android:layout_marginRight="16dp"
|
||||||
android:layout_marginTop="14dp"
|
android:layout_marginTop="14dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="?android:textColorPrimary"
|
||||||
osmand:typeface="@string/font_roboto_regular"
|
osmand:typeface="@string/font_roboto_regular"
|
||||||
tools:text="@string/lorem_ipsum"/>
|
tools:text="@string/lorem_ipsum"/>
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
android:id="@android:id/list"
|
android:id="@android:id/list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_margin="6dp"
|
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:divider="@null"
|
android:divider="@null"
|
||||||
android:dividerHeight="4dp"
|
android:dividerHeight="4dp"
|
||||||
|
|
|
@ -1,88 +1,95 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
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"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="84dp"
|
android:layout_height="84dp"
|
||||||
android:background="?attr/card_bg"
|
android:paddingLeft="6dp"
|
||||||
android:descendantFocusability="blocksDescendants"
|
android:paddingRight="6dp">
|
||||||
android:padding="2dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/plugin_logo"
|
|
||||||
android:layout_width="64dp"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
android:layout_margin="8dp"
|
|
||||||
android:background="@drawable/bg_plugin_logo_enabled"
|
|
||||||
android:scaleType="center"
|
|
||||||
tools:src="@drawable/ic_extension_dark"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:layout_marginLeft="6dp"
|
|
||||||
android:layout_marginStart="6dp"
|
|
||||||
android:layout_marginRight="36dp"
|
|
||||||
android:layout_marginEnd="36dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<net.osmand.plus.widgets.TextViewEx
|
|
||||||
android:id="@+id/plugin_name"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="4dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:lines="1"
|
|
||||||
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
|
|
||||||
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
|
<FrameLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="top|end">
|
android:background="?attr/card_bg"
|
||||||
|
android:descendantFocusability="blocksDescendants"
|
||||||
|
android:padding="2dp">
|
||||||
|
|
||||||
<ImageView
|
<LinearLayout
|
||||||
android:id="@+id/plugin_is_enabled"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/plugin_logo"
|
||||||
|
android:layout_width="64dp"
|
||||||
|
android:layout_height="64dp"
|
||||||
|
android:layout_margin="8dp"
|
||||||
|
android:background="@drawable/bg_plugin_logo_enabled"
|
||||||
|
android:scaleType="center"
|
||||||
|
tools:src="@drawable/ic_extension_dark"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:layout_marginEnd="36dp"
|
||||||
|
android:layout_marginLeft="6dp"
|
||||||
|
android:layout_marginRight="36dp"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<net.osmand.plus.widgets.TextViewEx
|
||||||
|
android:id="@+id/plugin_name"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="4dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:lines="1"
|
||||||
|
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
|
||||||
|
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_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center_horizontal|top"
|
android:layout_gravity="top|end">
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:src="?attr/ic_action_check"
|
|
||||||
android:visibility="invisible"
|
|
||||||
tools:visibility="visible"/>
|
|
||||||
|
|
||||||
<ImageButton
|
<ImageView
|
||||||
android:id="@+id/plugin_options"
|
android:id="@+id/plugin_is_enabled"
|
||||||
android:layout_width="36dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="36dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="6dp"
|
android:layout_gravity="center_horizontal|top"
|
||||||
android:layout_gravity="center_horizontal|bottom"
|
android:layout_marginTop="6dp"
|
||||||
android:background="?attr/ic_plugin_options"/>
|
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>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
|
@ -27,8 +27,9 @@
|
||||||
<attr name="switch_ex_text_color" format="color|reference" />
|
<attr name="switch_ex_text_color" format="color|reference" />
|
||||||
<attr name="bg_plugin_logo_disabled" format="reference" />
|
<attr name="bg_plugin_logo_disabled" format="reference" />
|
||||||
<attr name="plugin_details_header_bg" format="color|reference" />
|
<attr name="plugin_details_header_bg" format="color|reference" />
|
||||||
<attr name="plugin_details_header2_bg" format="color|reference" />
|
<attr name="plugin_details_install_header_bg" format="color|reference" />
|
||||||
<attr name="ic_world_globe" format="reference" />
|
<attr name="ic_world_globe" format="reference" />
|
||||||
|
<attr name="plugin_description_header_text_color" format="color|reference" />
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
|
|
||||||
<declare-styleable name="PagerSlidingTabStrip">
|
<declare-styleable name="PagerSlidingTabStrip">
|
||||||
|
|
|
@ -107,6 +107,6 @@
|
||||||
<color name="plugin_details_header_bg_light">#ffffff</color>
|
<color name="plugin_details_header_bg_light">#ffffff</color>
|
||||||
<color name="plugin_details_header_bg_dark">#333b40</color>
|
<color name="plugin_details_header_bg_dark">#333b40</color>
|
||||||
|
|
||||||
<color name="plugin_details_header2_bg_light">#dbdbdb</color>
|
<color name="plugin_details_install_header_bg_light">#dbdbdb</color>
|
||||||
<color name="plugin_details_header2_bg_dark">#ffffff</color>
|
<color name="plugin_details_install_header_bg_dark">#2d3438</color>
|
||||||
</resources>
|
</resources>
|
|
@ -2085,9 +2085,12 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
|
||||||
<string name="av_camera_pic_size_descr">Select internal camera Picture Size</string>
|
<string name="av_camera_pic_size_descr">Select internal camera Picture Size</string>
|
||||||
<string name="navigation_intent_invalid">Invalid format: %s</string>
|
<string name="navigation_intent_invalid">Invalid format: %s</string>
|
||||||
<string name="hide_all_waypoints">Remove all</string>
|
<string name="hide_all_waypoints">Remove all</string>
|
||||||
<string name="enable_plugin">Enable</string>
|
<string name="enable_plugin">Disabled</string>
|
||||||
<string name="disable_plugin">Disable</string>
|
<string name="disable_plugin">Enabled</string>
|
||||||
|
<string name="enable_plugin2">Enable</string>
|
||||||
|
<string name="disable_plugin2">Disable</string>
|
||||||
<string name="plugin_description_title">Description</string>
|
<string name="plugin_description_title">Description</string>
|
||||||
<string name="plugin_settings_button_caption">Settings</string>
|
<string name="plugin_settings_button_caption">Settings</string>
|
||||||
<string name="plugin_install_needs_network">You need an Internet connection to install this plugin.</string>
|
<string name="plugin_install_needs_network">You need an Internet connection to install this plugin.</string>
|
||||||
|
<string name="get_plugin">Get</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -162,8 +162,9 @@
|
||||||
<item name="switch_ex_text_color">@color/switch_ex_button_text_light</item>
|
<item name="switch_ex_text_color">@color/switch_ex_button_text_light</item>
|
||||||
<item name="bg_plugin_logo_disabled">@drawable/bg_plugin_logo_disabled_light</item>
|
<item name="bg_plugin_logo_disabled">@drawable/bg_plugin_logo_disabled_light</item>
|
||||||
<item name="plugin_details_header_bg">@color/plugin_details_header_bg_light</item>
|
<item name="plugin_details_header_bg">@color/plugin_details_header_bg_light</item>
|
||||||
<item name="plugin_details_header2_bg">@color/plugin_details_header2_bg_light</item>
|
<item name="plugin_details_install_header_bg">@color/plugin_details_install_header_bg_light</item>
|
||||||
<item name="ic_world_globe">@drawable/ic_world_globe_light</item>
|
<item name="ic_world_globe">@drawable/ic_world_globe_light</item>
|
||||||
|
<item name="plugin_description_header_text_color">#727272</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="OsmandDarkTheme" parent="Theme.AppCompat">
|
<style name="OsmandDarkTheme" parent="Theme.AppCompat">
|
||||||
|
@ -198,8 +199,9 @@
|
||||||
<item name="switch_ex_text_color">@color/switch_ex_button_text_dark</item>
|
<item name="switch_ex_text_color">@color/switch_ex_button_text_dark</item>
|
||||||
<item name="bg_plugin_logo_disabled">@drawable/bg_plugin_logo_disabled_dark</item>
|
<item name="bg_plugin_logo_disabled">@drawable/bg_plugin_logo_disabled_dark</item>
|
||||||
<item name="plugin_details_header_bg">@color/plugin_details_header_bg_dark</item>
|
<item name="plugin_details_header_bg">@color/plugin_details_header_bg_dark</item>
|
||||||
<item name="plugin_details_header2_bg">@color/plugin_details_header2_bg_dark</item>
|
<item name="plugin_details_install_header_bg">@color/plugin_details_install_header_bg_dark</item>
|
||||||
<item name="ic_world_globe">@drawable/ic_world_globe_dark</item>
|
<item name="ic_world_globe">@drawable/ic_world_globe_dark</item>
|
||||||
|
<item name="plugin_description_header_text_color">#70818c</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="OsmandLightDarkActionBarTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
<style name="OsmandLightDarkActionBarTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||||
|
|
|
@ -73,13 +73,17 @@ public abstract class OsmandPlugin {
|
||||||
return active;
|
return active;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean couldBeActivated() {
|
public boolean needsInstallation() {
|
||||||
return installURL != null;
|
return installURL != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInstallURL(String installURL) {
|
public void setInstallURL(String installURL) {
|
||||||
this.installURL = installURL;
|
this.installURL = installURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getInstallURL() {
|
||||||
|
return installURL;
|
||||||
|
}
|
||||||
|
|
||||||
public void disable(OsmandApplication app) {};
|
public void disable(OsmandApplication app) {};
|
||||||
|
|
||||||
|
@ -208,7 +212,7 @@ public abstract class OsmandPlugin {
|
||||||
return allPlugins;
|
return allPlugins;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Iterable<OsmandPlugin> getEnabledPlugins(){
|
public static List<OsmandPlugin> getEnabledPlugins(){
|
||||||
ArrayList<OsmandPlugin> lst = new ArrayList<OsmandPlugin>(allPlugins.size());
|
ArrayList<OsmandPlugin> lst = new ArrayList<OsmandPlugin>(allPlugins.size());
|
||||||
for(OsmandPlugin p : allPlugins) {
|
for(OsmandPlugin p : allPlugins) {
|
||||||
if(p.isActive()) {
|
if(p.isActive()) {
|
||||||
|
@ -217,6 +221,16 @@ public abstract class OsmandPlugin {
|
||||||
}
|
}
|
||||||
return lst;
|
return lst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<OsmandPlugin> getNotEnabledPlugins(){
|
||||||
|
ArrayList<OsmandPlugin> lst = new ArrayList<OsmandPlugin>(allPlugins.size());
|
||||||
|
for(OsmandPlugin p : allPlugins) {
|
||||||
|
if(!p.isActive()) {
|
||||||
|
lst.add(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return lst;
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static <T extends OsmandPlugin> T getEnabledPlugin(Class<T> clz) {
|
public static <T extends OsmandPlugin> T getEnabledPlugin(Class<T> clz) {
|
||||||
|
|
|
@ -28,7 +28,6 @@ import net.osmand.plus.FavouritesDbHelper.FavoriteGroup;
|
||||||
import net.osmand.plus.GPXUtilities;
|
import net.osmand.plus.GPXUtilities;
|
||||||
import net.osmand.plus.GPXUtilities.GPXFile;
|
import net.osmand.plus.GPXUtilities.GPXFile;
|
||||||
import net.osmand.plus.OsmAndFormatter;
|
import net.osmand.plus.OsmAndFormatter;
|
||||||
import net.osmand.plus.OsmandApplication;
|
|
||||||
import net.osmand.plus.OsmandSettings;
|
import net.osmand.plus.OsmandSettings;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
import net.osmand.plus.TargetPointsHelper;
|
import net.osmand.plus.TargetPointsHelper;
|
||||||
|
@ -731,8 +730,8 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
final ImageView ch = (ImageView) row.findViewById(R.id.check_item);
|
final ImageView ch = (ImageView) row.findViewById(R.id.check_item);
|
||||||
ch.setVisibility(View.VISIBLE);
|
ch.setVisibility(View.VISIBLE);
|
||||||
ch.setImageDrawable(getActivity().getResources().getDrawable(
|
ch.setImageDrawable(getActivity().getResources().getDrawable(
|
||||||
getMyApplication().getSettings().isLightContent() ? R.drawable.ic_action_settings_light
|
getMyApplication().getSettings().isLightContent() ? R.drawable.ic_action_settings_enabled_light
|
||||||
: R.drawable.ic_action_settings_dark));
|
: R.drawable.ic_action_settings_enabled_dark));
|
||||||
ch.setOnClickListener(new View.OnClickListener() {
|
ch.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
|
@ -31,10 +31,8 @@ import net.osmand.plus.OsmandPlugin;
|
||||||
import net.osmand.plus.OsmandSettings;
|
import net.osmand.plus.OsmandSettings;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
import net.osmand.plus.TargetPointsHelper;
|
import net.osmand.plus.TargetPointsHelper;
|
||||||
import net.osmand.plus.Version;
|
|
||||||
import net.osmand.plus.activities.actions.OsmAndDialogs;
|
import net.osmand.plus.activities.actions.OsmAndDialogs;
|
||||||
import net.osmand.plus.activities.actions.ShareLocation;
|
import net.osmand.plus.activities.actions.ShareLocation;
|
||||||
import net.osmand.plus.activities.actions.StartGPSStatus;
|
|
||||||
import net.osmand.plus.activities.search.SearchActivity;
|
import net.osmand.plus.activities.search.SearchActivity;
|
||||||
import net.osmand.plus.development.OsmandDevelopmentPlugin;
|
import net.osmand.plus.development.OsmandDevelopmentPlugin;
|
||||||
import net.osmand.plus.dialogs.ConfigureMapMenu;
|
import net.osmand.plus.dialogs.ConfigureMapMenu;
|
||||||
|
@ -889,7 +887,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
}).reg();
|
}).reg();
|
||||||
|
|
||||||
optionsMenuHelper.item(R.string.settings_activity)
|
optionsMenuHelper.item(R.string.settings_activity)
|
||||||
.icons(R.drawable.ic_action_settings_dark, R.drawable.ic_action_settings_light)
|
.icons(R.drawable.ic_action_settings_enabled_dark, R.drawable.ic_action_settings_enabled_light)
|
||||||
.listen(new OnContextMenuClick() {
|
.listen(new OnContextMenuClick() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
|
||||||
|
|
|
@ -2,6 +2,7 @@ package net.osmand.plus.activities;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
@ -58,46 +59,48 @@ public class PluginActivity extends OsmandActionBarActivity {
|
||||||
TextView descriptionView = (TextView)findViewById(R.id.plugin_description);
|
TextView descriptionView = (TextView)findViewById(R.id.plugin_description);
|
||||||
descriptionView.setText(plugin.getDescription());
|
descriptionView.setText(plugin.getDescription());
|
||||||
|
|
||||||
final Class<? extends Activity> settingsActivity = plugin.getSettingsActivity();
|
Button settingsButton = (Button)findViewById(R.id.plugin_settings);
|
||||||
final Button settingsButton = (Button)findViewById(R.id.plugin_settings);
|
settingsButton.setOnClickListener(new View.OnClickListener() {
|
||||||
if (settingsActivity == null) {
|
@Override
|
||||||
settingsButton.setVisibility(View.GONE);
|
public void onClick(View view) {
|
||||||
} else {
|
startActivity(new Intent(PluginActivity.this, plugin.getSettingsActivity()));
|
||||||
settingsButton.setEnabled(plugin.isActive());
|
}
|
||||||
settingsButton.setVisibility(View.VISIBLE);
|
});
|
||||||
settingsButton.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
startActivity(new Intent(PluginActivity.this, settingsActivity));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
CompoundButton enableDisableButton = (CompoundButton)findViewById(
|
CompoundButton enableDisableButton = (CompoundButton)findViewById(
|
||||||
R.id.plugin_enable_disable);
|
R.id.plugin_enable_disable);
|
||||||
enableDisableButton.setChecked(plugin.isActive());
|
|
||||||
enableDisableButton.setOnCheckedChangeListener(
|
enableDisableButton.setOnCheckedChangeListener(
|
||||||
new CompoundButton.OnCheckedChangeListener() {
|
new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
if (plugin.isActive() == isChecked) {
|
if (plugin.isActive() == isChecked) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean ok = OsmandPlugin.enablePlugin((OsmandApplication)getApplication(), plugin,
|
boolean ok = OsmandPlugin.enablePlugin((OsmandApplication)getApplication(),
|
||||||
isChecked);
|
plugin, isChecked);
|
||||||
settingsButton.setEnabled(isChecked && ok);
|
if (!ok) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
updateState();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Button getButton = (Button)findViewById(R.id.plugin_get);
|
||||||
|
getButton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(plugin.getInstallURL())));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
updateState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
CompoundButton enableDisableButton = (CompoundButton)findViewById(
|
updateState();
|
||||||
R.id.plugin_enable_disable);
|
|
||||||
enableDisableButton.setChecked(plugin.isActive());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -111,4 +114,33 @@ public class PluginActivity extends OsmandActionBarActivity {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateState() {
|
||||||
|
CompoundButton enableDisableButton = (CompoundButton)findViewById(
|
||||||
|
R.id.plugin_enable_disable);
|
||||||
|
Button getButton = (Button)findViewById(R.id.plugin_get);
|
||||||
|
Button settingsButton = (Button)findViewById(R.id.plugin_settings);
|
||||||
|
View installHeader = findViewById(R.id.plugin_install_header);
|
||||||
|
|
||||||
|
if (plugin.needsInstallation()) {
|
||||||
|
getButton.setVisibility(View.VISIBLE);
|
||||||
|
enableDisableButton.setVisibility(View.GONE);
|
||||||
|
settingsButton.setVisibility(View.GONE);
|
||||||
|
installHeader.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
getButton.setVisibility(View.GONE);
|
||||||
|
enableDisableButton.setVisibility(View.VISIBLE);
|
||||||
|
enableDisableButton.setChecked(plugin.isActive());
|
||||||
|
|
||||||
|
final Class<? extends Activity> settingsActivity = plugin.getSettingsActivity();
|
||||||
|
if (settingsActivity == null) {
|
||||||
|
settingsButton.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
settingsButton.setEnabled(plugin.isActive());
|
||||||
|
settingsButton.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
installHeader.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,8 +128,8 @@ public class PluginsActivity extends OsmandListActivity {
|
||||||
final PopupMenu optionsMenu = new PopupMenu(this, v);
|
final PopupMenu optionsMenu = new PopupMenu(this, v);
|
||||||
|
|
||||||
MenuItem enableDisableItem = optionsMenu.getMenu().add(plugin.isActive()
|
MenuItem enableDisableItem = optionsMenu.getMenu().add(plugin.isActive()
|
||||||
? R.string.disable_plugin
|
? R.string.disable_plugin2
|
||||||
: R.string.enable_plugin);
|
: R.string.enable_plugin2);
|
||||||
enableDisableItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
enableDisableItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onMenuItemClick(MenuItem item) {
|
public boolean onMenuItemClick(MenuItem item) {
|
||||||
|
|
|
@ -533,8 +533,8 @@ public class SelectedGPXFragment extends OsmandExpandableListFragment {
|
||||||
} else if(model.getType() == GpxDisplayItemType.TRACK_SEGMENT) {
|
} else if(model.getType() == GpxDisplayItemType.TRACK_SEGMENT) {
|
||||||
ch.setVisibility(View.VISIBLE);
|
ch.setVisibility(View.VISIBLE);
|
||||||
ch.setImageDrawable(getMyActivity().getResources().getDrawable(
|
ch.setImageDrawable(getMyActivity().getResources().getDrawable(
|
||||||
app.getSettings().isLightContent() ? R.drawable.ic_action_settings_light
|
app.getSettings().isLightContent() ? R.drawable.ic_action_settings_enabled_light
|
||||||
: R.drawable.ic_action_settings_dark));
|
: R.drawable.ic_action_settings_enabled_dark));
|
||||||
ch.setOnClickListener(new View.OnClickListener() {
|
ch.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package net.osmand.plus.dashboard;
|
package net.osmand.plus.dashboard;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.osmand.AndroidUtils;
|
import net.osmand.AndroidUtils;
|
||||||
|
@ -9,11 +12,13 @@ import net.osmand.plus.activities.PluginActivity;
|
||||||
import net.osmand.plus.development.OsmandDevelopmentPlugin;
|
import net.osmand.plus.development.OsmandDevelopmentPlugin;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.Button;
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
@ -29,7 +34,7 @@ public class DashPluginsFragment extends DashBaseFragment {
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
View pluginView = AndroidUtils.findParentViewById(buttonView, R.id.dash_plugin_item);
|
View pluginView = AndroidUtils.findParentViewById(buttonView, R.id.dash_plugin_item);
|
||||||
OsmandPlugin plugin = (OsmandPlugin)pluginView.getTag();
|
OsmandPlugin plugin = (OsmandPlugin)pluginView.getTag();
|
||||||
if (plugin.isActive() == isChecked) {
|
if (plugin.isActive() == isChecked || plugin.needsInstallation()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (OsmandPlugin.enablePlugin(getMyApplication(), plugin, isChecked)) {
|
if (OsmandPlugin.enablePlugin(getMyApplication(), plugin, isChecked)) {
|
||||||
|
@ -49,6 +54,15 @@ public class DashPluginsFragment extends DashBaseFragment {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private final View.OnClickListener getListener = new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
View pluginView = AndroidUtils.findParentViewById(view, R.id.dash_plugin_item);
|
||||||
|
OsmandPlugin plugin = (OsmandPlugin)pluginView.getTag();
|
||||||
|
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(plugin.getInstallURL())));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
private final View.OnClickListener pluginDetailsListener = new View.OnClickListener() {
|
private final View.OnClickListener pluginDetailsListener = new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
@ -73,24 +87,23 @@ public class DashPluginsFragment extends DashBaseFragment {
|
||||||
});
|
});
|
||||||
|
|
||||||
LinearLayout pluginsContainer = (LinearLayout) contentView.findViewById(R.id.plugins);
|
LinearLayout pluginsContainer = (LinearLayout) contentView.findViewById(R.id.plugins);
|
||||||
List<OsmandPlugin> enabledPlugins = OsmandPlugin.getAvailablePlugins();
|
List<OsmandPlugin> notActivePlugins = OsmandPlugin.getNotEnabledPlugins();
|
||||||
for(OsmandPlugin plugin : enabledPlugins) {
|
Collections.shuffle(notActivePlugins);
|
||||||
if (plugin instanceof OsmandDevelopmentPlugin) {
|
for(OsmandPlugin plugin : notActivePlugins) {
|
||||||
|
if (plugin instanceof OsmandDevelopmentPlugin) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
inflatePluginView(inflater, pluginsContainer, plugin);
|
inflatePluginView(inflater, pluginsContainer, plugin);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
for(OsmandPlugin plugin : OsmandPlugin.getAvailablePlugins()) {
|
for(OsmandPlugin plugin : OsmandPlugin.getEnabledPlugins()) {
|
||||||
if (pluginsContainer.getChildCount() > 2) {
|
if (pluginsContainer.getChildCount() >= 5) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (plugin instanceof OsmandDevelopmentPlugin) {
|
if (plugin instanceof OsmandDevelopmentPlugin) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (enabledPlugins.contains(plugin)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
inflatePluginView(inflater, pluginsContainer, plugin);
|
inflatePluginView(inflater, pluginsContainer, plugin);
|
||||||
}
|
}
|
||||||
|
@ -117,11 +130,17 @@ public class DashPluginsFragment extends DashBaseFragment {
|
||||||
|
|
||||||
private void updatePluginState(View pluginView) {
|
private void updatePluginState(View pluginView) {
|
||||||
OsmandPlugin plugin = (OsmandPlugin)pluginView.getTag();
|
OsmandPlugin plugin = (OsmandPlugin)pluginView.getTag();
|
||||||
boolean isEnabled = plugin.isActive();
|
|
||||||
|
|
||||||
CompoundButton enableDisableButton = (CompoundButton)pluginView.findViewById(
|
CompoundButton enableDisableButton = (CompoundButton)pluginView.findViewById(
|
||||||
R.id.check_item);
|
R.id.plugin_enable_disable);
|
||||||
enableDisableButton.setChecked(isEnabled);
|
Button getButton = (Button)pluginView.findViewById(R.id.get_plugin);
|
||||||
|
if (plugin.needsInstallation()) {
|
||||||
|
getButton.setVisibility(View.VISIBLE);
|
||||||
|
enableDisableButton.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
getButton.setVisibility(View.GONE);
|
||||||
|
enableDisableButton.setVisibility(View.VISIBLE);
|
||||||
|
enableDisableButton.setChecked(plugin.isActive());
|
||||||
|
}
|
||||||
|
|
||||||
ImageButton logoView = (ImageButton)pluginView.findViewById(R.id.plugin_logo);
|
ImageButton logoView = (ImageButton)pluginView.findViewById(R.id.plugin_logo);
|
||||||
if (plugin.isActive()) {
|
if (plugin.isActive()) {
|
||||||
|
@ -148,9 +167,13 @@ public class DashPluginsFragment extends DashBaseFragment {
|
||||||
logoView.setOnClickListener(toggleEnableDisableListener);
|
logoView.setOnClickListener(toggleEnableDisableListener);
|
||||||
logoView.setImageResource(plugin.getLogoResourceId());
|
logoView.setImageResource(plugin.getLogoResourceId());
|
||||||
|
|
||||||
CompoundButton enableDisableButton = (CompoundButton)view.findViewById(R.id.check_item);
|
CompoundButton enableDisableButton =
|
||||||
|
(CompoundButton)view.findViewById(R.id.plugin_enable_disable);
|
||||||
enableDisableButton.setOnCheckedChangeListener(enableDisableListener);
|
enableDisableButton.setOnCheckedChangeListener(enableDisableListener);
|
||||||
|
|
||||||
|
Button getButton = (Button)view.findViewById(R.id.get_plugin);
|
||||||
|
getButton.setOnClickListener(getListener);
|
||||||
|
|
||||||
updatePluginState(view);
|
updatePluginState(view);
|
||||||
|
|
||||||
container.addView(view);
|
container.addView(view);
|
||||||
|
|
|
@ -29,7 +29,6 @@ import android.app.AlertDialog.Builder;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.DialogInterface.OnMultiChoiceClickListener;
|
import android.content.DialogInterface.OnMultiChoiceClickListener;
|
||||||
import android.preference.PreferenceGroup;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
@ -65,7 +64,7 @@ public class ConfigureMapMenu {
|
||||||
|
|
||||||
createLayersItems(adapter, ma);
|
createLayersItems(adapter, ma);
|
||||||
if (!advanced){
|
if (!advanced){
|
||||||
adapter.item(R.string.btn_advanced_mode).icons(R.drawable.ic_action_settings_dark, R.drawable.ic_action_settings_light)
|
adapter.item(R.string.btn_advanced_mode).icons(R.drawable.ic_action_settings_enabled_dark, R.drawable.ic_action_settings_enabled_light)
|
||||||
.selected(advanced ? 1 : 0)
|
.selected(advanced ? 1 : 0)
|
||||||
.listen(new OnContextMenuClick() {
|
.listen(new OnContextMenuClick() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -438,7 +438,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
device != null && device.getLastLocation() != null ? MenuItemCompat.SHOW_AS_ACTION_NEVER : MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
|
device != null && device.getLastLocation() != null ? MenuItemCompat.SHOW_AS_ACTION_NEVER : MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
|
||||||
///
|
///
|
||||||
if (device != null) {
|
if (device != null) {
|
||||||
createMenuItem(menu, SETTINGS_DEV_ID, R.string.settings, R.drawable.ic_action_settings_light, R.drawable.ic_action_settings_dark,
|
createMenuItem(menu, SETTINGS_DEV_ID, R.string.settings, R.drawable.ic_action_settings_enabled_light, R.drawable.ic_action_settings_enabled_dark,
|
||||||
// there is a bug in Android 4.2 layout
|
// there is a bug in Android 4.2 layout
|
||||||
device.getLastLocation() != null ? MenuItemCompat.SHOW_AS_ACTION_NEVER : MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
|
device.getLastLocation() != null ? MenuItemCompat.SHOW_AS_ACTION_NEVER : MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
|
||||||
}
|
}
|
||||||
|
@ -963,7 +963,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
R.drawable.ic_action_plus_dark, R.drawable.ic_action_plus_dark,
|
R.drawable.ic_action_plus_dark, R.drawable.ic_action_plus_dark,
|
||||||
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
|
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
|
||||||
createMenuItem(menu, SETTINGS_ID, R.string.settings,
|
createMenuItem(menu, SETTINGS_ID, R.string.settings,
|
||||||
R.drawable.ic_action_settings_dark, R.drawable.ic_action_settings_dark,
|
R.drawable.ic_action_settings_enabled_dark, R.drawable.ic_action_settings_enabled_dark,
|
||||||
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
|
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
|
||||||
return super.onCreateOptionsMenu(menu);
|
return super.onCreateOptionsMenu(menu);
|
||||||
}
|
}
|
||||||
|
@ -1162,9 +1162,9 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
v.setVisibility(View.GONE);
|
v.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
if (getMyApplication().getSettings().isLightContent()){
|
if (getMyApplication().getSettings().isLightContent()){
|
||||||
v.setImageResource(R.drawable.ic_action_settings_light);
|
v.setImageResource(R.drawable.ic_action_settings_enabled_light);
|
||||||
} else {
|
} else {
|
||||||
v.setImageResource(R.drawable.ic_action_settings_dark);
|
v.setImageResource(R.drawable.ic_action_settings_enabled_dark);
|
||||||
}
|
}
|
||||||
v.setVisibility(View.VISIBLE);
|
v.setVisibility(View.VISIBLE);
|
||||||
v.setOnClickListener(new View.OnClickListener() {
|
v.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|