Merge pull request #8848 from osmandapp/Rtl2

Fix RTL step 2
This commit is contained in:
vshcherb 2020-05-05 15:18:00 +02:00 committed by GitHub
commit 9262900335
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
79 changed files with 389 additions and 148 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<nine-patch android:src="@drawable/bg_contextmenu_shadow_left_light" />
</item>
<item>
<shape>
<solid
android:color="@color/list_background_color_dark" />
</shape>
</item>
</layer-list>

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<nine-patch android:src="@drawable/bg_contextmenu_shadow_left_light" />
</item>
<item>
<shape>
<solid
android:color="@color/list_background_color_light" />
</shape>
</item>
</layer-list>

View file

@ -20,7 +20,9 @@
android:layout_height="@dimen/dashboard_map_toolbar" android:layout_height="@dimen/dashboard_map_toolbar"
android:minHeight="@dimen/dashboard_map_toolbar" android:minHeight="@dimen/dashboard_map_toolbar"
app:contentInsetLeft="54dp" app:contentInsetLeft="54dp"
app:contentInsetStart="54dp"> app:contentInsetStart="54dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -23,7 +23,9 @@
android:background="?attr/bg_color" android:background="?attr/bg_color"
android:minHeight="@dimen/dashboard_map_toolbar" android:minHeight="@dimen/dashboard_map_toolbar"
app:contentInsetLeft="54dp" app:contentInsetLeft="54dp"
app:contentInsetStart="54dp"> app:contentInsetStart="54dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -22,7 +22,9 @@
android:minHeight="@dimen/dashboard_map_toolbar" android:minHeight="@dimen/dashboard_map_toolbar"
android:theme="?attr/toolbar_theme" android:theme="?attr/toolbar_theme"
app:contentInsetLeft="72dp" app:contentInsetLeft="72dp"
app:contentInsetStart="72dp"> app:contentInsetStart="72dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
</androidx.appcompat.widget.Toolbar> </androidx.appcompat.widget.Toolbar>

View file

@ -7,7 +7,9 @@
android:layout_height="@dimen/bottom_sheet_selected_item_title_height" android:layout_height="@dimen/bottom_sheet_selected_item_title_height"
android:minHeight="@dimen/bottom_sheet_selected_item_title_height" android:minHeight="@dimen/bottom_sheet_selected_item_title_height"
osmand:contentInsetLeft="54dp" osmand:contentInsetLeft="54dp"
osmand:contentInsetStart="54dp"> osmand:contentInsetStart="54dp"
osmand:contentInsetRight="0dp"
osmand:contentInsetEnd="0dp">
<net.osmand.plus.widgets.TextViewEx <net.osmand.plus.widgets.TextViewEx
android:id="@+id/title" android:id="@+id/title"

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center"> android:gravity="center">
@ -31,7 +31,7 @@
android:textColor="@color/gpx_chart_blue" android:textColor="@color/gpx_chart_blue"
android:textStyle="bold" android:textStyle="bold"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true"/> android:maxLines="1"/>
<TextView <TextView
android:id="@+id/text_alt_units" android:id="@+id/text_alt_units"
@ -41,7 +41,7 @@
android:textSize="@dimen/default_sub_text_size" android:textSize="@dimen/default_sub_text_size"
android:textColor="?android:attr/textColorSecondary" android:textColor="?android:attr/textColorSecondary"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true"/> android:maxLines="1"/>
</LinearLayout> </LinearLayout>
@ -74,7 +74,7 @@
android:textColor="@color/gpx_chart_orange" android:textColor="@color/gpx_chart_orange"
android:textStyle="bold" android:textStyle="bold"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true"/> android:maxLines="1"/>
<TextView <TextView
android:id="@+id/text_spd_units" android:id="@+id/text_spd_units"
@ -84,7 +84,7 @@
android:textSize="@dimen/default_sub_text_size" android:textSize="@dimen/default_sub_text_size"
android:textColor="?android:attr/textColorSecondary" android:textColor="?android:attr/textColorSecondary"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true"/> android:maxLines="1"/>
</LinearLayout> </LinearLayout>
@ -109,7 +109,7 @@
android:textColor="@color/gpx_chart_green" android:textColor="@color/gpx_chart_green"
android:textStyle="bold" android:textStyle="bold"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true"/> android:maxLines="1"/>
<TextView <TextView
android:id="@+id/text_slp_units" android:id="@+id/text_slp_units"
@ -119,10 +119,10 @@
android:textSize="@dimen/default_sub_text_size" android:textSize="@dimen/default_sub_text_size"
android:textColor="?android:attr/textColorSecondary" android:textColor="?android:attr/textColorSecondary"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true"/> android:maxLines="1"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</RelativeLayout> </FrameLayout>

View file

@ -8,7 +8,9 @@
android:layout_height="@dimen/dashboard_map_toolbar" android:layout_height="@dimen/dashboard_map_toolbar"
android:background="@color/app_bar_color_light" android:background="@color/app_bar_color_light"
app:contentInsetLeft="4dp" app:contentInsetLeft="4dp"
app:contentInsetStart="4dp"> app:contentInsetStart="4dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -16,7 +16,9 @@
android:background="?attr/actionModeBackground" android:background="?attr/actionModeBackground"
android:minHeight="@dimen/dashboard_map_toolbar" android:minHeight="@dimen/dashboard_map_toolbar"
app:contentInsetLeft="54dp" app:contentInsetLeft="54dp"
app:contentInsetStart="54dp"> app:contentInsetStart="54dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -17,7 +17,9 @@
android:minHeight="@dimen/dashboard_map_toolbar" android:minHeight="@dimen/dashboard_map_toolbar"
android:theme="?attr/toolbar_theme" android:theme="?attr/toolbar_theme"
app:contentInsetLeft="@dimen/settings_divider_margin_start" app:contentInsetLeft="@dimen/settings_divider_margin_start"
app:contentInsetStart="@dimen/settings_divider_margin_start"/> app:contentInsetStart="@dimen/settings_divider_margin_start"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp"/>
<ScrollView <ScrollView
android:layout_width="fill_parent" android:layout_width="fill_parent"

View file

@ -28,7 +28,9 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:minHeight="@dimen/dashboard_map_toolbar" android:minHeight="@dimen/dashboard_map_toolbar"
app:contentInsetLeft="54dp" app:contentInsetLeft="54dp"
app:contentInsetStart="54dp"> app:contentInsetStart="54dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -18,7 +18,7 @@
style="@style/Widget.AppCompat.Button.Borderless" style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="52dp" android:layout_width="52dp"
android:layout_height="52dp" android:layout_height="52dp"
android:src="@drawable/ic_action_mode_back"/> android:src="@drawable/ic_arrow_back"/>
<net.osmand.plus.widgets.TextViewEx <net.osmand.plus.widgets.TextViewEx
android:id="@+id/titleTextView" android:id="@+id/titleTextView"

View file

@ -17,7 +17,9 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:minHeight="@dimen/toolbar_height" android:minHeight="@dimen/toolbar_height"
osmand:contentInsetLeft="54dp" osmand:contentInsetLeft="54dp"
osmand:contentInsetStart="54dp"> osmand:contentInsetStart="54dp"
osmand:contentInsetRight="0dp"
osmand:contentInsetEnd="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -8,7 +8,9 @@
android:background="?attr/actionModeBackground" android:background="?attr/actionModeBackground"
android:minHeight="@dimen/toolbar_height" android:minHeight="@dimen/toolbar_height"
app:contentInsetLeft="0dp" app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"> app:contentInsetStart="0dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -21,7 +23,7 @@
android:layout_width="@dimen/toolbar_height" android:layout_width="@dimen/toolbar_height"
android:layout_height="@dimen/toolbar_height" android:layout_height="@dimen/toolbar_height"
android:contentDescription="@string/access_shared_string_navigate_up" android:contentDescription="@string/access_shared_string_navigate_up"
android:src="@drawable/ic_action_mode_back" /> android:src="@drawable/ic_arrow_back" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -7,7 +7,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/actionModeBackground" android:background="?attr/actionModeBackground"
app:contentInsetLeft="0dp" app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"> app:contentInsetStart="0dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -27,7 +29,7 @@
android:layout_width="@dimen/toolbar_height" android:layout_width="@dimen/toolbar_height"
android:layout_height="@dimen/toolbar_height" android:layout_height="@dimen/toolbar_height"
android:contentDescription="@string/access_shared_string_navigate_up" android:contentDescription="@string/access_shared_string_navigate_up"
android:src="@drawable/ic_action_mode_back" /> android:src="@drawable/ic_arrow_back" />
<net.osmand.plus.widgets.TextViewEx <net.osmand.plus.widgets.TextViewEx
android:id="@+id/toolbar_title" android:id="@+id/toolbar_title"

View file

@ -18,7 +18,9 @@
android:minHeight="@dimen/dashboard_map_toolbar" android:minHeight="@dimen/dashboard_map_toolbar"
android:theme="?attr/toolbar_theme" android:theme="?attr/toolbar_theme"
app:contentInsetLeft="72dp" app:contentInsetLeft="72dp"
app:contentInsetStart="72dp" /> app:contentInsetStart="72dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp" />
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>

View file

@ -548,7 +548,9 @@
android:layout_height="@dimen/dashboard_map_toolbar" android:layout_height="@dimen/dashboard_map_toolbar"
android:background="@color/app_bar_color_light" android:background="@color/app_bar_color_light"
app:contentInsetLeft="4dp" app:contentInsetLeft="4dp"
app:contentInsetStart="4dp"> app:contentInsetStart="4dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -18,7 +18,7 @@
style="@style/Widget.AppCompat.Button.Borderless" style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="52dp" android:layout_width="52dp"
android:layout_height="52dp" android:layout_height="52dp"
android:src="@drawable/ic_action_mode_back"/> android:src="@drawable/ic_arrow_back"/>
<net.osmand.plus.widgets.TextViewEx <net.osmand.plus.widgets.TextViewEx
android:id="@+id/titleTextView" android:id="@+id/titleTextView"

View file

@ -18,7 +18,8 @@
android:theme="?attr/toolbar_theme" android:theme="?attr/toolbar_theme"
app:contentInsetLeft="72dp" app:contentInsetLeft="72dp"
app:contentInsetStart="72dp" app:contentInsetStart="72dp"
/> app:contentInsetRight="0dp"
app:contentInsetEnd="0dp"/>
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<include <include

View file

@ -20,7 +20,10 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="@dimen/list_item_height" android:minHeight="@dimen/list_item_height"
android:paddingLeft="@dimen/list_content_padding" android:paddingLeft="@dimen/list_content_padding"
android:paddingStart="@dimen/list_content_padding"> android:paddingStart="@dimen/list_content_padding"
android:paddingRight="0dp"
android:paddingEnd="0dp">
<CheckBox <CheckBox
android:id="@+id/check_local_index" android:id="@+id/check_local_index"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -40,8 +40,8 @@
android:layout_marginLeft="@dimen/context_menu_buttons_padding_bottom" android:layout_marginLeft="@dimen/context_menu_buttons_padding_bottom"
android:layout_marginRight="@dimen/context_menu_buttons_padding_bottom" android:layout_marginRight="@dimen/context_menu_buttons_padding_bottom"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="40dp" android:paddingStart="@dimen/route_info_app_modes_padding"
android:paddingLeft="40dp" android:paddingLeft="@dimen/route_info_app_modes_padding"
android:paddingEnd="@dimen/route_info_app_modes_padding" android:paddingEnd="@dimen/route_info_app_modes_padding"
android:paddingRight="@dimen/route_info_app_modes_padding" android:paddingRight="@dimen/route_info_app_modes_padding"
android:layout_marginStart="@dimen/context_menu_buttons_padding_bottom" android:layout_marginStart="@dimen/context_menu_buttons_padding_bottom"

View file

@ -16,6 +16,8 @@
android:visibility="gone" android:visibility="gone"
app:contentInsetLeft="54dp" app:contentInsetLeft="54dp"
app:contentInsetStart="54dp" app:contentInsetStart="54dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp"
tools:visibility="visible"> tools:visibility="visible">
<LinearLayout <LinearLayout

View file

@ -25,7 +25,9 @@
android:minHeight="@dimen/dashboard_map_toolbar" android:minHeight="@dimen/dashboard_map_toolbar"
android:theme="?attr/toolbar_theme" android:theme="?attr/toolbar_theme"
app:contentInsetLeft="72dp" app:contentInsetLeft="72dp"
app:contentInsetStart="72dp"> app:contentInsetStart="72dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
</androidx.appcompat.widget.Toolbar> </androidx.appcompat.widget.Toolbar>

View file

