Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Commit

Permalink
Add separator above OK/Cancel buttons
Browse files Browse the repository at this point in the history
Fixes #60
  • Loading branch information
spacecowboy committed Nov 8, 2015
1 parent c4f5d80 commit 846c5e2
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 16 deletions.
39 changes: 23 additions & 16 deletions library/src/main/res/layout/nnf_fragment_filepicker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
android:layout_height="wrap_content"
android:ellipsize="start"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Widget.ActionBar.Title" />
android:textAppearance="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"/>
</android.support.v7.widget.Toolbar>

<android.support.v7.widget.RecyclerView
Expand All @@ -49,7 +49,7 @@
android:layout_below="@+id/nnf_picker_toolbar"
android:descendantFocusability="afterDescendants"
android:focusable="true"
tools:listitem="@layout/nnf_filepicker_listitem_dir" />
tools:listitem="@layout/nnf_filepicker_listitem_dir"/>

<LinearLayout
android:id="@+id/nnf_button_container"
Expand All @@ -58,21 +58,28 @@
android:layout_alignParentBottom="true"
android:orientation="horizontal">

<Button
android:id="@+id/nnf_button_cancel"
style="?attr/borderlessButtonStyle"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_weight="1"
android:text="@android:string/cancel" />
<Button
android:id="@+id/nnf_button_cancel"
style="?attr/borderlessButtonStyle"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_weight="1"
android:text="@android:string/cancel"/>

<Button
android:id="@+id/nnf_button_ok"
style="?attr/borderlessButtonStyle"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_weight="1"
android:text="@android:string/ok" />
<Button
android:id="@+id/nnf_button_ok"
style="?attr/borderlessButtonStyle"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_weight="1"
android:text="@android:string/ok"/>

</LinearLayout>

<FrameLayout
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_above="@id/nnf_button_container"
android:background="?nnf_separator_color"/>
</RelativeLayout>
3 changes: 3 additions & 0 deletions library/src/main/res/values/attr.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
~ Copyright (c) 2015 Jonas Kalderstam
~
Expand All @@ -19,4 +20,6 @@
<resources>
<!-- Specifies theme to apply to the toolbar -->
<attr name="nnf_toolbarTheme" format="reference"/>
<!-- Color to apply to separator for OK/Cancel buttons -->
<attr name="nnf_separator_color" format="color"/>
</resources>
25 changes: 25 additions & 0 deletions library/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
~ Copyright (c) 2015 Jonas Kalderstam
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU Lesser General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<resources>
<!-- 12% black in LIGHT THEME -->
<color name="nnf_light_separator_color">#1e000000</color>
<!-- 12% white in BLACK THEME -->
<color name="nnf_dark_separator_color">#1effffff</color>
</resources>
4 changes: 4 additions & 0 deletions library/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
~ Copyright (c) 2015 Jonas Kalderstam
~
Expand All @@ -17,9 +18,11 @@
-->

<resources>

<style name="NNF_BaseTheme" parent="Theme.AppCompat.DialogWhenLarge">
<!-- You can override this in your sub theme -->
<item name="nnf_toolbarTheme">@style/ThemeOverlay.AppCompat.ActionBar</item>
<item name="nnf_separator_color">@color/nnf_dark_separator_color</item>

<!-- These are important. Handled by toolbar. -->
<item name="windowActionBar">false</item>
Expand All @@ -29,6 +32,7 @@
<style name="NNF_BaseTheme.Light" parent="Theme.AppCompat.Light.DialogWhenLarge">
<!-- You can override this in your sub theme -->
<item name="nnf_toolbarTheme">@style/ThemeOverlay.AppCompat.ActionBar</item>
<item name="nnf_separator_color">@color/nnf_light_separator_color</item>

<!-- These are important. Handled by toolbar. -->
<item name="windowActionBar">false</item>
Expand Down

0 comments on commit 846c5e2

Please sign in to comment.