Added landscape mode

This commit is contained in:
Dmitry Donskoy 2019-11-08 16:33:29 +03:00 committed by Aleksandr Zatsepin
parent a27b63788c
commit 983237225a
12 changed files with 133 additions and 139 deletions

View file

@ -4,32 +4,44 @@
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:baselineAligned="false">
<FrameLayout
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:padding="40dp"
android:layout_weight="1">
android:padding="@dimen/margin_base_plus">
<ImageView
android:id="@+id/iv__image"
android:layout_width="@dimen/info_page_image_size"
android:layout_height="@dimen/info_page_image_size"
android:layout_gravity="center|right"
android:layout_gravity="center_horizontal"
tools:src="@drawable/img_welcome"/>
</FrameLayout>
<LinearLayout
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:gravity="center_horizontal"
android:layout_margin="@dimen/margin_base_plus"
android:layout_weight="1">
<include
android:id="@+id/button_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
layout="@layout/welcome_buttons_horizontal_container"/>
<LinearLayout
android:id="@+id/text_container"
android:layout_above="@id/button_container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tv__title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/margin_double"
android:layout_marginEnd="@dimen/margin_double"
android:layout_marginBottom="@dimen/margin_base"
android:layout_marginTop="@dimen/margin_half_double_plus"
android:textAppearance="@style/MwmTextAppearance.Title"
android:fontFamily="@string/robotoMedium"
tools:text="@string/onboarding_welcome_title"
@ -38,10 +50,9 @@
android:id="@+id/tv__subtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/margin_double"
android:layout_marginEnd="@dimen/margin_double"
android:layout_marginBottom="@dimen/margin_base"
android:layout_marginTop="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body1.Secondary"
tools:text="@string/onboarding_welcome_first_subtitle"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>

View file

@ -8,28 +8,38 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="40dp"
android:padding="@dimen/margin_base_plus"
android:layout_weight="1">
<ImageView
android:id="@+id/iv__image"
android:layout_width="@dimen/info_page_image_size"
android:layout_height="@dimen/info_page_image_size"
android:layout_gravity="center|right"
android:layout_gravity="center"
tools:src="@drawable/img_welcome"/>
</FrameLayout>
<LinearLayout
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:gravity="center_horizontal"
android:layout_margin="@dimen/margin_base_plus"
android:layout_weight="1">
<include
android:id="@+id/button_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
layout="@layout/welcome_buttons_horizontal_container"/>
<LinearLayout
android:layout_above="@+id/button_container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tv__title"
android:layout_marginTop="@dimen/margin_half_double_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/margin_double"
android:layout_marginEnd="@dimen/margin_double"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Title"
android:fontFamily="@string/robotoMedium"
tools:text="@string/onboarding_welcome_title"
@ -38,10 +48,10 @@
android:id="@+id/tv__subtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/margin_double"
android:layout_marginEnd="@dimen/margin_double"
android:layout_marginBottom="@dimen/margin_base"
android:layout_marginTop="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body1.Secondary"
tools:text="@string/onboarding_welcome_first_subtitle"/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>

View file

@ -1,7 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mapswithme.maps.widget.HeightLimitedFrameLayout
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.mapswithme.maps.widget.HeightLimitedFrameLayout
android:layout_above="@id/btn_frame"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -40,3 +44,13 @@
tools:text="@string/onboarding_welcome_first_subtitle"/>
</LinearLayout>
</com.mapswithme.maps.widget.HeightLimitedFrameLayout>
<include
android:id="@+id/btn_frame"
layout="@layout/welcome_buttons_vertical_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginStart="@dimen/margin_base_plus"
android:layout_marginEnd="@dimen/margin_base_plus"
android:layout_marginBottom="@dimen/margin_base_plus" />
</RelativeLayout>

View file

@ -1,53 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
layout="@layout/info_page"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/btn_frame"/>
<RelativeLayout
android:id="@id/btn_frame"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="@dimen/margin_double_plus"
android:layout_alignParentBottom="true"
android:paddingTop="@dimen/margin_quarter_plus"
android:paddingBottom="@dimen/margin_quarter_plus"
android:paddingRight="@dimen/margin_half"
android:paddingLeft="@dimen/margin_half"
android:background="?accentButtonBackground"
android:gravity="center_vertical">
<TextView
android:id="@+id/btn__learn_more"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingLeft="@dimen/margin_half"
android:paddingRight="@dimen/margin_half"
android:textAppearance="@style/MwmTextAppearance.Button"
android:textColor="?accentButtonTextColor"
android:fontFamily="@string/robotoMedium"
android:text="@string/learn_more"
android:gravity="center_vertical"
android:background="?clickableBackground"
tools:targetApi="jelly_bean"/>
<TextView
android:id="@+id/btn__continue"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingLeft="@dimen/margin_half"
android:paddingRight="@dimen/margin_half"
android:textAppearance="@style/MwmTextAppearance.Button"
android:textColor="?accentButtonTextColor"
android:fontFamily="@string/robotoMedium"
android:text="@string/continue_download"
android:gravity="center_vertical"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:background="?clickableBackground"
tools:targetApi="jelly_bean"/>
</RelativeLayout>
android:layout_height="match_parent"/>
</RelativeLayout>