@ -7,6 +7,8 @@
android:minHeight="@dimen/dashboard_map_toolbar" android:minHeight="@dimen/dashboard_map_toolbar"
osmand:contentInsetLeft="0dp" osmand:contentInsetLeft="0dp"
osmand:contentInsetStart="0dp" osmand:contentInsetStart="0dp"
osmand:contentInsetRight="0dp"
osmand:contentInsetEnd="0dp"
osmand:theme="@style/ThemeOverlay.AppCompat.ActionBar"> osmand:theme="@style/ThemeOverlay.AppCompat.ActionBar">
<LinearLayout <LinearLayout
@ -22,7 +24,7 @@
android:layout_width="@dimen/toolbar_height" android:layout_width="@dimen/toolbar_height"
android:layout_height="@dimen/toolbar_height" android:layout_height="@dimen/toolbar_height"
android:contentDescription="@string/access_shared_string_navigate_up" android:contentDescription="@string/access_shared_string_navigate_up"
android:src="@drawable/ic_action_mode_back" android:src="@drawable/ic_arrow_back"
android:tint="?attr/default_icon_color" /> android:tint="?attr/default_icon_color" />
<LinearLayout <LinearLayout

View file

@ -6,6 +6,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
osmand:contentInsetLeft="0dp" osmand:contentInsetLeft="0dp"
osmand:contentInsetStart="0dp" osmand:contentInsetStart="0dp"
osmand:contentInsetRight="0dp"
osmand:contentInsetEnd="0dp"
osmand:theme="@style/ThemeOverlay.AppCompat.ActionBar"> osmand:theme="@style/ThemeOverlay.AppCompat.ActionBar">
<LinearLayout <LinearLayout
@ -27,7 +29,7 @@
android:layout_width="@dimen/toolbar_height" android:layout_width="@dimen/toolbar_height"
android:layout_height="@dimen/toolbar_height" android:layout_height="@dimen/toolbar_height"
android:contentDescription="@string/access_shared_string_navigate_up" android:contentDescription="@string/access_shared_string_navigate_up"
android:src="@drawable/ic_action_mode_back" android:src="@drawable/ic_arrow_back"
android:tint="?attr/default_icon_color" /> android:tint="?attr/default_icon_color" />
<net.osmand.plus.widgets.TextViewEx <net.osmand.plus.widgets.TextViewEx

View file

@ -7,7 +7,9 @@
android:background="?attr/actionModeBackground" android:background="?attr/actionModeBackground"
android:minHeight="@dimen/toolbar_height" android:minHeight="@dimen/toolbar_height"
osmand:contentInsetLeft="0dp" osmand:contentInsetLeft="0dp"
osmand:contentInsetStart="0dp"> osmand:contentInsetStart="0dp"
osmand:contentInsetRight="0dp"
osmand:contentInsetEnd="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -21,7 +23,7 @@
android:layout_width="@dimen/toolbar_height" android:layout_width="@dimen/toolbar_height"
android:layout_height="@dimen/toolbar_height" android:layout_height="@dimen/toolbar_height"
android:contentDescription="@string/access_shared_string_navigate_up" android:contentDescription="@string/access_shared_string_navigate_up"
android:src="@drawable/ic_action_mode_back" android:src="@drawable/ic_arrow_back"
android:tint="?attr/app_bar_primary_item_color"/> android:tint="?attr/app_bar_primary_item_color"/>
<LinearLayout <LinearLayout

View file

@ -6,6 +6,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
osmand:contentInsetLeft="0dp" osmand:contentInsetLeft="0dp"
osmand:contentInsetStart="0dp" osmand:contentInsetStart="0dp"
osmand:contentInsetRight="0dp"
osmand:contentInsetEnd="0dp"
osmand:theme="@style/ThemeOverlay.AppCompat.ActionBar"> osmand:theme="@style/ThemeOverlay.AppCompat.ActionBar">
<LinearLayout <LinearLayout
@ -27,7 +29,7 @@
android:layout_width="@dimen/toolbar_height" android:layout_width="@dimen/toolbar_height"
android:layout_height="@dimen/toolbar_height" android:layout_height="@dimen/toolbar_height"
android:contentDescription="@string/access_shared_string_navigate_up" android:contentDescription="@string/access_shared_string_navigate_up"
android:src="@drawable/ic_action_mode_back" android:src="@drawable/ic_arrow_back"
android:tint="?attr/default_icon_color" /> android:tint="?attr/default_icon_color" />
<LinearLayout <LinearLayout

View file

@ -31,6 +31,8 @@
android:contentInsetLeft="72dp" android:contentInsetLeft="72dp"
app:contentInsetLeft="72dp" app:contentInsetLeft="72dp"
app:contentInsetStart="72dp" app:contentInsetStart="72dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp"
android:background="?attr/actionModeBackground"/> android:background="?attr/actionModeBackground"/>
<RelativeLayout <RelativeLayout

View file

@ -18,7 +18,9 @@
android:minHeight="@dimen/dashboard_map_toolbar" android:minHeight="@dimen/dashboard_map_toolbar"
android:theme="?attr/toolbar_theme" android:theme="?attr/toolbar_theme"
app:contentInsetLeft="54dp" app:contentInsetLeft="54dp"
app:contentInsetStart="54dp"> app:contentInsetStart="54dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -19,7 +19,9 @@
android:minHeight="@dimen/dashboard_map_toolbar" android:minHeight="@dimen/dashboard_map_toolbar"
android:theme="?attr/toolbar_theme" android:theme="?attr/toolbar_theme"
app:contentInsetLeft="54dp" app:contentInsetLeft="54dp"
app:contentInsetStart="54dp"> app:contentInsetStart="54dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -24,7 +24,9 @@
android:minHeight="@dimen/dashboard_map_toolbar" android:minHeight="@dimen/dashboard_map_toolbar"
android:theme="?attr/toolbar_theme" android:theme="?attr/toolbar_theme"
app:contentInsetLeft="54dp" app:contentInsetLeft="54dp"
app:contentInsetStart="54dp"> app:contentInsetStart="54dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
<include layout="@layout/search_text_layout"/> <include layout="@layout/search_text_layout"/>
@ -40,6 +42,8 @@
android:visibility="gone" android:visibility="gone"
app:contentInsetLeft="54dp" app:contentInsetLeft="54dp"
app:contentInsetStart="54dp" app:contentInsetStart="54dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp"
tools:visibility="visible"> tools:visibility="visible">
<LinearLayout <LinearLayout

View file

@ -18,7 +18,9 @@
android:minHeight="@dimen/dashboard_map_toolbar" android:minHeight="@dimen/dashboard_map_toolbar"
android:theme="?attr/toolbar_theme" android:theme="?attr/toolbar_theme"
app:contentInsetLeft="54dp" app:contentInsetLeft="54dp"
app:contentInsetStart="54dp"> app:contentInsetStart="54dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
<include layout="@layout/search_text_layout"/> <include layout="@layout/search_text_layout"/>

View file

@ -21,7 +21,9 @@
android:descendantFocusability="blocksDescendants" android:descendantFocusability="blocksDescendants"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingLeft="@dimen/list_content_padding" android:paddingLeft="@dimen/list_content_padding"
android:paddingStart="@dimen/list_content_padding"> android:paddingStart="@dimen/list_content_padding"
android:paddingRight="0dp"
android:paddingEnd="0dp">
<ImageView <ImageView
android:id="@+id/icon" android:id="@+id/icon"

View file

@ -18,7 +18,9 @@
android:minHeight="@dimen/dashboard_map_toolbar" android:minHeight="@dimen/dashboard_map_toolbar"
android:theme="?attr/toolbar_theme" android:theme="?attr/toolbar_theme"
app:contentInsetLeft="54dp" app:contentInsetLeft="54dp"
app:contentInsetStart="54dp"> app:contentInsetStart="54dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -17,7 +17,9 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:theme="?attr/actionBarStyle" android:theme="?attr/actionBarStyle"
app:contentInsetLeft="54dp" app:contentInsetLeft="54dp"
app:contentInsetStart="54dp"> app:contentInsetStart="54dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
<TextView <TextView
android:id="@+id/title" android:id="@+id/title"

View file

@ -36,6 +36,8 @@
android:contentInsetLeft="0dp" android:contentInsetLeft="0dp"
app:contentInsetLeft="0dp" app:contentInsetLeft="0dp"
app:contentInsetStart="0dp" app:contentInsetStart="0dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom"/> android:layout_gravity="bottom"/>

View file

@ -17,7 +17,9 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:minHeight="@dimen/toolbar_height" android:minHeight="@dimen/toolbar_height"
osmand:contentInsetLeft="54dp" osmand:contentInsetLeft="54dp"
osmand:contentInsetStart="54dp"> osmand:contentInsetStart="54dp"
osmand:contentInsetRight="0dp"
osmand:contentInsetEnd="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -22,7 +22,9 @@
android:background="?attr/wikivoyage_bg_color" android:background="?attr/wikivoyage_bg_color"
android:minHeight="@dimen/dashboard_map_toolbar" android:minHeight="@dimen/dashboard_map_toolbar"
osmand:contentInsetLeft="54dp" osmand:contentInsetLeft="54dp"
osmand:contentInsetStart="54dp"> osmand:contentInsetStart="54dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -34,6 +34,7 @@
<attr name="ctx_menu_divider" format="reference" /> <attr name="ctx_menu_divider" format="reference" />
<attr name="bottom_menu_view_bg" format="reference" /> <attr name="bottom_menu_view_bg" format="reference" />
<attr name="left_menu_view_bg" format="reference" /> <attr name="left_menu_view_bg" format="reference" />
<attr name="right_menu_view_bg" format="reference" />
<attr name="stroked_buttons_and_links_outline" format="color" /> <attr name="stroked_buttons_and_links_outline" format="color" />
<attr name="dashboard_divider" format="reference" /> <attr name="dashboard_divider" format="reference" />

View file

@ -20,17 +20,19 @@
<item name="typeface">@string/font_roboto_medium</item> <item name="typeface">@string/font_roboto_medium</item>
<item name="android:textColor">?android:textColorSecondary</item> <item name="android:textColor">?android:textColorSecondary</item>
<item name="android:layout_marginLeft">@dimen/subHeaderMarginLeft</item> <item name="android:layout_marginLeft">@dimen/subHeaderMarginLeft</item>
<item name="android:layout_marginStart">@dimen/subHeaderMarginLeft</item>
</style> </style>
<style name="DashboardGeneralButton"> <style name="DashboardGeneralButton">
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:gravity">center_vertical|right</item> <item name="android:gravity">center_vertical|end</item>
<item name="android:layout_height">@dimen/showAllButtonHeight</item> <item name="android:layout_height">@dimen/showAllButtonHeight</item>
<item name="android:layout_gravity">center_vertical</item> <item name="android:layout_gravity">center_vertical</item>
<item name="android:textSize">@dimen/default_sub_text_size</item> <item name="android:textSize">@dimen/default_sub_text_size</item>
<item name="typeface">@string/font_roboto_medium</item> <item name="typeface">@string/font_roboto_medium</item>
<item name="android:textColor">?attr/dashboard_general_button_text_color</item> <item name="android:textColor">?attr/dashboard_general_button_text_color</item>
<item name="android:layout_marginRight">@dimen/showAllButtonMarginRight</item> <item name="android:layout_marginRight">@dimen/showAllButtonMarginRight</item>
<item name="android:layout_marginEnd">@dimen/showAllButtonMarginRight</item>
<item name="android:background">?attr/dashboard_button</item> <item name="android:background">?attr/dashboard_button</item>
</style> </style>
@ -162,7 +164,7 @@
<item name="ctx_menu_controller_text_color">@drawable/context_menu_controller_text_color_light</item> <item name="ctx_menu_controller_text_color">@drawable/context_menu_controller_text_color_light</item>
<item name="ctx_menu_divider">@color/ctx_menu_buttons_divider_light</item> <item name="ctx_menu_divider">@color/ctx_menu_buttons_divider_light</item>
<item name="search_background">@color/activity_background_color_dark</item> <item name="search_background">@color/activity_background_color_dark</item>
<item name="actionModeCloseDrawable">@drawable/ic_action_mode_back</item> <item name="actionModeCloseDrawable">@drawable/ic_arrow_back</item>
<item name="actionModeStyle">@style/WhiteActionMode</item> <item name="actionModeStyle">@style/WhiteActionMode</item>
<item name="actionMenuTextColor">@color/color_white</item> <item name="actionMenuTextColor">@color/color_white</item>
<item name="switch_ex_background">@drawable/switch_ex_background_light</item> <item name="switch_ex_background">@drawable/switch_ex_background_light</item>
@ -194,7 +196,7 @@
<item name="android:actionModeBackground">@color/app_bar_color_light</item> <item name="android:actionModeBackground">@color/app_bar_color_light</item>
<item name="android:actionBarStyle">@style/Widget.Styled.ActionBarLight</item> <item name="android:actionBarStyle">@style/Widget.Styled.ActionBarLight</item>
<item name="android:actionModeCloseDrawable">@drawable/ic_action_mode_back</item> <item name="android:actionModeCloseDrawable">@drawable/ic_arrow_back</item>
<item name="android:actionModeStyle">@style/WhiteActionMode</item> <item name="android:actionModeStyle">@style/WhiteActionMode</item>
<item name="android:actionMenuTextColor">@color/color_white</item> <item name="android:actionMenuTextColor">@color/color_white</item>
<item name="actionOverflowButtonStyle">@style/OverflowMenuButton</item> <item name="actionOverflowButtonStyle">@style/OverflowMenuButton</item>
@ -430,6 +432,7 @@
<item name="bg_map_context_menu">@drawable/bg_map_context_menu_dark</item> <item name="bg_map_context_menu">@drawable/bg_map_context_menu_dark</item>
<item name="bottom_menu_view_bg">@drawable/bg_bottom_menu_dark</item> <item name="bottom_menu_view_bg">@drawable/bg_bottom_menu_dark</item>
<item name="left_menu_view_bg">@drawable/bg_left_menu_dark</item> <item name="left_menu_view_bg">@drawable/bg_left_menu_dark</item>
<item name="right_menu_view_bg">@drawable/bg_right_menu_dark</item>
<item name="bg_point_editor_view">@drawable/bg_point_editor_view_dark</item> <item name="bg_point_editor_view">@drawable/bg_point_editor_view_dark</item>
<item name="dashboard_divider">@color/divider_color_dark</item> <item name="dashboard_divider">@color/divider_color_dark</item>
<item name="divider_color">@color/divider_color_dark</item> <item name="divider_color">@color/divider_color_dark</item>
@ -683,7 +686,9 @@
<style name="create_poi_text_field"> <style name="create_poi_text_field">
<item name="android:layout_marginTop">8dp</item> <item name="android:layout_marginTop">8dp</item>
<item name="android:layout_marginRight">16dp</item> <item name="android:layout_marginRight">16dp</item>
<item name="android:layout_marginEnd">16dp</item>
<item name="android:layout_marginLeft">68dp</item> <item name="android:layout_marginLeft">68dp</item>
<item name="android:layout_marginStart">68dp</item>
<item name="android:layout_width">match_parent</item> <item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>
<item name="android:layout_weight">1</item> <item name="android:layout_weight">1</item>
@ -692,6 +697,7 @@
<style name="edit_poi_imageview_style"> <style name="edit_poi_imageview_style">
<item name="android:layout_marginTop">16dp</item> <item name="android:layout_marginTop">16dp</item>
<item name="android:layout_marginLeft">16dp</item> <item name="android:layout_marginLeft">16dp</item>
<item name="android:layout_marginStart">16dp</item>
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>
</style> </style>

