Merge branch 'master' of github.com:Bars107/Osmand
This commit is contained in:
commit
349c231119
28 changed files with 502 additions and 295 deletions
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="?attr/expandable_list_item_background"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/expandable_list_item_background"
|
||||
android:minHeight="@dimen/list_item_height"
|
||||
android:paddingBottom="1dp"
|
||||
android:paddingLeft="@dimen/list_content_padding"
|
||||
|
@ -14,25 +14,49 @@
|
|||
android:id="@+id/check_download_item"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="false"
|
||||
android:layout_gravity="center_vertical"/>
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="@dimen/favorites_icon_right_margin"
|
||||
android:focusable="false"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/download_item"
|
||||
android:id="@+id/name"
|
||||
style="@style/ListText.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
tools:text="@string/lorem_ipsum"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/download_descr"
|
||||
style="@style/ListText.Small"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center_vertical"
|
||||
tools:text="@string/lorem_ipsum"
|
||||
android:maxLines="7"/>
|
||||
android:maxLines="1"
|
||||
android:textSize="12sp"
|
||||
tools:text="@string/lorem_ipsum"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/download_descr"
|
||||
android:id="@+id/update_descr"
|
||||
style="@style/ListText.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:gravity="right"/>
|
||||
android:textColor="@color/color_distance"
|
||||
android:textSize="12sp"
|
||||
tools:text="@string/lorem_ipsum"
|
||||
android:maxLines="1"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
style="@style/OsmandListView"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="?attr/expandable_list_background"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginRight="0dp"
|
||||
android:layout_marginTop="0dp"
|
||||
|
|
|
@ -1,43 +1,34 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/expandable_category_color"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="@dimen/list_header_padding"
|
||||
android:paddingRight="@dimen/list_header_padding"
|
||||
android:paddingTop="5dp">
|
||||
android:layout_height="@dimen/list_header_height"
|
||||
android:paddingLeft="@dimen/list_header_padding">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/explist_indicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginTop="@dimen/list_header_top_margin"
|
||||
android:src="@drawable/expandable_category_unpushed"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/category_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:autoLink="web"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="18sp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right">
|
||||
android:layout_marginLeft="@dimen/list_header_text_left_margin"
|
||||
android:layout_marginTop="@dimen/list_header_settings_top_margin"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/list_header_text_size"
|
||||
tools:text="@string/lorem_ipsum"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/check_item"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/list_header_settings_top_margin"
|
||||
android:focusable="false"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
|
@ -1,45 +1,35 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/expandable_category_color"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="4dp"
|
||||
android:paddingRight="4dp"
|
||||
android:paddingTop="5dp">
|
||||
android:layout_height="@dimen/list_header_height"
|
||||
android:paddingLeft="@dimen/list_header_padding">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/explist_indicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:paddingLeft="6dp"
|
||||
android:layout_marginTop="@dimen/list_header_top_margin"
|
||||
android:src="@drawable/expandable_category_unpushed"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/category_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/list_header_bottom_margin"
|
||||
android:layout_marginLeft="@dimen/list_header_text_left_margin"
|
||||
android:layout_marginTop="@dimen/list_header_top_margin"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="18sp"></TextView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right">
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/list_header_text_size"
|
||||
tools:text="@string/lorem_ipsum"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/check_item"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_action_settings_enabled_dark"
|
||||
android:layout_marginTop="@dimen/list_header_settings_top_margin"
|
||||
android:focusable="false"
|
||||
android:gravity="center_vertical" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
android:src="?attr/list_settings_icon"/>
|
||||
</LinearLayout>
|
|
@ -1,48 +1,35 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="3dp"
|
||||
android:paddingRight="3dp"
|
||||
android:stretchColumns="1">
|
||||
android:orientation="vertical">
|
||||
|
||||
<TableRow>
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/dialog_content_bottom_margin"
|
||||
android:paddingLeft="@dimen/dialog_content_margin"
|
||||
android:paddingRight="@dimen/dialog_content_margin"
|
||||
android:paddingTop="@dimen/dialog_content_bottom_margin">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dialog_elements_vertical_margin"
|
||||
android:text="@string/favourites_edit_dialog_name"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/Name"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="3dp"
|
||||
android:selectAllOnFocus="true"/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/osmo_group_description" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/descr"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:completionThreshold="1"
|
||||
android:inputType="textCapWords"
|
||||
android:paddingLeft="3dp"
|
||||
android:selectAllOnFocus="true" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dialog_elements_vertical_margin"
|
||||
android:text="@string/favourites_edit_dialog_category"/>
|
||||
|
||||
<AutoCompleteTextView
|
||||
|
@ -51,7 +38,21 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:completionThreshold="1"
|
||||
android:inputType="textCapWords"
|
||||
android:paddingLeft="3dp"
|
||||
android:selectAllOnFocus="true"/>
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dialog_elements_vertical_margin"
|
||||
android:text="@string/osmo_group_description"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/descr"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:completionThreshold="1"
|
||||
android:inputType="textCapWords"
|
||||
android:selectAllOnFocus="true"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -3,40 +3,92 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/expandable_list_item_background"
|
||||
android:minHeight="@dimen/list_item_height"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="@dimen/list_content_padding"
|
||||
android:paddingRight="@dimen/list_content_padding"
|
||||
android:background="?attr/expandable_list_item_background"
|
||||
android:paddingTop="5dp">
|
||||
android:paddingRight="@dimen/list_content_padding">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/check_item"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/favorites_icon_top_margin"
|
||||
android:layout_marginRight="@dimen/favorites_icon_right_margin"
|
||||
android:focusable="false"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/favourite_icon"
|
||||
android:layout_width="25dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:paddingRight="2dp"
|
||||
android:paddingTop="2dp"/>
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="@dimen/favorites_icon_right_margin"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/favourite_label"
|
||||
style="@style/ListText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/dashFavNameTextSize"
|
||||
tools:text="@string/lorem_ipsum"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/direction"
|
||||
android:layout_width="@dimen/dashFavDirectionSize"
|
||||
android:layout_height="@dimen/dashFavDirectionSize"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/distance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/showAllButtonTextSize"
|
||||
tools:text="100500 km"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/group_image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:src="@drawable/ic_small_group"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/group_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:textColor="@color/dashboard_descr_colol"
|
||||
android:textSize="@dimen/showAllButtonTextSize"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
|
@ -1,25 +1,54 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/DescriptionText"
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="@string/download_link_and_local_description" />
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/dialog_content_margin"
|
||||
android:paddingRight="@dimen/dialog_content_margin"
|
||||
android:paddingTop="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/device_memory"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/DescriptionText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/free"/>
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/DeterminateProgressBar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<ExpandableListView
|
||||
android:id="@android:id/list"
|
||||
style="@style/OsmandListView"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:groupIndicator="@android:color/transparent"
|
||||
style="@style/OsmandListView"/>
|
||||
android:groupIndicator="@android:color/transparent"/>
|
||||
|
||||
</LinearLayout>
|
|
@ -16,5 +16,5 @@
|
|||
android:orientation="horizontal"
|
||||
android:id="@+id/bottomControls"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="@dimen/bottom_tool_bar_size"/>
|
||||
</LinearLayout>
|
|
@ -7,7 +7,8 @@
|
|||
<ListView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
style="@style/OsmandListView"/>
|
||||
|
||||
<Button
|
||||
|
|
|
@ -42,6 +42,6 @@
|
|||
android:background="?attr/bottomToolBarColor"
|
||||
android:id="@+id/bottomControls"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="@dimen/bottom_tool_bar_size"/>
|
||||
|
||||
</LinearLayout>
|
|
@ -1,44 +1,58 @@
|
|||
<?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:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/list_item_height"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="3dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/poi_direction"
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="26dp" />
|
||||
android:paddingLeft="@dimen/list_content_padding"
|
||||
android:paddingRight="@dimen/list_content_padding">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/poi_icon"
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="26dp"
|
||||
android:layout_marginLeft="3dp" />
|
||||
|
||||
</LinearLayout>
|
||||
android:layout_marginRight="@dimen/favorites_icon_right_margin"
|
||||
tools:visiblity="visible"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingRight="3dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/poi_label"
|
||||
style="@style/ListText.Small"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:gravity="center_vertical" />
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
tools:text="@string/lorem_ipsum"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/poi_direction"
|
||||
android:layout_width="@dimen/dashFavDirectionSize"
|
||||
android:layout_height="@dimen/dashFavDirectionSize"
|
||||
android:layout_gravity="center_vertical"
|
||||
tools:visiblity="visible"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/distance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_distance"
|
||||
android:maxLines="1"
|
||||
tools:text="@string/lorem_ipsum"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -20,6 +20,6 @@
|
|||
android:id="@+id/bottomControls"
|
||||
android:background="?attr/bottomToolBarColor"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="@dimen/bottom_tool_bar_size"/>
|
||||
|
||||
</LinearLayout>
|
|
@ -31,6 +31,8 @@
|
|||
<attr name="ic_world_globe" format="reference" />
|
||||
<attr name="plugin_description_header_text_color" format="color|reference" />
|
||||
<attr name="expandable_list_item_background" format="color"/>
|
||||
<attr name="expandable_list_background" format="color"/>
|
||||
<attr name="list_settings_icon" format="reference"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="PagerSlidingTabStrip">
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="expandable_list_item_dark">#292f33</color>
|
||||
<color name="list_background_dark">#292f33</color>
|
||||
<color name="list_sub_menu_background_dark">#475259</color>
|
||||
<color name="expandable_list_item_light">@color/color_white</color>
|
||||
<color name="list_item_background_dark">#333b40</color>
|
||||
|
||||
|
||||
<color name="actionbar_dark_color">#39464d</color>
|
||||
<color name="tool_bar_color_dark">#CC080B0D</color>
|
||||
|
@ -108,7 +111,7 @@
|
|||
<color name="get_button_text">#ffffff</color>
|
||||
|
||||
<color name="plugin_details_header_bg_light">#ffffff</color>
|
||||
<color name="plugin_details_header_bg_dark">#333b40</color>
|
||||
|
||||
|
||||
<color name="plugin_details_install_header_bg_light">#dbdbdb</color>
|
||||
<color name="plugin_details_install_header_bg_dark">#2d3438</color>
|
||||
|
|
|
@ -26,8 +26,20 @@
|
|||
<dimen name="list_header_padding">8dp</dimen>
|
||||
<dimen name="tab_height">48dp</dimen>
|
||||
<dimen name="list_item_height">50dp</dimen>
|
||||
<dimen name="list_header_height">40dp</dimen>
|
||||
<dimen name="list_header_top_margin">16dp</dimen>
|
||||
<dimen name="list_header_settings_top_margin">10dp</dimen>
|
||||
<dimen name="list_header_text_left_margin">12dp</dimen>
|
||||
<dimen name="list_header_bottom_margin">8dp</dimen>
|
||||
<dimen name="bottom_tool_bar_size">48dp</dimen>
|
||||
<dimen name="favorites_icon_right_margin">18dp</dimen>
|
||||
<dimen name="favorites_icon_top_margin">13dp</dimen>
|
||||
<dimen name="dialog_elements_vertical_margin">16dp</dimen>
|
||||
<dimen name="dialog_content_margin">24dp</dimen>
|
||||
<dimen name="dialog_content_bottom_margin">16dp</dimen>
|
||||
|
||||
<!-- TextSizes -->
|
||||
<dimen name="list_header_text_size">14sp</dimen>
|
||||
<dimen name="showAllButtonTextSize">12sp</dimen>
|
||||
<dimen name="subHeaderTextSize">14sp</dimen>
|
||||
<dimen name="dashFavNameTextSize">16sp</dimen>
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
|
||||
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
|
||||
-->
|
||||
<string name="free">Free %1$s </string>
|
||||
<string name="device_memory">Device memory</string>
|
||||
<string name="rendering_attr_pisteGrooming_name">Piste grooming</string>
|
||||
<string name="plugin_ski_name">Ski Maps</string>
|
||||
<string name="plugin_nautical_name">Nautical Maps</string>
|
||||
|
|
|
@ -161,6 +161,8 @@
|
|||
<item name="ic_world_globe">@drawable/ic_world_globe_light</item>
|
||||
<item name="plugin_description_header_text_color">#727272</item>
|
||||
<item name="expandable_list_item_background">@color/expandable_list_item_light</item>
|
||||
<item name="expandable_list_background">@color/color_white</item>
|
||||
<item name="list_settings_icon">@drawable/ic_overflow_menu_light</item>
|
||||
</style>
|
||||
|
||||
<style name="OsmandDarkTheme" parent="Theme.AppCompat">
|
||||
|
@ -194,11 +196,13 @@
|
|||
<item name="switch_ex_background">@drawable/switch_ex_background_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="plugin_details_header_bg">@color/plugin_details_header_bg_dark</item>
|
||||
<item name="plugin_details_header_bg">@color/list_item_background_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="plugin_description_header_text_color">#70818c</item>
|
||||
<item name="expandable_list_item_background">@color/expandable_list_item_dark</item>
|
||||
<item name="expandable_list_item_background">@color/list_item_background_dark</item>
|
||||
<item name="expandable_list_background">@color/list_background_dark</item>
|
||||
<item name="list_settings_icon">@drawable/ic_overflow_menu_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Styled.ActionBarDark" parent="Widget.AppCompat.Light.ActionBar.Solid.Inverse">
|
||||
|
|
|
@ -18,7 +18,10 @@ import android.text.Spannable;
|
|||
import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ImageSpan;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import net.osmand.Location;
|
||||
import net.osmand.plus.GpxSelectionHelper;
|
||||
import net.osmand.plus.OsmAndLocationProvider;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
|
@ -35,12 +38,14 @@ import android.widget.TabHost;
|
|||
import android.widget.TabHost.TabSpec;
|
||||
import android.widget.TabWidget;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.plus.dashboard.DashLocationFragment;
|
||||
import net.osmand.plus.views.controls.PagerSlidingTabStrip;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class FavoritesActivity extends TabActivity {
|
||||
public class FavoritesActivity extends TabActivity implements OsmAndLocationProvider.OsmAndCompassListener, OsmAndLocationProvider.OsmAndLocationListener {
|
||||
|
||||
private static final String FAVOURITES_INFO = "FAVOURITES_INFO";
|
||||
private static final String TRACKS = "TRACKS";
|
||||
|
@ -119,12 +124,28 @@ public class FavoritesActivity extends TabActivity {
|
|||
updateSelectedTracks();
|
||||
}
|
||||
});
|
||||
|
||||
if (getMyApplication().getFavorites().getFavouritePoints().size() > 0) {
|
||||
getLocationProvider().addCompassListener(this);
|
||||
getLocationProvider().registerOrUnregisterCompassListener(true);
|
||||
}
|
||||
}
|
||||
|
||||
public OsmandApplication getMyApplication() {
|
||||
return (OsmandApplication) getApplication();
|
||||
}
|
||||
|
||||
private OsmAndLocationProvider getLocationProvider() {
|
||||
return getMyApplication().getLocationProvider();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
((OsmandApplication) getApplication()).getSelectedGpxHelper().setUiListener(FavoritesActivity.class, null);
|
||||
getLocationProvider().pauseAllUpdates();
|
||||
getLocationProvider().removeLocationListener(this);
|
||||
getLocationProvider().removeCompassListener(this);
|
||||
}
|
||||
|
||||
public void updateSelectedTracks() {
|
||||
|
@ -196,5 +217,25 @@ public class FavoritesActivity extends TabActivity {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCompassValue(float value) {
|
||||
for (WeakReference<Fragment> ref : fragList) {
|
||||
Fragment f = ref.get();
|
||||
if (f instanceof FavoritesTreeFragment && !f.isDetached()) {
|
||||
((FavoritesTreeFragment) f).updateCompassValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLocation(Location location) {
|
||||
for (WeakReference<Fragment> ref : fragList) {
|
||||
Fragment f = ref.get();
|
||||
if (f instanceof FavoritesTreeFragment && !f.isDetached()) {
|
||||
((FavoritesTreeFragment) f).updateLocation(location);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import net.osmand.Location;
|
||||
import net.osmand.access.AccessibleToast;
|
||||
import net.osmand.data.FavouritePoint;
|
||||
import net.osmand.data.LatLon;
|
||||
|
@ -33,6 +34,7 @@ import net.osmand.plus.OsmandSettings;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.TargetPointsHelper;
|
||||
import net.osmand.plus.base.FavoriteImageDrawable;
|
||||
import net.osmand.plus.dashboard.DashLocationFragment;
|
||||
import net.osmand.plus.dialogs.DirectionsDialogs;
|
||||
import net.osmand.plus.helpers.ColorDialogs;
|
||||
import net.osmand.plus.helpers.ScreenOrientationHelper;
|
||||
|
@ -62,6 +64,8 @@ import android.widget.Spinner;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.w3c.dom.Text;
|
||||
|
||||
|
||||
public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||
|
||||
|
@ -83,6 +87,9 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
|||
private ActionMode actionMode;
|
||||
private SearchView searchView;
|
||||
|
||||
protected LatLon loc = null;
|
||||
protected Float heading = null;
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
|
@ -125,6 +132,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
|||
// final LatLon mapLocation = getMyApplication().getSettings().getLastKnownMapLocation();
|
||||
favouritesAdapter.synchronizeGroups();
|
||||
|
||||
loc = getMyApplication().getSettings().getLastKnownMapLocation();
|
||||
if(favouritesAdapter.getGroupCount() > 0 &&
|
||||
"".equals(favouritesAdapter.getGroup(0).name)) {
|
||||
getExpandableListView().expandGroup(0);
|
||||
|
@ -737,9 +745,6 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
|||
} else {
|
||||
final ImageView ch = (ImageView) row.findViewById(R.id.check_item);
|
||||
ch.setVisibility(View.VISIBLE);
|
||||
ch.setImageDrawable(getActivity().getResources().getDrawable(
|
||||
getMyApplication().getSettings().isLightContent() ? R.drawable.ic_action_settings_enabled_light
|
||||
: R.drawable.ic_action_settings_enabled_dark));
|
||||
ch.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -761,7 +766,8 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
|||
row = inflater.inflate(R.layout.favourites_list_item, parent, false);
|
||||
}
|
||||
|
||||
TextView label = (TextView) row.findViewById(R.id.favourite_label);
|
||||
TextView name = (TextView) row.findViewById(R.id.favourite_label);
|
||||
TextView distanceText = (TextView) row.findViewById(R.id.distance);
|
||||
ImageView icon = (ImageView) row.findViewById(R.id.favourite_icon);
|
||||
final FavouritePoint model = (FavouritePoint) getChild(groupPosition, childPosition);
|
||||
row.setTag(model);
|
||||
|
@ -770,11 +776,19 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
|||
int dist = (int) (MapUtils.getDistance(model.getLatitude(), model.getLongitude(),
|
||||
lastKnownMapLocation.getLatitude(), lastKnownMapLocation.getLongitude()));
|
||||
String distance = OsmAndFormatter.getFormattedDistance(dist, getMyApplication()) + " ";
|
||||
label.setText(distance + model.getName(), TextView.BufferType.SPANNABLE);
|
||||
label.setTypeface(Typeface.DEFAULT, model.isVisible() ? Typeface.NORMAL : Typeface.ITALIC);
|
||||
((Spannable) label.getText()).setSpan(
|
||||
new ForegroundColorSpan(getResources().getColor(R.color.color_distance)), 0, distance.length() - 1,
|
||||
0);
|
||||
name.setText(model.getName(), TextView.BufferType.SPANNABLE);
|
||||
name.setTypeface(Typeface.DEFAULT, model.isVisible() ? Typeface.NORMAL : Typeface.ITALIC);
|
||||
distanceText.setText(distance);
|
||||
distanceText.setTextColor(getResources().getColor(R.color.color_distance));
|
||||
row.findViewById(R.id.group_image).setVisibility(View.GONE);
|
||||
|
||||
if(loc != null){
|
||||
ImageView direction = (ImageView) row.findViewById(R.id.direction);
|
||||
direction.setVisibility(View.VISIBLE);
|
||||
DashLocationFragment.updateArrow(getActivity(), loc, new LatLon(model.getLatitude(), model.getLongitude()), direction,
|
||||
10, R.drawable.ic_destination_arrow, heading);
|
||||
}
|
||||
|
||||
final CheckBox ch = (CheckBox) row.findViewById(R.id.check_item);
|
||||
if (selectionMode) {
|
||||
ch.setVisibility(View.VISIBLE);
|
||||
|
@ -862,5 +876,32 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public void updateLocation(Location location) {
|
||||
//This is used as origin for both Fav-list and direction arrows
|
||||
if (getMyApplication().getSettings().getLastKnownMapLocation() != null) {
|
||||
loc = getMyApplication().getSettings().getLastKnownMapLocation();
|
||||
} else {
|
||||
loc = new LatLon(0f, 0f);
|
||||
}
|
||||
updateArrows();
|
||||
}
|
||||
|
||||
public boolean updateCompassValue(float value) {
|
||||
//heading = value;
|
||||
//updateArrows();
|
||||
//99 in next line used to one-time initalize arrows (with reference vs. fixed-north direction) on non-compass devices
|
||||
float lastHeading = heading != null ? heading : 99;
|
||||
heading = value;
|
||||
if (heading != null && Math.abs(MapUtils.degreesDiff(lastHeading, heading)) > 5) {
|
||||
updateArrows();
|
||||
return true;
|
||||
} else {
|
||||
heading = lastHeading;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void updateArrows(){
|
||||
favouritesAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ import net.osmand.plus.render.MapRenderRepositories;
|
|||
import net.osmand.plus.sherpafy.TourViewActivity;
|
||||
import net.osmand.plus.views.controls.FloatingActionButton;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.AlertDialog.Builder;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
|
@ -139,9 +138,9 @@ public class MainMenuActivity extends BaseDownloadActivity implements OsmAndLoca
|
|||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
getMyApplication().getLocationProvider().pauseAllUpdates();
|
||||
getMyApplication().getLocationProvider().removeLocationListener(this);
|
||||
getMyApplication().getLocationProvider().removeCompassListener(this);
|
||||
getLocationProvider().pauseAllUpdates();
|
||||
getLocationProvider().removeLocationListener(this);
|
||||
getLocationProvider().removeCompassListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
package net.osmand.plus.activities.search;
|
||||
|
||||
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import gnu.trove.set.hash.TLongHashSet;
|
||||
|
||||
|
@ -285,6 +287,14 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
amenityAdapter = new AmenityAdapter(new ArrayList<Amenity>());
|
||||
setListAdapter(amenityAdapter);
|
||||
|
||||
boolean light = getMyApplication().getSettings().isLightContent();
|
||||
Drawable arrowImage = getResources().getDrawable(R.drawable.ic_destination_arrow_white);
|
||||
if (light) {
|
||||
arrowImage.setColorFilter(getResources().getColor(R.color.color_distance), PorterDuff.Mode.MULTIPLY);
|
||||
} else {
|
||||
arrowImage.setColorFilter(getResources().getColor(R.color.color_distance), PorterDuff.Mode.MULTIPLY);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -760,6 +770,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
}
|
||||
float[] mes = null;
|
||||
TextView label = (TextView) row.findViewById(R.id.poi_label);
|
||||
TextView distanceText = (TextView) row.findViewById(R.id.distance);
|
||||
ImageView direction = (ImageView) row.findViewById(R.id.poi_direction);
|
||||
ImageView icon = (ImageView) row.findViewById(R.id.poi_icon);
|
||||
Amenity amenity = getItem(position);
|
||||
|
@ -785,7 +796,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
}
|
||||
}
|
||||
if(loc != null){
|
||||
DirectionDrawable draw = new DirectionDrawable(SearchPOIActivity.this, width, height);
|
||||
DirectionDrawable draw = new DirectionDrawable(SearchPOIActivity.this, width, height, R.drawable.ic_destination_arrow_white);
|
||||
Float h = heading;
|
||||
float a = h != null ? h : 0;
|
||||
|
||||
|
@ -844,8 +855,8 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
distance = " " + OsmAndFormatter.getFormattedDistance((int) mes[0], getMyApplication()) + " "; //$NON-NLS-1$
|
||||
}
|
||||
String poiType = OsmAndFormatter.getPoiStringWithoutType(amenity, settings.usingEnglishNames());
|
||||
label.setText(distance + poiType, TextView.BufferType.SPANNABLE);
|
||||
((Spannable) label.getText()).setSpan(new ForegroundColorSpan(getResources().getColor(R.color.color_distance)), 0, distance.length() - 1, 0);
|
||||
label.setText(poiType);
|
||||
distanceText.setText(distance);
|
||||
return (row);
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ public class DashAudioVideoNotesActivity extends OsmandActionBarActivity {
|
|||
if (light) {
|
||||
row.setBackgroundColor(getResources().getColor(R.color.expandable_list_item_light));
|
||||
} else {
|
||||
row.setBackgroundColor(getResources().getColor(R.color.expandable_list_item_dark));
|
||||
row.setBackgroundColor(getResources().getColor(R.color.list_item_background_dark));
|
||||
}
|
||||
final AudioVideoNotesPlugin.Recording recording = getItem(position);
|
||||
DashAudioVideoNotesFragment.getNoteView(recording, row, DashAudioVideoNotesActivity.this, plugin);
|
||||
|
|
|
@ -139,8 +139,8 @@ public class DashFavoritesFragment extends DashLocationFragment implements Favou
|
|||
|
||||
if(loc != null){
|
||||
direction.setVisibility(View.VISIBLE);
|
||||
updateArrow(new LatLon(point.getLatitude(), point.getLongitude()), direction,
|
||||
10, R.drawable.ic_destination_arrow);
|
||||
updateArrow(getActivity(), loc, new LatLon(point.getLatitude(), point.getLongitude()), direction,
|
||||
10, R.drawable.ic_destination_arrow, heading);
|
||||
}
|
||||
arrows.add(direction);
|
||||
name.setText(point.getName());
|
||||
|
@ -177,8 +177,8 @@ public class DashFavoritesFragment extends DashLocationFragment implements Favou
|
|||
|
||||
for (int i = 0; i < arrows.size(); i++) {
|
||||
arrows.get(i).setVisibility(View.VISIBLE);
|
||||
updateArrow(new LatLon(points.get(i).getLatitude(),points.get(i).getLongitude()),
|
||||
arrows.get(i), 10, R.drawable.ic_destination_arrow);
|
||||
updateArrow(getActivity(), loc, new LatLon(points.get(i).getLatitude(), points.get(i).getLongitude()),
|
||||
arrows.get(i), 10, R.drawable.ic_destination_arrow, heading);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package net.osmand.plus.dashboard;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.hardware.Sensor;
|
||||
import android.hardware.SensorManager;
|
||||
|
@ -36,16 +37,17 @@ public class DashLocationFragment extends DashBaseFragment {
|
|||
}
|
||||
}
|
||||
|
||||
protected void updateArrow(LatLon l, ImageView direction, int size, int resourceId) {
|
||||
public static void updateArrow(Activity ctx, LatLon currentLocation, LatLon pointLocation,
|
||||
ImageView direction, int size, int resourceId, Float heading) {
|
||||
float[] mes = new float[2];
|
||||
Location.distanceBetween(l.getLatitude(), l.getLongitude(), loc.getLatitude(), loc.getLongitude(), mes);
|
||||
DirectionDrawable draw = new DirectionDrawable(getActivity(), size, size, resourceId);
|
||||
Location.distanceBetween(pointLocation.getLatitude(), pointLocation.getLongitude(), currentLocation.getLatitude(), currentLocation.getLongitude(), mes);
|
||||
DirectionDrawable draw = new DirectionDrawable(ctx, size, size, resourceId);
|
||||
Float h = heading;
|
||||
float a = h != null ? h : 0;
|
||||
|
||||
//Hardy: getRotation() is the correction if device's screen orientation != the default display's standard orientation
|
||||
int screenOrientation = 0;
|
||||
screenOrientation = ((WindowManager) getActivity().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation();
|
||||
screenOrientation = ((WindowManager) ctx.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation();
|
||||
switch (screenOrientation)
|
||||
{
|
||||
case ORIENTATION_0: // Device default (normally portrait)
|
||||
|
@ -63,7 +65,7 @@ public class DashLocationFragment extends DashBaseFragment {
|
|||
}
|
||||
|
||||
//Looks like screenOrientation correction must not be applied for devices without compass?
|
||||
Sensor compass = ((SensorManager) getActivity().getSystemService(Context.SENSOR_SERVICE)).getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
|
||||
Sensor compass = ((SensorManager) ctx.getSystemService(Context.SENSOR_SERVICE)).getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
|
||||
if (compass == null) {
|
||||
screenOrientation = 0;
|
||||
}
|
||||
|
|
|
@ -31,9 +31,6 @@ public class DownloadIndexAdapter extends OsmandBaseExpandableListAdapter implem
|
|||
|
||||
private Map<String, String> indexFileNames = null;
|
||||
private Map<String, String> indexActivatedFileNames = null;
|
||||
private int okColor;
|
||||
private int defaultColor;
|
||||
private int updateColor;
|
||||
private OsmandRegions osmandRegions;
|
||||
private java.text.DateFormat format;
|
||||
private OsmandApplication app;
|
||||
|
@ -45,11 +42,8 @@ public class DownloadIndexAdapter extends OsmandBaseExpandableListAdapter implem
|
|||
app = downloadFragment.getMyApplication();
|
||||
list = new ArrayList<IndexItemCategory>(IndexItemCategory.categorizeIndexItems(app, indexFiles));
|
||||
format = downloadFragment.getMyApplication().getResourceManager().getDateFormat();
|
||||
okColor = downloadFragment.getResources().getColor(R.color.color_ok);
|
||||
TypedArray ta = downloadFragment.getDownloadActivity().getTheme().obtainStyledAttributes(new int[]{android.R.attr.textColorPrimary});
|
||||
defaultColor = ta.getColor(0, downloadFragment.getResources().getColor(R.color.color_unknown));
|
||||
ta.recycle();
|
||||
updateColor = downloadFragment.getResources().getColor(R.color.color_update);
|
||||
osmandRegions = downloadFragment.getMyApplication().getResourceManager().getOsmandRegions();
|
||||
}
|
||||
|
||||
|
@ -233,13 +227,15 @@ public class DownloadIndexAdapter extends OsmandBaseExpandableListAdapter implem
|
|||
v = inflater.inflate(net.osmand.plus.R.layout.download_index_list_item, parent, false);
|
||||
}
|
||||
final View row = v;
|
||||
TextView item = (TextView) row.findViewById(R.id.download_item);
|
||||
TextView name = (TextView) row.findViewById(R.id.name);
|
||||
TextView edition = (TextView) row.findViewById(R.id.update_descr);
|
||||
edition.setText("");
|
||||
TextView description = (TextView) row.findViewById(R.id.download_descr);
|
||||
IndexItem e = (IndexItem) getChild(groupPosition, childPosition);
|
||||
OsmandApplication clctx = downloadFragment.getMyApplication();
|
||||
String eName = e.getVisibleDescription(clctx) + "\n" + e.getVisibleName(clctx, osmandRegions);
|
||||
item.setText(eName.trim()); //$NON-NLS-1$
|
||||
String d = e.getDate(format) + "\n" + e.getSizeDescription(clctx);
|
||||
String eName = e.getVisibleName(clctx, osmandRegions);
|
||||
name.setText(eName.trim()); //$NON-NLS-1$
|
||||
String d = e.getDate(format) + " " + e.getSizeDescription(clctx);
|
||||
description.setText(d.trim());
|
||||
|
||||
CheckBox ch = (CheckBox) row.findViewById(R.id.check_download_item);
|
||||
|
@ -255,49 +251,34 @@ public class DownloadIndexAdapter extends OsmandBaseExpandableListAdapter implem
|
|||
|
||||
if (indexFileNames != null) {
|
||||
|
||||
if (!e.isAlreadyDownloaded(indexFileNames)) {
|
||||
item.setTextColor(defaultColor);
|
||||
item.setTypeface(Typeface.DEFAULT, Typeface.NORMAL);
|
||||
} else {
|
||||
if (e.isAlreadyDownloaded(indexFileNames)) {
|
||||
if (e.getType() == DownloadActivityType.HILLSHADE_FILE
|
||||
|| e.getType() == DownloadActivityType.SRTM_COUNTRY_FILE) {
|
||||
item.setTextColor(okColor); // GREEN
|
||||
String sfName = e.getTargetFileName();
|
||||
if (indexActivatedFileNames.containsKey(sfName)) {
|
||||
item.setTypeface(Typeface.DEFAULT, Typeface.NORMAL);
|
||||
name.setTypeface(Typeface.DEFAULT, Typeface.NORMAL);
|
||||
// next case since present hillshade files cannot be deactivated, but are not in indexActivatedFileNames
|
||||
} else if (e.getType() == DownloadActivityType.HILLSHADE_FILE) {
|
||||
item.setTypeface(Typeface.DEFAULT, Typeface.NORMAL);
|
||||
name.setTypeface(Typeface.DEFAULT, Typeface.NORMAL);
|
||||
} else {
|
||||
item.setTypeface(Typeface.DEFAULT, Typeface.ITALIC);
|
||||
name.setTypeface(Typeface.DEFAULT, Typeface.ITALIC);
|
||||
}
|
||||
} else if (e.getDate(format) != null) {
|
||||
String sfName = e.getTargetFileName();
|
||||
final boolean updatableResource = indexActivatedFileNames.containsKey(sfName);
|
||||
if (updatableResource && !DownloadActivity.downloadListIndexThread.checkIfItemOutdated(e)) {
|
||||
item.setText(item.getText() + "\n" + downloadFragment.getResources().getString(R.string.local_index_installed) + " : "
|
||||
edition.setText(downloadFragment.getResources().getString(R.string.local_index_installed) + " : "
|
||||
+ indexActivatedFileNames.get(sfName));
|
||||
item.setTextColor(okColor); // GREEN
|
||||
item.setTypeface(Typeface.DEFAULT, Typeface.NORMAL);
|
||||
} else if (indexFileNames.containsKey(sfName) && !DownloadActivity.downloadListIndexThread.checkIfItemOutdated(e)) {
|
||||
item.setText(item.getText() + "\n" + downloadFragment.getResources().getString(R.string.local_index_installed) + " : "
|
||||
edition.setText(downloadFragment.getResources().getString(R.string.local_index_installed) + " : "
|
||||
+ indexFileNames.get(sfName));
|
||||
item.setTextColor(okColor);
|
||||
item.setTypeface(Typeface.DEFAULT, Typeface.ITALIC);
|
||||
} else if (updatableResource) {
|
||||
item.setText(item.getText() + "\n" + downloadFragment.getResources().getString(R.string.local_index_installed) + " : "
|
||||
edition.setText(downloadFragment.getResources().getString(R.string.local_index_installed) + " : "
|
||||
+ indexActivatedFileNames.get(sfName));
|
||||
item.setTextColor(updateColor); // LIGHT_BLUE
|
||||
item.setTypeface(Typeface.DEFAULT, Typeface.NORMAL);
|
||||
} else {
|
||||
item.setText(item.getText() + "\n" + downloadFragment.getResources().getString(R.string.local_index_installed) + " : "
|
||||
edition.setText(name.getText() + "\n" + downloadFragment.getResources().getString(R.string.local_index_installed) + " : "
|
||||
+ indexFileNames.get(sfName));
|
||||
item.setTextColor(updateColor);
|
||||
item.setTypeface(Typeface.DEFAULT, Typeface.ITALIC);
|
||||
}
|
||||
} else {
|
||||
item.setTextColor(okColor);
|
||||
item.setTypeface(Typeface.DEFAULT, Typeface.NORMAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,6 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
|
|||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.local_index, container, false);
|
||||
|
||||
// getDownloadActivity().getSupportActionBar().setTitle(R.string.local_index_descr_title);
|
||||
getDownloadActivity().setSupportProgressBarIndeterminateVisibility(false);
|
||||
|
||||
ExpandableListView listView = (ExpandableListView)view.findViewById(android.R.id.list);
|
||||
|
@ -663,7 +662,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
|
|||
size = formatGb.format(new Object[]{(float) (fs.getAvailableBlocks()) * fs.getBlockSize() / (1 << 30) });
|
||||
}
|
||||
|
||||
String text = getString(R.string.local_index_description, size);
|
||||
String text = getString(R.string.free, size);
|
||||
int l = text.indexOf('.');
|
||||
if(l == -1) {
|
||||
l = text.length();
|
||||
|
|
|
@ -86,7 +86,7 @@ public class DashParkingFragment extends DashLocationFragment {
|
|||
ImageView direction = (ImageView) mainView.findViewById(R.id.direction_icon);
|
||||
if (loc != null){
|
||||
direction.setVisibility(View.VISIBLE);
|
||||
updateArrow(position, direction, 10, R.drawable.ic_destination_arrow);
|
||||
updateArrow(getActivity(), loc, position, direction, 10, R.drawable.ic_destination_arrow, heading);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@ import android.graphics.*;
|
|||
import android.graphics.drawable.Drawable;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
|
||||
/**
|
||||
|
@ -54,7 +56,12 @@ public class DirectionDrawable extends Drawable {
|
|||
public void draw(Canvas canvas) {
|
||||
if (resourceId != -1) {
|
||||
canvas.rotate(angle, canvas.getHeight() / 2, canvas.getWidth() / 2);
|
||||
Bitmap arrow = BitmapFactory.decodeResource(ctx.getResources(), resourceId);
|
||||
|
||||
Drawable arrowImage = ctx.getResources().getDrawable(resourceId);
|
||||
Bitmap arrow = Bitmap.createBitmap(canvas.getWidth(), canvas.getHeight(), Bitmap.Config.ARGB_8888);
|
||||
Canvas canv = new Canvas(arrow);
|
||||
arrowImage.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
|
||||
arrowImage.draw(canv);
|
||||
canvas.drawBitmap(arrow, null, new Rect(0, 0, arrow.getHeight(), arrow.getWidth()), null);
|
||||
} else {
|
||||
canvas.rotate(angle, canvas.getHeight()/2, canvas.getWidth() / 2);
|
||||
|
|
Loading…
Reference in a new issue