teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

レイアウト追記

2019/02/27 13:54

投稿

Aki_1988
Aki_1988

スコア44

title CHANGED
File without changes
body CHANGED
@@ -52,7 +52,7 @@
52
52
  override fun getItemCount() = dataset.size
53
53
  }
54
54
  ```
55
- #### RecyclerView の レイアウト
55
+ #### RecyclerView の レイアウト / fragment_dialog_calender.xml
56
56
  ```xml
57
57
  <?xml version="1.0" encoding="utf-8"?>
58
58
  <androidx.appcompat.widget.LinearLayoutCompat
@@ -174,7 +174,7 @@
174
174
  </androidx.recyclerview.widget.RecyclerView>
175
175
  </androidx.appcompat.widget.LinearLayoutCompat>
176
176
  ```
177
- #### RecyclerView のリストレイアウト
177
+ #### RecyclerView のリストレイアウト / list_item_calender
178
178
  ```xml
179
179
  <?xml version="1.0" encoding="utf-8"?>
180
180
  <androidx.appcompat.widget.LinearLayoutCompat

2

レイアウト追記

2019/02/27 13:54

投稿

Aki_1988
Aki_1988

スコア44

title CHANGED
File without changes
body CHANGED
@@ -172,49 +172,38 @@
172
172
  android:layout_height="wrap_content">
173
173
 
174
174
  </androidx.recyclerview.widget.RecyclerView>
175
+ </androidx.appcompat.widget.LinearLayoutCompat>
176
+ ```
177
+ #### RecyclerView のリストレイアウト
178
+ ```xml
179
+ <?xml version="1.0" encoding="utf-8"?>
180
+ <androidx.appcompat.widget.LinearLayoutCompat
181
+ xmlns:android="http://schemas.android.com/apk/res/android"
182
+ android:orientation="horizontal"
183
+ android:layout_width="wrap_content"
184
+ android:layout_height="wrap_content">
175
185
 
176
- <com.google.android.material.chip.ChipGroup
186
+ <androidx.appcompat.widget.LinearLayoutCompat
177
- android:layout_width="match_parent"
187
+ android:layout_width="0dp"
178
- android:layout_height="wrap_content"
179
- android:layout_marginLeft="16dp"
180
- android:layout_marginTop="8dp"
188
+ android:layout_height="48dp"
181
- android:layout_marginBottom="8dp"
189
+ android:layout_weight="1"
190
+ android:orientation="horizontal"
182
- app:singleSelection="true">
191
+ android:gravity="center">
183
192
 
184
- <!--TODO デザイン変更-->
185
- <com.google.android.material.chip.Chip
193
+ <androidx.appcompat.widget.AppCompatTextView
194
+ android:id="@+id/calender_item_date"
186
- android:layout_width="wrap_content"
195
+ android:layout_width="36dp"
187
- android:layout_height="wrap_content"
196
+ android:layout_height="36dp"
188
- android:checkable="true"
197
+ android:background="@drawable/bg_circle"
189
- app:chipBackgroundColor="@color/colorGS06_White"
198
+ android:backgroundTint="@color/colorGS06_White"
199
+ android:gravity="center"
200
+ android:layout_gravity="center"
190
- app:chipStrokeWidth="1dp"
201
+ android:textSize="14sp"
191
- app:chipStrokeColor="@color/colorGS04_LightGrey"
192
- android:textColor="@color/colorGS03_Grey"
202
+ android:textColor="@color/colorGS01_Black"
193
- android:text="Inbox"/>
203
+ android:text="1"/>
194
204
 
195
- <com.google.android.material.chip.Chip
196
- android:layout_width="wrap_content"
205
+ </androidx.appcompat.widget.LinearLayoutCompat>
197
- android:layout_height="wrap_content"
198
- android:layout_marginLeft="8dp"
199
- android:checkable="true"
200
- app:chipBackgroundColor="@color/colorGS06_White"
201
- app:chipStrokeWidth="1dp"
202
- app:chipStrokeColor="@color/colorGS04_LightGrey"
203
- android:textColor="@color/colorGS03_Grey"
204
- android:text="次にやる"/>
205
206
 
206
- <com.google.android.material.chip.Chip
207
- android:layout_width="wrap_content"
208
- android:layout_height="wrap_content"
209
- android:layout_marginLeft="8dp"
210
- android:checkable="true"
211
- app:chipBackgroundColor="@color/colorGS06_White"
212
- app:chipStrokeWidth="1dp"
213
- app:chipStrokeColor="@color/colorGS04_LightGrey"
214
- android:textColor="@color/colorGS03_Grey"
215
- android:text="いつか"/>
216
-
217
- </com.google.android.material.chip.ChipGroup>
218
207
  </androidx.appcompat.widget.LinearLayoutCompat>