View file

@ -14,6 +14,7 @@ import android.graphics.Matrix;
import android.graphics.Paint; import android.graphics.Paint;
import android.graphics.PointF; import android.graphics.PointF;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ClipDrawable; import android.graphics.drawable.ClipDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable; import android.graphics.drawable.LayerDrawable;
@ -662,6 +663,13 @@ public class AndroidUtils {
} }
} }
public static Drawable[] getCompoundDrawables(@NonNull TextView tv){
if (isSupportRTL()) {
return tv.getCompoundDrawablesRelative();
}
return tv.getCompoundDrawables();
}
public static void setPadding(View view, int start, int top, int end, int bottom) { public static void setPadding(View view, int start, int top, int end, int bottom) {
if (isSupportRTL()) { if (isSupportRTL()) {
view.setPaddingRelative(start, top, end, bottom); view.setPaddingRelative(start, top, end, bottom);
@ -684,14 +692,67 @@ public class AndroidUtils {
} }
public static int getNavigationIconResId(@NonNull Context ctx) { public static int getNavigationIconResId(@NonNull Context ctx) {
return getLayoutDirection(ctx) == ViewCompat.LAYOUT_DIRECTION_RTL ? return isLayoutRtl(ctx) ? R.drawable.ic_arrow_forward : R.drawable.ic_arrow_back;
R.drawable.ic_arrow_forward : R.drawable.ic_arrow_back; }
public static Drawable getDrawableForDirection(@NonNull Context ctx,
@NonNull Drawable drawable) {
return isLayoutRtl(ctx) ? getMirroredDrawable(ctx, drawable) : drawable;
}
public static Drawable getMirroredDrawable(@NonNull Context ctx,
@NonNull Drawable drawable) {
Bitmap bitmap = drawableToBitmap(drawable);
return new BitmapDrawable(ctx.getResources(), flipBitmapHorizontally(bitmap));
}
public static Bitmap drawableToBitmap(Drawable drawable) {
if (drawable instanceof BitmapDrawable) {
BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
if(bitmapDrawable.getBitmap() != null) {
return bitmapDrawable.getBitmap();
}
}
Bitmap bitmap = null;
if(drawable.getIntrinsicWidth() <= 0 || drawable.getIntrinsicHeight() <= 0) {
bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);
} else {
bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
}
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);
return bitmap;
}
public static Bitmap flipBitmapHorizontally(Bitmap source) {
Matrix matrix = new Matrix();
matrix.preScale(-1.0f, 1.0f, source.getWidth() / 2f, source.getHeight() / 2f);
return Bitmap.createBitmap(source, 0, 0, source.getWidth(), source.getHeight(), matrix, true);
}
public static void setTextHorizontalGravity(@NonNull TextView tv, int hGravity) {
if (tv.getContext() != null) {
boolean isLayoutRtl = AndroidUtils.isLayoutRtl(tv.getContext());
int gravity = Gravity.LEFT;
if (isLayoutRtl && (hGravity == Gravity.START)
|| !isLayoutRtl && hGravity == Gravity.END) {
gravity = Gravity.RIGHT;
}
tv.setGravity(gravity);
}
} }
public static boolean isSupportRTL() { public static boolean isSupportRTL() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1; return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1;
} }
public static boolean isLayoutRtl(Context ctx) {
return isSupportRTL() && getLayoutDirection(ctx) == ViewCompat.LAYOUT_DIRECTION_RTL;
}
public static ArrayList<View> getChildrenViews(ViewGroup vg) { public static ArrayList<View> getChildrenViews(ViewGroup vg) {
ArrayList<View> result = new ArrayList<>(); ArrayList<View> result = new ArrayList<>();
for (int i = 0; i < vg.getChildCount(); i++) { for (int i = 0; i < vg.getChildCount(); i++) {

View file

@ -145,7 +145,7 @@ public class SecondSplashScreenFragment extends BaseOsmAndFragment {
} else { } else {
elementsPaddingLeft = getNavigationBarWidth(); elementsPaddingLeft = getNavigationBarWidth();
} }
logoLayoutParams.setMargins(0, logoMarginTop, 0, 0); AndroidUtils.setMargins(logoLayoutParams, 0, logoMarginTop, 0, 0);
logo.setPadding(elementsPaddingLeft, 0, elementsPaddingRight, 0); logo.setPadding(elementsPaddingLeft, 0, elementsPaddingRight, 0);
logo.setLayoutParams(logoLayoutParams); logo.setLayoutParams(logoLayoutParams);
view.addView(logo); view.addView(logo);

View file

@ -23,7 +23,6 @@ import android.view.WindowManager;
import android.widget.CompoundButton; import android.widget.CompoundButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.ColorInt; import androidx.annotation.ColorInt;
@ -620,10 +619,10 @@ public class UiUtilities {
return new ContextThemeWrapper(context, nightMode ? darkStyle : lightStyle); return new ContextThemeWrapper(context, nightMode ? darkStyle : lightStyle);
} }
public static void setMargins(View v, int l, int t, int r, int b) { public static void setMargins(View v, int s, int t, int e, int b) {
if (v.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) { if (v.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) {
ViewGroup.MarginLayoutParams p = (ViewGroup.MarginLayoutParams) v.getLayoutParams(); ViewGroup.MarginLayoutParams p = (ViewGroup.MarginLayoutParams) v.getLayoutParams();
p.setMargins(l, t, r, b); AndroidUtils.setMargins(p, s, t, e, b);
v.requestLayout(); v.requestLayout();
} }
} }

View file

@ -1951,11 +1951,13 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
if (settings.DO_NOT_USE_ANIMATIONS.get()) { if (settings.DO_NOT_USE_ANIMATIONS.get()) {
if (event.getAction() == MotionEvent.ACTION_DOWN) { if (event.getAction() == MotionEvent.ACTION_DOWN) {
if (drawerLayout.isDrawerOpen(Gravity.START)) { if (drawerLayout.isDrawerOpen(Gravity.START)) {
int width = AndroidUtils.dpToPx(this, 280); int drawerWidth = AndroidUtils.dpToPx(this, 280);
if (event.getRawX() > width) { int screenWidth = AndroidUtils.getScreenWidth(MapActivity.this);
boolean isLayoutRtl = AndroidUtils.isLayoutRtl(app);
if ((!isLayoutRtl && event.getRawX() > drawerWidth)
|| (isLayoutRtl && event.getRawX() <= screenWidth - drawerWidth)) {
closeDrawer(); closeDrawer();
} }
} }
} }
} }

View file

@ -117,7 +117,7 @@ public class StartGPSStatus extends OsmAndAction {
final AppCompatCheckBox cb = new AppCompatCheckBox(activity); final AppCompatCheckBox cb = new AppCompatCheckBox(activity);
cb.setText(R.string.shared_string_remember_my_choice); cb.setText(R.string.shared_string_remember_my_choice);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
lp.setMargins(dp24, dp8, dp8, dp24); AndroidUtils.setMargins(lp, dp24, dp8, dp8, dp24);
cb.setLayoutParams(lp); cb.setLayoutParams(lp);
cb.setPadding(dp8, 0, 0, 0); cb.setPadding(dp8, 0, 0, 0);
int textColorPrimary = ContextCompat.getColor(activity, isNightMode() ? R.color.text_color_primary_dark : R.color.text_color_primary_light); int textColorPrimary = ContextCompat.getColor(activity, isNightMode() ? R.color.text_color_primary_dark : R.color.text_color_primary_light);

View file

@ -287,7 +287,8 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
currentMenuState = MenuState.FULL_SCREEN; currentMenuState = MenuState.FULL_SCREEN;
if (isSingleFragment()) { if (isSingleFragment()) {
final TypedValue typedValueAttr = new TypedValue(); final TypedValue typedValueAttr = new TypedValue();
mapActivity.getTheme().resolveAttribute(R.attr.left_menu_view_bg, typedValueAttr, true); int bgAttrId = AndroidUtils.isLayoutRtl(app) ? R.attr.right_menu_view_bg : R.attr.left_menu_view_bg;
mapActivity.getTheme().resolveAttribute(bgAttrId, typedValueAttr, true);
mainView.setBackgroundResource(typedValueAttr.resourceId); mainView.setBackgroundResource(typedValueAttr.resourceId);
mainView.setLayoutParams(new FrameLayout.LayoutParams(getLandscapeWidth(), ViewGroup.LayoutParams.MATCH_PARENT)); mainView.setLayoutParams(new FrameLayout.LayoutParams(getLandscapeWidth(), ViewGroup.LayoutParams.MATCH_PARENT));
} else { } else {

View file

@ -16,6 +16,7 @@ import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.Window; import android.view.Window;
import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.TextView; import android.widget.TextView;
@ -187,7 +188,9 @@ public abstract class ChoosePlanDialogFragment extends BaseOsmAndDialogFragment
} }
View view = inflate(R.layout.purchase_dialog_fragment, container); View view = inflate(R.layout.purchase_dialog_fragment, container);
view.findViewById(R.id.button_back).setOnClickListener(new OnClickListener() { ImageView buttonBack = view.findViewById(R.id.button_back);
buttonBack.setImageResource(AndroidUtils.getNavigationIconResId(ctx));
buttonBack.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
dismiss(); dismiss();

View file

@ -29,7 +29,8 @@ public class DashSearchFragment extends DashBaseFragment {
View view = getActivity().getLayoutInflater().inflate(R.layout.dash_search_fragment, container, false); View view = getActivity().getLayoutInflater().inflate(R.layout.dash_search_fragment, container, false);
TextView searchFor = (TextView) view.findViewById(R.id.search_for); TextView searchFor = (TextView) view.findViewById(R.id.search_for);
searchFor.setCompoundDrawablesWithIntrinsicBounds(getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_action_search_dark), null, null, null); AndroidUtils.setCompoundDrawablesWithIntrinsicBounds(searchFor,
getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_action_search_dark), null, null, null);
searchFor.setCompoundDrawablePadding(AndroidUtils.dpToPx(getActivity(), 16f)); searchFor.setCompoundDrawablePadding(AndroidUtils.dpToPx(getActivity(), 16f));
view.findViewById(R.id.search_card).setOnClickListener(new View.OnClickListener() { view.findViewById(R.id.search_card).setOnClickListener(new View.OnClickListener() {

View file

@ -395,9 +395,9 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, IRouteInfo
private FrameLayout.LayoutParams getActionButtonLayoutParams(int btnSizePx) { private FrameLayout.LayoutParams getActionButtonLayoutParams(int btnSizePx) {
int topPadPx = mapActivity.getResources().getDimensionPixelSize(R.dimen.dashboard_map_top_padding); int topPadPx = mapActivity.getResources().getDimensionPixelSize(R.dimen.dashboard_map_top_padding);
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(btnSizePx, btnSizePx); FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(btnSizePx, btnSizePx);
int marginRight = btnSizePx / 4; int marginEnd = btnSizePx / 4;
params.setMargins(0, landscape ? 0 : topPadPx - 2 * btnSizePx, marginRight, landscape ? marginRight : 0); AndroidUtils.setMargins(params, 0, landscape ? 0 : topPadPx - 2 * btnSizePx, marginEnd, landscape ? marginEnd : 0);
params.gravity = landscape ? Gravity.BOTTOM | Gravity.RIGHT : Gravity.TOP | Gravity.RIGHT; params.gravity = landscape ? Gravity.BOTTOM | Gravity.END : Gravity.TOP | Gravity.END;
return params; return params;
} }

View file

@ -14,6 +14,7 @@ import androidx.annotation.NonNull;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.DialogFragment; import androidx.fragment.app.DialogFragment;
import net.osmand.AndroidUtils;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings; import net.osmand.plus.OsmandSettings;
@ -58,6 +59,7 @@ public class HelpArticleDialogFragment extends DialogFragment {
final View view = inflater.inflate(R.layout.fragment_help_article, container, false); final View view = inflater.inflate(R.layout.fragment_help_article, container, false);
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar); Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
toolbar.setNavigationIcon(AndroidUtils.getNavigationIconResId(getContext()));
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up); toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(new View.OnClickListener() { toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override @Override

View file

@ -2,6 +2,7 @@ package net.osmand.plus.liveupdates;
import android.app.Activity; import android.app.Activity;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MotionEvent; import android.view.MotionEvent;
@ -98,7 +99,7 @@ public class SubscriptionFragment extends BaseOsmAndDialogFragment implements In
@Override @Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
OsmandApplication app = getMyApplication();
String userName = settings.BILLING_USER_NAME.get(); String userName = settings.BILLING_USER_NAME.get();
String email = settings.BILLING_USER_EMAIL.get(); String email = settings.BILLING_USER_EMAIL.get();
String countryDownloadName = settings.BILLING_USER_COUNTRY_DOWNLOAD_NAME.get(); String countryDownloadName = settings.BILLING_USER_COUNTRY_DOWNLOAD_NAME.get();
@ -122,7 +123,8 @@ public class SubscriptionFragment extends BaseOsmAndDialogFragment implements In
View view = inflater.inflate(R.layout.subscription_fragment, container, false); View view = inflater.inflate(R.layout.subscription_fragment, container, false);
ImageButton closeButton = (ImageButton) view.findViewById(R.id.closeButton); ImageButton closeButton = (ImageButton) view.findViewById(R.id.closeButton);
closeButton.setImageDrawable(getMyApplication().getUIUtilities().getIcon(R.drawable.ic_action_mode_back)); Drawable icBack = app.getUIUtilities().getIcon(AndroidUtils.getNavigationIconResId(app));
closeButton.setImageDrawable(icBack);
closeButton.setOnClickListener(new View.OnClickListener() { closeButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {

View file

@ -320,7 +320,8 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
if (menu.isLandscapeLayout()) { if (menu.isLandscapeLayout()) {
final TypedValue typedValueAttr = new TypedValue(); final TypedValue typedValueAttr = new TypedValue();
mapActivity.getTheme().resolveAttribute(R.attr.left_menu_view_bg, typedValueAttr, true); int bgAttrId = AndroidUtils.isLayoutRtl(app) ? R.attr.right_menu_view_bg : R.attr.left_menu_view_bg;
mapActivity.getTheme().resolveAttribute(bgAttrId, typedValueAttr, true);
mainView.setBackgroundResource(typedValueAttr.resourceId); mainView.setBackgroundResource(typedValueAttr.resourceId);
mainView.setLayoutParams(new FrameLayout.LayoutParams(menu.getLandscapeWidthPx(), mainView.setLayoutParams(new FrameLayout.LayoutParams(menu.getLandscapeWidthPx(),
ViewGroup.LayoutParams.MATCH_PARENT)); ViewGroup.LayoutParams.MATCH_PARENT));

View file

@ -1112,7 +1112,7 @@ public class MenuBuilder {
} else { } else {
button.setTextColor(ContextCompat.getColor(context, light ? R.color.text_color_primary_light : R.color.text_color_primary_dark)); button.setTextColor(ContextCompat.getColor(context, light ? R.color.text_color_primary_light : R.color.text_color_primary_dark));
} }
button.setGravity(Gravity.LEFT | Gravity.CENTER_VERTICAL); button.setGravity(Gravity.START | Gravity.CENTER_VERTICAL);
button.setSingleLine(singleLine); button.setSingleLine(singleLine);
button.setEllipsize(TextUtils.TruncateAt.END); button.setEllipsize(TextUtils.TruncateAt.END);

View file

@ -6,6 +6,7 @@ import android.view.View.OnClickListener;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import net.osmand.AndroidUtils;
import net.osmand.binary.OsmandOdb.TransportRouteStop; import net.osmand.binary.OsmandOdb.TransportRouteStop;
import net.osmand.data.LatLon; import net.osmand.data.LatLon;
import net.osmand.data.PointDescription; import net.osmand.data.PointDescription;
@ -29,8 +30,10 @@ public class TransportRouteController extends MenuController {
super(new MenuBuilder(mapActivity), pointDescription, mapActivity); super(new MenuBuilder(mapActivity), pointDescription, mapActivity);
this.transportRoute = transportRoute; this.transportRoute = transportRoute;
builder.setShowOnlinePhotos(false); builder.setShowOnlinePhotos(false);
int navigationIconResId = AndroidUtils.getNavigationIconResId(mapActivity);
toolbarController = new ContextMenuToolbarController(this); toolbarController = new ContextMenuToolbarController(this);
toolbarController.setTitle(getNameStr()); toolbarController.setTitle(getNameStr());
toolbarController.setBackBtnIconIds(navigationIconResId, navigationIconResId);
toolbarController.setOnBackButtonClickListener(new OnClickListener() { toolbarController.setOnBackButtonClickListener(new OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
@ -66,7 +69,6 @@ public class TransportRouteController extends MenuController {
} }
}; };
leftTitleButtonController.caption = mapActivity.getString(R.string.shared_string_previous); leftTitleButtonController.caption = mapActivity.getString(R.string.shared_string_previous);
leftTitleButtonController.leftIconId = R.drawable.ic_arrow_back;
rightTitleButtonController = new TitleButtonController() { rightTitleButtonController = new TitleButtonController() {
@Override @Override
@ -78,7 +80,14 @@ public class TransportRouteController extends MenuController {
} }
}; };
rightTitleButtonController.caption = mapActivity.getString(R.string.shared_string_next); rightTitleButtonController.caption = mapActivity.getString(R.string.shared_string_next);
rightTitleButtonController.rightIconId = R.drawable.ic_arrow_forward;
if (AndroidUtils.isLayoutRtl(mapActivity)) {
leftTitleButtonController.rightIconId = R.drawable.ic_arrow_forward;
rightTitleButtonController.leftIconId = R.drawable.ic_arrow_back;
} else {
leftTitleButtonController.leftIconId = R.drawable.ic_arrow_back;
rightTitleButtonController.rightIconId = R.drawable.ic_arrow_forward;
}
} }
@NonNull @NonNull

View file

@ -3,6 +3,7 @@ package net.osmand.plus.mapcontextmenu.other;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.util.TypedValue;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -195,7 +196,10 @@ public class TrackDetailsMenuFragment extends BaseOsmAndFragment {
if (!landscapeLayout) { if (!landscapeLayout) {
AndroidUtils.setBackground(ctx, mainView, nightMode, R.drawable.bg_bottom_menu_light, R.drawable.bg_bottom_menu_dark); AndroidUtils.setBackground(ctx, mainView, nightMode, R.drawable.bg_bottom_menu_light, R.drawable.bg_bottom_menu_dark);
} else { } else {
AndroidUtils.setBackground(ctx, mainView, nightMode, R.drawable.bg_left_menu_light, R.drawable.bg_left_menu_dark); final TypedValue typedValueAttr = new TypedValue();
int bgAttrId = AndroidUtils.isLayoutRtl(ctx) ? R.attr.right_menu_view_bg : R.attr.left_menu_view_bg;
ctx.getTheme().resolveAttribute(bgAttrId, typedValueAttr, true);
mainView.setBackgroundResource(typedValueAttr.resourceId);
} }
AndroidUtils.setTextPrimaryColor(ctx, (TextView) mainView.findViewById(R.id.y_axis_title), nightMode); AndroidUtils.setTextPrimaryColor(ctx, (TextView) mainView.findViewById(R.id.y_axis_title), nightMode);

View file

@ -1,6 +1,7 @@
package net.osmand.plus.mapmarkers; package net.osmand.plus.mapmarkers;
import android.content.Context; import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -81,7 +82,8 @@ public class MapMarkerSelectionFragment extends BaseOsmAndDialogFragment {
View view = inflater.inflate(R.layout.map_marker_selection_fragment, container, false); View view = inflater.inflate(R.layout.map_marker_selection_fragment, container, false);
ImageButton closeButton = (ImageButton) view.findViewById(R.id.closeButton); ImageButton closeButton = (ImageButton) view.findViewById(R.id.closeButton);
closeButton.setImageDrawable(getMyApplication().getUIUtilities().getIcon(R.drawable.ic_action_mode_back)); Drawable icBack = app.getUIUtilities().getIcon(AndroidUtils.getNavigationIconResId(app));
closeButton.setImageDrawable(icBack);
closeButton.setOnClickListener(new View.OnClickListener() { closeButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {

View file

@ -200,8 +200,9 @@ public class PlanRouteFragment extends BaseOsmAndFragment implements OsmAndLocat
} }
}); });
int navigationIconResId = AndroidUtils.getNavigationIconResId(mapActivity);
toolbarController = new PlanRouteToolbarController(); toolbarController = new PlanRouteToolbarController();
toolbarController.setBackBtnIconIds(R.drawable.ic_action_mode_back, R.drawable.ic_action_mode_back); toolbarController.setBackBtnIconIds(navigationIconResId, navigationIconResId);
toolbarController.setTitle(getString(R.string.plan_route)); toolbarController.setTitle(getString(R.string.plan_route));
toolbarController.setOnBackButtonClickListener(new View.OnClickListener() { toolbarController.setOnBackButtonClickListener(new View.OnClickListener() {
@Override @Override

View file

@ -296,7 +296,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment {
undoBtn = ((ImageButton) mainView.findViewById(R.id.undo_point_button)); undoBtn = ((ImageButton) mainView.findViewById(R.id.undo_point_button));
redoBtn = ((ImageButton) mainView.findViewById(R.id.redo_point_button)); redoBtn = ((ImageButton) mainView.findViewById(R.id.redo_point_button));
undoBtn.setImageDrawable(getContentIcon(R.drawable.ic_action_undo_dark)); Drawable undoDrawable = getContentIcon(R.drawable.ic_action_undo_dark);
undoBtn.setImageDrawable(AndroidUtils.getDrawableForDirection(mapActivity, undoDrawable));
undoBtn.setOnClickListener(new View.OnClickListener() { undoBtn.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
@ -316,7 +317,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment {
} }
}); });
redoBtn.setImageDrawable(getContentIcon(R.drawable.ic_action_redo_dark)); Drawable redoDrawable = getContentIcon(R.drawable.ic_action_redo_dark);
redoBtn.setImageDrawable(AndroidUtils.getDrawableForDirection(mapActivity, redoDrawable));
redoBtn.setOnClickListener(new View.OnClickListener() { redoBtn.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
@ -394,7 +396,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment {
toolBarController = new MeasurementToolBarController(newGpxData); toolBarController = new MeasurementToolBarController(newGpxData);
if (editingCtx.getSelectedPointPosition() != -1) { if (editingCtx.getSelectedPointPosition() != -1) {
toolBarController.setBackBtnIconIds(R.drawable.ic_action_mode_back, R.drawable.ic_action_mode_back); int navigationIconResId = AndroidUtils.getNavigationIconResId(mapActivity);
toolBarController.setBackBtnIconIds(navigationIconResId, navigationIconResId);
} else { } else {
toolBarController.setBackBtnIconIds(R.drawable.ic_action_remove_dark, R.drawable.ic_action_remove_dark); toolBarController.setBackBtnIconIds(R.drawable.ic_action_remove_dark, R.drawable.ic_action_remove_dark);
} }
@ -971,7 +974,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment {
private void switchMovePointMode(boolean enable) { private void switchMovePointMode(boolean enable) {
if (enable) { if (enable) {
toolBarController.setBackBtnIconIds(R.drawable.ic_action_mode_back, R.drawable.ic_action_mode_back); int navigationIconResId = AndroidUtils.getNavigationIconResId(getMapActivity());
toolBarController.setBackBtnIconIds(navigationIconResId, navigationIconResId);
} else { } else {
toolBarController.setBackBtnIconIds(R.drawable.ic_action_remove_dark, R.drawable.ic_action_remove_dark); toolBarController.setBackBtnIconIds(R.drawable.ic_action_remove_dark, R.drawable.ic_action_remove_dark);
} }
@ -990,7 +994,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment {
private void switchAddPointBeforeAfterMode(boolean enable) { private void switchAddPointBeforeAfterMode(boolean enable) {
if (enable) { if (enable) {
toolBarController.setBackBtnIconIds(R.drawable.ic_action_mode_back, R.drawable.ic_action_mode_back); int navigationIconResId = AndroidUtils.getNavigationIconResId(getMapActivity());
toolBarController.setBackBtnIconIds(navigationIconResId, navigationIconResId);
} else { } else {
toolBarController.setBackBtnIconIds(R.drawable.ic_action_remove_dark, R.drawable.ic_action_remove_dark); toolBarController.setBackBtnIconIds(R.drawable.ic_action_remove_dark, R.drawable.ic_action_remove_dark);
} }

View file

@ -57,7 +57,8 @@ public class RecyclerViewFragment extends Fragment {
final int backgroundColor = ContextCompat.getColor(getActivity(), final int backgroundColor = ContextCompat.getColor(getActivity(),
nightMode ? R.color.activity_background_color_dark : R.color.activity_background_color_light); nightMode ? R.color.activity_background_color_dark : R.color.activity_background_color_light);
final TypedValue typedValueAttr = new TypedValue(); final TypedValue typedValueAttr = new TypedValue();
getActivity().getTheme().resolveAttribute(R.attr.left_menu_view_bg, typedValueAttr, true); int bgAttrId = AndroidUtils.isLayoutRtl(getActivity()) ? R.attr.right_menu_view_bg : R.attr.left_menu_view_bg;
getActivity().getTheme().resolveAttribute(bgAttrId, typedValueAttr, true);
parent = new FrameLayout(mapActivity); parent = new FrameLayout(mapActivity);
parent.setLayoutParams(new LayoutParams(width + AndroidUtils.dpToPx(getActivity(), 16), height)); parent.setLayoutParams(new LayoutParams(width + AndroidUtils.dpToPx(getActivity(), 16), height));

View file

@ -1,5 +1,6 @@
package net.osmand.plus.measurementtool; package net.osmand.plus.measurementtool;
import android.graphics.drawable.Drawable;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.ContextThemeWrapper; import android.view.ContextThemeWrapper;
@ -7,6 +8,8 @@ import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import net.osmand.AndroidUtils;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.MenuBottomSheetDialogFragment;
import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem; import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
@ -26,6 +29,11 @@ public class SaveAsNewTrackBottomSheetDialogFragment extends MenuBottomSheetDial
@Override @Override
public void createMenuItems(Bundle savedInstanceState) { public void createMenuItems(Bundle savedInstanceState) {
OsmandApplication app = getMyApplication();
if (app == null) {
return;
}
items.add(new TitleItem(getString(R.string.shared_string_save_as_gpx))); items.add(new TitleItem(getString(R.string.shared_string_save_as_gpx)));
items.add(new ShortDescriptionItem(getString(R.string.measurement_tool_save_as_new_track_descr))); items.add(new ShortDescriptionItem(getString(R.string.measurement_tool_save_as_new_track_descr)));
@ -37,12 +45,16 @@ public class SaveAsNewTrackBottomSheetDialogFragment extends MenuBottomSheetDial
final ImageView routePointImage = (ImageView) imagesRow.findViewById(R.id.route_point_image); final ImageView routePointImage = (ImageView) imagesRow.findViewById(R.id.route_point_image);
final ImageView lineImage = (ImageView) imagesRow.findViewById(R.id.line_image); final ImageView lineImage = (ImageView) imagesRow.findViewById(R.id.line_image);
routePointImage.setImageResource(nightMode Drawable routePointDrawable = app.getUIUtilities().getIcon(nightMode
? R.drawable.img_help_trip_route_points_night ? R.drawable.img_help_trip_route_points_night
: R.drawable.img_help_trip_route_points_day); : R.drawable.img_help_trip_route_points_day);
lineImage.setImageResource(nightMode Drawable lineDrawable = app.getUIUtilities().getIcon(nightMode
? R.drawable.img_help_trip_track_night ? R.drawable.img_help_trip_track_night
: R.drawable.img_help_trip_track_day); : R.drawable.img_help_trip_track_day);
if (routePointDrawable != null && lineDrawable != null) {
routePointImage.setImageDrawable(AndroidUtils.getDrawableForDirection(app, routePointDrawable));
lineImage.setImageDrawable(AndroidUtils.getDrawableForDirection(app, lineDrawable));
}
routePointImage.setOnClickListener(saveAsRoutePointOnClickListener); routePointImage.setOnClickListener(saveAsRoutePointOnClickListener);
lineImage.setOnClickListener(saveAsLineOnClickListener); lineImage.setOnClickListener(saveAsLineOnClickListener);

View file

@ -573,9 +573,9 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
cb.setTextColor(textColorPrimary); cb.setTextColor(textColorPrimary);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT); LayoutParams.WRAP_CONTENT);
lp.setMargins(dp24, dp8, dp24, 0); AndroidUtils.setMargins(lp, dp24, dp8, dp24, 0);
cb.setLayoutParams(lp); cb.setLayoutParams(lp);
cb.setPadding(dp8, 0, 0, 0); AndroidUtils.setPadding(cb, dp8, 0, 0, 0);
cb.setChecked(!choice.value); cb.setChecked(!choice.value);
cb.setOnCheckedChangeListener(new OnCheckedChangeListener() { cb.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override @Override
@ -590,7 +590,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
if (showTrackSelection) { if (showTrackSelection) {
View divider = new View(uiCtx); View divider = new View(uiCtx);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, AndroidUtils.dpToPx(uiCtx, 1f)); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, AndroidUtils.dpToPx(uiCtx, 1f));
lp.setMargins(0, dp8 * 2, 0, 0); AndroidUtils.setMargins(lp, 0, dp8 * 2, 0, 0);
divider.setLayoutParams(lp); divider.setLayoutParams(lp);
divider.setBackgroundColor(uiCtx.getResources().getColor(nightMode ? R.color.divider_color_dark : R.color.divider_color_light)); divider.setBackgroundColor(uiCtx.getResources().getColor(nightMode ? R.color.divider_color_dark : R.color.divider_color_light));
ll.addView(divider); ll.addView(divider);
@ -600,9 +600,9 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
cb.setTextColor(textColorPrimary); cb.setTextColor(textColorPrimary);
lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT); LayoutParams.WRAP_CONTENT);
lp.setMargins(dp24, dp8 * 2, dp24, 0); AndroidUtils.setMargins(lp, dp24, dp8 * 2, dp24, 0);
cb.setLayoutParams(lp); cb.setLayoutParams(lp);
cb.setPadding(dp8, 0, 0, 0); AndroidUtils.setPadding(cb, dp8, 0, 0, 0);
cb.setChecked(app.getSelectedGpxHelper().getSelectedCurrentRecordingTrack() != null); cb.setChecked(app.getSelectedGpxHelper().getSelectedCurrentRecordingTrack() != null);
cb.setOnCheckedChangeListener(new OnCheckedChangeListener() { cb.setOnCheckedChangeListener(new OnCheckedChangeListener() {

View file

@ -7,6 +7,7 @@ import android.text.Editable;
import android.text.InputFilter; import android.text.InputFilter;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.view.ContextThemeWrapper; import android.view.ContextThemeWrapper;
import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.View.OnFocusChangeListener; import android.view.View.OnFocusChangeListener;
@ -21,6 +22,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import net.osmand.AndroidUtils;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
import net.osmand.osm.AbstractPoiType; import net.osmand.osm.AbstractPoiType;
import net.osmand.osm.MapPoiTypes; import net.osmand.osm.MapPoiTypes;
@ -202,6 +204,7 @@ public class AdvancedEditPoiFragment extends BaseOsmAndFragment
.inflate(R.layout.poi_tag_list_item, null, false); .inflate(R.layout.poi_tag_list_item, null, false);
final AutoCompleteTextView tagEditText = final AutoCompleteTextView tagEditText =
(AutoCompleteTextView) convertView.findViewById(R.id.tagEditText); (AutoCompleteTextView) convertView.findViewById(R.id.tagEditText);
AndroidUtils.setTextHorizontalGravity(tagEditText, Gravity.START);
ImageButton deleteItemImageButton = ImageButton deleteItemImageButton =
(ImageButton) convertView.findViewById(R.id.deleteItemImageButton); (ImageButton) convertView.findViewById(R.id.deleteItemImageButton);
deleteItemImageButton.setImageDrawable(deleteDrawable); deleteItemImageButton.setImageDrawable(deleteDrawable);
@ -215,6 +218,7 @@ public class AdvancedEditPoiFragment extends BaseOsmAndFragment
}); });
final AutoCompleteTextView valueEditText = final AutoCompleteTextView valueEditText =
(AutoCompleteTextView) convertView.findViewById(R.id.valueEditText); (AutoCompleteTextView) convertView.findViewById(R.id.valueEditText);
AndroidUtils.setTextHorizontalGravity(valueEditText, Gravity.START);
valueEditText.setFilters(new InputFilter[] { valueEditText.setFilters(new InputFilter[] {
new InputFilter.LengthFilter(AMENITY_TEXT_LENGTH) new InputFilter.LengthFilter(AMENITY_TEXT_LENGTH)
}); });

View file

@ -10,6 +10,7 @@ import android.text.TextUtils;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.util.TypedValue; import android.util.TypedValue;
import android.view.ContextThemeWrapper; import android.view.ContextThemeWrapper;
import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -24,6 +25,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import net.osmand.AndroidUtils;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
import net.osmand.osm.edit.OSMSettings; import net.osmand.osm.edit.OSMSettings;
import net.osmand.plus.R; import net.osmand.plus.R;
@ -104,6 +106,11 @@ public class BasicEditPoiFragment extends BaseOsmAndFragment
phoneEditText.setFilters(lengthLimit); phoneEditText.setFilters(lengthLimit);
webSiteEditText.setFilters(lengthLimit); webSiteEditText.setFilters(lengthLimit);
descriptionEditText.setFilters(lengthLimit); descriptionEditText.setFilters(lengthLimit);
AndroidUtils.setTextHorizontalGravity(streetEditText, Gravity.START);
AndroidUtils.setTextHorizontalGravity(houseNumberEditText, Gravity.START);
AndroidUtils.setTextHorizontalGravity(phoneEditText, Gravity.START);
AndroidUtils.setTextHorizontalGravity(webSiteEditText, Gravity.START);
AndroidUtils.setTextHorizontalGravity(descriptionEditText, Gravity.START);
Button addOpeningHoursButton = (Button) view.findViewById(R.id.addOpeningHoursButton); Button addOpeningHoursButton = (Button) view.findViewById(R.id.addOpeningHoursButton);
addOpeningHoursButton.setOnClickListener(new View.OnClickListener() { addOpeningHoursButton.setOnClickListener(new View.OnClickListener() {
@Override @Override

View file

@ -16,6 +16,7 @@ import android.text.Editable;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.util.TypedValue; import android.util.TypedValue;
import android.view.Gravity;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MotionEvent; import android.view.MotionEvent;
@ -247,6 +248,7 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment {
}); });
EditText poiNameEditText = (EditText) view.findViewById(R.id.poiNameEditText); EditText poiNameEditText = (EditText) view.findViewById(R.id.poiNameEditText);
AndroidUtils.setTextHorizontalGravity(poiNameEditText, Gravity.START);
poiNameEditText.addTextChangedListener(new TextWatcher() { poiNameEditText.addTextChangedListener(new TextWatcher() {
@Override @Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) { public void beforeTextChanged(CharSequence s, int start, int count, int after) {
@ -273,6 +275,7 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment {
AndroidUtils.showSoftKeyboard(poiNameEditText); AndroidUtils.showSoftKeyboard(poiNameEditText);
poiTypeTextInputLayout = (TextInputLayout) view.findViewById(R.id.poiTypeTextInputLayout); poiTypeTextInputLayout = (TextInputLayout) view.findViewById(R.id.poiTypeTextInputLayout);
poiTypeEditText = (AutoCompleteTextView) view.findViewById(R.id.poiTypeEditText); poiTypeEditText = (AutoCompleteTextView) view.findViewById(R.id.poiTypeEditText);
AndroidUtils.setTextHorizontalGravity(poiTypeEditText, Gravity.START);
poiTypeEditText.setText(editPoiData.getPoiTypeString()); poiTypeEditText.setText(editPoiData.getPoiTypeString());
poiTypeEditText.addTextChangedListener(new TextWatcher() { poiTypeEditText.addTextChangedListener(new TextWatcher() {
@Override @Override
@ -301,12 +304,26 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment {
poiTypeEditText.setOnTouchListener(new View.OnTouchListener() { poiTypeEditText.setOnTouchListener(new View.OnTouchListener() {
@Override @Override
public boolean onTouch(final View v, MotionEvent event) { public boolean onTouch(final View v, MotionEvent event) {
Context ctx = getContext();
if (ctx == null) {
return false;
}
boolean isLayoutRtl = AndroidUtils.isLayoutRtl(getContext());
final EditText editText = (EditText) v; final EditText editText = (EditText) v;
final int DRAWABLE_RIGHT = 2;
if (event.getAction() == MotionEvent.ACTION_UP) { if (event.getAction() == MotionEvent.ACTION_UP) {
if (event.getX() >= (editText.getRight() final int DRAWABLE_END = 2;
- editText.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().width() int expandBtnWidth = AndroidUtils.getCompoundDrawables(editText)[DRAWABLE_END].getBounds().width();
- editText.getPaddingRight())) {
boolean expandButtonPressed = false;
if (isLayoutRtl) {
expandButtonPressed = event.getX() <= (editText.getLeft() + expandBtnWidth
+ editText.getPaddingLeft());
} else {
expandButtonPressed = event.getX() >= (editText.getRight() - expandBtnWidth
- editText.getPaddingRight());
}
if (expandButtonPressed) {
PoiCategory category = editPoiData.getPoiCategory(); PoiCategory category = editPoiData.getPoiCategory();
if (category != null) { if (category != null) {
PoiSubTypeDialogFragment dialogFragment = PoiSubTypeDialogFragment dialogFragment =
@ -319,7 +336,6 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment {
}); });
dialogFragment.show(getChildFragmentManager(), "PoiSubTypeDialogFragment"); dialogFragment.show(getChildFragmentManager(), "PoiSubTypeDialogFragment");
} }
return true; return true;
} }
} }

View file

@ -147,7 +147,8 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
solidToolbarView.setLayoutParams(new FrameLayout.LayoutParams(width, ViewGroup.LayoutParams.WRAP_CONTENT)); solidToolbarView.setLayoutParams(new FrameLayout.LayoutParams(width, ViewGroup.LayoutParams.WRAP_CONTENT));
solidToolbarView.setVisibility(View.VISIBLE); solidToolbarView.setVisibility(View.VISIBLE);
final TypedValue typedValueAttr = new TypedValue(); final TypedValue typedValueAttr = new TypedValue();
mapActivity.getTheme().resolveAttribute(R.attr.left_menu_view_bg, typedValueAttr, true); int bgAttrId = AndroidUtils.isLayoutRtl(mapActivity) ? R.attr.right_menu_view_bg : R.attr.left_menu_view_bg;
mapActivity.getTheme().resolveAttribute(bgAttrId, typedValueAttr, true);
view.findViewById(R.id.pager_container).setBackgroundResource(typedValueAttr.resourceId); view.findViewById(R.id.pager_container).setBackgroundResource(typedValueAttr.resourceId);
view.setLayoutParams(new FrameLayout.LayoutParams(getResources().getDimensionPixelSize(R.dimen.dashboard_land_width), ViewGroup.LayoutParams.MATCH_PARENT)); view.setLayoutParams(new FrameLayout.LayoutParams(getResources().getDimensionPixelSize(R.dimen.dashboard_land_width), ViewGroup.LayoutParams.MATCH_PARENT));
} }
@ -327,11 +328,11 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
active ? R.drawable.pages_active_light : R.drawable.pages_inactive_light, active ? R.drawable.pages_active_light : R.drawable.pages_inactive_light,
active ? R.drawable.pages_active_dark : R.drawable.pages_inactive_dark); active ? R.drawable.pages_active_dark : R.drawable.pages_inactive_dark);
if (i == 0) { if (i == 0) {
layoutParams.setMargins(itemMargin, 0, itemPadding, 0); AndroidUtils.setMargins(layoutParams, itemMargin, 0, itemPadding, 0);
} else if (i == routesCount - 1) { } else if (i == routesCount - 1) {
layoutParams.setMargins(0, 0, itemMargin, 0); AndroidUtils.setMargins(layoutParams, 0, 0, itemMargin, 0);
} else { } else {
layoutParams.setMargins(0, 0, itemPadding, 0); AndroidUtils.setMargins(layoutParams, 0, 0, itemPadding, 0);
} }
itemView.setLayoutParams(layoutParams); itemView.setLayoutParams(layoutParams);
pagesView.addView(itemView); pagesView.addView(itemView);

View file

@ -1004,7 +1004,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
optionsTitle.setVisibility(View.VISIBLE); optionsTitle.setVisibility(View.VISIBLE);
endPadding += AndroidUtils.getTextWidth(app.getResources().getDimensionPixelSize(R.dimen.text_button_text_size), app.getString(R.string.shared_string_options)); endPadding += AndroidUtils.getTextWidth(app.getResources().getDimensionPixelSize(R.dimen.text_button_text_size), app.getString(R.string.shared_string_options));
} }
if (AndroidUtils.getLayoutDirection(app) == View.LAYOUT_DIRECTION_RTL) { if (AndroidUtils.isLayoutRtl(app)) {
optionsContainer.setPadding(endPadding, optionsContainer.getPaddingTop(), optionsContainer.getPaddingRight(), optionsContainer.getPaddingBottom()); optionsContainer.setPadding(endPadding, optionsContainer.getPaddingTop(), optionsContainer.getPaddingRight(), optionsContainer.getPaddingBottom());
} else { // LTR } else { // LTR
optionsContainer.setPadding(optionsContainer.getPaddingLeft(), optionsContainer.getPaddingTop(), endPadding, optionsContainer.getPaddingBottom()); optionsContainer.setPadding(optionsContainer.getPaddingLeft(), optionsContainer.getPaddingTop(), endPadding, optionsContainer.getPaddingBottom());

View file

@ -128,10 +128,10 @@ public class MapRouteInfoMenuFragment extends ContextMenuFragment {
int widthNoShadow = getLandscapeNoShadowWidth(); int widthNoShadow = getLandscapeNoShadowWidth();
modesLayoutToolbar.setLayoutParams(new FrameLayout.LayoutParams(widthNoShadow, ViewGroup.LayoutParams.WRAP_CONTENT)); modesLayoutToolbar.setLayoutParams(new FrameLayout.LayoutParams(widthNoShadow, ViewGroup.LayoutParams.WRAP_CONTENT));
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(widthNoShadow, ViewGroup.LayoutParams.WRAP_CONTENT); FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(widthNoShadow, ViewGroup.LayoutParams.WRAP_CONTENT);
params.gravity = Gravity.BOTTOM; params.gravity = Gravity.BOTTOM|Gravity.START;
view.findViewById(R.id.control_buttons).setLayoutParams(params); view.findViewById(R.id.control_buttons).setLayoutParams(params);
View appModesView = view.findViewById(R.id.app_modes); View appModesView = view.findViewById(R.id.app_modes);
appModesView.setPadding(0, 0, appModesView.getPaddingRight(), 0); AndroidUtils.setPadding(appModesView, 0, 0, appModesView.getPaddingRight(), 0);
} }
} }
return view; return view;

View file

@ -186,7 +186,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
view.findViewById(getBottomScrollViewId()).setBackgroundDrawable(null); view.findViewById(getBottomScrollViewId()).setBackgroundDrawable(null);
LinearLayout cardsContainer = getCardsContainer(); LinearLayout cardsContainer = getCardsContainer();
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) cardsContainer.getLayoutParams(); FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) cardsContainer.getLayoutParams();
layoutParams.setMargins(pageMarginPx, 0, pageMarginPx, 0); AndroidUtils.setMargins(layoutParams, pageMarginPx, 0, pageMarginPx, 0);
cardsContainer.setLayoutParams(layoutParams); cardsContainer.setLayoutParams(layoutParams);
updateCardsLayout(); updateCardsLayout();
} }
@ -459,7 +459,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
ImageView routeLine = new ImageView(view.getContext()); ImageView routeLine = new ImageView(view.getContext());
FrameLayout.LayoutParams routeLineParams = new FrameLayout.LayoutParams(dpToPx(8f), ViewGroup.LayoutParams.MATCH_PARENT); FrameLayout.LayoutParams routeLineParams = new FrameLayout.LayoutParams(dpToPx(8f), ViewGroup.LayoutParams.MATCH_PARENT);
routeLineParams.gravity = Gravity.START; routeLineParams.gravity = Gravity.START;
routeLineParams.setMargins(dpToPx(24), dpToPx(14), dpToPx(22), dpToPx(36)); AndroidUtils.setMargins(routeLineParams, dpToPx(24), dpToPx(14), dpToPx(22), dpToPx(36));
routeLine.setLayoutParams(routeLineParams); routeLine.setLayoutParams(routeLineParams);
int bgColor = transportStopRoute.getColor(app, isNightMode()); int bgColor = transportStopRoute.getColor(app, isNightMode());
routeLine.setBackgroundColor(bgColor); routeLine.setBackgroundColor(bgColor);
@ -595,7 +595,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
private View createImagesContainer(@NonNull Context context) { private View createImagesContainer(@NonNull Context context) {
LinearLayout imagesContainer = new LinearLayout(context); LinearLayout imagesContainer = new LinearLayout(context);
FrameLayout.LayoutParams imagesContainerParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT); FrameLayout.LayoutParams imagesContainerParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT);
imagesContainer.setPadding(dpToPx(16), dpToPx(12), dpToPx(24), 0); AndroidUtils.setPadding(imagesContainer, dpToPx(16), dpToPx(12), dpToPx(24), 0);
imagesContainer.setOrientation(LinearLayout.VERTICAL); imagesContainer.setOrientation(LinearLayout.VERTICAL);
imagesContainer.setLayoutParams(imagesContainerParams); imagesContainer.setLayoutParams(imagesContainerParams);
return imagesContainer; return imagesContainer;
@ -745,7 +745,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
ImageView walkLineImage = new ImageView(container.getContext()); ImageView walkLineImage = new ImageView(container.getContext());
walkLineImage.setImageDrawable(app.getUIUtilities().getIcon(R.drawable.walk_route_item_light)); walkLineImage.setImageDrawable(app.getUIUtilities().getIcon(R.drawable.walk_route_item_light));
LinearLayout.LayoutParams walkImageLayoutParams = new LinearLayout.LayoutParams(dpToPx(10), dpToPx(14)); LinearLayout.LayoutParams walkImageLayoutParams = new LinearLayout.LayoutParams(dpToPx(10), dpToPx(14));
walkImageLayoutParams.setMargins(dpToPx(7), dpToPx(6), 0, dpToPx(6)); AndroidUtils.setMargins(walkImageLayoutParams, dpToPx(7), dpToPx(6), 0, dpToPx(6));
walkLineImage.setLayoutParams(walkImageLayoutParams); walkLineImage.setLayoutParams(walkImageLayoutParams);
container.addView(walkLineImage); container.addView(walkLineImage);
} }
@ -862,12 +862,12 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
LinearLayout llIconCollapse = new LinearLayout(view.getContext()); LinearLayout llIconCollapse = new LinearLayout(view.getContext());
llIconCollapse.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, dpToPx(48f))); llIconCollapse.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, dpToPx(48f)));
llIconCollapse.setOrientation(LinearLayout.HORIZONTAL); llIconCollapse.setOrientation(LinearLayout.HORIZONTAL);
llIconCollapse.setGravity(Gravity.CENTER_VERTICAL); llIconCollapse.setGravity(Gravity.CENTER_VERTICAL|Gravity.START);
ll.addView(llIconCollapse); ll.addView(llIconCollapse);
LinearLayout.LayoutParams llIconCollapseParams = new LinearLayout.LayoutParams(dpToPx(24f), dpToPx(24f)); LinearLayout.LayoutParams llIconCollapseParams = new LinearLayout.LayoutParams(dpToPx(24f), dpToPx(24f));
llIconCollapseParams.setMargins(0, dpToPx(12f), 0, dpToPx(12f)); AndroidUtils.setMargins(llIconCollapseParams,0, dpToPx(12f), 0, dpToPx(12f));
llIconCollapseParams.gravity = Gravity.CENTER_VERTICAL; llIconCollapseParams.gravity = Gravity.CENTER_VERTICAL|Gravity.START;
iconViewCollapse.setLayoutParams(llIconCollapseParams); iconViewCollapse.setLayoutParams(llIconCollapseParams);
iconViewCollapse.setScaleType(ImageView.ScaleType.CENTER_INSIDE); iconViewCollapse.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
iconViewCollapse.setImageDrawable(getCollapseIcon(collapsableView.getContenView().getVisibility() == View.GONE)); iconViewCollapse.setImageDrawable(getCollapseIcon(collapsableView.getContenView().getVisibility() == View.GONE));
@ -934,13 +934,13 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
ImageView iconView = new ImageView(view.getContext()); ImageView iconView = new ImageView(view.getContext());
iconView.setImageDrawable(icon); iconView.setImageDrawable(icon);
FrameLayout.LayoutParams imageViewLayoutParams = new FrameLayout.LayoutParams(dpToPx(28), dpToPx(28)); FrameLayout.LayoutParams imageViewLayoutParams = new FrameLayout.LayoutParams(dpToPx(28), dpToPx(28));
imageViewLayoutParams.gravity = Gravity.TOP; imageViewLayoutParams.gravity = Gravity.TOP|Gravity.START;
iconView.setLayoutParams(imageViewLayoutParams); iconView.setLayoutParams(imageViewLayoutParams);
iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE); iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
imageViewLayoutParams.setMargins(dpToPx(14), dpToPx(8), dpToPx(22), 0); AndroidUtils.setMargins(imageViewLayoutParams, dpToPx(14), dpToPx(8), dpToPx(22), 0);
iconView.setBackgroundResource(R.drawable.border_round_solid_light); iconView.setBackgroundResource(R.drawable.border_round_solid_light);
iconView.setPadding(dpToPx(2), dpToPx(2), dpToPx(2), dpToPx(2)); AndroidUtils.setPadding(iconView, dpToPx(2), dpToPx(2), dpToPx(2), dpToPx(2));
baseItemView.addView(iconView); baseItemView.addView(iconView);
} }
@ -957,9 +957,9 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
TextView timeView = new TextView(view.getContext()); TextView timeView = new TextView(view.getContext());
FrameLayout.LayoutParams timeViewParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); FrameLayout.LayoutParams timeViewParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
timeViewParams.gravity = Gravity.END | Gravity.TOP; timeViewParams.gravity = Gravity.END | Gravity.TOP;
timeViewParams.setMargins(0, dpToPx(8), 0, 0); AndroidUtils.setMargins(timeViewParams,0, dpToPx(8), 0, 0);
timeView.setLayoutParams(timeViewParams); timeView.setLayoutParams(timeViewParams);
timeView.setPadding(0, 0, dpToPx(16), 0); AndroidUtils.setPadding(timeView,0, 0, dpToPx(16), 0);
timeView.setTextSize(16); timeView.setTextSize(16);
timeView.setTextColor(getMainFontColor()); timeView.setTextColor(getMainFontColor());
@ -1008,7 +1008,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
View routeBadge = createRouteBadge(mapActivity, transportStopRoute); View routeBadge = createRouteBadge(mapActivity, transportStopRoute);
LinearLayout.LayoutParams routeBadgeParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams routeBadgeParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
routeBadgeParams.setMargins(0, dpToPx(6), 0, dpToPx(8)); AndroidUtils.setMargins(routeBadgeParams, 0, dpToPx(6), 0, dpToPx(8));
routeBadge.setLayoutParams(routeBadgeParams); routeBadge.setLayoutParams(routeBadgeParams);
llText.addView(routeBadge); llText.addView(routeBadge);
@ -1045,13 +1045,13 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
ImageView iconView = new ImageView(view.getContext()); ImageView iconView = new ImageView(view.getContext());
iconView.setImageDrawable(icon); iconView.setImageDrawable(icon);
FrameLayout.LayoutParams imageViewLayoutParams = new FrameLayout.LayoutParams(dpToPx(28), dpToPx(28)); FrameLayout.LayoutParams imageViewLayoutParams = new FrameLayout.LayoutParams(dpToPx(28), dpToPx(28));
imageViewLayoutParams.gravity = Gravity.TOP; imageViewLayoutParams.gravity = Gravity.TOP|Gravity.START;
iconView.setLayoutParams(imageViewLayoutParams); iconView.setLayoutParams(imageViewLayoutParams);
iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE); iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
imageViewLayoutParams.setMargins(dpToPx(14), dpToPx(8), dpToPx(22), 0); AndroidUtils.setMargins(imageViewLayoutParams, dpToPx(14), dpToPx(8), dpToPx(22), 0);
iconView.setBackgroundResource(R.drawable.border_round_solid_light); iconView.setBackgroundResource(R.drawable.border_round_solid_light);
iconView.setPadding(dpToPx(2), dpToPx(2), dpToPx(2), dpToPx(2)); AndroidUtils.setPadding(iconView, dpToPx(2), dpToPx(2), dpToPx(2), dpToPx(2));
baseItemView.addView(iconView); baseItemView.addView(iconView);
} }
@ -1068,9 +1068,9 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
TextView timeView = new TextView(view.getContext()); TextView timeView = new TextView(view.getContext());
FrameLayout.LayoutParams timeViewParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); FrameLayout.LayoutParams timeViewParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
timeViewParams.gravity = Gravity.END | Gravity.TOP; timeViewParams.gravity = Gravity.END | Gravity.TOP;
timeViewParams.setMargins(0, dpToPx(8), 0, 0); AndroidUtils.setMargins(timeViewParams, 0, dpToPx(8), 0, 0);
timeView.setLayoutParams(timeViewParams); timeView.setLayoutParams(timeViewParams);
timeView.setPadding(0, 0, dpToPx(16), 0); AndroidUtils.setPadding(timeView, 0, 0, dpToPx(16), 0);
timeView.setTextSize(16); timeView.setTextSize(16);
timeView.setTextColor(getMainFontColor()); timeView.setTextColor(getMainFontColor());
@ -1127,16 +1127,16 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
Drawable icon = getPaintedContentIcon(R.drawable.ic_action_pedestrian_dark, getActiveColor()); Drawable icon = getPaintedContentIcon(R.drawable.ic_action_pedestrian_dark, getActiveColor());
ImageView iconView = new ImageView(view.getContext()); ImageView iconView = new ImageView(view.getContext());
iconView.setImageDrawable(icon); iconView.setImageDrawable(AndroidUtils.getDrawableForDirection(view.getContext(), icon));
FrameLayout.LayoutParams imageViewLayoutParams = new FrameLayout.LayoutParams(dpToPx(24), dpToPx(24)); FrameLayout.LayoutParams imageViewLayoutParams = new FrameLayout.LayoutParams(dpToPx(24), dpToPx(24));
imageViewLayoutParams.gravity = imagesContainer != null ? Gravity.TOP : Gravity.CENTER_VERTICAL; imageViewLayoutParams.gravity = Gravity.START| (imagesContainer != null ? Gravity.TOP : Gravity.CENTER_VERTICAL);
iconView.setLayoutParams(imageViewLayoutParams); iconView.setLayoutParams(imageViewLayoutParams);
iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE); iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
if (imagesContainer != null) { if (imagesContainer != null) {
imagesContainer.addView(iconView); imagesContainer.addView(iconView);
} else { } else {
imageViewLayoutParams.setMargins(dpToPx(16), 0, dpToPx(24), 0); AndroidUtils.setMargins(imageViewLayoutParams, dpToPx(16), 0, dpToPx(24), 0);
baseItemView.addView(iconView); baseItemView.addView(iconView);
} }
@ -1183,7 +1183,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
if (imagesContainer != null) { if (imagesContainer != null) {
imagesContainer.addView(iconView); imagesContainer.addView(iconView);
} else { } else {
imageViewLayoutParams.setMargins(dpToPx(16), 0, dpToPx(24), 0); AndroidUtils.setMargins(imageViewLayoutParams, dpToPx(16), 0, dpToPx(24), 0);
baseItemView.addView(iconView); baseItemView.addView(iconView);
} }
} }
@ -1197,9 +1197,9 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
TextView timeView = new TextView(view.getContext()); TextView timeView = new TextView(view.getContext());
FrameLayout.LayoutParams timeViewParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); FrameLayout.LayoutParams timeViewParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
timeViewParams.gravity = Gravity.END | Gravity.TOP; timeViewParams.gravity = Gravity.END | Gravity.TOP;
timeViewParams.setMargins(0, dpToPx(8), 0, 0); AndroidUtils.setMargins(timeViewParams, 0, dpToPx(8), 0, 0);
timeView.setLayoutParams(timeViewParams); timeView.setLayoutParams(timeViewParams);
timeView.setPadding(0, 0, dpToPx(16), 0); AndroidUtils.setPadding(timeView, 0, 0, dpToPx(16), 0);
timeView.setTextSize(16); timeView.setTextSize(16);
timeView.setTextColor(getMainFontColor()); timeView.setTextColor(getMainFontColor());
@ -1247,7 +1247,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
if (imagesContainer != null) { if (imagesContainer != null) {
imagesContainer.addView(iconView); imagesContainer.addView(iconView);
} else { } else {
imageViewLayoutParams.setMargins(dpToPx(16), 0, dpToPx(24), 0); AndroidUtils.setMargins(imageViewLayoutParams, dpToPx(16), 0, dpToPx(24), 0);
baseItemView.addView(iconView); baseItemView.addView(iconView);
} }
@ -1271,9 +1271,9 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
TextView timeView = new TextView(view.getContext()); TextView timeView = new TextView(view.getContext());
FrameLayout.LayoutParams timeViewParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); FrameLayout.LayoutParams timeViewParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
timeViewParams.gravity = Gravity.END | Gravity.TOP; timeViewParams.gravity = Gravity.END | Gravity.TOP;
timeViewParams.setMargins(0, dpToPx(8), 0, 0); AndroidUtils.setMargins(timeViewParams, 0, dpToPx(8), 0, 0);
timeView.setLayoutParams(timeViewParams); timeView.setLayoutParams(timeViewParams);
timeView.setPadding(0, 0, dpToPx(16), 0); AndroidUtils.setPadding(timeView, 0, 0, dpToPx(16), 0);
timeView.setTextSize(16); timeView.setTextSize(16);
timeView.setTextColor(getMainFontColor()); timeView.setTextColor(getMainFontColor());
@ -1315,13 +1315,13 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
ImageView iconView = new ImageView(view.getContext()); ImageView iconView = new ImageView(view.getContext());
iconView.setImageDrawable(icon); iconView.setImageDrawable(icon);
FrameLayout.LayoutParams imageViewLayoutParams = new FrameLayout.LayoutParams(dpToPx(22), dpToPx(22)); FrameLayout.LayoutParams imageViewLayoutParams = new FrameLayout.LayoutParams(dpToPx(22), dpToPx(22));
imageViewLayoutParams.gravity = Gravity.CENTER_VERTICAL; imageViewLayoutParams.gravity = Gravity.CENTER_VERTICAL | Gravity.START;
iconView.setLayoutParams(imageViewLayoutParams); iconView.setLayoutParams(imageViewLayoutParams);
iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE); iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
imageViewLayoutParams.setMargins(dpToPx(17), 0, dpToPx(25), 0); AndroidUtils.setMargins(imageViewLayoutParams, dpToPx(17), 0, dpToPx(25), 0);
iconView.setBackgroundResource(R.drawable.border_round_solid_light_small); iconView.setBackgroundResource(R.drawable.border_round_solid_light_small);
iconView.setPadding(dpToPx(2), dpToPx(2), dpToPx(2), dpToPx(2)); AndroidUtils.setPadding(iconView, dpToPx(2), dpToPx(2), dpToPx(2), dpToPx(2));
baseItemView.addView(iconView); baseItemView.addView(iconView);
} }
@ -1366,7 +1366,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
OsmandApplication app = requireMyApplication(); OsmandApplication app = requireMyApplication();
TextViewEx titleView = new TextViewEx(container.getContext()); TextViewEx titleView = new TextViewEx(container.getContext());
FrameLayout.LayoutParams titleParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); FrameLayout.LayoutParams titleParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
titleParams.gravity = Gravity.CENTER_VERTICAL; titleParams.gravity = Gravity.CENTER_VERTICAL | Gravity.START;
titleView.setTypeface(FontCache.getRobotoRegular(container.getContext())); titleView.setTypeface(FontCache.getRobotoRegular(container.getContext()));
titleView.setLayoutParams(titleParams); titleView.setLayoutParams(titleParams);
titleView.setTextSize(16); titleView.setTextSize(16);
@ -1380,7 +1380,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
OsmandApplication app = requireMyApplication(); OsmandApplication app = requireMyApplication();
TextViewEx textViewDescription = new TextViewEx(container.getContext()); TextViewEx textViewDescription = new TextViewEx(container.getContext());
LinearLayout.LayoutParams descriptionParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams descriptionParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
descriptionParams.setMargins(0, dpToPx(paddingTop), 0, dpToPx(paddingBottom)); AndroidUtils.setMargins(descriptionParams, 0, dpToPx(paddingTop), 0, dpToPx(paddingBottom));
textViewDescription.setLayoutParams(descriptionParams); textViewDescription.setLayoutParams(descriptionParams);
textViewDescription.setTypeface(FontCache.getRobotoRegular(container.getContext())); textViewDescription.setTypeface(FontCache.getRobotoRegular(container.getContext()));
textViewDescription.setTextSize(14); textViewDescription.setTextSize(14);
@ -1394,7 +1394,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
llText.setOrientation(LinearLayout.VERTICAL); llText.setOrientation(LinearLayout.VERTICAL);
LinearLayout.LayoutParams llTextViewParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams llTextViewParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT);
llTextViewParams.weight = 1f; llTextViewParams.weight = 1f;
llTextViewParams.gravity = Gravity.CENTER_VERTICAL; llTextViewParams.gravity = Gravity.CENTER_VERTICAL | Gravity.START;
llText.setLayoutParams(llTextViewParams); llText.setLayoutParams(llTextViewParams);
return llText; return llText;
} }
@ -1406,7 +1406,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
ll.setMinimumHeight(dpToPx(minHeight)); ll.setMinimumHeight(dpToPx(minHeight));
ll.setLayoutParams(llParams); ll.setLayoutParams(llParams);
ll.setBackgroundResource(AndroidUtils.resolveAttribute(context, android.R.attr.selectableItemBackground)); ll.setBackgroundResource(AndroidUtils.resolveAttribute(context, android.R.attr.selectableItemBackground));
ll.setPadding(dpToPx(64f), 0, dpToPx(16f), 0); AndroidUtils.setPadding(ll, dpToPx(64f), 0, dpToPx(16f), 0);
ll.setOnLongClickListener(onLongClickListener); ll.setOnLongClickListener(onLongClickListener);
return ll; return ll;
} }
@ -1471,9 +1471,9 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
OsmandApplication app = requireMyApplication(); OsmandApplication app = requireMyApplication();
View horizontalLine = new View(view.getContext()); View horizontalLine = new View(view.getContext());
LinearLayout.LayoutParams llHorLineParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, dpToPx(1f)); LinearLayout.LayoutParams llHorLineParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, dpToPx(1f));
llHorLineParams.gravity = Gravity.BOTTOM; llHorLineParams.gravity = Gravity.BOTTOM | Gravity.START;
if (needMargin) { if (needMargin) {
llHorLineParams.setMargins(dpToPx(64), 0, 0, 0); AndroidUtils.setMargins(llHorLineParams, dpToPx(64), 0, 0, 0);
} }
horizontalLine.setLayoutParams(llHorLineParams); horizontalLine.setLayoutParams(llHorLineParams);
horizontalLine.setBackgroundColor(ContextCompat.getColor(app, isNightMode() ? R.color.divider_color_dark : R.color.divider_color_light)); horizontalLine.setBackgroundColor(ContextCompat.getColor(app, isNightMode() ? R.color.divider_color_dark : R.color.divider_color_light));

