[android] layouts refactoring.

This commit is contained in:
Roman Romanov 2017-06-01 11:12:54 +04:00
parent e57bcf9efa
commit 8a6eee94f8
23 changed files with 359 additions and 493 deletions

View file

@ -1,87 +0,0 @@
<?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">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/btn_frame">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_base"
android:layout_gravity="center"
android:src="@drawable/img_permissions"
android:layout_weight="1"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Title"
android:fontFamily="@string/robotoMedium"
android:text="@string/onboarding_permissions_title"
tools:targetApi="jelly_bean"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body1.Secondary"
android:text="@string/onboarding_permissions_message"/>
</LinearLayout>
</LinearLayout>
<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>
</RelativeLayout>

View file

@ -1,87 +0,0 @@
<?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">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/btn_frame">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_base"
android:layout_gravity="center"
android:src="@drawable/img_no_storage_permission"
android:layout_weight="1"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center_vertical"
android:layout_weight="1">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Title"
android:fontFamily="@string/robotoMedium"
android:text="@string/onboarding_storage_permissions_title"
tools:targetApi="jelly_bean"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body1.Secondary"
android:text="@string/onboarding_storage_permissions_message"/>
</LinearLayout>
</LinearLayout>
<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/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>
</RelativeLayout>

View file

@ -1,84 +0,0 @@
<?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">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/btn_frame">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_base"
android:layout_gravity="center"
android:src="@drawable/img_welcome"
android:layout_weight="1"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Title"
android:fontFamily="@string/robotoMedium"
android:text="@string/onboarding_welcome_title"
tools:targetApi="jelly_bean"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body1.Secondary"
android:text="@string/onboarding_welcome_first_subtitle"/>
<TextView
android:id="@+id/tv__terms_and_privacy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body3"
android:linksClickable="true"
tools:text="@string/onboarding_welcome_second_subtitle"/>
</LinearLayout>
</LinearLayout>
<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__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/accept_and_continue"
android:gravity="center_vertical"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:background="?clickableBackground"
tools:targetApi="jelly_bean"/>
</RelativeLayout>
</RelativeLayout>

View file

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="40dp"
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"
tools:src="@drawable/img_welcome"/>
</FrameLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_weight="1">
<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:textAppearance="@style/MwmTextAppearance.Title"
android:fontFamily="@string/robotoMedium"
tools:text="@string/onboarding_welcome_title"
tools:targetApi="jelly_bean"/>
<TextView
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:textAppearance="@style/MwmTextAppearance.Body1.Secondary"
tools:text="@string/onboarding_welcome_first_subtitle"/>
<TextView
android:id="@+id/tv__subtitle2"
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.Body3"
android:linksClickable="true"
tools:text="@string/onboarding_welcome_second_subtitle"/>
</LinearLayout>
</LinearLayout>

View file

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="40dp"
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"
tools:src="@drawable/img_welcome"/>
</FrameLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_weight="1">
<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:textAppearance="@style/MwmTextAppearance.Title"
android:fontFamily="@string/robotoMedium"
tools:text="@string/onboarding_welcome_title"
tools:targetApi="jelly_bean"/>
<TextView
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:textAppearance="@style/MwmTextAppearance.Body1.Secondary"
tools:text="@string/onboarding_welcome_first_subtitle"/>
<TextView
android:id="@+id/tv__subtitle2"
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.Body3"
android:linksClickable="true"
tools:text="@string/onboarding_welcome_second_subtitle"/>
</LinearLayout>
</LinearLayout>

View file

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mapswithme.maps.widget.HeightLimitedFrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="@dimen/info_page_image_size"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center">
<ImageView
android:id="@+id/iv__image"
android:layout_width="@dimen/info_page_image_size"
android:layout_height="@dimen/info_page_image_size"
android:layout_marginBottom="@dimen/margin_base"
android:layout_gravity="center_horizontal"
android:tag="@string/tag_height_limited"
tools:src="@drawable/img_welcome"/>
<TextView
android:id="@+id/tv__title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Title"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:fontFamily="@string/robotoMedium"
tools:text="@string/onboarding_welcome_title"
tools:targetApi="jelly_bean"/>
<TextView
android:id="@+id/tv__subtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body1.Secondary"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
tools:text="@string/onboarding_welcome_first_subtitle"/>
<TextView
android:id="@+id/tv__subtitle2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body3"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:linksClickable="true"
android:visibility="gone"
tools:text="@string/onboarding_welcome_second_subtitle"
tools:visibility="visible"/>
</LinearLayout>
</com.mapswithme.maps.widget.HeightLimitedFrameLayout>

View file

