Commit e612faac0e21c0cfa243274419ce4776934ab4e6
1 parent
0d82ce7d
- complete add logic
Showing
5 changed files
with
329 additions
and
57 deletions
app/src/main/java/net/devfac/userstory/Constants.java
... | ... | @@ -43,10 +43,32 @@ public class Constants { |
43 | 43 | public static final String BASE_JAVASCRIPT_FILL_LOGIN_PWD = "javascript:document.getElementById('au_pwd').value='"; //k1626ehs@use';"; |
44 | 44 | public static final String BASE_JAVASCRIPT_FILL_LOGIN_SUBMIT = "javascript:au_submit();"; |
45 | 45 | |
46 | - //HTML Parsing | |
46 | + //HTML Entities | |
47 | 47 | public static final String BOOK_SEARCH_CLASS_BOOK_INFO = "bookInfo"; |
48 | 48 | public static final String BOOK_SEARCH_CLASS_BOOK_IMAGE = "bookImage"; |
49 | 49 | public static final String BOOK_SEARCH_CLASS_BOOK_TITLE = "bookTitle"; |
50 | 50 | public static final String BOOK_SEARCH_CLASS_BOOK_DESC = "bookDesc"; |
51 | 51 | public static final String BOOK_SEARCH_CLASS_BOOK_GENRE = "bookGenre"; |
52 | + | |
53 | + public static final String BOOK_ADD_ID_READ_STATUS = "category"; | |
54 | + public static final String BOOK_ADD_ID_HAVING_STATUS = "category2"; | |
55 | + public static final String BOOK_ADD_ID_RATING = "starsgiven"; | |
56 | + public static final String BOOK_ADD_ID_MEMO = "comment"; | |
57 | + public static final String BOOK_ADD_ID_DATE_START = "startDate"; | |
58 | + public static final String BOOK_ADD_ID_DATE_END = "endDate"; | |
59 | + public static final String BOOK_ADD_ID_DATE_PURCHASED = "purchaseDate"; | |
60 | + public static final String BOOK_ADD_ID_IS_RENTABLE = "is_rentable"; | |
61 | + | |
62 | + //BookInfo | |
63 | + public static final int READING_STATUS_ON_READING = 1; | |
64 | + public static final int READING_STATUS_READ_DONE = 2; | |
65 | + public static final int READING_STATUS_TO_READ = 3; | |
66 | + | |
67 | + public static final int HAVING_STATUS_OWNED = 10; | |
68 | + public static final int HAVING_STATUS_BORROWED = 20; | |
69 | + public static final int HAVING_STATUS_WANT_TO_HAVE = 30; | |
70 | + public static final int HAVING_STATUS_LENT = 40; | |
71 | + | |
72 | + public static final int IS_NOT_RENTABLE = 0; | |
73 | + public static final int IS_RENTABLE = 1; | |
52 | 74 | } | ... | ... |
app/src/main/java/net/devfac/userstory/DialogAddBook.java
... | ... | @@ -2,18 +2,48 @@ package net.devfac.userstory; |
2 | 2 | |
3 | 3 | import android.app.Dialog; |
4 | 4 | import android.content.Context; |
5 | +import android.graphics.Bitmap; | |
6 | +import android.graphics.BitmapFactory; | |
7 | +import android.view.View; | |
5 | 8 | import android.view.WindowManager; |
9 | +import android.widget.Button; | |
10 | +import android.widget.CheckBox; | |
11 | +import android.widget.EditText; | |
12 | +import android.widget.ImageView; | |
13 | +import android.widget.RadioGroup; | |
14 | +import android.widget.RatingBar; | |
6 | 15 | import android.widget.TextView; |
7 | 16 | |
17 | +import net.devfac.userstory.FSM.Action; | |
18 | +import net.devfac.userstory.FSM.StateContext; | |
19 | +import net.devfac.userstory.Utils.Logger; | |
20 | + | |
21 | +import java.io.File; | |
22 | + | |
8 | 23 | /** |
9 | 24 | * Created by Onether on 15. 11. 7.. |
10 | 25 | */ |
11 | -public class DialogAddBook extends Dialog { | |
26 | +public class DialogAddBook extends Dialog implements View.OnClickListener { | |
27 | + private Context mContext; | |
28 | + | |
12 | 29 | private TextView mTextBookAddTitle; |
13 | 30 | private TextView mTextBookAddDetails; |
31 | + private ImageView mImageBookCover; | |
32 | + private Button mBtnAddBook; | |
33 | + private RadioGroup mRadioGroupReadStatus; | |
34 | + private RadioGroup mRadioGroupHavingStatus; | |
35 | + private RatingBar mRatingBar; | |
36 | + private CheckBox mCheckboxIsRentable; | |
37 | + private EditText mEditMemo; | |
38 | + private EditText mEditDateStartRead; | |
39 | + private EditText mEditDateEndRead; | |
40 | + private EditText mEditDatePurchased; | |
41 | + | |
14 | 42 | |
15 | 43 | public DialogAddBook(Context context) { |
16 | 44 | super(context); |
45 | + mContext = context; | |
46 | + | |
17 | 47 | windowDimBehind(); |
18 | 48 | |
19 | 49 | setContentView(R.layout.dialog_add_book); |
... | ... | @@ -27,10 +57,33 @@ public class DialogAddBook extends Dialog { |
27 | 57 | |
28 | 58 | mTextBookAddTitle = (TextView)findViewById(R.id.text_book_add_title); |
29 | 59 | mTextBookAddDetails = (TextView)findViewById(R.id.text_book_add_details); |
60 | + mImageBookCover = (ImageView)findViewById(R.id.image_book_cover); | |
61 | + mRadioGroupReadStatus = (RadioGroup)findViewById(R.id.radio_group_read_status); | |
62 | + mRadioGroupHavingStatus = (RadioGroup)findViewById(R.id.radio_group_having_status); | |
63 | + mRatingBar = (RatingBar)findViewById(R.id.rating_bar); | |
64 | + mCheckboxIsRentable = (CheckBox)findViewById(R.id.checkbox_is_rentable); | |
65 | + mEditMemo = (EditText)findViewById(R.id.edit_memo); | |
66 | + mEditDateStartRead = (EditText)findViewById(R.id.edit_date_start_read); | |
67 | + mEditDateEndRead = (EditText)findViewById(R.id.edit_date_end_read); | |
68 | + mEditDatePurchased = (EditText)findViewById(R.id.edit_date_purchased); | |
69 | + | |
70 | + mBtnAddBook = (Button)findViewById(R.id.btn_add_book); | |
71 | + | |
72 | + mBtnAddBook.setOnClickListener(this); | |
30 | 73 | |
31 | 74 | mTextBookAddTitle.setText(selectedBook.title); |
32 | 75 | String details = selectedBook.desc + "|" + selectedBook.genre.replace(">", ">"); |
33 | 76 | mTextBookAddDetails.setText(details); |
77 | + | |
78 | + if( selectedBook.imageFileName != null && !selectedBook.imageFileName.equals("")){ | |
79 | + File coverFile = new File(Constants.IMAGE_FILE_SAVE_PATH, selectedBook.imageFileName); | |
80 | + if( coverFile.exists() ){ | |
81 | + Bitmap coverBitmap = BitmapFactory.decodeFile(coverFile.getAbsolutePath()); | |
82 | + mImageBookCover.setImageBitmap(coverBitmap); | |
83 | + } | |
84 | + } | |
85 | + | |
86 | + | |
34 | 87 | } |
35 | 88 | |
36 | 89 | private void windowDimBehind(){ |
... | ... | @@ -40,4 +93,85 @@ public class DialogAddBook extends Dialog { |
40 | 93 | getWindow().setAttributes(lpWindow); |
41 | 94 | } |
42 | 95 | |
96 | + @Override | |
97 | + public void onClick(View v) { | |
98 | + switch( v.getId() ){ | |
99 | + case R.id.btn_add_book: | |
100 | + BookInfoToAdd mBookInfoToAdd = new BookInfoToAdd(); | |
101 | + switch( mRadioGroupReadStatus.getCheckedRadioButtonId() ){ | |
102 | + case R.id.radio_reading_status_reading: | |
103 | + mBookInfoToAdd.readingStatus = Constants.READING_STATUS_ON_READING; | |
104 | + break; | |
105 | + case R.id.radio_reading_status_done: | |
106 | + mBookInfoToAdd.readingStatus = Constants.READING_STATUS_READ_DONE; | |
107 | + break; | |
108 | + case R.id.radio_reading_status_to_read: | |
109 | + mBookInfoToAdd.readingStatus = Constants.READING_STATUS_TO_READ; | |
110 | + break; | |
111 | + } | |
112 | + | |
113 | + switch( mRadioGroupHavingStatus.getCheckedRadioButtonId() ){ | |
114 | + case R.id.radio_having_status_owned: | |
115 | + mBookInfoToAdd.havingStatus = Constants.HAVING_STATUS_OWNED; | |
116 | + break; | |
117 | + case R.id.radio_having_status_borrowed: | |
118 | + mBookInfoToAdd.havingStatus = Constants.HAVING_STATUS_BORROWED; | |
119 | + break; | |
120 | + case R.id.radio_having_status_want_to_have: | |
121 | + mBookInfoToAdd.havingStatus = Constants.HAVING_STATUS_WANT_TO_HAVE; | |
122 | + break; | |
123 | + case R.id.radio_having_status_lent: | |
124 | + mBookInfoToAdd.havingStatus = Constants.HAVING_STATUS_LENT; | |
125 | + break; | |
126 | + } | |
127 | + | |
128 | + mBookInfoToAdd.rating = (int)mRatingBar.getRating(); | |
129 | + | |
130 | + mBookInfoToAdd.memo = mEditMemo.getText().toString(); | |
131 | + mBookInfoToAdd.startDate = mEditDateStartRead.getText().toString(); | |
132 | + mBookInfoToAdd.endDate = mEditDateEndRead.getText().toString(); | |
133 | + mBookInfoToAdd.purchasedDate = mEditDatePurchased.getText().toString(); | |
134 | + | |
135 | + if( mCheckboxIsRentable.isChecked() ){ | |
136 | + mBookInfoToAdd.isRentable = Constants.IS_RENTABLE; | |
137 | + } | |
138 | + else{ | |
139 | + mBookInfoToAdd.isRentable = Constants.IS_NOT_RENTABLE; | |
140 | + } | |
141 | + | |
142 | + Logger.i("BOOKINFOTOADD : " + mBookInfoToAdd.toString()); | |
143 | + | |
144 | + StateContext.getInstance(mContext).processEvent(Action.RES_INPUT_INFO_TO_ADD, mBookInfoToAdd); | |
145 | + | |
146 | + dismiss(); | |
147 | + break; | |
148 | + } | |
149 | + | |
150 | + } | |
151 | + | |
152 | + public static class BookInfoToAdd{ | |
153 | + public int readingStatus; | |
154 | + public int havingStatus; | |
155 | + public int rating; | |
156 | + public String memo; | |
157 | + public String startDate; | |
158 | + public String endDate; | |
159 | + public String purchasedDate; | |
160 | + public int isRentable; | |
161 | + | |
162 | + @Override | |
163 | + public String toString() { | |
164 | + return "BookInfoToAdd{" + | |
165 | + "readingStatus=" + readingStatus + | |
166 | + ", havingStatus=" + havingStatus + | |
167 | + ", rating=" + rating + | |
168 | + ", memo='" + memo + '\'' + | |
169 | + ", startDate='" + startDate + '\'' + | |
170 | + ", endDate='" + endDate + '\'' + | |
171 | + ", purchasedDate='" + purchasedDate + '\'' + | |
172 | + ", isRentable=" + isRentable + | |
173 | + '}'; | |
174 | + } | |
175 | + } | |
176 | + | |
43 | 177 | } | ... | ... |
app/src/main/java/net/devfac/userstory/FSM/state/StateInputInfoToAdd.java
1 | 1 | package net.devfac.userstory.FSM.state; |
2 | 2 | |
3 | +import net.devfac.userstory.Constants; | |
4 | +import net.devfac.userstory.DialogAddBook; | |
3 | 5 | import net.devfac.userstory.FSM.Action; |
4 | 6 | import net.devfac.userstory.FSM.State; |
5 | 7 | import net.devfac.userstory.FSM.StateContext; |
... | ... | @@ -43,7 +45,6 @@ public class StateInputInfoToAdd implements State { |
43 | 45 | @Override |
44 | 46 | public void run() { |
45 | 47 | mStateContext.runJavaScript(mStateContext.mWebView, strUrl); |
46 | -// mStateContext.mWebView.loadUrl(strUrl); | |
47 | 48 | } |
48 | 49 | }); |
49 | 50 | |
... | ... | @@ -51,6 +52,87 @@ public class StateInputInfoToAdd implements State { |
51 | 52 | |
52 | 53 | @Override |
53 | 54 | public void onExit(Object output, StateContext.STATE_RESULT stateResult) { |
55 | + final DialogAddBook.BookInfoToAdd mBookInfoToAdd = (DialogAddBook.BookInfoToAdd)output; | |
54 | 56 | |
57 | + ((MainActivity)mStateContext.mContext).runOnUiThread(new Runnable() { | |
58 | + @Override | |
59 | + public void run() { | |
60 | + String scriptUrl = | |
61 | + UrlGenerator.getInstance(mStateContext.mContext) | |
62 | + .getJavascriptSetValueOfId( | |
63 | + Constants.BOOK_ADD_ID_READ_STATUS, | |
64 | + String.valueOf(mBookInfoToAdd.readingStatus)); | |
65 | + | |
66 | + mStateContext.runJavaScript(mStateContext.mWebView, scriptUrl); | |
67 | + | |
68 | + scriptUrl = | |
69 | + UrlGenerator.getInstance(mStateContext.mContext) | |
70 | + .getJavascriptSetValueOfId( | |
71 | + Constants.BOOK_ADD_ID_HAVING_STATUS, | |
72 | + String.valueOf(mBookInfoToAdd.havingStatus)); | |
73 | + | |
74 | + mStateContext.runJavaScript(mStateContext.mWebView, scriptUrl); | |
75 | + | |
76 | + scriptUrl = | |
77 | + UrlGenerator.getInstance(mStateContext.mContext) | |
78 | + .getJavascriptSetValueOfId( | |
79 | + Constants.BOOK_ADD_ID_RATING, | |
80 | + String.valueOf(mBookInfoToAdd.rating)); | |
81 | + | |
82 | + mStateContext.runJavaScript(mStateContext.mWebView, scriptUrl); | |
83 | + | |
84 | + scriptUrl = | |
85 | + UrlGenerator.getInstance(mStateContext.mContext) | |
86 | + .getJavascriptSetValueOfId( | |
87 | + Constants.BOOK_ADD_ID_MEMO, | |
88 | + mBookInfoToAdd.memo); | |
89 | + | |
90 | + mStateContext.runJavaScript(mStateContext.mWebView, scriptUrl); | |
91 | + | |
92 | + scriptUrl = | |
93 | + UrlGenerator.getInstance(mStateContext.mContext) | |
94 | + .getJavascriptSetValueOfId( | |
95 | + Constants.BOOK_ADD_ID_DATE_START, | |
96 | + mBookInfoToAdd.startDate); | |
97 | + | |
98 | + mStateContext.runJavaScript(mStateContext.mWebView, scriptUrl); | |
99 | + | |
100 | + scriptUrl = | |
101 | + UrlGenerator.getInstance(mStateContext.mContext) | |
102 | + .getJavascriptSetValueOfId( | |
103 | + Constants.BOOK_ADD_ID_DATE_END, | |
104 | + mBookInfoToAdd.endDate); | |
105 | + | |
106 | + mStateContext.runJavaScript(mStateContext.mWebView, scriptUrl); | |
107 | + | |
108 | + scriptUrl = | |
109 | + UrlGenerator.getInstance(mStateContext.mContext) | |
110 | + .getJavascriptSetValueOfId( | |
111 | + Constants.BOOK_ADD_ID_DATE_PURCHASED, | |
112 | + mBookInfoToAdd.purchasedDate); | |
113 | + | |
114 | + mStateContext.runJavaScript(mStateContext.mWebView, scriptUrl); | |
115 | + | |
116 | + if(mBookInfoToAdd.isRentable == Constants.IS_RENTABLE ){ | |
117 | + scriptUrl = | |
118 | + UrlGenerator.getInstance(mStateContext.mContext) | |
119 | + .getJavascriptSetCheckbox( | |
120 | + Constants.BOOK_ADD_ID_DATE_PURCHASED, | |
121 | + true); | |
122 | + } | |
123 | + else if(mBookInfoToAdd.isRentable == Constants.IS_NOT_RENTABLE ){ | |
124 | + scriptUrl = | |
125 | + UrlGenerator.getInstance(mStateContext.mContext) | |
126 | + .getJavascriptSetCheckbox( | |
127 | + Constants.BOOK_ADD_ID_DATE_PURCHASED, | |
128 | + false); | |
129 | + } | |
130 | + | |
131 | + mStateContext.runJavaScript(mStateContext.mWebView, scriptUrl); | |
132 | + | |
133 | + scriptUrl = "javascript:book_submit();"; | |
134 | + mStateContext.runJavaScript(mStateContext.mWebView, scriptUrl); | |
135 | + } | |
136 | + }); | |
55 | 137 | } |
56 | 138 | } | ... | ... |
app/src/main/java/net/devfac/userstory/Utils/UrlGenerator.java
... | ... | @@ -73,4 +73,17 @@ public class UrlGenerator { |
73 | 73 | return Constants.BASE_JAVASCRIPT_FILL_LOGIN_SUBMIT; |
74 | 74 | } |
75 | 75 | |
76 | + public String getJavascriptSetValueOfId(String id, String value){ | |
77 | + return "javascript:document.getElementById('" + id + "').value=" + value + ";"; | |
78 | + } | |
79 | + | |
80 | + public String getJavascriptSetCheckbox(String id, boolean checked){ | |
81 | + if( checked){ | |
82 | + return "javascript:document.getElementById('" + id + "').checked=true;"; | |
83 | + } | |
84 | + else{ | |
85 | + return "javascript:document.getElementById('" + id + "').checked=false;"; | |
86 | + } | |
87 | + } | |
88 | + | |
76 | 89 | } | ... | ... |
app/src/main/res/layout/dialog_add_book.xml
... | ... | @@ -31,13 +31,13 @@ |
31 | 31 | android:layout_width="wrap_content" |
32 | 32 | android:layout_height="wrap_content" |
33 | 33 | android:textAppearance="?android:attr/textAppearanceMedium" |
34 | - android:text="글쓰기 달인이 되려면 잘못된 문장부터 고쳐라" | |
34 | + android:text="TITLE" | |
35 | 35 | android:id="@+id/text_book_add_title" /> |
36 | 36 | |
37 | 37 | <TextView |
38 | 38 | android:layout_width="wrap_content" |
39 | 39 | android:layout_height="wrap_content" |
40 | - android:text="박찬영 지음 | 리베르 | 20151031 국내도서>인문학>책읽기/글쓰기>글쓰기" | |
40 | + android:text="Details" | |
41 | 41 | android:id="@+id/text_book_add_details" |
42 | 42 | android:singleLine="false" |
43 | 43 | android:autoText="false" |
... | ... | @@ -56,14 +56,16 @@ |
56 | 56 | <ImageView |
57 | 57 | android:layout_width="wrap_content" |
58 | 58 | android:layout_height="wrap_content" |
59 | - android:id="@+id/imageView2" | |
59 | + android:id="@+id/image_book_cover" | |
60 | 60 | android:layout_gravity="right" /> |
61 | 61 | </LinearLayout> |
62 | 62 | </LinearLayout> |
63 | 63 | |
64 | 64 | <RadioGroup |
65 | 65 | android:layout_width="match_parent" |
66 | - android:layout_height="wrap_content"> | |
66 | + android:layout_height="wrap_content" | |
67 | + android:id="@+id/radio_group_read_status" | |
68 | + android:layout_marginTop="5dp"> | |
67 | 69 | |
68 | 70 | <TextView |
69 | 71 | android:layout_width="wrap_content" |
... | ... | @@ -76,25 +78,29 @@ |
76 | 78 | android:layout_width="wrap_content" |
77 | 79 | android:layout_height="wrap_content" |
78 | 80 | android:text="읽고 있는 책" |
79 | - android:id="@+id/radioButton" /> | |
81 | + android:id="@+id/radio_reading_status_reading" | |
82 | + android:checked="false" /> | |
80 | 83 | |
81 | 84 | <RadioButton |
82 | 85 | android:layout_width="wrap_content" |
83 | 86 | android:layout_height="wrap_content" |
84 | 87 | android:text="읽은 책" |
85 | - android:id="@+id/radioButton2" /> | |
88 | + android:id="@+id/radio_reading_status_done" | |
89 | + android:checked="true" /> | |
86 | 90 | |
87 | 91 | <RadioButton |
88 | 92 | android:layout_width="wrap_content" |
89 | 93 | android:layout_height="wrap_content" |
90 | 94 | android:text="읽을 책" |
91 | - android:id="@+id/radioButton3" /> | |
95 | + android:id="@+id/radio_reading_status_to_read" /> | |
92 | 96 | |
93 | 97 | </RadioGroup> |
94 | 98 | |
95 | 99 | <RadioGroup |
96 | 100 | android:layout_width="match_parent" |
97 | - android:layout_height="wrap_content"> | |
101 | + android:layout_height="wrap_content" | |
102 | + android:id="@+id/radio_group_having_status" | |
103 | + android:layout_marginTop="5dp"> | |
98 | 104 | |
99 | 105 | <TextView |
100 | 106 | android:layout_width="wrap_content" |
... | ... | @@ -107,25 +113,26 @@ |
107 | 113 | android:layout_width="wrap_content" |
108 | 114 | android:layout_height="wrap_content" |
109 | 115 | android:text="가지고 있는 책" |
110 | - android:id="@+id/radioButton4" /> | |
116 | + android:id="@+id/radio_having_status_owned" | |
117 | + android:checked="true" /> | |
111 | 118 | |
112 | 119 | <RadioButton |
113 | 120 | android:layout_width="wrap_content" |
114 | 121 | android:layout_height="wrap_content" |
115 | 122 | android:text="빌린 책" |
116 | - android:id="@+id/radioButton5" /> | |
123 | + android:id="@+id/radio_having_status_borrowed" /> | |
117 | 124 | |
118 | 125 | <RadioButton |
119 | 126 | android:layout_width="wrap_content" |
120 | 127 | android:layout_height="wrap_content" |
121 | 128 | android:text="갖고 싶은 책" |
122 | - android:id="@+id/radioButton6" /> | |
129 | + android:id="@+id/radio_having_status_want_to_have" /> | |
123 | 130 | |
124 | 131 | <RadioButton |
125 | 132 | android:layout_width="wrap_content" |
126 | 133 | android:layout_height="wrap_content" |
127 | 134 | android:text="빌려준 책" |
128 | - android:id="@+id/radioButton7" /> | |
135 | + android:id="@+id/radio_having_status_lent" /> | |
129 | 136 | |
130 | 137 | </RadioGroup> |
131 | 138 | |
... | ... | @@ -133,7 +140,8 @@ |
133 | 140 | android:orientation="horizontal" |
134 | 141 | android:layout_width="match_parent" |
135 | 142 | android:layout_height="wrap_content" |
136 | - android:gravity="center_vertical"> | |
143 | + android:gravity="center_vertical" | |
144 | + android:layout_marginTop="5dp"> | |
137 | 145 | |
138 | 146 | <TextView |
139 | 147 | android:layout_width="wrap_content" |
... | ... | @@ -145,16 +153,17 @@ |
145 | 153 | <RatingBar |
146 | 154 | android:layout_width="wrap_content" |
147 | 155 | android:layout_height="wrap_content" |
148 | - android:id="@+id/ratingBar" | |
156 | + android:id="@+id/rating_bar" | |
149 | 157 | android:numStars="5" |
150 | 158 | style="@style/RatingBar" |
151 | 159 | android:stepSize="1" /> |
152 | 160 | |
153 | - <CheckBox | |
161 | + <TextView | |
154 | 162 | android:layout_width="wrap_content" |
155 | 163 | android:layout_height="wrap_content" |
156 | - android:text="잘 모르겠어요" | |
157 | - android:id="@+id/checkBox" /> | |
164 | + android:textAppearance="?android:attr/textAppearanceSmall" | |
165 | + android:text="잚 모르겠어요" | |
166 | + android:id="@+id/textView" /> | |
158 | 167 | |
159 | 168 | </LinearLayout> |
160 | 169 | |
... | ... | @@ -162,7 +171,8 @@ |
162 | 171 | android:orientation="horizontal" |
163 | 172 | android:layout_width="match_parent" |
164 | 173 | android:layout_height="wrap_content" |
165 | - android:gravity="center_vertical" > | |
174 | + android:gravity="center_vertical" | |
175 | + android:layout_marginTop="5dp"> | |
166 | 176 | |
167 | 177 | <TextView |
168 | 178 | android:layout_width="wrap_content" |
... | ... | @@ -174,13 +184,14 @@ |
174 | 184 | <CheckBox |
175 | 185 | android:layout_width="wrap_content" |
176 | 186 | android:layout_height="wrap_content" |
177 | - android:id="@+id/checkBox2" /> | |
187 | + android:id="@+id/checkbox_is_rentable" /> | |
178 | 188 | </LinearLayout> |
179 | 189 | |
180 | 190 | <LinearLayout |
181 | 191 | android:orientation="vertical" |
182 | 192 | android:layout_width="match_parent" |
183 | - android:layout_height="wrap_content"> | |
193 | + android:layout_height="wrap_content" | |
194 | + android:layout_marginTop="5dp"> | |
184 | 195 | |
185 | 196 | <TextView |
186 | 197 | android:layout_width="wrap_content" |
... | ... | @@ -194,70 +205,79 @@ |
194 | 205 | android:layout_height="wrap_content" |
195 | 206 | android:inputType="textMultiLine" |
196 | 207 | android:ems="10" |
197 | - android:id="@+id/editText" /> | |
208 | + android:id="@+id/edit_memo" /> | |
198 | 209 | </LinearLayout> |
199 | 210 | |
200 | 211 | <LinearLayout |
201 | 212 | android:orientation="horizontal" |
202 | 213 | android:layout_width="match_parent" |
203 | - android:layout_height="wrap_content"> | |
214 | + android:layout_height="wrap_content" | |
215 | + android:weightSum="9" | |
216 | + android:layout_marginTop="5dp"> | |
204 | 217 | |
205 | 218 | <TextView |
206 | - android:layout_width="wrap_content" | |
219 | + android:layout_width="0dp" | |
207 | 220 | android:layout_height="wrap_content" |
208 | 221 | android:textAppearance="?android:attr/textAppearanceSmall" |
209 | 222 | android:text="구입 일자" |
210 | 223 | android:id="@+id/textView9" |
211 | - android:singleLine="false" /> | |
224 | + android:singleLine="false" | |
225 | + android:layout_weight="3" | |
226 | + android:gravity="center_horizontal" /> | |
212 | 227 | |
213 | - <EditText | |
214 | - android:layout_width="wrap_content" | |
228 | + <TextView | |
229 | + android:layout_width="0dp" | |
215 | 230 | android:layout_height="wrap_content" |
216 | - android:inputType="date" | |
217 | - android:ems="10" | |
218 | - android:id="@+id/editText2" | |
219 | - android:layout_weight="1" | |
220 | - android:text="" /> | |
231 | + android:textAppearance="?android:attr/textAppearanceSmall" | |
232 | + android:text="읽기 시작" | |
233 | + android:id="@+id/textView10" | |
234 | + android:singleLine="false" | |
235 | + android:layout_weight="3" | |
236 | + android:gravity="center_horizontal" /> | |
237 | + | |
238 | + <TextView | |
239 | + android:layout_width="0dp" | |
240 | + android:layout_height="wrap_content" | |
241 | + android:textAppearance="?android:attr/textAppearanceSmall" | |
242 | + android:text="읽기 완료" | |
243 | + android:id="@+id/textView11" | |
244 | + android:singleLine="false" | |
245 | + android:layout_weight="3" | |
246 | + android:gravity="center_horizontal" /> | |
221 | 247 | |
222 | 248 | </LinearLayout> |
223 | 249 | |
224 | 250 | <LinearLayout |
225 | 251 | android:orientation="horizontal" |
226 | 252 | android:layout_width="match_parent" |
227 | - android:layout_height="wrap_content" > | |
228 | - | |
229 | - <TextView | |
230 | - android:layout_width="wrap_content" | |
231 | - android:layout_height="wrap_content" | |
232 | - android:textAppearance="?android:attr/textAppearanceSmall" | |
233 | - android:text="읽기 시작" | |
234 | - android:id="@+id/textView10" | |
235 | - android:singleLine="false" /> | |
253 | + android:layout_height="wrap_content" | |
254 | + android:weightSum="9"> | |
236 | 255 | |
237 | 256 | <EditText |
238 | - android:layout_width="wrap_content" | |
257 | + android:layout_width="0dp" | |
239 | 258 | android:layout_height="wrap_content" |
240 | 259 | android:inputType="date" |
241 | 260 | android:ems="10" |
242 | - android:id="@+id/editText3" | |
243 | - android:layout_weight="1" | |
261 | + android:id="@+id/edit_date_purchased" | |
262 | + android:layout_weight="3" | |
244 | 263 | android:text="" /> |
245 | 264 | |
246 | - <TextView | |
247 | - android:layout_width="wrap_content" | |
265 | + <EditText | |
266 | + android:layout_width="0dp" | |
248 | 267 | android:layout_height="wrap_content" |
249 | - android:textAppearance="?android:attr/textAppearanceSmall" | |
250 | - android:text="읽기 완료" | |
251 | - android:id="@+id/textView11" | |
252 | - android:singleLine="false" /> | |
268 | + android:inputType="date" | |
269 | + android:ems="10" | |
270 | + android:id="@+id/edit_date_start_read" | |
271 | + android:layout_weight="3" | |
272 | + android:text="" /> | |
253 | 273 | |
254 | 274 | <EditText |
255 | - android:layout_width="wrap_content" | |
275 | + android:layout_width="0dp" | |
256 | 276 | android:layout_height="wrap_content" |
257 | 277 | android:inputType="date" |
258 | 278 | android:ems="10" |
259 | - android:id="@+id/editText4" | |
260 | - android:layout_weight="1" | |
279 | + android:id="@+id/edit_date_end_read" | |
280 | + android:layout_weight="3" | |
261 | 281 | android:text="" /> |
262 | 282 | </LinearLayout> |
263 | 283 | |
... | ... | @@ -265,8 +285,9 @@ |
265 | 285 | android:layout_width="match_parent" |
266 | 286 | android:layout_height="wrap_content" |
267 | 287 | android:text="내 서재에 추가합니다" |
268 | - android:id="@+id/button" | |
269 | - android:layout_gravity="center_horizontal" /> | |
288 | + android:id="@+id/btn_add_book" | |
289 | + android:layout_gravity="center_horizontal" | |
290 | + android:layout_marginTop="5dp" /> | |
270 | 291 | </LinearLayout> |
271 | 292 | </ScrollView> |
272 | 293 | ... | ... |