View file

@ -162,13 +162,14 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
if (!portrait) { if (!portrait) {
final TypedValue typedValueAttr = new TypedValue(); final TypedValue typedValueAttr = new TypedValue();
mapActivity.getTheme().resolveAttribute(R.attr.left_menu_view_bg, typedValueAttr, true); int bgAttrId = AndroidUtils.isLayoutRtl(mapActivity) ? R.attr.right_menu_view_bg : R.attr.left_menu_view_bg;
mapActivity.getTheme().resolveAttribute(bgAttrId, typedValueAttr, true);
mainView.setBackgroundResource(typedValueAttr.resourceId); mainView.setBackgroundResource(typedValueAttr.resourceId);
mainView.setLayoutParams(new FrameLayout.LayoutParams(getResources().getDimensionPixelSize(R.dimen.dashboard_land_width), ViewGroup.LayoutParams.MATCH_PARENT)); mainView.setLayoutParams(new FrameLayout.LayoutParams(getResources().getDimensionPixelSize(R.dimen.dashboard_land_width), ViewGroup.LayoutParams.MATCH_PARENT));
int width = getResources().getDimensionPixelSize(R.dimen.dashboard_land_width) - getResources().getDimensionPixelSize(R.dimen.dashboard_land_shadow_width); int width = getResources().getDimensionPixelSize(R.dimen.dashboard_land_width) - getResources().getDimensionPixelSize(R.dimen.dashboard_land_shadow_width);
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(width, ViewGroup.LayoutParams.WRAP_CONTENT); FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(width, ViewGroup.LayoutParams.WRAP_CONTENT);
params.gravity = Gravity.BOTTOM; params.gravity = Gravity.BOTTOM|Gravity.START;
view.findViewById(R.id.control_buttons).setLayoutParams(params); view.findViewById(R.id.control_buttons).setLayoutParams(params);
} }