@ -1,14 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
android:layout_height="match_parent">
<View
android:id="@+id/anchor_center"
android:layout_width="1dp"
android:layout_height="1dp"
android:layout_centerInParent="true"/>
<ImageView
android:id="@+id/iv__logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/img_logo"/>
</LinearLayout>
android:src="@drawable/img_logo"
android:layout_above="@id/anchor_center"
android:layout_centerHorizontal="true"/>
<TextView
android:id="@+id/tv__app_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/margin_double_plus"
android:textAppearance="@style/MwmTextAppearance.Title"
android:textAllCaps="true"
android:textColor="?android:textColorSecondary"
android:text="@string/app_name"/>
</RelativeLayout>

View file

@ -4,48 +4,11 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.mapswithme.maps.widget.HeightLimitedFrameLayout
android:orientation="vertical"
<include
layout="@layout/info_page"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/btn_frame">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_base"
android:layout_gravity="center_horizontal"
android:tag="@string/tag_height_limited"
android:src="@drawable/img_permissions"/>
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Title"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:fontFamily="@string/robotoMedium"
android:text="@string/onboarding_permissions_title"
tools:targetApi="jelly_bean"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body1.Secondary"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:text="@string/onboarding_permissions_message"/>
</LinearLayout>
</com.mapswithme.maps.widget.HeightLimitedFrameLayout>
android:layout_above="@+id/btn_frame"/>
<RelativeLayout
android:id="@id/btn_frame"
android:orientation="horizontal"

View file

@ -4,48 +4,11 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.mapswithme.maps.widget.HeightLimitedFrameLayout
android:orientation="vertical"
<include
layout="@layout/info_page"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/btn_frame">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_base"
android:layout_gravity="center_horizontal"
android:tag="@string/tag_height_limited"
android:src="@drawable/img_no_storage_permission"/>
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Title"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:fontFamily="@string/robotoMedium"
android:text="@string/onboarding_storage_permissions_title"
tools:targetApi="jelly_bean"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body1.Secondary"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:text="@string/onboarding_storage_permissions_message"/>
</LinearLayout>
</com.mapswithme.maps.widget.HeightLimitedFrameLayout>
android:layout_above="@+id/btn_frame"/>
<RelativeLayout
android:id="@id/btn_frame"
android:orientation="horizontal"

View file

@ -4,60 +4,11 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.mapswithme.maps.widget.HeightLimitedFrameLayout
android:orientation="vertical"
<include
layout="@layout/info_page"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/btn_frame">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_base"
android:layout_gravity="center_horizontal"
android:tag="@string/tag_height_limited"
android:src="@drawable/img_welcome"/>
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Title"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:fontFamily="@string/robotoMedium"
android:text="@string/onboarding_welcome_title"
tools:targetApi="jelly_bean"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body1.Secondary"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:text="@string/onboarding_welcome_first_subtitle"/>
<TextView
android:id="@+id/tv__terms_and_privacy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body3"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:linksClickable="true"
tools:text="@string/onboarding_welcome_second_subtitle"/>
</LinearLayout>
</com.mapswithme.maps.widget.HeightLimitedFrameLayout>
android:layout_above="@+id/btn_frame"/>
<RelativeLayout
android:id="@id/btn_frame"
android:orientation="horizontal"

View file

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mapswithme.maps.widget.HeightLimitedFrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center">
<ImageView
android:id="@+id/iv__image"
android:layout_width="@dimen/info_page_image_size"
android:layout_height="@dimen/info_page_image_size"
android:layout_marginBottom="@dimen/margin_base"
android:layout_gravity="center_horizontal"
android:tag="@string/tag_height_limited"
tools:src="@drawable/img_welcome"/>
<TextView
android:id="@+id/tv__title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_double"
android:layout_marginRight="@dimen/margin_double"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Title"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:fontFamily="@string/robotoMedium"
tools:text="@string/onboarding_welcome_title"
tools:targetApi="jelly_bean"/>
<TextView
android:id="@+id/tv__subtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_double"
android:layout_marginRight="@dimen/margin_double"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body1.Secondary"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
tools:text="@string/onboarding_welcome_first_subtitle"/>
<TextView
android:id="@+id/tv__subtitle2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_double"
android:layout_marginRight="@dimen/margin_double"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body3"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:linksClickable="true"
android:visibility="gone"
tools:text="@string/onboarding_welcome_second_subtitle"
tools:visibility="visible"/>
</LinearLayout>
</com.mapswithme.maps.widget.HeightLimitedFrameLayout>

View file

@ -6,7 +6,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/margin_double"
android:paddingRight="@dimen/margin_double">
android:paddingRight="@dimen/margin_double"
android:paddingTop="@dimen/permissions_title_note_margin">
<TextView
android:id="@+id/tv__note"
android:layout_width="wrap_content"

