Add live_now_dialog_card and related resources; refactor dimens

This commit is contained in:
Alex Sytnyk 2018-06-21 12:44:43 +03:00
parent 298dd25b6f
commit 797366c142
9 changed files with 148 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include layout="@layout/list_item_divider"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/card_bg_color"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/list_item_height"
android:gravity="center_vertical">
<ImageView
android:id="@+id/icon"
android:layout_width="@dimen/list_item_icon_size"
android:layout_height="@dimen/list_item_icon_size"
android:layout_marginEnd="@dimen/list_item_icon_margin_right"
android:layout_marginLeft="@dimen/list_item_icon_margin_left"
android:layout_marginRight="@dimen/list_item_icon_margin_right"
android:layout_marginStart="@dimen/list_item_icon_margin_left"
tools:src="@drawable/ic_launcher_background"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/content_padding_standard"
android:layout_marginRight="@dimen/content_padding_standard"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="?attr/textAppearanceListItem"
android:textStyle="bold"
tools:text="Share location"/>
<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="?attr/textAppearanceListItemSecondary"
tools:text="Live: 1 • All: 36"/>
</LinearLayout>
<ImageView
android:id="@+id/image_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding_small"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="@dimen/image_button_padding"
tools:src="@drawable/ic_overflow_menu_white"
tools:tint="@color/icon_light"/>
</LinearLayout>
<LinearLayout
android:id="@+id/show_on_map_row"
android:layout_width="match_parent"
android:layout_height="@dimen/list_item_height_min"
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:paddingEnd="@dimen/content_padding_standard"
android:paddingLeft="@dimen/list_item_content_margin"
android:paddingRight="@dimen/content_padding_standard"
android:paddingStart="@dimen/list_item_content_margin">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/content_padding_standard"
android:layout_marginRight="@dimen/content_padding_standard"
android:layout_weight="1"
android:text="@string/show_on_map"
android:textAppearance="?attr/textAppearanceListItemSecondary"
android:textColor="?attr/ctrl_active_color"
android:textStyle="bold"/>
<Switch
android:id="@+id/show_on_map_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<View
android:id="@+id/bottom_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="@dimen/card_divider_bottom_margin"
android:layout_marginLeft="@dimen/list_item_content_margin"
android:layout_marginStart="@dimen/list_item_content_margin"
android:background="?attr/card_divider_color"/>
</LinearLayout>
<include
android:id="@+id/bottom_shadow"
layout="@layout/card_bottom_divider"/>
</LinearLayout>

View file

@ -2,6 +2,7 @@
<resources>
<declare-styleable name="AppTheme">
<attr name="card_bg_color" format="reference" />
<attr name="card_divider_color" format="reference" />
<attr name="screen_bg_color" format="reference" />
<attr name="icon_color" format="reference" />
<attr name="ctrl_active_color" format="reference" />

View file

@ -1,17 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="content_padding_small">4dp</dimen>
<dimen name="content_padding_half">8dp</dimen>
<dimen name="content_padding_standard">16dp</dimen>
<dimen name="progress_bar_size_small">32dp</dimen>
<dimen name="dialog_title_text_size">22sp</dimen>
<dimen name="action_bar_height">60dp</dimen>
<dimen name="dialog_padding_vertical">24dp</dimen>
<dimen name="dialog_padding_horizontal">60dp</dimen>
<dimen name="dialog_padding_horizontal_edit">44dp</dimen>
<dimen name="list_item_height_min">48dp</dimen>
<dimen name="dialog_button_height">36dp</dimen>
<dimen name="dialog_button_radius">2dp</dimen>
<dimen name="list_item_height">60dp</dimen>
<dimen name="list_item_height_min">48dp</dimen>
<dimen name="list_item_icon_size">32dp</dimen>
<dimen name="list_item_icon_margin_left">12dp</dimen>
<dimen name="list_item_icon_margin_right">20dp</dimen>
<dimen name="list_item_content_margin">64dp</dimen>
<dimen name="card_divider_bottom_margin">6dp</dimen>
<dimen name="image_button_padding">12dp</dimen>
<!-- Text sizes -->
<dimen name="dialog_title_text_size">22sp</dimen>
<dimen name="title_text_size">18sp</dimen>
<dimen name="descr_text_size">16sp</dimen>
<dimen name="action_bar_height">60dp</dimen>
</resources>
</resources>

View file

@ -1,4 +1,5 @@
<resources>
<string name="show_on_map">Show on map</string>
<string name="app_name">OsmAnd Telegram</string>
<string name="phone_number_title">Phone number</string>
<string name="phone_number_descr">Phone number in the international format</string>

View file

@ -2,8 +2,8 @@
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:windowBackground">@color/card_bg_light</item>
<item name="android:colorBackground">@color/card_bg_light</item>
<item name="android:windowBackground">@color/screen_bg_light</item>
<item name="android:colorBackground">@color/screen_bg_light</item>
<item name="colorControlNormal">@color/primary_text_light</item>
<item name="colorControlActivated">@color/ctrl_active_light</item>
<item name="android:windowLightStatusBar">true</item>
@ -16,6 +16,7 @@
<item name="android:textColorTertiary">@color/description_text_light</item>
<item name="card_bg_color">@color/card_bg_light</item>
<item name="card_divider_color">@color/card_divider_light</item>
<item name="screen_bg_color">@color/screen_bg_light</item>
<item name="icon_color">@color/icon_light</item>
<item name="ctrl_active_color">@color/ctrl_active_light</item>