219
208
  ```
220
209
 

1

レイアウト追記

2019/02/27 13:53

投稿

Aki_1988
Aki_1988

スコア44

title CHANGED
File without changes
body CHANGED
@@ -1,14 +1,11 @@
1
- ### 前提・実現したいこと
1
+ ### 実現したいこと
2
- 以下サンプルのような datepicker を独自実装したいと考えています。
2
+ 以下のような datepicker を独自実装したいと考えています。
3
- 赤枠内の日付部分を recyclerView で実装する、を想定しております
3
+ 日付部分を recyclerView で実装。
4
4
 
5
5
  ![イメージ説明](abe3289a1eaa2288181a693d7076af90.png)
6
6
 
7
-
8
7
  ### 発生している問題
9
- dialog 内で recyclerView のデータを表示させることができませんでした
8
+ dialog 内で recyclerView のデータを表示させることができない
10
- 以下サンプルのような状態になりましたが、解決方法がわかりません。
11
- ※ ダイアログ下部の OK / キャンセルはまだ未実装のため、表示されておりません。
12
9
 
13
10
  ![イメージ説明](9d138a3d745414fd8ddea7bf206971d7.png)
14
11
 
@@ -56,8 +53,171 @@
56
53
  }
57
54
  ```
58
55
  #### RecyclerView の レイアウト