View file

@ -1,6 +1,7 @@
package net.osmand.plus.routepreparationmenu.cards; package net.osmand.plus.routepreparationmenu.cards;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.GradientDrawable;
import android.os.Build; import android.os.Build;
import android.text.SpannableString; import android.text.SpannableString;
@ -389,7 +390,8 @@ public class PublicTransportCard extends BaseCard {
TextView transportStopRouteTextView = (TextView) bageView.findViewById(R.id.transport_stop_route_text); TextView transportStopRouteTextView = (TextView) bageView.findViewById(R.id.transport_stop_route_text);
ImageView transportStopRouteImageView = (ImageView) bageView.findViewById(R.id.transport_stop_route_icon); ImageView transportStopRouteImageView = (ImageView) bageView.findViewById(R.id.transport_stop_route_icon);
transportStopRouteImageView.setImageDrawable(getActiveIcon(R.drawable.ic_action_pedestrian_dark)); Drawable icPedestrian = getActiveIcon(R.drawable.ic_action_pedestrian_dark);
transportStopRouteImageView.setImageDrawable(AndroidUtils.getDrawableForDirection(app, icPedestrian));
transportStopRouteTextView.setText(OsmAndFormatter.getFormattedDuration((int) walkTime, app)); transportStopRouteTextView.setText(OsmAndFormatter.getFormattedDuration((int) walkTime, app));
GradientDrawable gradientDrawableBg = (GradientDrawable) bageView.getBackground(); GradientDrawable gradientDrawableBg = (GradientDrawable) bageView.getBackground();
gradientDrawableBg.setColor(activeColor); gradientDrawableBg.setColor(activeColor);
@ -413,7 +415,8 @@ public class PublicTransportCard extends BaseCard {
private View createArrow() { private View createArrow() {
LinearLayout container = new LinearLayout(app); LinearLayout container = new LinearLayout(app);
ImageView arrow = new ImageView(app); ImageView arrow = new ImageView(app);
arrow.setImageDrawable(getContentIcon(R.drawable.ic_action_arrow_forward_16)); Drawable icArrow = getContentIcon(R.drawable.ic_action_arrow_forward_16);
arrow.setImageDrawable(AndroidUtils.getDrawableForDirection(app, icArrow));
container.addView(arrow, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, AndroidUtils.dpToPx(app, 28))); container.addView(arrow, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, AndroidUtils.dpToPx(app, 28)));
return container; return container;
} }