View file

@ -1,53 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
layout="@layout/info_page"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/btn_frame"/>
<RelativeLayout
android:id="@id/btn_frame"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="@dimen/margin_double_plus"
android:layout_alignParentBottom="true"
android:paddingTop="@dimen/margin_quarter_plus"
android:paddingBottom="@dimen/margin_quarter_plus"
android:paddingRight="@dimen/margin_half"
android:paddingLeft="@dimen/margin_half"
android:background="?accentButtonBackground"
android:gravity="center_vertical">
<TextView
android:id="@+id/btn__exit"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingLeft="@dimen/margin_half"
android:paddingRight="@dimen/margin_half"
android:textAppearance="@style/MwmTextAppearance.Button"
android:textColor="?accentButtonTextColor"
android:fontFamily="@string/robotoMedium"
android:text="@string/button_exit"
android:gravity="center_vertical"
android:background="?clickableBackground"
tools:targetApi="jelly_bean"/>
<TextView
android:id="@+id/btn__settings"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingLeft="@dimen/margin_half"
android:paddingRight="@dimen/margin_half"
android:textAppearance="@style/MwmTextAppearance.Button"
android:textColor="?accentButtonTextColor"
android:fontFamily="@string/robotoMedium"
android:text="@string/settings"
android:gravity="center_vertical"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:background="?clickableBackground"
tools:targetApi="jelly_bean"/>
</RelativeLayout>
android:layout_height="match_parent"/>
</RelativeLayout>

View file

@ -1,28 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
layout="@layout/info_page"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/btn_frame"/>
<RelativeLayout
android:id="@id/btn_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center_vertical"
android:layout_marginEnd="@dimen/margin_base_plus"
android:layout_marginStart="@dimen/margin_base_plus"
android:layout_marginBottom="@dimen/margin_base_plus"
android:orientation="horizontal">
<include
layout="@layout/accept_decline_button_container"
android:layout_marginBottom="@dimen/margin_base_plus"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
android:layout_height="match_parent"/>
</RelativeLayout>

View file

@ -1,7 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mapswithme.maps.widget.HeightLimitedFrameLayout
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.mapswithme.maps.widget.HeightLimitedFrameLayout
android:layout_above="@id/btn_frame"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -44,3 +48,13 @@
tools:text="@string/onboarding_welcome_first_subtitle"/>
</LinearLayout>
</com.mapswithme.maps.widget.HeightLimitedFrameLayout>
<include
android:id="@+id/btn_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginStart="@dimen/margin_base_plus"
android:layout_marginEnd="@dimen/margin_base_plus"
android:layout_marginBottom="@dimen/margin_base_plus"
layout="@layout/welcome_buttons_vertical_container"/>
</RelativeLayout>

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:id="@+id/accept_btn"
style="@style/MwmWidget.Button.Primary"
android:layout_alignParentEnd="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:lines="1"
android:minWidth="@dimen/welcome_btn_min_height"
android:text="@string/accept" />
<TextView
android:id="@+id/decline_btn"
android:layout_toStartOf="@id/accept_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/margin_half"
android:background="?attr/selectableItemBackground"
android:fontFamily="@string/robotoMedium"
android:gravity="center"
android:letterSpacing="0.01"
android:minWidth="@dimen/welcome_btn_min_height"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/text_size_body_3"
android:textStyle="normal"
android:layout_centerVertical="true"
android:lines="1"
tools:text="NOW"
tools:ignore="UnusedAttribute" />
</RelativeLayout>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<include
layout="@layout/accept_decline_button_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_base_plus" />
</RelativeLayout>

View file

@ -281,4 +281,5 @@
<dimen name="subscription_view_pager_height">144dp</dimen>
<dimen name="zero">0dp</dimen>
<dimen name="all_pass_top_offset">62dp</dimen>
<dimen name="welcome_btn_min_height">148dp</dimen>
</resources>

View file

@ -64,7 +64,7 @@ public class PermissionsDialogFragment extends BasePermissionsDialogFragment
@Override
protected int getFirstActionButton()
{
return R.id.btn__learn_more;
return R.id.accept_btn;
}
@Override

View file

@ -66,8 +66,8 @@ public class StoragePermissionsDialogFragment extends BaseMwmDialogFragment impl
View content = View.inflate(getActivity(), R.layout.fragment_storage_permissions, null);
res.setContentView(content);
content.findViewById(R.id.btn__exit).setOnClickListener(this);
content.findViewById(R.id.btn__settings).setOnClickListener(this);
content.findViewById(R.id.accept_btn).setOnClickListener(this);
content.findViewById(R.id.decline_btn).setOnClickListener(this);
ImageView image = (ImageView) content.findViewById(R.id.iv__image);
image.setImageResource(R.drawable.img_no_storage_permission);
TextView title = (TextView) content.findViewById(R.id.tv__title);
@ -83,11 +83,11 @@ public class StoragePermissionsDialogFragment extends BaseMwmDialogFragment impl
{
switch (v.getId())
{
case R.id.btn__exit:
case R.id.decline_btn:
getActivity().finish();
break;
case R.id.btn__settings:
case R.id.accept_btn:
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", getContext().getPackageName(), null);