59
- 問題なさそうなので省略します。
56
+ ```xml
57
+ <?xml version="1.0" encoding="utf-8"?>
58
+ <androidx.appcompat.widget.LinearLayoutCompat
59
+ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"
60
+ android:orientation="vertical"
61
+ android:layout_width="match_parent"
62
+ android:layout_height="match_parent">
60
63
 
64
+ <androidx.appcompat.widget.LinearLayoutCompat
65
+ android:layout_width="wrap_content"
66
+ android:layout_height="48dp"
67
+ android:layout_marginTop="8dp"
68
+ android:orientation="horizontal"
69
+ android:gravity="center"
70
+ android:layout_gravity="center">
71
+
72
+ <androidx.appcompat.widget.AppCompatImageButton
73
+ android:layout_width="wrap_content"
74
+ android:layout_height="wrap_content"
75
+ android:padding="4dp"
76
+ android:layout_marginRight="32dp"
77
+ android:background="@android:color/transparent"
78
+ android:tint="@color/colorGS01_Black"
79
+ android:src="@drawable/ic_chevron_left_24dp"/>
80
+
81
+ <androidx.appcompat.widget.AppCompatTextView
82
+ android:layout_width="wrap_content"
83
+ android:layout_height="wrap_content"
84
+ android:text="2019年1月"
85
+ android:textSize="16sp"
86
+ android:textColor="@color/colorGS01_Black"/>
87
+
88
+ <androidx.appcompat.widget.AppCompatImageButton
89
+ android:layout_width="wrap_content"
90
+ android:layout_height="wrap_content"
91
+ android:padding="4dp"
92
+ android:layout_marginLeft="32dp"
93
+ android:background="@android:color/transparent"
94
+ android:tint="@color/colorGS01_Black"
95
+ android:src="@drawable/ic_chevron_right_24dp"/>
96
+ </androidx.appcompat.widget.LinearLayoutCompat>
97
+
98
+ <androidx.appcompat.widget.LinearLayoutCompat
99
+ android:layout_width="match_parent"
100
+ android:layout_height="wrap_content"
101
+ android:orientation="horizontal"
102
+ android:layout_gravity="center">
103
+
104
+ <androidx.appcompat.widget.AppCompatTextView
105
+ android:layout_width="0dp"
106
+ android:layout_height="48dp"
107
+ android:layout_weight="1"
108
+ android:gravity="center"
109
+ android:text="月"
110
+ android:textSize="14sp"
111
+ android:textColor="@color/colorGS03_Grey"/>
112
+
113
+ <androidx.appcompat.widget.AppCompatTextView
114
+ android:layout_width="0dp"
115
+ android:layout_height="48dp"
116
+ android:layout_weight="1"
117
+ android:gravity="center"
118
+ android:text="火"
119
+ android:textSize="14sp"
120
+ android:textColor="@color/colorGS03_Grey"/>
121
+
122
+ <androidx.appcompat.widget.AppCompatTextView
123
+ android:layout_width="0dp"
124
+ android:layout_height="48dp"
125
+ android:layout_weight="1"
126
+ android:gravity="center"
127
+ android:text="水"
128
+ android:textSize="14sp"
129
+ android:textColor="@color/colorGS03_Grey"/>
130
+
131
+ <androidx.appcompat.widget.AppCompatTextView
132
+ android:layout_width="0dp"
133
+ android:layout_height="48dp"
134
+ android:layout_weight="1"
135
+ android:gravity="center"
136
+ android:text="木"
137
+ android:textSize="14sp"
138
+ android:textColor="@color/colorGS03_Grey"/>
139
+
140
+ <androidx.appcompat.widget.AppCompatTextView
141
+ android:layout_width="0dp"
142
+ android:layout_height="48dp"
143
+ android:layout_weight="1"
144
+ android:gravity="center"
145
+ android:text="金"
146
+ android:textSize="14sp"
147
+ android:textColor="@color/colorGS03_Grey"/>
148
+
149
+ <androidx.appcompat.widget.AppCompatTextView
150
+ android:layout_width="0dp"
151
+ android:layout_height="48dp"
152
+ android:layout_weight="1"
153
+ android:gravity="center"
154
+ android:text="土"
155
+ android:textSize="14sp"
156
+ android:textColor="@color/colorGS03_Grey"/>
157
+
158
+ <androidx.appcompat.widget.AppCompatTextView
159
+ android:layout_width="0dp"
160
+ android:layout_height="48dp"
161
+ android:layout_weight="1"
162
+ android:gravity="center"
163
+ android:text="日"
164
+ android:textSize="14sp"
165
+ android:textColor="@color/colorGS03_Grey"/>
166
+
167
+ </androidx.appcompat.widget.LinearLayoutCompat>
168
+
169
+ <androidx.recyclerview.widget.RecyclerView
170
+ android:id="@+id/date_list_in_calender"
171
+ android:layout_width="match_parent"
172
+ android:layout_height="wrap_content">
173
+
174
+ </androidx.recyclerview.widget.RecyclerView>
175
+
176
+ <com.google.android.material.chip.ChipGroup
177
+ android:layout_width="match_parent"
178
+ android:layout_height="wrap_content"
179
+ android:layout_marginLeft="16dp"
180
+ android:layout_marginTop="8dp"
181
+ android:layout_marginBottom="8dp"
182
+ app:singleSelection="true">
183
+
184
+ <!--TODO デザイン変更-->
185
+ <com.google.android.material.chip.Chip
186
+ android:layout_width="wrap_content"
187
+ android:layout_height="wrap_content"
188
+ android:checkable="true"
189
+ app:chipBackgroundColor="@color/colorGS06_White"
190
+ app:chipStrokeWidth="1dp"
191
+ app:chipStrokeColor="@color/colorGS04_LightGrey"
192
+ android:textColor="@color/colorGS03_Grey"
193
+ android:text="Inbox"/>
194
+
195
+ <com.google.android.material.chip.Chip
196
+ android:layout_width="wrap_content"
197
+ android:layout_height="wrap_content"
198
+ android:layout_marginLeft="8dp"
199
+ android:checkable="true"
200
+ app:chipBackgroundColor="@color/colorGS06_White"
201
+ app:chipStrokeWidth="1dp"
202
+ app:chipStrokeColor="@color/colorGS04_LightGrey"
203
+ android:textColor="@color/colorGS03_Grey"
204
+ android:text="次にやる"/>
205
+
206
+ <com.google.android.material.chip.Chip
207
+ android:layout_width="wrap_content"
208
+ android:layout_height="wrap_content"
209
+ android:layout_marginLeft="8dp"
210
+ android:checkable="true"
211
+ app:chipBackgroundColor="@color/colorGS06_White"
212
+ app:chipStrokeWidth="1dp"
213
+ app:chipStrokeColor="@color/colorGS04_LightGrey"
214
+ android:textColor="@color/colorGS03_Grey"
215
+ android:text="いつか"/>
216
+
217
+ </com.google.android.material.chip.ChipGroup>
218
+ </androidx.appcompat.widget.LinearLayoutCompat>
219
+ ```
220
+
61
221
  ### 補足
62
222
 
63
223
  プログラミング初心者なので、情報不足や検討違いな箇所があるかと思いますが、どうぞよろしくお願いします。