fix toggle button display after rotate screen

This commit is contained in:
Skalii 2021-03-11 14:06:40 +02:00
parent 6e5964de40
commit 1c4484b44c
2 changed files with 56 additions and 56 deletions

View file

@ -1,16 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="@dimen/bottom_sheet_selected_item_title_height"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding">
android:paddingLeft="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding"
android:paddingRight="@dimen/content_padding">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/icon"
@ -19,7 +18,7 @@
android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/bottom_sheet_icon_margin"
android:layout_marginRight="@dimen/bottom_sheet_icon_margin"
tools:src="@drawable/list_destination"/>
tools:src="@drawable/list_destination" />
<LinearLayout
android:layout_width="0dp"
@ -35,7 +34,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.ListItemTitle"
tools:text="Some title"/>
tools:text="Some title" />
<TextView
android:id="@+id/description"
@ -45,7 +44,7 @@
android:maxLines="2"
android:textAppearance="@style/TextAppearance.ContextMenuSubtitle"
android:textColor="@null"
tools:text="Some description"/>
tools:text="Some description" />
</LinearLayout>
<androidx.appcompat.widget.SwitchCompat
@ -53,11 +52,12 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/bottom_sheet_content_margin"
android:layout_marginStart="@dimen/bottom_sheet_content_margin"
android:layout_marginLeft="@dimen/bottom_sheet_content_margin"
android:background="@null"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"/>
android:focusableInTouchMode="false"
android:saveEnabled="false" />
</LinearLayout>

View file

@ -11,9 +11,9 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
@ -688,7 +688,7 @@ public class PlanRouteFragment extends BaseOsmAndFragment implements OsmAndLocat
}
});
if (!portrait) {
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) appModesBtn.getLayoutParams();
FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) appModesBtn.getLayoutParams();
params.leftMargin = mapActivity.getResources().getDimensionPixelSize(R.dimen.dashboard_land_width);
appModesBtn.setLayoutParams(params);
}