View file

@ -186,7 +186,9 @@ public class ConfigureMenuItemsFragment extends BaseOsmAndFragment
toolbarTitle.setTextColor(nightMode toolbarTitle.setTextColor(nightMode
? getResources().getColor(R.color.text_color_primary_dark) ? getResources().getColor(R.color.text_color_primary_dark)
: getResources().getColor(R.color.list_background_color_dark)); : getResources().getColor(R.color.list_background_color_dark));
toolbarButton.setImageDrawable(getPaintedContentIcon(R.drawable.ic_arrow_back, getResources().getColor(R.color.text_color_secondary_light))); toolbarButton.setImageDrawable(getPaintedContentIcon(
AndroidUtils.getNavigationIconResId(app),
getResources().getColor(R.color.text_color_secondary_light)));
toolbarTitle.setText(screenType.titleRes); toolbarTitle.setText(screenType.titleRes);
toolbarButton.setOnClickListener(new View.OnClickListener() { toolbarButton.setOnClickListener(new View.OnClickListener() {
@Override @Override

View file

@ -103,7 +103,9 @@ public class ConfigureMenuRootFragment extends BaseOsmAndFragment {
? getResources().getColor(R.color.text_color_primary_dark) ? getResources().getColor(R.color.text_color_primary_dark)
: getResources().getColor(R.color.list_background_color_dark)); : getResources().getColor(R.color.list_background_color_dark));
toolbarSubTitle.setTextColor(getResources().getColor(R.color.text_color_secondary_light)); toolbarSubTitle.setTextColor(getResources().getColor(R.color.text_color_secondary_light));
toolbarButton.setImageDrawable(getPaintedContentIcon(R.drawable.ic_arrow_back, getResources().getColor(R.color.text_color_secondary_light))); toolbarButton.setImageDrawable(getPaintedContentIcon(
AndroidUtils.getNavigationIconResId(app),
getResources().getColor(R.color.text_color_secondary_light)));
toolbarButton.setOnClickListener(new View.OnClickListener() { toolbarButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {

View file

@ -283,7 +283,8 @@ public class ImportDuplicatesFragment extends BaseOsmAndFragment implements View
private void setupToolbar(Toolbar toolbar) { private void setupToolbar(Toolbar toolbar) {
toolbar.setTitle(R.string.import_duplicates_title); toolbar.setTitle(R.string.import_duplicates_title);
toolbar.setNavigationIcon(getPaintedContentIcon(R.drawable.ic_arrow_back, toolbar.setNavigationIcon(getPaintedContentIcon(
AndroidUtils.getNavigationIconResId(app),
nightMode nightMode
? getResources().getColor(R.color.active_buttons_and_links_text_dark) ? getResources().getColor(R.color.active_buttons_and_links_text_dark)
: getResources().getColor(R.color.active_buttons_and_links_text_light))); : getResources().getColor(R.color.active_buttons_and_links_text_light)));

View file

@ -28,6 +28,7 @@ import android.view.View;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.Toast; import android.widget.Toast;
import net.osmand.AndroidUtils;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
import net.osmand.access.AccessibilityActionsProvider; import net.osmand.access.AccessibilityActionsProvider;
import net.osmand.core.android.MapRendererView; import net.osmand.core.android.MapRendererView;
@ -632,7 +633,8 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
} else if (mapPosition == OsmandSettings.LANDSCAPE_MIDDLE_RIGHT_CONSTANT) { } else if (mapPosition == OsmandSettings.LANDSCAPE_MIDDLE_RIGHT_CONSTANT) {
ratiox = 0.7f; ratiox = 0.7f;
} else { } else {
ratiox = mapPositionX == 0 ? 0.5f : 0.75f; boolean isLayoutRtl = AndroidUtils.isLayoutRtl(application);
ratiox = mapPositionX == 0 ? 0.5f : (isLayoutRtl ? 0.25f : 0.75f);
} }
final int cy = (int) (ratioy * view.getHeight()); final int cy = (int) (ratioy * view.getHeight());
final int cx = (int) (ratiox * view.getWidth()); final int cx = (int) (ratiox * view.getWidth());

View file

@ -6,10 +6,11 @@ import android.util.AttributeSet;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import net.osmand.AndroidUtils;
public class FlowLayout extends ViewGroup { public class FlowLayout extends ViewGroup {
private int line_height; private int line_height;
private boolean rtl = false;
public static class LayoutParams extends ViewGroup.LayoutParams { public static class LayoutParams extends ViewGroup.LayoutParams {
@ -91,12 +92,10 @@ public class FlowLayout extends ViewGroup {
@Override @Override
protected void onLayout(boolean changed, int l, int t, int r, int b) { protected void onLayout(boolean changed, int l, int t, int r, int b) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
rtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL;
}
final int count = getChildCount(); final int count = getChildCount();
final int width = r - l; final int width = r - l;
int xpos = rtl ? width - getPaddingRight() : getPaddingLeft(); boolean isLayoutRtl = AndroidUtils.isLayoutRtl(getContext());
int xpos = isLayoutRtl ? width - getPaddingRight() : getPaddingLeft();
int ypos = getPaddingTop(); int ypos = getPaddingTop();
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
final View child = getChildAt(i); final View child = getChildAt(i);
@ -104,13 +103,13 @@ public class FlowLayout extends ViewGroup {
final int childw = child.getMeasuredWidth(); final int childw = child.getMeasuredWidth();
final int childh = child.getMeasuredHeight(); final int childh = child.getMeasuredHeight();
final LayoutParams lp = (LayoutParams) child.getLayoutParams(); final LayoutParams lp = (LayoutParams) child.getLayoutParams();
if (rtl) { if (isLayoutRtl) {
if (xpos - childw < l) { if (xpos - childw < l) {
xpos = width - getPaddingRight(); xpos = width - getPaddingRight();
ypos += line_height; ypos += line_height;
} }
child.layout(xpos - childw, ypos, xpos, ypos + childh); child.layout(xpos - childw, ypos, xpos, ypos + childh);
xpos -= childw - lp.horizontal_spacing; xpos -= childw + lp.horizontal_spacing;
} else { } else {
if (xpos + childw > width) { if (xpos + childw > width) {
xpos = getPaddingLeft(); xpos = getPaddingLeft();