View file

@ -7,7 +7,8 @@
android:layout_height="wrap_content"
android:paddingLeft="@dimen/margin_double"
android:paddingRight="@dimen/margin_double"
android:paddingTop="@dimen/permissions_title_top_margin">
android:paddingTop="@dimen/permissions_title_top_margin"
android:paddingBottom="@dimen/permissions_title_bottom_margin">
<TextView
android:id="@+id/tv__title"
android:layout_width="wrap_content"

View file

@ -20,5 +20,8 @@
<dimen name="start_button_width">128dp</dimen>
<dimen name="permissions_title_top_margin">52dp</dimen>
<dimen name="permissions_items_margin">@dimen/margin_base</dimen>
<dimen name="permissions_title_bottom_margin">@dimen/margin_half</dimen>
<dimen name="permissions_title_note_margin">@dimen/margin_half</dimen>
<dimen name="permissions_items_margin">@dimen/margin_half</dimen>
<dimen name="info_page_image_size">200dp</dimen>
</resources>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="info_page_image_size">360dp</dimen>
</resources>

View file

@ -9,4 +9,5 @@
<dimen name="margin_direction_around_center">80dp</dimen>
<dimen name="permissions_details_width">480dp</dimen>
<dimen name="info_page_image_size">360dp</dimen>
</resources>

View file

@ -191,6 +191,9 @@
<dimen name="action_bar_extended_height">72dp</dimen>
<dimen name="permissions_title_top_margin">80dp</dimen>
<dimen name="permissions_items_margin">@dimen/margin_double</dimen>
<dimen name="permissions_title_bottom_margin">@dimen/margin_base</dimen>
<dimen name="permissions_title_note_margin">@dimen/margin_base</dimen>
<dimen name="permissions_items_margin">@dimen/margin_base</dimen>
<dimen name="permissions_details_width">@dimen/match_parent</dimen>
<dimen name="info_page_image_size">240dp</dimen>
</resources>

View file

@ -37,6 +37,7 @@ public class SplashActivity extends AppCompatActivity
private static boolean sFirstStart;
private View mIvLogo;
private View mAppName;
private boolean mPermissionsGranted;
private boolean mNeedStoragePermission;
@ -174,7 +175,7 @@ public class SplashActivity extends AppCompatActivity
if (sFirstStart)
{
PushwooshHelper.nativeProcessFirstLaunch();
UiUtils.hide(mIvLogo);
UiUtils.hide(mIvLogo, mAppName);
return;
}
@ -183,7 +184,7 @@ public class SplashActivity extends AppCompatActivity
{
if (ViralFragment.shouldDisplay())
{
UiUtils.hide(mIvLogo);
UiUtils.hide(mIvLogo, mAppName);
ViralFragment dialog = new ViralFragment();
dialog.onDismiss(new DialogInterface()
{
@ -208,7 +209,7 @@ public class SplashActivity extends AppCompatActivity
}
else
{
UiUtils.hide(mIvLogo);
UiUtils.hide(mIvLogo, mAppName);
}
}
@ -236,6 +237,7 @@ public class SplashActivity extends AppCompatActivity
UiUtils.setupStatusBar(this);
setContentView(R.layout.activity_splash);
mIvLogo = findViewById(R.id.iv__logo);
mAppName = findViewById(R.id.tv__app_name);
}
private void init()

View file

@ -1,89 +0,0 @@
package com.mapswithme.maps.news;
import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import com.mapswithme.maps.BuildConfig;
import com.mapswithme.maps.R;
import com.mapswithme.maps.location.LocationHelper;
import com.mapswithme.util.Counters;
public class FirstStartFragment extends BaseNewsFragment
{
private class Adapter extends BaseNewsFragment.Adapter
{
@Override
int getTitles()
{
return R.array.first_start_titles;
}
@Override
int getSubtitles1()
{
return R.array.first_start_subtitles;
}
@Override
int getSubtitles2()
{
return 0;
}
@Override
int getSwitchTitles()
{
return R.array.first_start_switch_titles;
}
@Override
int getSwitchSubtitles()
{
return R.array.first_start_switch_subtitles;
}
@Override
int getImages()
{
return R.array.first_start_images;
}
}
@Override
BaseNewsFragment.Adapter createAdapter()
{
return new Adapter();
}
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState)
{
LocationHelper.INSTANCE.onEnteredIntoFirstRun();
return super.onCreateDialog(savedInstanceState);
}
public static boolean showOn(@NonNull FragmentActivity activity,
@Nullable NewsDialogListener listener)
{
if (Counters.getFirstInstallVersion() < BuildConfig.VERSION_CODE)
return false;
FragmentManager fm = activity.getSupportFragmentManager();
if (fm.isDestroyed())
return false;
if (Counters.isFirstStartDialogSeen() &&
!recreate(activity, FirstStartFragment.class))
return false;
create(activity, FirstStartFragment.class, listener);
Counters.setFirstStartDialogSeen();
return true;
}
}

