Commit 0551ca9461c122555fc90aa5a62741d1fd7ab880
1 parent
83e45be0
- fix booksearchresult layout
Showing
5 changed files
with
33 additions
and
11 deletions
app/src/main/java/net/devfac/userstory/FragmentAddBook.java
... | ... | @@ -46,7 +46,8 @@ public class FragmentAddBook extends Fragment implements StateEventListener { |
46 | 46 | mListSearchedResult = (ListView)v.findViewById(R.id.list_searched_result); |
47 | 47 | mEditBookTitleToAdd = (EditText)v.findViewById(R.id.edit_book_title_to_add); |
48 | 48 | |
49 | - mListSearchedResult.setOnItemLongClickListener(new SearchResultLongClickListener()); | |
49 | + mListSearchedResult.setOnItemClickListener(new SearchResultClickListener() ); | |
50 | +// mListSearchedResult.setOnItemLongClickListener(new SearchResultLongClickListener()); | |
50 | 51 | |
51 | 52 | webView = (WebView)v.findViewById(R.id.webView2); |
52 | 53 | |
... | ... | @@ -127,7 +128,6 @@ public class FragmentAddBook extends Fragment implements StateEventListener { |
127 | 128 | |
128 | 129 | } |
129 | 130 | |
130 | - | |
131 | 131 | public static class BookSearchResult{ |
132 | 132 | public String id; |
133 | 133 | public String isbn; |
... | ... | @@ -137,6 +137,19 @@ public class FragmentAddBook extends Fragment implements StateEventListener { |
137 | 137 | public String imageUrl; |
138 | 138 | public String imageFileName; |
139 | 139 | } |
140 | + private class SearchResultClickListener implements AdapterView.OnItemClickListener{ | |
141 | + | |
142 | + @Override | |
143 | + public void onItemClick(AdapterView<?> parent, View view, int position, long id) { | |
144 | + Logger.i("Clicked : " + ((BookSearchResult)parent.getItemAtPosition(position)).title); | |
145 | + StateContext.getInstance(getActivity()).processEvent(Action.REQ_INPUT_INFO_TO_ADD, | |
146 | + parent.getItemAtPosition(position)); | |
147 | + | |
148 | + DialogAddBook mDialogAddBook = new DialogAddBook(getActivity(), (BookSearchResult)parent.getItemAtPosition(position)); | |
149 | + mDialogAddBook.setTitle("책 추가하기"); | |
150 | + mDialogAddBook.show(); | |
151 | + } | |
152 | + } | |
140 | 153 | |
141 | 154 | private class SearchResultLongClickListener implements AdapterView.OnItemLongClickListener{ |
142 | 155 | ... | ... |
app/src/main/java/net/devfac/userstory/FragmentBookShelf.java
... | ... | @@ -70,7 +70,9 @@ public class FragmentBookShelf extends Fragment implements StateEventListener { |
70 | 70 | getActivity().runOnUiThread(new Runnable() { |
71 | 71 | @Override |
72 | 72 | public void run() { |
73 | - mProgressDialog = ProgressDialog.show(getActivity(), "SYNC", "SYNC START"); | |
73 | + mProgressDialog = ProgressDialog.show(getActivity(), | |
74 | + getResources().getString(R.string.bookshlef_sync_dialog_title), | |
75 | + getResources().getString(R.string.bookshlef_sync_dialog_content)); | |
74 | 76 | } |
75 | 77 | }); |
76 | 78 | } | ... | ... |
app/src/main/res/layout/fragment_addbook.xml
app/src/main/res/layout/listview_searched_result_item.xml
... | ... | @@ -9,32 +9,35 @@ |
9 | 9 | android:layout_height="wrap_content" |
10 | 10 | android:id="@+id/image_cover" |
11 | 11 | android:background="#BBBBBB" |
12 | - android:layout_weight="2" | |
13 | - android:layout_gravity="center_vertical" /> | |
12 | + android:layout_weight="1" | |
13 | + android:layout_gravity="center_vertical" | |
14 | + android:layout_margin="5dp" | |
15 | + android:src="@mipmap/ic_launcher" | |
16 | + android:adjustViewBounds="true" /> | |
14 | 17 | |
15 | 18 | <LinearLayout |
16 | 19 | android:orientation="vertical" |
17 | 20 | android:layout_width="0dp" |
18 | 21 | android:layout_height="wrap_content" |
19 | - android:layout_weight="8" | |
20 | - android:layout_gravity="center_vertical"> | |
22 | + android:layout_gravity="center_vertical" | |
23 | + android:layout_weight="9"> | |
21 | 24 | |
22 | 25 | <TextView |
23 | - android:layout_width="match_parent" | |
26 | + android:layout_width="wrap_content" | |
24 | 27 | android:layout_height="wrap_content" |
25 | 28 | android:textAppearance="?android:attr/textAppearanceSmall" |
26 | 29 | android:text="Small Text" |
27 | 30 | android:id="@+id/text_book_title" /> |
28 | 31 | |
29 | 32 | <TextView |
30 | - android:layout_width="match_parent" | |
33 | + android:layout_width="wrap_content" | |
31 | 34 | android:layout_height="wrap_content" |
32 | 35 | android:textAppearance="?android:attr/textAppearanceSmall" |
33 | 36 | android:text="Small Text" |
34 | 37 | android:id="@+id/text_book_desc" /> |
35 | 38 | |
36 | 39 | <TextView |
37 | - android:layout_width="match_parent" | |
40 | + android:layout_width="wrap_content" | |
38 | 41 | android:layout_height="wrap_content" |
39 | 42 | android:textAppearance="?android:attr/textAppearanceSmall" |
40 | 43 | android:text="Small Text" | ... | ... |
app/src/main/res/values/strings.xml
... | ... | @@ -13,4 +13,8 @@ |
13 | 13 | |
14 | 14 | <string name="add_book_search_dialog_title">검색중</string> |
15 | 15 | <string name="add_book_search_dialog_content">추가할 책을 검색중입니다.\n잠시만 기다려주세요...</string> |
16 | + | |
17 | + <string name="bookshlef_sync_dialog_title">가져오는중</string> | |
18 | + <string name="bookshlef_sync_dialog_content">책 목록을 동기화 하는 중입니다.\n잠시만 기다려주세요...</string> | |
19 | + | |
16 | 20 | </resources> | ... | ... |