Skip to content

Commit 81c3f02

Browse files
author
Artem Kholodnyi
committed
Add Save button to demo
1 parent d00f779 commit 81c3f02

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

demo/src/main/java/com/yalantis/starwarsdemo/view/SideFragment.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
import butterknife.Bind;
3737
import butterknife.ButterKnife;
38+
import butterknife.OnClick;
3839

3940
/**
4041
* Created by Artem Kholodnyi on 11/19/15.
@@ -277,4 +278,8 @@ public void onAnimationFinished() {
277278

278279
public abstract String getTagString();
279280

281+
@OnClick(R.id.btn_save)
282+
void onClick() {
283+
doBreak();
284+
}
280285
}

demo/src/main/res/layout/fragment_side.xml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,28 @@
5555

5656
</android.support.design.widget.AppBarLayout>
5757

58-
5958
<android.support.v7.widget.RecyclerView
60-
xmlns:android="http://schemas.android.com/apk/res/android"
6159
android:layout_width="match_parent"
6260
android:layout_height="match_parent"
6361
android:id="@+id/recycler"
6462
style="?attr/viewStyle"
6563
android:paddingLeft="16dp"
6664
android:paddingRight="16dp"
6765
android:paddingTop="16dp"
68-
android:paddingBottom="16dp"
66+
android:paddingBottom="@dimen/save_btn_height"
6967
app:layout_behavior="@string/appbar_scrolling_view_behavior"
7068
/>
7169

70+
<Button
71+
android:id="@+id/btn_save"
72+
android:layout_width="match_parent"
73+
android:layout_height="@dimen/save_btn_height"
74+
android:text="@string/save"
75+
android:layout_gravity="bottom"
76+
android:background="?attr/colorControlNormal"
77+
android:textColor="@android:color/white"
78+
android:textAllCaps="false"
79+
/>
7280

7381
</android.support.design.widget.CoordinatorLayout>
7482

demo/src/main/res/values/dimens.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
<dimen name="activity_horizontal_margin">16dp</dimen>
44
<dimen name="activity_vertical_margin">16dp</dimen>
55
<dimen name="fab_margin">16dp</dimen>
6-
<dimen name="appbar_height">256dp</dimen>
6+
<dimen name="appbar_height">200dp</dimen>
77
<dimen name="photo_toolbar_height">256dp</dimen>
88
<dimen name="text_view_padding">8dp</dimen>
9+
<dimen name="save_btn_height">48dp</dimen>
910
</resources>

demo/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515
<string name="label_homeworld" type="id">Homeworld</string>
1616
<string name="label_birthday" type="id">Birthday</string>
1717
<string name="label_gender" type="id">Gender</string>
18+
<string name="save">Save</string>
1819
</resources>

0 commit comments

Comments
 (0)