View file

@ -11,6 +11,7 @@ import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;
import com.mapswithme.maps.BuildConfig;
@ -18,6 +19,7 @@ import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseMwmDialogFragment;
import com.mapswithme.maps.location.LocationHelper;
import com.mapswithme.util.Counters;
import com.mapswithme.util.UiUtils;
public class WelcomeDialogFragment extends BaseMwmDialogFragment implements View.OnClickListener
{
@ -81,6 +83,8 @@ public class WelcomeDialogFragment extends BaseMwmDialogFragment implements View
public Dialog onCreateDialog(Bundle savedInstanceState)
{
LocationHelper.INSTANCE.onEnteredIntoFirstRun();
if (!LocationHelper.INSTANCE.isActive())
LocationHelper.INSTANCE.start();
Dialog res = super.onCreateDialog(savedInstanceState);
res.requestWindowFeature(Window.FEATURE_NO_TITLE);
@ -89,7 +93,14 @@ public class WelcomeDialogFragment extends BaseMwmDialogFragment implements View
View content = View.inflate(getActivity(), R.layout.fragment_welcome, null);
res.setContentView(content);
content.findViewById(R.id.btn__continue).setOnClickListener(this);
TextView terms = (TextView) content.findViewById(R.id.tv__terms_and_privacy);
ImageView image = (ImageView) content.findViewById(R.id.iv__image);
image.setImageResource(R.drawable.img_welcome);
TextView title = (TextView) content.findViewById(R.id.tv__title);
title.setText(R.string.onboarding_welcome_title);
TextView subtitle = (TextView) content.findViewById(R.id.tv__subtitle1);
subtitle.setText(R.string.onboarding_welcome_first_subtitle);
TextView terms = (TextView) content.findViewById(R.id.tv__subtitle2);
UiUtils.show(terms);
terms.setText(Html.fromHtml(getString(R.string.onboarding_welcome_second_subtitle)));
terms.setMovementMethod(LinkMovementMethod.getInstance());

View file

@ -2,17 +2,22 @@ package com.mapswithme.maps.permissions;
import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.DrawableRes;
import android.support.annotation.IdRes;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseMwmDialogFragment;
import com.mapswithme.util.PermissionsUtils;
@ -92,9 +97,37 @@ abstract class BasePermissionsDialogFragment extends BaseMwmDialogFragment
if (button != null)
button.setOnClickListener(this);
ImageView image = (ImageView) content.findViewById(R.id.iv__image);
if (image != null)
image.setImageResource(getImageRes());
TextView title = (TextView) content.findViewById(R.id.tv__title);
if (title != null)
title.setText(getTitleRes());
TextView subtitle = (TextView) content.findViewById(R.id.tv__subtitle1);
if (subtitle != null)
subtitle.setText(getSubtitleRes());
return res;
}
@DrawableRes
protected int getImageRes()
{
return 0;
}
@StringRes
protected int getTitleRes()
{
return 0;
}
@StringRes
protected int getSubtitleRes()
{
return 0;
}
@LayoutRes
abstract protected int getLayoutRes();

View file

@ -1,10 +1,12 @@
package com.mapswithme.maps.permissions;
import android.os.Bundle;
import android.support.annotation.DrawableRes;
import android.support.annotation.IdRes;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
@ -44,6 +46,27 @@ public class PermissionsDialogFragment extends BasePermissionsDialogFragment
mDetailDialog = (DialogFragment) f;
}
@DrawableRes
@Override
protected int getImageRes()
{
return R.drawable.img_permissions;
}
@StringRes
@Override
protected int getTitleRes()
{
return R.string.onboarding_permissions_title;
}
@StringRes
@Override
protected int getSubtitleRes()
{
return R.string.onboarding_permissions_message;
}
@LayoutRes
@Override
protected int getLayoutRes()

View file

@ -13,6 +13,8 @@ import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;
import com.mapswithme.maps.R;
import com.mapswithme.maps.SplashActivity;
@ -65,6 +67,12 @@ public class StoragePermissionsDialogFragment extends BaseMwmDialogFragment impl
res.setContentView(content);
content.findViewById(R.id.btn__exit).setOnClickListener(this);
content.findViewById(R.id.btn__settings).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);
title.setText(R.string.onboarding_storage_permissions_title);
TextView subtitle = (TextView) content.findViewById(R.id.tv__subtitle1);
subtitle.setText(R.string.onboarding_storage_permissions_message);
return res;
}