[go: nahoru, domu]

Skip to content

Commit

Permalink
Added editor layout for tablets (sw600dp)
Browse files Browse the repository at this point in the history
  • Loading branch information
aforcier committed Apr 29, 2015
1 parent 5e59531 commit efcde28
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 3 deletions.
129 changes: 129 additions & 0 deletions WordPressEditor/src/main/res/layout-sw600dp/fragment_editor.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<FrameLayout 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"
tools:context="org.wordpress.android.editor.EditorFragment">

<include
layout="@layout/editor_webview"
android:id="@+id/webview" />

<LinearLayout
android:id="@+id/format_bar"
android:layout_width="fill_parent"
android:layout_height="@dimen/format_bar_height"
android:layout_gravity="bottom"
android:background="@android:color/white"
android:orientation="vertical">

<View
android:id="@+id/format_bar_horizontal_divider"
android:layout_width="fill_parent"
android:layout_height="@dimen/format_bar_horizontal_divider_height"
style="@style/Divider"/>

<LinearLayout
android:id="@+id/format_bar_buttons"
android:layout_width="fill_parent"
android:layout_height="@dimen/format_bar_height"
android:layout_gravity="bottom"
android:gravity="center"
android:orientation="horizontal"
tools:ignore="RtlHardcoded">

<LinearLayout
style="@style/FormatBarTabletGroup"
android:layout_width="wrap_content"
android:layout_height="fill_parent">

<ToggleButton
android:id="@+id/format_bar_button_media"
style="@style/FormatBarButtonTablet"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/format_bar_button_media_selector"/>
</LinearLayout>

<LinearLayout
style="@style/FormatBarTabletGroup"
android:layout_width="wrap_content"
android:layout_height="fill_parent">

<ToggleButton
android:id="@+id/format_bar_button_bold"
style="@style/FormatBarButtonTablet"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/format_bar_button_bold_selector"/>

<ToggleButton
android:id="@+id/format_bar_button_italic"
style="@style/FormatBarButtonTablet"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/format_bar_button_italic_selector"/>

<ToggleButton
android:id="@+id/format_bar_button_strikethrough"
style="@style/FormatBarButtonTablet"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/format_bar_button_strikethrough_selector"/>
</LinearLayout>

<LinearLayout
style="@style/FormatBarTabletGroup"
android:layout_width="wrap_content"
android:layout_height="fill_parent">

<ToggleButton
android:id="@+id/format_bar_button_link"
style="@style/FormatBarButtonTablet"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/format_bar_button_link_selector"/>
</LinearLayout>

<LinearLayout
style="@style/FormatBarTabletGroup"
android:layout_width="wrap_content"
android:layout_height="fill_parent">

<ToggleButton
android:id="@+id/format_bar_button_ul"
style="@style/FormatBarButtonTablet"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/format_bar_button_ul_selector"/>

<ToggleButton
android:id="@+id/format_bar_button_ol"
style="@style/FormatBarButtonTablet"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/format_bar_button_ol_selector"/>

<ToggleButton
android:id="@+id/format_bar_button_quote"
style="@style/FormatBarButtonTablet"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/format_bar_button_quote_selector"/>
</LinearLayout>

<LinearLayout
style="@style/FormatBarTabletGroup"
android:layout_width="wrap_content"
android:layout_height="fill_parent">

<ToggleButton
android:id="@+id/format_bar_button_html"
style="@style/FormatBarButtonTablet"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/format_bar_button_html_selector"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>

</FrameLayout>
4 changes: 1 addition & 3 deletions WordPressEditor/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
<dimen name="format_bar_button_right_margin">4dp</dimen>
<dimen name="format_bar_html_button_left_margin">3dp</dimen>

<dimen name="format_bar_left_margin_tablet">5dp</dimen>
<dimen name="format_bar_right_margin_tablet">9dp</dimen>
<dimen name="format_bar_html_button_left_margin_tablet">9dp</dimen>
<dimen name="format_bar_button_margin_tablet">2dp</dimen>

<dimen name="format_bar_horizontal_divider_height">1dp</dimen>
<dimen name="format_bar_vertical_divider_width">0.6dp</dimen>
Expand Down
10 changes: 10 additions & 0 deletions WordPressEditor/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
<item name="android:textOff">""</item>
</style>

<style name="FormatBarButtonTablet" parent="FormatBarButton">
<item name="android:layout_marginRight">@dimen/format_bar_button_margin_tablet</item>
<item name="android:layout_marginLeft">@dimen/format_bar_button_margin_tablet</item>
</style>

<style name="FormatBarScrollViewButton" parent="FormatBarButton">
<item name="android:layout_marginRight">@dimen/format_bar_button_right_margin</item>
</style>
Expand All @@ -26,4 +31,9 @@
<item name="android:background">@color/wp_gray</item>
<item name="android:alpha">0.5</item>
</style>

<style name="FormatBarTabletGroup">
<item name="android:layout_marginLeft">20dp</item>
<item name="android:layout_marginRight">20dp</item>
</style>
</resources>

0 comments on commit efcde28

Please sign in to comment.