Showing
110 changed files
with
3560 additions
and
0 deletions
Code/Test/app/src/main/AndroidManifest.xml
0 → 100644
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + package="com.example.test"> | ||
4 | + | ||
5 | + <uses-permission android:name="android.permission.INTERNET" /> | ||
6 | + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
7 | + <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | ||
8 | + <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | ||
9 | + | ||
10 | + <application | ||
11 | + android:allowBackup="true" | ||
12 | + android:icon="@mipmap/ic_clothes" | ||
13 | + android:label="@string/app_name" | ||
14 | + android:roundIcon="@mipmap/ic_clothes_round" | ||
15 | + android:supportsRtl="true" | ||
16 | + android:theme="@style/Theme.Test" | ||
17 | + android:usesCleartextTraffic="true"> | ||
18 | + <activity android:name=".ClothesActivity"></activity> | ||
19 | + <activity android:name=".WeatherActivity" /> | ||
20 | + <activity android:name=".MainActivity"/> | ||
21 | + <activity android:name=".SplashActivity"> | ||
22 | + <intent-filter> | ||
23 | + <action android:name="android.intent.action.MAIN" /> | ||
24 | + <category android:name="android.intent.category.LAUNCHER" /> | ||
25 | + </intent-filter> | ||
26 | + </activity> | ||
27 | + </application> | ||
28 | + | ||
29 | +</manifest> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
Code/Test/app/src/main/assets/10.png
0 → 100644
10.9 KB
Code/Test/app/src/main/assets/11.png
0 → 100644
16.8 KB
Code/Test/app/src/main/assets/20.png
0 → 100644
19.6 KB
Code/Test/app/src/main/assets/21.png
0 → 100644
21.6 KB
Code/Test/app/src/main/assets/30.png
0 → 100644
22.8 KB
Code/Test/app/src/main/assets/40.png
0 → 100644
25.8 KB
Code/Test/app/src/main/assets/50.png
0 → 100644
28.3 KB
Code/Test/app/src/main/assets/51.png
0 → 100644
29.7 KB
Code/Test/app/src/main/assets/60.png
0 → 100644
30.6 KB
Code/Test/app/src/main/assets/61.png
0 → 100644
31.8 KB
Code/Test/app/src/main/assets/70.png
0 → 100644
29.1 KB
Code/Test/app/src/main/assets/71.png
0 → 100644
32.8 KB
Code/Test/app/src/main/assets/80.png
0 → 100644
21.9 KB
Code/Test/app/src/main/assets/81.png
0 → 100644
23 KB
Code/Test/app/src/main/assets/angel.png
0 → 100644
11.6 KB
Code/Test/app/src/main/assets/blank.png
0 → 100644
13.2 KB
Code/Test/app/src/main/assets/clear.png
0 → 100644
8.49 KB
Code/Test/app/src/main/assets/cloudy.png
0 → 100644
8.18 KB
Code/Test/app/src/main/assets/location.png
0 → 100644
3.9 KB
Code/Test/app/src/main/assets/main.png
0 → 100644
21.7 KB
Code/Test/app/src/main/assets/mostcloudy.png
0 → 100644
8.06 KB
Code/Test/app/src/main/assets/partcloudy.png
0 → 100644
8.73 KB
Code/Test/app/src/main/assets/pop.png
0 → 100644
5.93 KB
Code/Test/app/src/main/assets/rain.png
0 → 100644
8.18 KB
Code/Test/app/src/main/assets/snow.png
0 → 100644
8.89 KB
Code/Test/app/src/main/assets/snowrain.png
0 → 100644
8.55 KB
Code/Test/app/src/main/assets/summer.png
0 → 100644
12.6 KB
3.86 KB
31.2 KB
30.8 KB
Code/Test/app/src/main/assets/wClear.png
0 → 100644
11.4 KB
Code/Test/app/src/main/assets/wCloudy.png
0 → 100644
11.4 KB
11.5 KB
14.8 KB
Code/Test/app/src/main/assets/wRain.png
0 → 100644
11.3 KB
Code/Test/app/src/main/assets/wSnow.png
0 → 100644
12.7 KB
Code/Test/app/src/main/assets/wSnowrain.png
0 → 100644
12.6 KB
Code/Test/app/src/main/assets/wind.png
0 → 100644
8.68 KB
46.8 KB
1 | +package com.example.test; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | +import android.graphics.drawable.Drawable; | ||
5 | +import android.view.LayoutInflater; | ||
6 | +import android.view.View; | ||
7 | +import android.view.ViewGroup; | ||
8 | +import android.widget.BaseAdapter; | ||
9 | +import android.widget.ImageView; | ||
10 | +import android.widget.TextView; | ||
11 | + | ||
12 | +import java.util.ArrayList; | ||
13 | + | ||
14 | +public class CheckListAdapter extends BaseAdapter { | ||
15 | + // Adapter에 추가된 데이터를 저장하기 위한 ArrayList | ||
16 | + private ArrayList<CheckListItem> CheckListItemList = new ArrayList<CheckListItem>(); | ||
17 | + | ||
18 | + // ListViewAdapter의 생성자 | ||
19 | + public CheckListAdapter() { | ||
20 | + | ||
21 | + } | ||
22 | + | ||
23 | + // Adapter에 사용되는 데이터의 개수를 리턴. | ||
24 | + @Override | ||
25 | + public int getCount() { | ||
26 | + return CheckListItemList.size(); | ||
27 | + } | ||
28 | + | ||
29 | + // position에 위치한 데이터를 화면에 출력하는데 사용될 View를 리턴. | ||
30 | + @Override | ||
31 | + public View getView(int position, View convertView, ViewGroup parent) { | ||
32 | + final int pos = position; | ||
33 | + final Context context = parent.getContext(); | ||
34 | + | ||
35 | + // "listview_check" Layout을 inflate하여 convertView 참조 획득. | ||
36 | + if (convertView == null) { | ||
37 | + LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); | ||
38 | + convertView = inflater.inflate(R.layout.listview_check, parent, false); | ||
39 | + } | ||
40 | + | ||
41 | + // 화면에 표시될 View(Layout이 inflate된)으로부터 위젯에 대한 참조 획득 | ||
42 | + ImageView icon = (ImageView) convertView.findViewById(R.id.check_icon); | ||
43 | + TextView checklist = (TextView) convertView.findViewById(R.id.input_checklist); | ||
44 | + | ||
45 | + // Data Set(listViewItemList)에서 position에 위치한 데이터 참조 획득 | ||
46 | + CheckListItem checklistItem = CheckListItemList.get(position); | ||
47 | + | ||
48 | + // 아이템 내 각 위젯에 데이터 반영 | ||
49 | + icon.setImageDrawable(checklistItem.getIcon()); | ||
50 | + checklist.setText(checklistItem.getCheckList()); | ||
51 | + | ||
52 | + return convertView; | ||
53 | + } | ||
54 | + | ||
55 | + // 지정한 위치(position)에 있는 데이터와 관계된 아이템(row)의 ID를 리턴. | ||
56 | + @Override | ||
57 | + public long getItemId(int position) { | ||
58 | + return position; | ||
59 | + } | ||
60 | + | ||
61 | + // 지정한 위치(position)에 있는 데이터 리턴 | ||
62 | + @Override | ||
63 | + public Object getItem(int position) { | ||
64 | + return CheckListItemList.get(position) ; | ||
65 | + } | ||
66 | + | ||
67 | + // 아이템 데이터 추가를 위한 함수 | ||
68 | + public void addItem(Drawable icon, String temp) { | ||
69 | + CheckListItem item = new CheckListItem(); | ||
70 | + | ||
71 | + item.setIcon(icon); | ||
72 | + item.setCheckList(temp); | ||
73 | + | ||
74 | + CheckListItemList.add(item); | ||
75 | + } | ||
76 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +package com.example.test; | ||
2 | + | ||
3 | +import android.graphics.drawable.Drawable; | ||
4 | + | ||
5 | +public class CheckListItem { | ||
6 | + private Drawable check; | ||
7 | + private String list; | ||
8 | + | ||
9 | + public void setIcon(Drawable icon) { | ||
10 | + check = icon ; | ||
11 | + } | ||
12 | + | ||
13 | + public void setCheckList(String checklist) { | ||
14 | + list = checklist ; | ||
15 | + } | ||
16 | + | ||
17 | + public Drawable getIcon() { | ||
18 | + return this.check ; | ||
19 | + } | ||
20 | + | ||
21 | + public String getCheckList() { | ||
22 | + return this.list ; | ||
23 | + } | ||
24 | + | ||
25 | +} |
1 | +package com.example.test; | ||
2 | + | ||
3 | +import androidx.appcompat.app.AppCompatActivity; | ||
4 | +import androidx.core.content.ContextCompat; | ||
5 | + | ||
6 | +import android.app.AlertDialog; | ||
7 | +import android.content.DialogInterface; | ||
8 | +import android.content.Intent; | ||
9 | +import android.content.res.AssetManager; | ||
10 | +import android.graphics.Bitmap; | ||
11 | +import android.graphics.BitmapFactory; | ||
12 | +import android.os.Bundle; | ||
13 | +import android.view.View; | ||
14 | +import android.view.ViewGroup; | ||
15 | +import android.widget.Button; | ||
16 | +import android.widget.ImageView; | ||
17 | +import android.widget.ListAdapter; | ||
18 | +import android.widget.ListView; | ||
19 | +import android.widget.TextView; | ||
20 | + | ||
21 | +import java.io.InputStream; | ||
22 | +import java.util.ArrayList; | ||
23 | + | ||
24 | + | ||
25 | +public class ClothesActivity extends AppCompatActivity { | ||
26 | + | ||
27 | + private Button btn_main; | ||
28 | + private Button btn_weather; | ||
29 | + public static String start = ""; | ||
30 | + public static String from = ""; | ||
31 | + TextView Location; | ||
32 | + | ||
33 | + ClothesRecommend mClothes; | ||
34 | + ClothesActivity cThis; | ||
35 | + | ||
36 | + TextView input_Average; | ||
37 | + TextView input_Perceived; | ||
38 | + TextView input_Wind; | ||
39 | + TextView input_Precipiation; | ||
40 | + | ||
41 | + ImageView main_Weather; | ||
42 | + ImageView main_Location; | ||
43 | + ImageView main_Average; | ||
44 | + ImageView main_Perceived; | ||
45 | + ImageView main_Wind; | ||
46 | + ImageView main_Precipitation; | ||
47 | + ImageView today_Cloth; | ||
48 | + ImageView recommend; | ||
49 | + | ||
50 | + Bitmap bitmap_Weather; | ||
51 | + Bitmap bitmap_Location; | ||
52 | + Bitmap bitmap_temperature; | ||
53 | + Bitmap bitmap_Wind; | ||
54 | + Bitmap bitmap_Precipitation; | ||
55 | + Bitmap bitmap_Today; | ||
56 | + Bitmap bitmap_Recommend; | ||
57 | + | ||
58 | + @Override | ||
59 | + protected void onCreate(Bundle savedInstanceState) { | ||
60 | + super.onCreate(savedInstanceState); | ||
61 | + setContentView(R.layout.activity_clothes); | ||
62 | + | ||
63 | + Initialize(); | ||
64 | + } | ||
65 | + | ||
66 | + public void Initialize(){ | ||
67 | + cThis = this; | ||
68 | + Location = (TextView) findViewById(R.id.txt_location); | ||
69 | + | ||
70 | + btn_main = findViewById(R.id.btn_main);//btn_main 아이디 찾기 | ||
71 | + btn_main.setOnClickListener(new View.OnClickListener() { | ||
72 | + @Override | ||
73 | + public void onClick(View v) { | ||
74 | + //버튼 클릭시 WeatherActivity 에서 MainActivity 로 이동 | ||
75 | + Intent intent = new Intent(ClothesActivity.this, MainActivity.class); | ||
76 | + startActivity(intent);// 이동 | ||
77 | + } | ||
78 | + }); | ||
79 | + | ||
80 | + Intent intent = getIntent(); | ||
81 | + String code = intent.getStringExtra("code"); | ||
82 | + String start = intent.getStringExtra("start"); | ||
83 | + String from = intent.getStringExtra("from"); | ||
84 | + String leaf = intent.getStringExtra("leaf"); | ||
85 | + String gender = intent.getStringExtra("gender"); | ||
86 | + | ||
87 | + btn_weather = findViewById(R.id.btn_weather);//btn_weather 아이디 찾기 | ||
88 | + btn_weather.setOnClickListener(new View.OnClickListener() { | ||
89 | + @Override | ||
90 | + public void onClick(View v) { | ||
91 | + //버튼 클릭시 ClothesActivity 에서 WeatherActivity 로 이동 경로 | ||
92 | + Intent intent = new Intent(ClothesActivity.this, WeatherActivity.class); | ||
93 | + intent.putExtra("code", code); //code에 있는 값 이동 | ||
94 | + intent.putExtra("start", start); //start에 있는 값 이동 | ||
95 | + intent.putExtra("from", from); //from에 있는 값 이동 | ||
96 | + intent.putExtra("leaf", leaf); //leaf에 있는 값 이동 | ||
97 | + intent.putExtra("gender", gender); //gender에 있는 값 이동 | ||
98 | + startActivity(intent);// 이동 | ||
99 | + } | ||
100 | + }); | ||
101 | + | ||
102 | + | ||
103 | + Location.setText(leaf); | ||
104 | + mClothes = new ClothesRecommend((ClothesActivity) cThis); | ||
105 | + | ||
106 | + ImgUpload(); | ||
107 | + Recommend(start, from, code, gender); | ||
108 | + } | ||
109 | + | ||
110 | + public void ImgUpload(){ | ||
111 | + main_Location = (ImageView)findViewById(R.id.Img_location); | ||
112 | + | ||
113 | + main_Average = (ImageView)findViewById(R.id.Img_aver); | ||
114 | + main_Perceived = (ImageView)findViewById(R.id.Img_perceived); | ||
115 | + main_Wind = (ImageView)findViewById(R.id.Img_wind); | ||
116 | + main_Precipitation = (ImageView)findViewById(R.id.Img_pop); | ||
117 | + | ||
118 | + today_Cloth = (ImageView)findViewById(R.id.today_cloth); | ||
119 | + | ||
120 | + AssetManager as = getResources().getAssets(); | ||
121 | + InputStream is = null; | ||
122 | + | ||
123 | + try{ | ||
124 | + is = as.open("location.png"); | ||
125 | + bitmap_Location = BitmapFactory.decodeStream(is); | ||
126 | + main_Location.setImageBitmap(bitmap_Location); | ||
127 | + is.close(); | ||
128 | + }catch(Exception e){ | ||
129 | + e.printStackTrace(); | ||
130 | + } | ||
131 | + | ||
132 | + try{ | ||
133 | + is = as.open("temperature.png"); | ||
134 | + bitmap_temperature = BitmapFactory.decodeStream(is); | ||
135 | + main_Average.setImageBitmap(bitmap_temperature); | ||
136 | + main_Perceived.setImageBitmap(bitmap_temperature); | ||
137 | + is.close(); | ||
138 | + }catch(Exception e){ | ||
139 | + e.printStackTrace(); | ||
140 | + } | ||
141 | + | ||
142 | + try{ | ||
143 | + is = as.open("wind.png"); | ||
144 | + bitmap_Wind = BitmapFactory.decodeStream(is); | ||
145 | + main_Wind.setImageBitmap(bitmap_Wind); | ||
146 | + is.close(); | ||
147 | + }catch(Exception e){ | ||
148 | + e.printStackTrace(); | ||
149 | + } | ||
150 | + | ||
151 | + try{ | ||
152 | + is = as.open("pop.png"); | ||
153 | + bitmap_Precipitation = BitmapFactory.decodeStream(is); | ||
154 | + main_Precipitation.setImageBitmap(bitmap_Precipitation); | ||
155 | + is.close(); | ||
156 | + }catch(Exception e){ | ||
157 | + e.printStackTrace(); | ||
158 | + } | ||
159 | + | ||
160 | + try{ | ||
161 | + is = as.open("today_cloth.png"); | ||
162 | + bitmap_Today = BitmapFactory.decodeStream(is); | ||
163 | + today_Cloth.setImageBitmap(bitmap_Today); | ||
164 | + is.close(); | ||
165 | + }catch(Exception e){ | ||
166 | + e.printStackTrace(); | ||
167 | + } | ||
168 | + } | ||
169 | + | ||
170 | + public void Recommend(String start, String from, String code, String gender){ | ||
171 | + ArrayList<ArrayList<String>> gData = new ArrayList<ArrayList<String>>(); | ||
172 | + | ||
173 | + input_Average = (TextView)findViewById(R.id.input_aver); | ||
174 | + input_Perceived = (TextView)findViewById(R.id.input_perceived); | ||
175 | + input_Wind = (TextView)findViewById(R.id.input_wind); | ||
176 | + input_Precipiation = (TextView)findViewById(R.id.input_pop); | ||
177 | + | ||
178 | + // 날씨 정보 Get | ||
179 | + mClothes = new ClothesRecommend((ClothesActivity) cThis); | ||
180 | + gData = mClothes.AccessWeather(code); | ||
181 | + | ||
182 | + try { | ||
183 | + int tmp = 0; | ||
184 | + int tmx = -50; // 가장 높은 온도 | ||
185 | + int tmn = 50; // 가장 낮은 온도 | ||
186 | + int vmx = 0; // 가장 센 풍속 | ||
187 | + int temp = 0; // 평균 온도를 구하기 위한 temp | ||
188 | + int stmp = 0; // 평균 온도를 구하기 위한 sumtmp | ||
189 | + int cnt = 0; // 평균 온도를 구하기 위한 cnt | ||
190 | + int gen = 0; // 성별 | ||
191 | + int pop = 0; // 강수확률 | ||
192 | + int mpop = 0; // 최대 강수확률 | ||
193 | + | ||
194 | + ArrayList<Integer> wNum = new ArrayList<>(); | ||
195 | + | ||
196 | + // gData에 접근 | ||
197 | + for (int i = 0; i < gData.size(); i++) { | ||
198 | + String hour = gData.get(i).get(0); | ||
199 | + System.out.println(start); | ||
200 | + System.out.println(from); | ||
201 | + if (start.compareTo(hour) <= 0 && from.compareTo(hour) >= 0) { | ||
202 | + | ||
203 | + wNum.add(i); | ||
204 | + temp = Integer.parseInt(gData.get(i).get(1)); | ||
205 | + stmp += temp; | ||
206 | + cnt += 1; | ||
207 | + | ||
208 | + tmp = mClothes.Cal_Perceived(gData.get(i).get(1), gData.get(i).get(4)); | ||
209 | + | ||
210 | + // 최고 체감온도 설정 | ||
211 | + if (tmp > tmx) tmx = tmp; | ||
212 | + | ||
213 | + // 최저 체감온도 설정 | ||
214 | + if (tmp < tmn) tmn = tmp; | ||
215 | + | ||
216 | + double velo = Double.parseDouble(gData.get(i).get(4)); | ||
217 | + | ||
218 | + // 최대 풍속 설정 | ||
219 | + if (vmx < (int) velo) | ||
220 | + vmx = (int) velo; | ||
221 | + | ||
222 | + pop = Integer.parseInt(gData.get(i).get(6)); | ||
223 | + if (pop > mpop) { | ||
224 | + mpop = pop; | ||
225 | + } | ||
226 | + } | ||
227 | + } | ||
228 | + | ||
229 | + String main = gData.get(wNum.get(0)).get(5); | ||
230 | + main = GetMainWeather(main); | ||
231 | + | ||
232 | + AssetManager as = getResources().getAssets(); | ||
233 | + InputStream is = null; | ||
234 | + | ||
235 | + main_Weather = (ImageView) findViewById(R.id.main_weather); | ||
236 | + | ||
237 | + try { | ||
238 | + is = as.open(main + ".png"); | ||
239 | + bitmap_Weather = BitmapFactory.decodeStream(is); | ||
240 | + main_Weather.setImageBitmap(bitmap_Weather); | ||
241 | + is.close(); | ||
242 | + } catch (Exception e) { | ||
243 | + e.printStackTrace(); | ||
244 | + } | ||
245 | + | ||
246 | + if (cnt != 0) stmp = (stmp / cnt); | ||
247 | + if (gender.equals("여자")) gen = 1; | ||
248 | + int gap = tmx - tmn; | ||
249 | + | ||
250 | + ArrayList<Integer> perceived = new ArrayList<Integer>(); | ||
251 | + perceived.add(mClothes.Cal_Perceived(String.valueOf(stmp),String.valueOf(vmx))); | ||
252 | + perceived.add(gen); | ||
253 | + | ||
254 | + ArrayList<ArrayList<String>> clothes = new ArrayList<ArrayList<String>>(); | ||
255 | + clothes = mClothes.Recommend(perceived); | ||
256 | + | ||
257 | + ArrayList<String> wCode = clothes.get(0); | ||
258 | + ArrayList<String> Top = clothes.get(1); | ||
259 | + ArrayList<String> Bottom = clothes.get(2); | ||
260 | + | ||
261 | + // 옷 이미지 정보 불러오기 | ||
262 | + String mCode = wCode.get(0); | ||
263 | + recommend = (ImageView)findViewById(R.id.recommend); | ||
264 | + | ||
265 | + try{ | ||
266 | + is = as.open(mCode + ".png"); | ||
267 | + bitmap_Recommend = BitmapFactory.decodeStream(is); | ||
268 | + recommend.setImageBitmap(bitmap_Recommend); | ||
269 | + is.close(); | ||
270 | + } catch(Exception e){ | ||
271 | + e.printStackTrace(); | ||
272 | + } | ||
273 | + | ||
274 | + input_Average.setText(String.valueOf(stmp) + "°C"); | ||
275 | + input_Perceived.setText(String.valueOf(tmn) + "°C ~ " + String.valueOf(tmx) + "°C"); | ||
276 | + input_Wind.setText(String.valueOf(vmx) + "m/s"); | ||
277 | + input_Precipiation.setText(String.valueOf(mpop) + "%"); | ||
278 | + | ||
279 | + int rain; | ||
280 | + if (mpop < 60) { | ||
281 | + rain = 0; | ||
282 | + } else { | ||
283 | + rain = 1; | ||
284 | + } | ||
285 | + | ||
286 | + GetCheckList(MergeList(Top),MergeList(Bottom), gap, vmx, rain); | ||
287 | + } catch(Exception e){ | ||
288 | + AlertDialog.Builder dlg = new AlertDialog.Builder(ClothesActivity.this); | ||
289 | + dlg.setMessage("선택한 시간대에 맞는 날씨를 불러올 수 없어 \n현재 날씨로 대체합니다."); // 메시지 | ||
290 | + dlg.setPositiveButton("확인",new DialogInterface.OnClickListener(){ | ||
291 | + public void onClick(DialogInterface dialog, int which) { | ||
292 | + } | ||
293 | + }); | ||
294 | + dlg.show(); | ||
295 | + | ||
296 | + ArrayList<String> Now = new ArrayList<>(); | ||
297 | + Now = gData.get(0); | ||
298 | + | ||
299 | + String main = Now.get(5); | ||
300 | + main = GetMainWeather(main); | ||
301 | + | ||
302 | + AssetManager as = getResources().getAssets(); | ||
303 | + InputStream is = null; | ||
304 | + | ||
305 | + main_Weather = (ImageView) findViewById(R.id.main_weather); | ||
306 | + | ||
307 | + try { | ||
308 | + is = as.open(main + ".png"); | ||
309 | + bitmap_Weather = BitmapFactory.decodeStream(is); | ||
310 | + main_Weather.setImageBitmap(bitmap_Weather); | ||
311 | + is.close(); | ||
312 | + } catch (Exception E) { | ||
313 | + E.printStackTrace(); | ||
314 | + } | ||
315 | + | ||
316 | + int temp = mClothes.Cal_Perceived(Now.get(1), Now.get(4)); | ||
317 | + | ||
318 | + input_Average.setText(Now.get(1) + "°C"); | ||
319 | + input_Perceived.setText(String.valueOf(temp) + "°C"); | ||
320 | + input_Wind.setText(Now.get(4) + "m/s"); | ||
321 | + input_Precipiation.setText(Now.get(6) + "%"); | ||
322 | + | ||
323 | + int rain; | ||
324 | + if (Integer.parseInt(Now.get(6)) < 60) { | ||
325 | + rain = 0; | ||
326 | + } else { | ||
327 | + rain = 1; | ||
328 | + } | ||
329 | + | ||
330 | + int gen = 0; | ||
331 | + if (gender.equals("여자")) | ||
332 | + gen = 1; | ||
333 | + | ||
334 | + ArrayList<Integer> perceived = new ArrayList<Integer>(); | ||
335 | + perceived.add(temp); | ||
336 | + perceived.add(gen); | ||
337 | + | ||
338 | + ArrayList<ArrayList<String>> clothes = new ArrayList<ArrayList<String>>(); | ||
339 | + clothes = mClothes.Recommend(perceived); | ||
340 | + | ||
341 | + ArrayList<String> wCode = clothes.get(0); | ||
342 | + ArrayList<String> Top = clothes.get(1); | ||
343 | + ArrayList<String> Bottom = clothes.get(2); | ||
344 | + | ||
345 | + // 옷 이미지 정보 불러오기 | ||
346 | + String mCode = wCode.get(0); | ||
347 | + recommend = (ImageView)findViewById(R.id.recommend); | ||
348 | + | ||
349 | + try{ | ||
350 | + is = as.open(mCode + ".png"); | ||
351 | + bitmap_Recommend = BitmapFactory.decodeStream(is); | ||
352 | + recommend.setImageBitmap(bitmap_Recommend); | ||
353 | + is.close(); | ||
354 | + } catch(Exception E){ | ||
355 | + E.printStackTrace(); | ||
356 | + } | ||
357 | + | ||
358 | + GetCheckList(MergeList(Top),MergeList(Bottom), 0, Integer.parseInt(Now.get(4)), rain); | ||
359 | + } | ||
360 | + | ||
361 | + } | ||
362 | + | ||
363 | + public String MergeList(ArrayList<String> list){ | ||
364 | + String result = list.get(0); | ||
365 | + | ||
366 | + for (int i = 1; i < list.size(); i++){ | ||
367 | + result = result + ", " + list.get(i); | ||
368 | + } | ||
369 | + | ||
370 | + return result; | ||
371 | + } | ||
372 | + | ||
373 | + public String GetMainWeather(String main){ | ||
374 | + if (main.equals("Clear")) { | ||
375 | + main = "wClear"; | ||
376 | + } else if (main.equals("Partly Cloudy")) { | ||
377 | + main = "wPartcloudy"; | ||
378 | + } else if (main.equals("Mostly Cloudy")) { | ||
379 | + main = "wMostcloudy"; | ||
380 | + } else if (main.equals("Cloudy")) { | ||
381 | + main = "wCloudy"; | ||
382 | + } else if (main.equals("Rain")) { | ||
383 | + main = "wRain"; | ||
384 | + } else if (main.equals("Snow/Rain")) { | ||
385 | + main = "wSnowrain"; | ||
386 | + } else if (main.equals("Snow")) { | ||
387 | + main = "wSnow"; | ||
388 | + } | ||
389 | + | ||
390 | + return main; | ||
391 | + } | ||
392 | + | ||
393 | + public void GetCheckList(String top, String bottom, int gap, int velo, int rain){ | ||
394 | + ListView listview ; | ||
395 | + CheckListAdapter adapter; | ||
396 | + | ||
397 | + // Adapter 생성 | ||
398 | + adapter = new CheckListAdapter() ; | ||
399 | + | ||
400 | + // 리스트뷰 참조 및 Adapter달기 | ||
401 | + listview = (ListView) findViewById(R.id.checklist); | ||
402 | + listview.setAdapter(adapter); | ||
403 | + | ||
404 | + adapter.addItem(ContextCompat.getDrawable(this, R.drawable.check), "상의는 " + top + "을 추천해요!"); | ||
405 | + adapter.addItem(ContextCompat.getDrawable(this, R.drawable.check), "하의는 " + bottom + "을 추천해요!"); | ||
406 | + | ||
407 | + // 일교차 경고 | ||
408 | + if (gap >= 10) { | ||
409 | + adapter.addItem(ContextCompat.getDrawable(this, R.drawable.check), "일교차가 크니 옷차림에 주의하세요."); | ||
410 | + } | ||
411 | + | ||
412 | + // 풍속에 따른 옷 추천 | ||
413 | + if (velo < 4) { | ||
414 | + adapter.addItem(ContextCompat.getDrawable(this, R.drawable.check), "바람이 많이 불지 않아요~"); | ||
415 | + } else if (velo >= 4 && velo < 9) { | ||
416 | + adapter.addItem(ContextCompat.getDrawable(this, R.drawable.check), "바람이 조금 부니 긴팔이나 가디건을 챙겨주세요."); | ||
417 | + } else if (velo >= 9 && velo < 14) { | ||
418 | + adapter.addItem(ContextCompat.getDrawable(this, R.drawable.check), "바람이 강하니 바람막이나 겉옷을 챙겨주세요."); | ||
419 | + } else { | ||
420 | + adapter.addItem(ContextCompat.getDrawable(this, R.drawable.check), "아주 강한 바람이므로 외출을 자제해주세요."); | ||
421 | + } | ||
422 | + | ||
423 | + // 강수 확률에 따른 옷 추천 | ||
424 | + if (rain == 0){ | ||
425 | + adapter.addItem(ContextCompat.getDrawable(this, R.drawable.check), "오늘은 비소식이 없네요!"); | ||
426 | + } else if (rain == 1){ | ||
427 | + adapter.addItem(ContextCompat.getDrawable(this, R.drawable.check), "오늘 비소식이 있으니 우산이나 우비를 챙기세요!!"); | ||
428 | + } | ||
429 | + | ||
430 | + setListViewHeightBasedOnChildren(listview); | ||
431 | + } | ||
432 | + | ||
433 | + // 리스트뷰 전체 목록 보이는 함수 | ||
434 | + public static void setListViewHeightBasedOnChildren(ListView listView) { | ||
435 | + ListAdapter listAdapter = listView.getAdapter(); | ||
436 | + if (listAdapter == null) { | ||
437 | + // pre-condition | ||
438 | + return; | ||
439 | + } | ||
440 | + | ||
441 | + int totalHeight = 0; | ||
442 | + int desiredWidth = View.MeasureSpec.makeMeasureSpec(listView.getWidth(), View.MeasureSpec.AT_MOST); | ||
443 | + | ||
444 | + for (int i = 0; i < listAdapter.getCount(); i++) { | ||
445 | + View listItem = listAdapter.getView(i, null, listView); | ||
446 | + listItem.measure(desiredWidth, View.MeasureSpec.UNSPECIFIED); | ||
447 | + totalHeight += listItem.getMeasuredHeight(); | ||
448 | + } | ||
449 | + | ||
450 | + ViewGroup.LayoutParams params = listView.getLayoutParams(); | ||
451 | + params.height = totalHeight + (listView.getDividerHeight() * (listAdapter.getCount() - 1)); | ||
452 | + listView.setLayoutParams(params); | ||
453 | + listView.requestLayout(); | ||
454 | + } | ||
455 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +package com.example.test; | ||
2 | + | ||
3 | +import android.os.StrictMode; | ||
4 | + | ||
5 | +import java.util.ArrayList; | ||
6 | + | ||
7 | +public class ClothesRecommend extends Thread { | ||
8 | + | ||
9 | + ClothesActivity cContext; | ||
10 | + WeatherActivity wContext; | ||
11 | + WeatherForCast mWeather; | ||
12 | + | ||
13 | + public ClothesRecommend(ClothesActivity mContext) { | ||
14 | + this.cContext = cContext; | ||
15 | + } | ||
16 | + | ||
17 | + public int Cal_Perceived(String Temper, String Velo) { | ||
18 | + | ||
19 | + int perceived; | ||
20 | + double temper = Double.parseDouble(Temper); | ||
21 | + double velo = Double.parseDouble(Velo); | ||
22 | + perceived = (int) (13.12 + 0.6215 * temper - 11.37 * Math.pow(velo, 0.16) + 0.3965 * Math.pow(velo, 0.16) * temper); | ||
23 | + | ||
24 | + return perceived; | ||
25 | + } | ||
26 | + | ||
27 | + // 체감온도에 따른 옷추천 (Recommend는 [체감온도, 성별]으로 이루어진 배열) | ||
28 | + public ArrayList<ArrayList<String>> Recommend(ArrayList<Integer> Recommend){ | ||
29 | + int perceived = Recommend.get(0); | ||
30 | + int gender = Recommend.get(1); | ||
31 | + | ||
32 | + ArrayList<String> code = new ArrayList<String>(); | ||
33 | + ArrayList<String> top = new ArrayList<String>(); | ||
34 | + ArrayList<String> bottom = new ArrayList<String>(); | ||
35 | + ArrayList<ArrayList<String>> clothes = new ArrayList<ArrayList<String>>(); | ||
36 | + | ||
37 | + if (perceived >= 28){ | ||
38 | + top.add("민소매"); | ||
39 | + top.add("반팔"); | ||
40 | + bottom.add("반바지"); | ||
41 | + if (gender == 1){ | ||
42 | + bottom.add("치마"); | ||
43 | + top.add("원피스"); | ||
44 | + code.add("11"); | ||
45 | + } else { code.add("10"); } | ||
46 | + } else if (perceived >= 23) { | ||
47 | + top.add("반팔"); | ||
48 | + top.add("얇은 셔츠"); | ||
49 | + top.add("긴팔"); | ||
50 | + bottom.add("반바지"); | ||
51 | + bottom.add("면바지"); | ||
52 | + if (gender == 1){ | ||
53 | + bottom.add("치마"); | ||
54 | + code.add("21"); | ||
55 | + } else { code.add("20"); } | ||
56 | + } else if (perceived >= 20) { | ||
57 | + top.add("긴팔"); | ||
58 | + top.add("가디건"); | ||
59 | + bottom.add("면바지"); | ||
60 | + bottom.add("슬랙스"); | ||
61 | + bottom.add("스키니"); | ||
62 | + code.add("30"); | ||
63 | + } else if (perceived >= 17) { | ||
64 | + top.add("가디건"); | ||
65 | + top.add("후드티"); | ||
66 | + top.add("맨투맨"); | ||
67 | + bottom.add("청바지"); | ||
68 | + bottom.add("면바지"); | ||
69 | + code.add("40"); | ||
70 | + } else if (perceived >= 12) { | ||
71 | + top.add("후드티"); | ||
72 | + top.add("셔츠"); | ||
73 | + top.add("가디건"); | ||
74 | + bottom.add("긴바지"); | ||
75 | + bottom.add("청바지"); | ||
76 | + if (gender == 1){ | ||
77 | + bottom.add("살색스타킹"); | ||
78 | + code.add("51"); | ||
79 | + } else { code.add("50"); } | ||
80 | + } else if (perceived >= 10) { | ||
81 | + top.add("자켓"); | ||
82 | + top.add("니트"); | ||
83 | + top.add("트렌치코트"); | ||
84 | + bottom.add("긴바지"); | ||
85 | + if (gender == 1){ | ||
86 | + bottom.add("검정스타킹"); | ||
87 | + code.add("61"); | ||
88 | + } else { code.add("60"); } | ||
89 | + } else if (perceived >= 4) { | ||
90 | + top.add("코트"); | ||
91 | + top.add("자켓"); | ||
92 | + top.add("히트텍"); | ||
93 | + bottom.add("긴바지"); | ||
94 | + if (gender == 1){ | ||
95 | + bottom.add("레깅스"); | ||
96 | + code.add("71"); | ||
97 | + } else { code.add("70"); } | ||
98 | + } else { | ||
99 | + top.add("패딩"); | ||
100 | + top.add("두꺼운 코트"); | ||
101 | + bottom.add("긴바지"); | ||
102 | + if (gender == 1) { | ||
103 | + bottom.add("레깅스"); | ||
104 | + code.add("81"); | ||
105 | + } else { code.add("80"); } | ||
106 | + } | ||
107 | + | ||
108 | + clothes.add(code); | ||
109 | + clothes.add(top); | ||
110 | + clothes.add(bottom); | ||
111 | + | ||
112 | + // Return [[이미지 코드], [상의], [하의]] | ||
113 | + return clothes; | ||
114 | + } | ||
115 | + | ||
116 | + public ArrayList<ArrayList<String>> AccessWeather(String code){ | ||
117 | + ArrayList<ArrayList<String>> gData = new ArrayList<ArrayList<String>>(); | ||
118 | + mWeather = new WeatherForCast(code, (WeatherActivity) wContext); | ||
119 | + gData = mWeather.GetOpenWeather(code); | ||
120 | + | ||
121 | + return gData; | ||
122 | + } | ||
123 | + | ||
124 | + @Override | ||
125 | + public void run() { | ||
126 | + super.run(); | ||
127 | + if (android.os.Build.VERSION.SDK_INT > 9) { | ||
128 | + StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); | ||
129 | + StrictMode.setThreadPolicy(policy); | ||
130 | + } | ||
131 | + } | ||
132 | +} |
1 | +package com.example.test; | ||
2 | + | ||
3 | +import android.content.ContentValues; | ||
4 | +import android.os.StrictMode; | ||
5 | + | ||
6 | +import java.io.BufferedReader; | ||
7 | +import java.io.IOException; | ||
8 | +import java.io.InputStream; | ||
9 | +import java.io.InputStreamReader; | ||
10 | +import java.net.MalformedURLException; | ||
11 | +import java.net.URL; | ||
12 | +import java.net.URLConnection; | ||
13 | +import java.util.ArrayList; | ||
14 | +import java.util.LinkedList; | ||
15 | +import java.util.List; | ||
16 | +import java.util.regex.Matcher; | ||
17 | +import java.util.regex.Pattern; | ||
18 | + | ||
19 | +import org.json.simple.JSONArray; | ||
20 | +import org.json.simple.JSONObject; | ||
21 | +import org.json.simple.parser.JSONParser; | ||
22 | +import org.json.simple.parser.ParseException; | ||
23 | + | ||
24 | + | ||
25 | +public class GetAreaCode extends Thread { | ||
26 | + | ||
27 | + MainActivity mContext; | ||
28 | + | ||
29 | + public GetAreaCode(MainActivity mContext) | ||
30 | + { | ||
31 | + this.mContext = mContext; | ||
32 | + } | ||
33 | + | ||
34 | + // 시 리스트 받아오는 함수 | ||
35 | + public LinkedList GetTopCode(){ | ||
36 | + | ||
37 | + if (android.os.Build.VERSION.SDK_INT > 9) { | ||
38 | + StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); | ||
39 | + StrictMode.setThreadPolicy(policy); | ||
40 | + } | ||
41 | + | ||
42 | + String result; | ||
43 | + | ||
44 | + URL url = null; | ||
45 | + | ||
46 | + URLConnection conn; | ||
47 | + | ||
48 | + JSONParser parser; | ||
49 | + JSONArray jArr; | ||
50 | + JSONObject jobj; | ||
51 | + | ||
52 | + //시 검색 | ||
53 | + try { | ||
54 | + url = new URL("http://www.kma.go.kr/DFSROOT/POINT/DATA/top.json.txt"); | ||
55 | + conn = url.openConnection(); | ||
56 | + } catch (MalformedURLException e) { | ||
57 | + e.printStackTrace(); | ||
58 | + } catch (IOException e) { | ||
59 | + e.printStackTrace(); | ||
60 | + } | ||
61 | + | ||
62 | + LinkedList mArea = new LinkedList(); | ||
63 | + | ||
64 | + try { | ||
65 | + InputStreamReader isr = new InputStreamReader(url.openStream(), "UTF-8"); | ||
66 | + BufferedReader br = new BufferedReader(isr); | ||
67 | + | ||
68 | + result = br.readLine().toString(); | ||
69 | + br.close(); | ||
70 | + | ||
71 | + parser = new JSONParser(); | ||
72 | + jArr = (JSONArray) parser.parse(result); | ||
73 | + | ||
74 | + for (int i = 0; i < jArr.size(); i++) { | ||
75 | + jobj = (JSONObject) jArr.get(i); | ||
76 | + mArea.add(jobj.get("value")); | ||
77 | + } | ||
78 | + | ||
79 | + } catch (IOException | ParseException e) { | ||
80 | + e.printStackTrace(); | ||
81 | + } | ||
82 | + | ||
83 | + return mArea; | ||
84 | + } | ||
85 | + | ||
86 | + // 시 코드 받아와서 구 검색하는 함수 | ||
87 | + public LinkedList GetMdlCode(String Top){ | ||
88 | + if (android.os.Build.VERSION.SDK_INT > 9) { | ||
89 | + StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); | ||
90 | + StrictMode.setThreadPolicy(policy); | ||
91 | + } | ||
92 | + | ||
93 | + String result; | ||
94 | + String areaMdl = "종로구"; | ||
95 | + String code = ""; //지역 코드 | ||
96 | + | ||
97 | + URL url = null; | ||
98 | + | ||
99 | + URLConnection conn; | ||
100 | + | ||
101 | + JSONParser parser; | ||
102 | + JSONArray jArr; | ||
103 | + JSONObject jobj; | ||
104 | + | ||
105 | + //시 검색 | ||
106 | + try { | ||
107 | + url = new URL("http://www.kma.go.kr/DFSROOT/POINT/DATA/mdl."+Top+".json.txt"); | ||
108 | + conn = url.openConnection(); | ||
109 | + } catch (MalformedURLException e) { | ||
110 | + e.printStackTrace(); | ||
111 | + } catch (IOException e) { | ||
112 | + e.printStackTrace(); | ||
113 | + } | ||
114 | + | ||
115 | + LinkedList mArea = new LinkedList(); | ||
116 | + | ||
117 | + try { | ||
118 | + InputStreamReader isr = new InputStreamReader(url.openStream(), "UTF-8"); | ||
119 | + BufferedReader br = new BufferedReader(isr); | ||
120 | + | ||
121 | + result = br.readLine().toString(); | ||
122 | + br.close(); | ||
123 | + | ||
124 | + parser = new JSONParser(); | ||
125 | + jArr = (JSONArray) parser.parse(result); | ||
126 | + | ||
127 | + for (int i = 0; i < jArr.size(); i++) { | ||
128 | + jobj = (JSONObject) jArr.get(i); | ||
129 | + | ||
130 | + mArea.add(jobj.get("value")); | ||
131 | + | ||
132 | + if (jobj.get("value").equals(areaMdl)) { | ||
133 | + code = (String) jobj.get("code"); | ||
134 | + } | ||
135 | + } | ||
136 | + } catch (IOException | ParseException e) { | ||
137 | + e.printStackTrace(); | ||
138 | + } | ||
139 | + | ||
140 | + return mArea; | ||
141 | + } | ||
142 | + | ||
143 | + // 구 코드 받아와서 동 검색 함수 | ||
144 | + public LinkedList GetLeafCode(String Mdl){ | ||
145 | + if (android.os.Build.VERSION.SDK_INT > 9) { | ||
146 | + StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); | ||
147 | + StrictMode.setThreadPolicy(policy); | ||
148 | + } | ||
149 | + | ||
150 | + String result; | ||
151 | + String areaLeaf = "종로1가동"; | ||
152 | + String code = ""; | ||
153 | + | ||
154 | + URL url = null; | ||
155 | + URLConnection conn; | ||
156 | + | ||
157 | + JSONParser parser; | ||
158 | + JSONArray jArr; | ||
159 | + JSONObject jobj; | ||
160 | + | ||
161 | + //시 검색 | ||
162 | + try { | ||
163 | + url = new URL("http://www.kma.go.kr/DFSROOT/POINT/DATA/leaf."+Mdl+".json.txt"); | ||
164 | + conn = url.openConnection(); | ||
165 | + } catch (MalformedURLException e) { | ||
166 | + e.printStackTrace(); | ||
167 | + } catch (IOException e) { | ||
168 | + e.printStackTrace(); | ||
169 | + } | ||
170 | + | ||
171 | + LinkedList mArea = new LinkedList(); | ||
172 | + | ||
173 | + try { | ||
174 | + InputStreamReader isr = new InputStreamReader(url.openStream(), "UTF-8"); | ||
175 | + BufferedReader br = new BufferedReader(isr); | ||
176 | + | ||
177 | + result = br.readLine().toString(); | ||
178 | + br.close(); | ||
179 | + | ||
180 | + parser = new JSONParser(); | ||
181 | + jArr = (JSONArray) parser.parse(result); | ||
182 | + | ||
183 | + for (int i = 0; i < jArr.size(); i++) { | ||
184 | + jobj = (JSONObject) jArr.get(i); | ||
185 | + | ||
186 | + mArea.add(jobj.get("value")); | ||
187 | + | ||
188 | + if (jobj.get("value").equals(areaLeaf)) { | ||
189 | + code = (String) jobj.get("code"); | ||
190 | + } | ||
191 | + } | ||
192 | + } catch (IOException | ParseException e) { | ||
193 | + e.printStackTrace(); | ||
194 | + } | ||
195 | + | ||
196 | + return mArea; | ||
197 | + } | ||
198 | + | ||
199 | + // 시 코드 검색하는 함수 | ||
200 | + public String SearchTop(Object areaTop) { | ||
201 | + //areaTop은 시 이름!!! (코드가 아님) | ||
202 | + if (android.os.Build.VERSION.SDK_INT > 9) { | ||
203 | + StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); | ||
204 | + StrictMode.setThreadPolicy(policy); | ||
205 | + } | ||
206 | + | ||
207 | + String result; | ||
208 | + String code = ""; //지역 코드 | ||
209 | + | ||
210 | + URL url = null; | ||
211 | + URLConnection conn; | ||
212 | + | ||
213 | + JSONParser parser; | ||
214 | + JSONArray jArr; | ||
215 | + JSONObject jobj; | ||
216 | + | ||
217 | + //시 검색 | ||
218 | + try { | ||
219 | + url = new URL("http://www.kma.go.kr/DFSROOT/POINT/DATA/top.json.txt"); | ||
220 | + | ||
221 | + conn = url.openConnection(); | ||
222 | + | ||
223 | + } catch (MalformedURLException e) { | ||
224 | + e.printStackTrace(); | ||
225 | + } catch (IOException e) { | ||
226 | + e.printStackTrace(); | ||
227 | + } | ||
228 | + | ||
229 | + try { | ||
230 | + InputStreamReader isr = new InputStreamReader(url.openStream(), "UTF-8"); | ||
231 | + BufferedReader br = new BufferedReader(isr); | ||
232 | + | ||
233 | + result = br.readLine().toString(); | ||
234 | + br.close(); | ||
235 | + | ||
236 | + parser = new JSONParser(); | ||
237 | + jArr = (JSONArray) parser.parse(result); | ||
238 | + | ||
239 | + for (int i = 0; i < jArr.size(); i++) { | ||
240 | + jobj = (JSONObject) jArr.get(i); | ||
241 | + | ||
242 | + if (jobj.get("value").equals(areaTop)) { | ||
243 | + code = (String) jobj.get("code"); | ||
244 | + break; | ||
245 | + } | ||
246 | + } | ||
247 | + | ||
248 | + } catch (IOException | ParseException e) { | ||
249 | + e.printStackTrace(); | ||
250 | + } | ||
251 | + | ||
252 | + return code; | ||
253 | + } | ||
254 | + | ||
255 | + // 구 코드 검색하는 함수 | ||
256 | + public String SearchMdl(Object areaMdl, Object Top) { | ||
257 | + // areaMdl은 구 이름!! 코드가 아님 | ||
258 | + if (android.os.Build.VERSION.SDK_INT > 9) { | ||
259 | + StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); | ||
260 | + StrictMode.setThreadPolicy(policy); | ||
261 | + } | ||
262 | + | ||
263 | + String result; | ||
264 | + String code = ""; //지역 코드 | ||
265 | + | ||
266 | + URL url = null; | ||
267 | + URLConnection conn; | ||
268 | + | ||
269 | + JSONParser parser; | ||
270 | + JSONArray jArr; | ||
271 | + JSONObject jobj; | ||
272 | + | ||
273 | + //시 검색 | ||
274 | + try { | ||
275 | + url = new URL("http://www.kma.go.kr/DFSROOT/POINT/DATA/mdl."+Top+".json.txt"); | ||
276 | + conn = url.openConnection(); | ||
277 | + } catch (MalformedURLException e) { | ||
278 | + e.printStackTrace(); | ||
279 | + } catch (IOException e) { | ||
280 | + e.printStackTrace(); | ||
281 | + } | ||
282 | + | ||
283 | + try { | ||
284 | + InputStreamReader isr = new InputStreamReader(url.openStream(), "UTF-8"); | ||
285 | + BufferedReader br = new BufferedReader(isr); | ||
286 | + | ||
287 | + result = br.readLine().toString(); | ||
288 | + br.close(); | ||
289 | + | ||
290 | + parser = new JSONParser(); | ||
291 | + jArr = (JSONArray) parser.parse(result); | ||
292 | + | ||
293 | + for (int i = 0; i < jArr.size(); i++) { | ||
294 | + jobj = (JSONObject) jArr.get(i); | ||
295 | + | ||
296 | + if (jobj.get("value").equals(areaMdl)) { | ||
297 | + code = (String) jobj.get("code"); | ||
298 | + break; | ||
299 | + } | ||
300 | + } | ||
301 | + | ||
302 | + } catch (IOException | ParseException e) { | ||
303 | + e.printStackTrace(); | ||
304 | + } | ||
305 | + | ||
306 | + return code; | ||
307 | + } | ||
308 | + | ||
309 | + | ||
310 | + // 동 검색하는 함수 | ||
311 | + public String SearchLeaf(Object areaLeaf, Object Mdl) { | ||
312 | + if (android.os.Build.VERSION.SDK_INT > 9) { | ||
313 | + StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); | ||
314 | + StrictMode.setThreadPolicy(policy); | ||
315 | + } | ||
316 | + | ||
317 | + String result; | ||
318 | + String code = ""; //지역 코드 | ||
319 | + | ||
320 | + URL url = null; | ||
321 | + URLConnection conn; | ||
322 | + | ||
323 | + JSONParser parser; | ||
324 | + JSONArray jArr; | ||
325 | + JSONObject jobj; | ||
326 | + | ||
327 | + //시 검색 | ||
328 | + try { | ||
329 | + url = new URL("http://www.kma.go.kr/DFSROOT/POINT/DATA/leaf."+Mdl+".json.txt"); | ||
330 | + conn = url.openConnection(); | ||
331 | + } catch (MalformedURLException e) { | ||
332 | + e.printStackTrace(); | ||
333 | + } catch (IOException e) { | ||
334 | + e.printStackTrace(); | ||
335 | + } | ||
336 | + | ||
337 | + try { | ||
338 | + InputStreamReader isr = new InputStreamReader(url.openStream(), "UTF-8"); | ||
339 | + BufferedReader br = new BufferedReader(isr); | ||
340 | + | ||
341 | + result = br.readLine().toString(); | ||
342 | + br.close(); | ||
343 | + | ||
344 | + parser = new JSONParser(); | ||
345 | + jArr = (JSONArray) parser.parse(result); | ||
346 | + | ||
347 | + for (int i = 0; i < jArr.size(); i++) { | ||
348 | + jobj = (JSONObject) jArr.get(i); | ||
349 | + | ||
350 | + if (jobj.get("value").equals(areaLeaf)) { | ||
351 | + code = (String) jobj.get("code"); | ||
352 | + break; | ||
353 | + } | ||
354 | + } | ||
355 | + | ||
356 | + } catch (IOException | ParseException e) { | ||
357 | + e.printStackTrace(); | ||
358 | + } | ||
359 | + | ||
360 | + return code; | ||
361 | + } | ||
362 | + | ||
363 | + | ||
364 | + @Override | ||
365 | + public void run() { | ||
366 | + super.run(); | ||
367 | + if (android.os.Build.VERSION.SDK_INT > 9) { | ||
368 | + StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); | ||
369 | + StrictMode.setThreadPolicy(policy); | ||
370 | + } | ||
371 | + } | ||
372 | +} |
1 | +package com.example.test; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | +import android.graphics.drawable.Drawable; | ||
5 | +import android.view.LayoutInflater; | ||
6 | +import android.view.View; | ||
7 | +import android.view.ViewGroup; | ||
8 | +import android.widget.BaseAdapter; | ||
9 | +import android.widget.ImageView; | ||
10 | +import android.widget.TextView; | ||
11 | + | ||
12 | +import java.util.ArrayList; | ||
13 | + | ||
14 | +public class ListViewAdapter extends BaseAdapter { | ||
15 | + // Adapter에 추가된 데이터를 저장하기 위한 ArrayList | ||
16 | + private ArrayList<ListViewItem> listViewItemList = new ArrayList<ListViewItem>(); | ||
17 | + | ||
18 | + // ListViewAdapter의 생성자 | ||
19 | + public ListViewAdapter() { | ||
20 | + | ||
21 | + } | ||
22 | + | ||
23 | + // Adapter에 사용되는 데이터의 개수를 리턴. | ||
24 | + @Override | ||
25 | + public int getCount() { | ||
26 | + return listViewItemList.size(); | ||
27 | + } | ||
28 | + | ||
29 | + // position에 위치한 데이터를 화면에 출력하는데 사용될 View를 리턴. | ||
30 | + @Override | ||
31 | + public View getView(int position, View convertView, ViewGroup parent) { | ||
32 | + final int pos = position; | ||
33 | + final Context context = parent.getContext(); | ||
34 | + | ||
35 | + // "listview_item" Layout을 inflate하여 convertView 참조 획득. | ||
36 | + if (convertView == null) { | ||
37 | + LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); | ||
38 | + convertView = inflater.inflate(R.layout.listview_item, parent, false); | ||
39 | + } | ||
40 | + | ||
41 | + // 화면에 표시될 View(Layout이 inflate된)으로부터 위젯에 대한 참조 획득 | ||
42 | + TextView time = (TextView) convertView.findViewById(R.id.input_time); | ||
43 | + ImageView weather = (ImageView) convertView.findViewById(R.id.input_weather); | ||
44 | + TextView temperature = (TextView) convertView.findViewById(R.id.input_temperature); | ||
45 | + TextView wind = (TextView) convertView.findViewById(R.id.input_wind); | ||
46 | + TextView pop = (TextView) convertView.findViewById(R.id.input_precipitation); | ||
47 | + | ||
48 | + // Data Set(listViewItemList)에서 position에 위치한 데이터 참조 획득 | ||
49 | + ListViewItem listViewItem = listViewItemList.get(position); | ||
50 | + | ||
51 | + // 아이템 내 각 위젯에 데이터 반영 | ||
52 | + time.setText(listViewItem.getTime()); | ||
53 | + weather.setImageDrawable(listViewItem.getWeather()); | ||
54 | + temperature.setText(listViewItem.getTemperature()); | ||
55 | + wind.setText(listViewItem.getWind()); | ||
56 | + pop.setText(listViewItem.getPrecipitation()); | ||
57 | + | ||
58 | + return convertView; | ||
59 | + } | ||
60 | + | ||
61 | + // 지정한 위치(position)에 있는 데이터와 관계된 아이템(row)의 ID를 리턴. | ||
62 | + @Override | ||
63 | + public long getItemId(int position) { | ||
64 | + return position; | ||
65 | + } | ||
66 | + | ||
67 | + // 지정한 위치(position)에 있는 데이터 리턴 | ||
68 | + @Override | ||
69 | + public Object getItem(int position) { | ||
70 | + return listViewItemList.get(position) ; | ||
71 | + } | ||
72 | + | ||
73 | + // 아이템 데이터 추가를 위한 함수 | ||
74 | + public void addItem(String time, Drawable weather, String temp, String wind, String pop) { | ||
75 | + ListViewItem item = new ListViewItem(); | ||
76 | + | ||
77 | + item.setTime(time); | ||
78 | + item.setWeather(weather); | ||
79 | + item.setTemperature(temp); | ||
80 | + item.setWind(wind); | ||
81 | + item.setPrecipitation(pop); | ||
82 | + | ||
83 | + listViewItemList.add(item); | ||
84 | + } | ||
85 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +package com.example.test; | ||
2 | + | ||
3 | +import android.graphics.drawable.Drawable; | ||
4 | + | ||
5 | +public class ListViewItem { | ||
6 | + private Drawable weather; | ||
7 | + private String time; | ||
8 | + private String temperature; | ||
9 | + private String wind; | ||
10 | + private String precipitation; | ||
11 | + | ||
12 | + public void setWeather(Drawable icon) { | ||
13 | + weather = icon ; | ||
14 | + } | ||
15 | + | ||
16 | + public void setTime(String mtime) { | ||
17 | + time = mtime ; | ||
18 | + } | ||
19 | + | ||
20 | + public void setTemperature(String temp) { | ||
21 | + temperature = temp ; | ||
22 | + } | ||
23 | + | ||
24 | + public void setWind(String mwind) { | ||
25 | + wind = mwind ; | ||
26 | + } | ||
27 | + | ||
28 | + public void setPrecipitation(String prec) { | ||
29 | + precipitation = prec ; | ||
30 | + } | ||
31 | + | ||
32 | + public Drawable getWeather() { | ||
33 | + return this.weather ; | ||
34 | + } | ||
35 | + | ||
36 | + public String getTime() { | ||
37 | + return this.time ; | ||
38 | + } | ||
39 | + | ||
40 | + public String getTemperature() { | ||
41 | + return this.temperature ; | ||
42 | + } | ||
43 | + | ||
44 | + public String getWind() { | ||
45 | + return this.wind; | ||
46 | + } | ||
47 | + | ||
48 | + public String getPrecipitation() { | ||
49 | + return this.precipitation; | ||
50 | + } | ||
51 | + | ||
52 | + | ||
53 | + | ||
54 | + | ||
55 | + | ||
56 | +} |
1 | +package com.example.test; | ||
2 | + | ||
3 | +import androidx.appcompat.app.AlertDialog; | ||
4 | +import androidx.appcompat.app.AppCompatActivity; | ||
5 | + | ||
6 | +import android.content.DialogInterface; | ||
7 | +import android.content.Intent; | ||
8 | +import android.content.res.AssetManager; | ||
9 | +import android.graphics.Bitmap; | ||
10 | +import android.graphics.BitmapFactory; | ||
11 | +import android.location.Address; | ||
12 | +import android.location.Geocoder; | ||
13 | +import android.location.LocationManager; | ||
14 | +import android.os.Bundle; | ||
15 | +import android.os.Handler; | ||
16 | +import android.os.Message; | ||
17 | +import android.util.Log; | ||
18 | +import android.view.View; | ||
19 | +import android.widget.AdapterView; | ||
20 | +import android.widget.ArrayAdapter; | ||
21 | +import android.widget.Button; | ||
22 | +import android.widget.DatePicker; | ||
23 | +import android.widget.ImageView; | ||
24 | +import android.widget.RadioButton; | ||
25 | +import android.widget.RadioGroup; | ||
26 | +import android.widget.Spinner; | ||
27 | +import android.widget.TextView; | ||
28 | +import android.widget.Toast; | ||
29 | + | ||
30 | +import java.io.InputStream; | ||
31 | +import java.util.ArrayList; | ||
32 | + | ||
33 | +import java.io.IOException; | ||
34 | +import java.util.Calendar; | ||
35 | +import java.util.LinkedList; | ||
36 | +import java.util.List; | ||
37 | +import java.util.Locale; | ||
38 | + | ||
39 | +public class MainActivity extends AppCompatActivity { | ||
40 | + | ||
41 | + public static String start = ""; | ||
42 | + public static String from = ""; | ||
43 | + | ||
44 | + private Spinner spinner; | ||
45 | + ArrayList<String> arrayArea; | ||
46 | + ArrayAdapter<String> arrayAdapter; | ||
47 | + | ||
48 | + MainActivity mThis; | ||
49 | + GetAreaCode mArea; | ||
50 | + | ||
51 | + Button btn_clothes; | ||
52 | + | ||
53 | + String code; | ||
54 | + private static final int GPS_ENABLE_REQUEST_CODE = 2000; | ||
55 | + | ||
56 | + // 날짜 받아오는 함수 초기화 | ||
57 | + Spinner sMonth; | ||
58 | + Spinner sDay; | ||
59 | + Spinner sHour; | ||
60 | + Spinner fMonth; | ||
61 | + Spinner fDay; | ||
62 | + Spinner fHour; | ||
63 | + ArrayAdapter<String> ArrayAdapter2; | ||
64 | + ArrayAdapter<String> ArrayAdapter3; | ||
65 | + ArrayAdapter<String> ArrayAdapter4; | ||
66 | + | ||
67 | + ImageView Angel; | ||
68 | + Bitmap bitmap_angel; | ||
69 | + | ||
70 | + | ||
71 | + @Override | ||
72 | + protected void onCreate(Bundle savedInstanceState) | ||
73 | + { | ||
74 | + super.onCreate(savedInstanceState); | ||
75 | + setContentView(R.layout.activity_main); | ||
76 | + | ||
77 | + Initialize(); | ||
78 | + } | ||
79 | + | ||
80 | + public void Initialize() { | ||
81 | + mThis = this; | ||
82 | + Angel = (ImageView)findViewById(R.id.angel); | ||
83 | + | ||
84 | + AssetManager as = getResources().getAssets(); | ||
85 | + InputStream is = null; | ||
86 | + try{ | ||
87 | + is = as.open("angel.png"); | ||
88 | + | ||
89 | + bitmap_angel = BitmapFactory.decodeStream(is); | ||
90 | + | ||
91 | + Angel.setImageBitmap(bitmap_angel); | ||
92 | + | ||
93 | + is.close(); | ||
94 | + }catch(Exception e){ | ||
95 | + e.printStackTrace(); | ||
96 | + } | ||
97 | + | ||
98 | + SelectDate(); | ||
99 | + SaveTop(); | ||
100 | + } | ||
101 | + | ||
102 | + public void SaveTop() { | ||
103 | + mArea = new GetAreaCode(this); | ||
104 | + | ||
105 | + LinkedList area = new LinkedList(); | ||
106 | + | ||
107 | + area = mArea.GetTopCode(); | ||
108 | + | ||
109 | + arrayAdapter = new ArrayAdapter<>(getApplicationContext(), | ||
110 | + android.R.layout.simple_spinner_dropdown_item, area); | ||
111 | + | ||
112 | + spinner = (Spinner)findViewById(R.id.TopList); | ||
113 | + spinner.setAdapter(arrayAdapter); | ||
114 | + LinkedList finalArea = area; | ||
115 | + spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | ||
116 | + @Override | ||
117 | + public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { | ||
118 | + SaveMdl(mArea.SearchTop(finalArea.get(i))); | ||
119 | + } | ||
120 | + | ||
121 | + @Override | ||
122 | + public void onNothingSelected(AdapterView<?> adapterView) { | ||
123 | + } | ||
124 | + }); | ||
125 | + | ||
126 | + } | ||
127 | + | ||
128 | + public void SaveMdl(String Top) { | ||
129 | + arrayArea = new ArrayList<>(); | ||
130 | + mArea = new GetAreaCode(this); | ||
131 | + | ||
132 | + LinkedList area = new LinkedList(); | ||
133 | + | ||
134 | + area = mArea.GetMdlCode(Top); | ||
135 | + | ||
136 | + arrayAdapter = new ArrayAdapter<>(getApplicationContext(), | ||
137 | + android.R.layout.simple_spinner_dropdown_item, area); | ||
138 | + | ||
139 | + spinner = (Spinner)findViewById(R.id.MdlList); | ||
140 | + spinner.setAdapter(arrayAdapter); | ||
141 | + LinkedList finalArea = area; | ||
142 | + spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | ||
143 | + @Override | ||
144 | + public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { | ||
145 | + System.out.println(mArea.SearchMdl(finalArea.get(i), Top)); | ||
146 | + SaveLeaf(mArea.SearchMdl(finalArea.get(i), Top)); | ||
147 | + } | ||
148 | + | ||
149 | + @Override | ||
150 | + public void onNothingSelected(AdapterView<?> adapterView) { | ||
151 | + } | ||
152 | + }); | ||
153 | + | ||
154 | + } | ||
155 | + | ||
156 | + public void SaveLeaf(String Mdl) { | ||
157 | + arrayArea = new ArrayList<>(); | ||
158 | + mArea = new GetAreaCode(this); | ||
159 | + final RadioGroup rg = (RadioGroup)findViewById(R.id.radioGender); | ||
160 | + | ||
161 | + LinkedList area = new LinkedList(); | ||
162 | + | ||
163 | + area = mArea.GetLeafCode(Mdl); | ||
164 | + | ||
165 | + arrayAdapter = new ArrayAdapter<>(getApplicationContext(), | ||
166 | + android.R.layout.simple_spinner_dropdown_item, area); | ||
167 | + | ||
168 | + spinner = (Spinner)findViewById(R.id.LeafList); | ||
169 | + spinner.setAdapter(arrayAdapter); | ||
170 | + LinkedList finalArea = area; | ||
171 | + spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | ||
172 | + @Override | ||
173 | + public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { | ||
174 | + code = mArea.SearchLeaf(finalArea.get(i), Mdl); | ||
175 | + | ||
176 | + View.OnClickListener listener = new View.OnClickListener() | ||
177 | + { | ||
178 | + @Override | ||
179 | + public void onClick(View v) { | ||
180 | + | ||
181 | + start = ""; | ||
182 | + String month = sMonth.getSelectedItem().toString(); | ||
183 | + start += String.format("%2s",month.substring(0,month.length()-1)).replace(" ","0"); | ||
184 | + String day = sDay.getSelectedItem().toString(); | ||
185 | + start += String.format("%2s",day.substring(0,day.length()-1)).replace(" ","0"); | ||
186 | + String hour = sHour.getSelectedItem().toString(); | ||
187 | + start += String.format("%2s",hour.substring(0,hour.length()-1)).replace(" ","0"); | ||
188 | + | ||
189 | + | ||
190 | + from = ""; | ||
191 | + String month2 = fMonth.getSelectedItem().toString(); | ||
192 | + from += String.format("%2s",month2.substring(0,month2.length()-1)).replace(" ","0"); | ||
193 | + String day2 = fDay.getSelectedItem().toString(); | ||
194 | + from += String.format("%2s",day2.substring(0,day2.length()-1)).replace(" ","0"); | ||
195 | + String hour2 = fHour.getSelectedItem().toString(); | ||
196 | + from += String.format("%2s",hour2.substring(0,hour2.length()-1)).replace(" ","0"); | ||
197 | + | ||
198 | + String leaf = spinner.getSelectedItem().toString(); | ||
199 | + | ||
200 | + int gender = rg.getCheckedRadioButtonId(); | ||
201 | + RadioButton rb = (RadioButton)findViewById(gender); | ||
202 | + | ||
203 | + Intent intent = new Intent(MainActivity.this, WeatherActivity.class); | ||
204 | + intent.putExtra("code", code); //code에 있는 값 이동 | ||
205 | + intent.putExtra("start", start); //start에 있는 값 이동 | ||
206 | + intent.putExtra("from", from); //from에 있는 값 이동 | ||
207 | + intent.putExtra("leaf", leaf); //leaf에 있는 값 이동 | ||
208 | + intent.putExtra("gender", rb.getText().toString()); | ||
209 | + startActivity(intent); // 이동 | ||
210 | + } | ||
211 | + }; | ||
212 | + | ||
213 | + Button btn_weather = (Button) findViewById(R.id.btn_weather); | ||
214 | + btn_weather.setOnClickListener(listener); | ||
215 | + | ||
216 | + btn_clothes = findViewById(R.id.btn_clothes); | ||
217 | + btn_clothes.setOnClickListener(new View.OnClickListener() { //선언 | ||
218 | + | ||
219 | + | ||
220 | + @Override | ||
221 | + public void onClick(View v) { | ||
222 | + //MainActivity 에서 ClothesActivity 로 이동 | ||
223 | + start = ""; | ||
224 | + String month = sMonth.getSelectedItem().toString(); | ||
225 | + start += String.format("%2s",month.substring(0,month.length()-1)).replace(" ","0"); | ||
226 | + String day = sDay.getSelectedItem().toString(); | ||
227 | + start += String.format("%2s",day.substring(0,day.length()-1)).replace(" ","0"); | ||
228 | + String hour = sHour.getSelectedItem().toString(); | ||
229 | + start += String.format("%2s",hour.substring(0,hour.length()-1)).replace(" ","0"); | ||
230 | + | ||
231 | + from = ""; | ||
232 | + String month2 = fMonth.getSelectedItem().toString(); | ||
233 | + from += String.format("%2s",month2.substring(0,month2.length()-1)).replace(" ","0"); | ||
234 | + String day2 = fDay.getSelectedItem().toString(); | ||
235 | + from += String.format("%2s",day2.substring(0,day2.length()-1)).replace(" ","0"); | ||
236 | + String hour2 = fHour.getSelectedItem().toString(); | ||
237 | + from += String.format("%2s",hour2.substring(0,hour2.length()-1)).replace(" ","0"); | ||
238 | + | ||
239 | + String leaf = spinner.getSelectedItem().toString(); | ||
240 | + | ||
241 | + int gender = rg.getCheckedRadioButtonId(); | ||
242 | + RadioButton rb = (RadioButton)findViewById(gender); | ||
243 | + | ||
244 | + Intent intent = new Intent(MainActivity.this, ClothesActivity.class); | ||
245 | + intent.putExtra("code", code); //code에 있는 값 이동 | ||
246 | + intent.putExtra("start", start); //start에 있는 값 이동 | ||
247 | + intent.putExtra("from", from); //from에 있는 값 이동 | ||
248 | + intent.putExtra("leaf", leaf); //leaf에 있는 값 이동 | ||
249 | + intent.putExtra("code", code);//code에 있는 값 이동 | ||
250 | + intent.putExtra("gender", rb.getText().toString()); //gender에 있는 값 이동 | ||
251 | + startActivity(intent);//액티비티 이동 | ||
252 | + } | ||
253 | + }); | ||
254 | + } | ||
255 | + @Override | ||
256 | + public void onNothingSelected(AdapterView<?> adapterView) { | ||
257 | + } | ||
258 | + }); | ||
259 | + | ||
260 | + } | ||
261 | + | ||
262 | + public void SelectDate(){ | ||
263 | + Calendar cal = Calendar.getInstance(); | ||
264 | + | ||
265 | + int month = cal.get(Calendar.MONTH) + 1; | ||
266 | + int day = cal.get(Calendar.DAY_OF_MONTH); | ||
267 | + int hour = cal.get(Calendar.HOUR_OF_DAY); | ||
268 | + | ||
269 | + // *** 초기 위젯에 현재 시각 박기 | ||
270 | + LinkedList LMonth = new LinkedList(); | ||
271 | + LinkedList LDay = new LinkedList(); | ||
272 | + LinkedList LHour = new LinkedList(); | ||
273 | + | ||
274 | + LMonth.add(String.valueOf(month) + "월"); | ||
275 | + | ||
276 | + int day1 = day; | ||
277 | + int day2 = day + 1; | ||
278 | + int day3 = day + 2; | ||
279 | + int day4 = day + 3; | ||
280 | + | ||
281 | + switch(month){ | ||
282 | + case 1: case 3: case 5: case 7: case 8: case 10: case 12: | ||
283 | + if (day4 > 31){ | ||
284 | + LMonth.add(String.valueOf(month + 1) + "월"); | ||
285 | + if (day1 > 31){ | ||
286 | + day1 -= 31; | ||
287 | + day2 -= 31; | ||
288 | + day3 -= 31; | ||
289 | + day4 -= 31; | ||
290 | + break; | ||
291 | + } else if (day2 > 31){ | ||
292 | + day2 -= 31; | ||
293 | + day3 -= 31; | ||
294 | + day4 -= 31; | ||
295 | + break; | ||
296 | + } else if (day3 > 31){ | ||
297 | + day3 -= 31; | ||
298 | + day4 -= 31; | ||
299 | + break; | ||
300 | + } else if (day4 > 31) { | ||
301 | + day4 -= 31; | ||
302 | + } | ||
303 | + } else{ | ||
304 | + break; | ||
305 | + } | ||
306 | + case 2: | ||
307 | + if (day4 > 28){ | ||
308 | + LMonth.add(String.valueOf(month + 1) + "월"); | ||
309 | + if (day1 > 28){ | ||
310 | + day1 -= 28; | ||
311 | + day2 -= 28; | ||
312 | + day3 -= 28; | ||
313 | + day4 -= 28; | ||
314 | + break; | ||
315 | + } else if (day2 > 28){ | ||
316 | + day2 -= 28; | ||
317 | + day3 -= 28; | ||
318 | + day4 -= 28; | ||
319 | + break; | ||
320 | + } else if (day3 > 28){ | ||
321 | + day3 -= 28; | ||
322 | + day4 -= 28; | ||
323 | + break; | ||
324 | + } else if (day4 > 28) { | ||
325 | + day4 -= 28; | ||
326 | + } | ||
327 | + } else{ | ||
328 | + break; | ||
329 | + } | ||
330 | + case 4: case 6: case 9: case 11: | ||
331 | + if (day4 > 30){ | ||
332 | + LMonth.add(String.valueOf(month + 1) + "월"); | ||
333 | + if (day1 > 30){ | ||
334 | + day1 -= 30; | ||
335 | + day2 -= 30; | ||
336 | + day3 -= 30; | ||
337 | + day4 -= 30; | ||
338 | + break; | ||
339 | + } else if (day2 > 30){ | ||
340 | + day2 -= 30; | ||
341 | + day3 -= 30; | ||
342 | + day4 -= 30; | ||
343 | + break; | ||
344 | + } else if (day3 > 30){ | ||
345 | + day3 -= 30; | ||
346 | + day4 -= 30; | ||
347 | + break; | ||
348 | + } else if (day4 > 30) { | ||
349 | + day4 -= 30; | ||
350 | + } | ||
351 | + } else { | ||
352 | + break; | ||
353 | + } | ||
354 | + } | ||
355 | + | ||
356 | + LDay.add(String.valueOf(day1) + "일"); | ||
357 | + LDay.add(String.valueOf(day2) + "일"); | ||
358 | + LDay.add(String.valueOf(day3) + "일"); | ||
359 | + LDay.add(String.valueOf(day4) + "일"); | ||
360 | + | ||
361 | + for (int i = 1; i <= 24; i++){ | ||
362 | + LHour.add(String.valueOf(i)+"시"); | ||
363 | + } | ||
364 | + | ||
365 | + | ||
366 | + // 월 select | ||
367 | + ArrayAdapter2 = new ArrayAdapter<>(getApplicationContext(), | ||
368 | + android.R.layout.simple_spinner_dropdown_item, LMonth); | ||
369 | + | ||
370 | + | ||
371 | + sMonth = (Spinner)findViewById(R.id.start_month); | ||
372 | + sMonth.setAdapter(ArrayAdapter2); | ||
373 | + sMonth.setSelection(getIndex(sMonth, String.valueOf(month) + "월")); | ||
374 | + LinkedList finalmonth = LMonth; | ||
375 | + sMonth.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | ||
376 | + @Override | ||
377 | + public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { | ||
378 | + } | ||
379 | + | ||
380 | + @Override | ||
381 | + public void onNothingSelected(AdapterView<?> adapterView) { | ||
382 | + } | ||
383 | + }); | ||
384 | + | ||
385 | + fMonth = (Spinner)findViewById(R.id.from_month); | ||
386 | + fMonth.setAdapter(ArrayAdapter2); | ||
387 | + fMonth.setSelection(getIndex(fMonth, String.valueOf(month) + "월")); | ||
388 | + LinkedList frommonth = LMonth; | ||
389 | + fMonth.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | ||
390 | + @Override | ||
391 | + public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { | ||
392 | + } | ||
393 | + | ||
394 | + @Override | ||
395 | + public void onNothingSelected(AdapterView<?> adapterView) { | ||
396 | + } | ||
397 | + }); | ||
398 | + | ||
399 | + // 일 select | ||
400 | + ArrayAdapter3 = new ArrayAdapter<>(getApplicationContext(), | ||
401 | + android.R.layout.simple_spinner_dropdown_item, LDay); | ||
402 | + | ||
403 | + sDay = (Spinner)findViewById(R.id.start_day); | ||
404 | + sDay.setAdapter(ArrayAdapter3); | ||
405 | + sDay.setSelection(getIndex(sDay, String.valueOf(day) + "일")); | ||
406 | + LinkedList finalday = LDay; | ||
407 | + sDay.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | ||
408 | + @Override | ||
409 | + public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { | ||
410 | + } | ||
411 | + | ||
412 | + @Override | ||
413 | + public void onNothingSelected(AdapterView<?> adapterView) { | ||
414 | + } | ||
415 | + }); | ||
416 | + | ||
417 | + fDay = (Spinner)findViewById(R.id.from_day); | ||
418 | + fDay.setAdapter(ArrayAdapter3); | ||
419 | + fDay.setSelection(getIndex(fDay, String.valueOf(day) + "일")); | ||
420 | + LinkedList fromday = LDay; | ||
421 | + fDay.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | ||
422 | + @Override | ||
423 | + public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { | ||
424 | + } | ||
425 | + | ||
426 | + @Override | ||
427 | + public void onNothingSelected(AdapterView<?> adapterView) { | ||
428 | + } | ||
429 | + }); | ||
430 | + | ||
431 | + // 시간 select | ||
432 | + ArrayAdapter4 = new ArrayAdapter<>(getApplicationContext(), | ||
433 | + android.R.layout.simple_spinner_dropdown_item, LHour); | ||
434 | + | ||
435 | + sHour = (Spinner)findViewById(R.id.start_hour); | ||
436 | + sHour.setAdapter(ArrayAdapter4); | ||
437 | + sHour.setSelection(getIndex(sHour, String.valueOf(hour) + "시")); | ||
438 | + LinkedList finalhour = LHour; | ||
439 | + sHour.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | ||
440 | + @Override | ||
441 | + public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { | ||
442 | + } | ||
443 | + | ||
444 | + @Override | ||
445 | + public void onNothingSelected(AdapterView<?> adapterView) { | ||
446 | + } | ||
447 | + }); | ||
448 | + | ||
449 | + fHour = (Spinner)findViewById(R.id.from_hour); | ||
450 | + fHour.setAdapter(ArrayAdapter4); | ||
451 | + fHour.setSelection(getIndex(fHour, String.valueOf(hour) + "시")); | ||
452 | + LinkedList fromhour = LHour; | ||
453 | + fHour.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | ||
454 | + @Override | ||
455 | + public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { | ||
456 | + } | ||
457 | + | ||
458 | + @Override | ||
459 | + public void onNothingSelected(AdapterView<?> adapterView) { | ||
460 | + } | ||
461 | + }); | ||
462 | + } | ||
463 | + | ||
464 | + private int getIndex(Spinner spinner, String item){ | ||
465 | + for (int i = 0; i < spinner.getCount(); i++){ | ||
466 | + if (spinner.getItemAtPosition(i).toString().equalsIgnoreCase(item)){ | ||
467 | + return i; | ||
468 | + } | ||
469 | + } | ||
470 | + return 0; | ||
471 | + } | ||
472 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +package com.example.test; | ||
2 | + | ||
3 | +import android.app.Activity; | ||
4 | +import android.content.Intent; | ||
5 | +import android.content.res.AssetManager; | ||
6 | +import android.graphics.Bitmap; | ||
7 | +import android.graphics.BitmapFactory; | ||
8 | +import android.os.Bundle; | ||
9 | +import android.os.Handler; | ||
10 | +import android.widget.ImageView; | ||
11 | + | ||
12 | +import java.io.InputStream; | ||
13 | + | ||
14 | +public class SplashActivity extends Activity { | ||
15 | + | ||
16 | + @Override | ||
17 | + protected void onCreate(Bundle savedInstanceState) { | ||
18 | + super.onCreate(savedInstanceState); | ||
19 | + setContentView(R.layout.activity_splash); | ||
20 | + | ||
21 | + try { | ||
22 | + Thread.sleep(3000); //대기 초 설정 | ||
23 | + startActivity(new Intent(SplashActivity.this, MainActivity.class)); | ||
24 | + finish(); | ||
25 | + } catch (Exception e) { | ||
26 | + e.printStackTrace(); | ||
27 | + } | ||
28 | + } | ||
29 | +} |
1 | +package com.example.test; | ||
2 | + | ||
3 | +import androidx.appcompat.app.AppCompatActivity; | ||
4 | +import androidx.core.content.ContextCompat; | ||
5 | + | ||
6 | + | ||
7 | +import android.content.Intent; | ||
8 | +import android.content.res.AssetManager; | ||
9 | +import android.graphics.Bitmap; | ||
10 | +import android.graphics.BitmapFactory; | ||
11 | +import android.os.Bundle; | ||
12 | +import android.os.Handler; | ||
13 | +import android.os.Message; | ||
14 | +import android.view.View; | ||
15 | +import android.view.ViewGroup; | ||
16 | +import android.widget.Button; | ||
17 | +import android.widget.ImageView; | ||
18 | +import android.widget.ListAdapter; | ||
19 | +import android.widget.ListView; | ||
20 | +import android.widget.TextView; | ||
21 | + | ||
22 | +import java.io.InputStream; | ||
23 | +import java.util.ArrayList; | ||
24 | + | ||
25 | +public class WeatherActivity extends AppCompatActivity { | ||
26 | + | ||
27 | + private Button btn_main; | ||
28 | + private Button btn_clothes; | ||
29 | + TextView Location; | ||
30 | + WeatherForCast mForeCast; | ||
31 | + WeatherActivity wThis; | ||
32 | + | ||
33 | + ImageView main_Weather; | ||
34 | + ImageView main_Location; | ||
35 | + ImageView main_Average; | ||
36 | + ImageView main_MinMax; | ||
37 | + ImageView main_Perceived; | ||
38 | + ImageView main_Wind; | ||
39 | + ImageView main_Precipitation; | ||
40 | + ImageView today_Weather; | ||
41 | + ImageView weather_Blank; | ||
42 | + | ||
43 | + Bitmap bitmap_Weather; | ||
44 | + Bitmap bitmap_Location; | ||
45 | + Bitmap bitmap_temperature; | ||
46 | + Bitmap bitmap_wind; | ||
47 | + Bitmap bitmap_Precipitation; | ||
48 | + Bitmap bitmap_Today; | ||
49 | + Bitmap bitmap_Blank; | ||
50 | + | ||
51 | + TextView Now; | ||
52 | + TextView Perceived; | ||
53 | + TextView Wind; | ||
54 | + TextView Precipitation; | ||
55 | + TextView Select; | ||
56 | + | ||
57 | + | ||
58 | + @Override | ||
59 | + protected void onCreate(Bundle savedInstanceState) { | ||
60 | + super.onCreate(savedInstanceState); | ||
61 | + setContentView(R.layout.activity_weather); | ||
62 | + | ||
63 | + Initialize(); | ||
64 | + } | ||
65 | + | ||
66 | + public void Initialize(){ | ||
67 | + wThis = this; | ||
68 | + Location = (TextView) findViewById(R.id.txt_location); | ||
69 | + | ||
70 | + Intent intent = getIntent(); | ||
71 | + String code = intent.getStringExtra("code"); | ||
72 | + | ||
73 | + mForeCast = new WeatherForCast(code, (WeatherActivity) wThis); | ||
74 | + | ||
75 | + String start = intent.getStringExtra("start"); | ||
76 | + String from = intent.getStringExtra("from"); | ||
77 | + String leaf = intent.getStringExtra("leaf"); | ||
78 | + String gender = intent.getStringExtra("gender"); | ||
79 | + | ||
80 | + Location.setText(leaf); | ||
81 | + | ||
82 | + main_Location = (ImageView)findViewById(R.id.Img_location); | ||
83 | + AssetManager as = getResources().getAssets(); | ||
84 | + InputStream is = null; | ||
85 | + | ||
86 | + try{ | ||
87 | + is = as.open("location.png"); | ||
88 | + bitmap_Location = BitmapFactory.decodeStream(is); | ||
89 | + main_Location.setImageBitmap(bitmap_Location); | ||
90 | + is.close(); | ||
91 | + }catch(Exception e){ | ||
92 | + e.printStackTrace(); | ||
93 | + } | ||
94 | + | ||
95 | + ImgUpload(); | ||
96 | + GetWeather(start, from, code); | ||
97 | + | ||
98 | + btn_main = findViewById(R.id.btn_main);//btn_first 아이디을 찾아라 | ||
99 | + btn_main.setOnClickListener(new View.OnClickListener() { | ||
100 | + @Override | ||
101 | + public void onClick(View v) { | ||
102 | + //버튼 클릭시 SecondActivity 에서 MainActivity 로 이동 경로 | ||
103 | + Intent intent = new Intent(WeatherActivity.this, MainActivity.class); | ||
104 | + startActivity(intent);// 이동 | ||
105 | + } | ||
106 | + }); | ||
107 | + | ||
108 | + btn_clothes = findViewById(R.id.btn_clothes);//btn_clothes 아이디 찾기 | ||
109 | + btn_clothes.setOnClickListener(new View.OnClickListener() { | ||
110 | + @Override | ||
111 | + public void onClick(View v) { | ||
112 | + //버튼 클릭시 WeatherActivity 에서 ClothesActivity 로 이동 경로 | ||
113 | + Intent intent = new Intent(WeatherActivity.this, ClothesActivity.class); | ||
114 | + intent.putExtra("code", code); //code에 있는 값 이동 | ||
115 | + intent.putExtra("start", start); //start에 있는 값 이동 | ||
116 | + intent.putExtra("from", from); //from에 있는 값 이동 | ||
117 | + intent.putExtra("leaf", leaf); //leaf에 있는 값 이동 | ||
118 | + intent.putExtra("gender", gender); //gender에 있는 값 이동 | ||
119 | + startActivity(intent);// 이동 | ||
120 | + } | ||
121 | + }); | ||
122 | + } | ||
123 | + | ||
124 | + public void ImgUpload(){ | ||
125 | + main_Location = (ImageView)findViewById(R.id.Img_location); | ||
126 | + main_Average = (ImageView)findViewById(R.id.Img_aver); | ||
127 | + main_MinMax = (ImageView)findViewById(R.id.Img_minmax); | ||
128 | + main_Perceived = (ImageView)findViewById(R.id.Img_perceived); | ||
129 | + main_Wind = (ImageView)findViewById(R.id.Img_wind); | ||
130 | + main_Precipitation = (ImageView)findViewById(R.id.Img_pop); | ||
131 | + today_Weather = (ImageView)findViewById(R.id.today_weather); | ||
132 | + | ||
133 | + | ||
134 | + AssetManager as = getResources().getAssets(); | ||
135 | + InputStream is = null; | ||
136 | + | ||
137 | + try{ | ||
138 | + is = as.open("location.png"); | ||
139 | + bitmap_Location = BitmapFactory.decodeStream(is); | ||
140 | + main_Location.setImageBitmap(bitmap_Location); | ||
141 | + is.close(); | ||
142 | + }catch(Exception e){ | ||
143 | + e.printStackTrace(); | ||
144 | + } | ||
145 | + | ||
146 | + try{ | ||
147 | + is = as.open("wind.png"); | ||
148 | + bitmap_wind = BitmapFactory.decodeStream(is); | ||
149 | + main_Wind.setImageBitmap(bitmap_wind); | ||
150 | + is.close(); | ||
151 | + }catch(Exception e){ | ||
152 | + e.printStackTrace(); | ||
153 | + } | ||
154 | + | ||
155 | + try{ | ||
156 | + is = as.open("temperature.png"); | ||
157 | + bitmap_temperature = BitmapFactory.decodeStream(is); | ||
158 | + main_Average.setImageBitmap(bitmap_temperature); | ||
159 | + main_MinMax.setImageBitmap(bitmap_temperature); | ||
160 | + is.close(); | ||
161 | + }catch(Exception e){ | ||
162 | + e.printStackTrace(); | ||
163 | + } | ||
164 | + | ||
165 | + try{ | ||
166 | + is = as.open("pop.png"); | ||
167 | + bitmap_Precipitation = BitmapFactory.decodeStream(is); | ||
168 | + main_Precipitation.setImageBitmap(bitmap_Precipitation); | ||
169 | + is.close(); | ||
170 | + }catch(Exception e){ | ||
171 | + e.printStackTrace(); | ||
172 | + } | ||
173 | + | ||
174 | + try{ | ||
175 | + is = as.open("today_weather.png"); | ||
176 | + bitmap_Today = BitmapFactory.decodeStream(is); | ||
177 | + today_Weather.setImageBitmap(bitmap_Today); | ||
178 | + is.close(); | ||
179 | + }catch(Exception e){ | ||
180 | + e.printStackTrace(); | ||
181 | + } | ||
182 | + } | ||
183 | + | ||
184 | + public void GetWeather(String start, String from, String code){ | ||
185 | + ArrayList<ArrayList<String>> wData = new ArrayList<ArrayList<String>>(); | ||
186 | + wData = mForeCast.GetOpenWeather(code); | ||
187 | + System.out.println("Start GetWeather"); | ||
188 | + System.out.println(wData); | ||
189 | + String mData = ""; | ||
190 | + | ||
191 | + int sMonth = Integer.parseInt(start.substring(0,2)); | ||
192 | + int sDay = Integer.parseInt(start.substring(2,4)); | ||
193 | + int sHour = Integer.parseInt(start.substring(4,6)); | ||
194 | + | ||
195 | + int fMonth = Integer.parseInt(from.substring(0,2)); | ||
196 | + int fDay = Integer.parseInt(from.substring(2,4)); | ||
197 | + int fHour = Integer.parseInt(from.substring(4,6)); | ||
198 | + | ||
199 | + String select = String.valueOf(sMonth) + "월 " + String.valueOf(sDay) + "일 " + String.valueOf(sHour) + "시부터 " | ||
200 | + + String.valueOf(fMonth) + "월 " + String.valueOf(fDay) + "일 " + String.valueOf(fHour) + "시까지"; | ||
201 | + | ||
202 | + // TextView 연결 | ||
203 | + Now = (TextView)findViewById(R.id.input_now); | ||
204 | + Perceived = (TextView)findViewById(R.id.input_perceived); | ||
205 | + Wind = (TextView)findViewById(R.id.input_wind); | ||
206 | + Precipitation = (TextView)findViewById(R.id.input_pop); | ||
207 | + Select = (TextView)findViewById(R.id.select_time); | ||
208 | + | ||
209 | + | ||
210 | + // 현재 날씨 input | ||
211 | + Now.setText(wData.get(0).get(1) + "°C"); | ||
212 | + Perceived.setText(mForeCast.GetPerceived(wData.get(0).get(1), wData.get(0).get(4)) + "°C"); | ||
213 | + Wind.setText(wData.get(0).get(4) + "m/s"); | ||
214 | + Precipitation.setText(wData.get(0).get(6) + "%"); | ||
215 | + Select.setText(select); | ||
216 | + | ||
217 | + ListView listview ; | ||
218 | + ListViewAdapter adapter; | ||
219 | + | ||
220 | + // Adapter 생성 | ||
221 | + adapter = new ListViewAdapter() ; | ||
222 | + | ||
223 | + // 리스트뷰 참조 및 Adapter달기 | ||
224 | + listview = (ListView) findViewById(R.id.listview1); | ||
225 | + listview.setAdapter(adapter); | ||
226 | + | ||
227 | + // 날씨에 맞는 id값 받아오기 | ||
228 | + int clear = R.drawable.clear; | ||
229 | + int cloudy = R.drawable.cloudy; | ||
230 | + int mostcloudy = R.drawable.mostcloudy; | ||
231 | + int partcloudy = R.drawable.partcloudy; | ||
232 | + int rain = R.drawable.rain; | ||
233 | + int snow = R.drawable.snow; | ||
234 | + int snowrain = R.drawable.snowrain; | ||
235 | + | ||
236 | + int weather = clear; | ||
237 | + | ||
238 | + String main = wData.get(0).get(5); | ||
239 | + if (main.equals("Clear")){ | ||
240 | + main = "wClear"; | ||
241 | + } else if (main.equals("Partly Cloudy")){ | ||
242 | + main = "wPartcloudy"; | ||
243 | + } else if (main.equals("Mostly Cloudy")){ | ||
244 | + main = "wMostcloudy"; | ||
245 | + } else if (main.equals("Cloudy")){ | ||
246 | + main = "wCloudy"; | ||
247 | + } else if (main.equals("Rain")){ | ||
248 | + main = "wRain"; | ||
249 | + } else if (main.equals("Snow/Rain")){ | ||
250 | + main = "wSnowrain"; | ||
251 | + } else if (main.equals("Snow")){ | ||
252 | + main = "wSnow"; | ||
253 | + } | ||
254 | + | ||
255 | + | ||
256 | + AssetManager as = getResources().getAssets(); | ||
257 | + InputStream is = null; | ||
258 | + | ||
259 | + main_Weather = (ImageView)findViewById(R.id.main_weather); | ||
260 | + | ||
261 | + try{ | ||
262 | + is = as.open(main + ".png"); | ||
263 | + bitmap_Weather = BitmapFactory.decodeStream(is); | ||
264 | + main_Weather.setImageBitmap(bitmap_Weather); | ||
265 | + is.close(); | ||
266 | + }catch(Exception e){ | ||
267 | + e.printStackTrace(); | ||
268 | + } | ||
269 | + | ||
270 | + for (int i = 0; i < wData.size(); i++){ | ||
271 | + String hour = wData.get(i).get(0); | ||
272 | + | ||
273 | + String time = ""; | ||
274 | + time = hour.substring(4,6); | ||
275 | + int num = Integer.parseInt(time); | ||
276 | + if (num <= 12){ | ||
277 | + time = "오전 " + String.valueOf(num) + "시"; | ||
278 | + } else { | ||
279 | + time = "오후 " + String.valueOf(num) + "시"; | ||
280 | + } | ||
281 | + | ||
282 | + | ||
283 | + if (start.compareTo(hour) <= 0 && from.compareTo(hour) >= 0){ | ||
284 | + if (wData.get(i).get(5).equals("Clear")){ | ||
285 | + weather = clear; | ||
286 | + } else if (wData.get(i).get(5).equals("Partly Cloudy")){ | ||
287 | + weather = partcloudy; | ||
288 | + } else if (wData.get(i).get(5).equals("Mostly Cloudy")){ | ||
289 | + weather = mostcloudy; | ||
290 | + } else if (wData.get(i).get(5).equals("Cloudy")){ | ||
291 | + weather = cloudy; | ||
292 | + } else if (wData.get(i).get(5).equals("Rain")){ | ||
293 | + weather = rain; | ||
294 | + } else if (wData.get(i).get(5).equals("Snow/Rain")){ | ||
295 | + weather = snowrain; | ||
296 | + } else if (wData.get(i).get(5).equals("Snow")){ | ||
297 | + weather = snow; | ||
298 | + } | ||
299 | + | ||
300 | + adapter.addItem(time,ContextCompat.getDrawable(this, weather), | ||
301 | + wData.get(i).get(1) + "°C", wData.get(i).get(4) + "m/s", wData.get(i).get(6) + "%") ; | ||
302 | + } | ||
303 | + } | ||
304 | + setListViewHeightBasedOnChildren(listview); | ||
305 | + | ||
306 | + | ||
307 | + if (adapter.getCount() == 0){ | ||
308 | + weather_Blank = (ImageView)findViewById(R.id.Img_blank); | ||
309 | + | ||
310 | + try{ | ||
311 | + is = as.open("blank.png"); | ||
312 | + bitmap_Blank = BitmapFactory.decodeStream(is); | ||
313 | + weather_Blank.setImageBitmap(bitmap_Blank); | ||
314 | + is.close(); | ||
315 | + }catch(Exception e){ | ||
316 | + e.printStackTrace(); | ||
317 | + } | ||
318 | + } | ||
319 | + } | ||
320 | + | ||
321 | + // 리스트뷰 전체 목록 보이는 함수 | ||
322 | + public static void setListViewHeightBasedOnChildren(ListView listView) { | ||
323 | + ListAdapter listAdapter = listView.getAdapter(); | ||
324 | + if (listAdapter == null) { | ||
325 | + // pre-condition | ||
326 | + return; | ||
327 | + } | ||
328 | + | ||
329 | + int totalHeight = 0; | ||
330 | + int desiredWidth = View.MeasureSpec.makeMeasureSpec(listView.getWidth(), View.MeasureSpec.AT_MOST); | ||
331 | + | ||
332 | + for (int i = 0; i < listAdapter.getCount(); i++) { | ||
333 | + View listItem = listAdapter.getView(i, null, listView); | ||
334 | + listItem.measure(desiredWidth, View.MeasureSpec.UNSPECIFIED); | ||
335 | + totalHeight += listItem.getMeasuredHeight(); | ||
336 | + } | ||
337 | + | ||
338 | + ViewGroup.LayoutParams params = listView.getLayoutParams(); | ||
339 | + params.height = totalHeight + (listView.getDividerHeight() * (listAdapter.getCount() - 1)); | ||
340 | + listView.setLayoutParams(params); | ||
341 | + listView.requestLayout(); | ||
342 | + } | ||
343 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +package com.example.test; | ||
2 | + | ||
3 | +import android.os.StrictMode; | ||
4 | + | ||
5 | +import org.w3c.dom.Document; | ||
6 | +import org.w3c.dom.Element; | ||
7 | +import org.w3c.dom.Node; | ||
8 | +import org.w3c.dom.NodeList; | ||
9 | +import org.xml.sax.SAXException; | ||
10 | + | ||
11 | +import java.io.IOException; | ||
12 | +import java.net.MalformedURLException; | ||
13 | +import java.util.ArrayList; | ||
14 | +import java.util.Calendar; | ||
15 | + | ||
16 | +import javax.xml.parsers.DocumentBuilder; | ||
17 | +import javax.xml.parsers.DocumentBuilderFactory; | ||
18 | +import javax.xml.parsers.ParserConfigurationException; | ||
19 | + | ||
20 | +public class WeatherForCast extends Thread { | ||
21 | + | ||
22 | + String code; | ||
23 | + //MainActivity mContext; | ||
24 | + WeatherActivity wContext; | ||
25 | + String mWeather; | ||
26 | + ArrayList<ArrayList<String>> gWeather; | ||
27 | + | ||
28 | + public String getWeather() | ||
29 | + { | ||
30 | + return mWeather; | ||
31 | + } | ||
32 | + | ||
33 | + public WeatherForCast(String code, WeatherActivity wContext) | ||
34 | + { | ||
35 | + this.code = code; | ||
36 | + this.wContext = wContext; | ||
37 | + } | ||
38 | + | ||
39 | + // tag값의 정보를 가져오는 메소드 | ||
40 | + private static String getTagValue(String tag, Element eElement) { | ||
41 | + NodeList nlList = eElement.getElementsByTagName(tag).item(0).getChildNodes(); | ||
42 | + Node nValue = (Node) nlList.item(0); | ||
43 | + if(nValue == null) | ||
44 | + return null; | ||
45 | + return nValue.getNodeValue(); | ||
46 | + } | ||
47 | + | ||
48 | + public ArrayList<ArrayList<String>> GetOpenWeather(String code) | ||
49 | + { | ||
50 | + | ||
51 | + ArrayList<ArrayList<String>> wData = new ArrayList<ArrayList<String>>(); | ||
52 | + | ||
53 | + try{ | ||
54 | + String url = "http://www.kma.go.kr/wid/queryDFSRSS.jsp?zone="+ code; | ||
55 | + | ||
56 | + DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); | ||
57 | + DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); | ||
58 | + Document doc = dBuilder.parse(url); | ||
59 | + | ||
60 | + // root tag | ||
61 | + doc.getDocumentElement().normalize(); | ||
62 | + | ||
63 | + NodeList nlDate = doc.getElementsByTagName("header"); | ||
64 | + Node ndate = nlDate.item(0); | ||
65 | + Element eDate = (Element) ndate; | ||
66 | + String date = getTagValue("tm", eDate); | ||
67 | + | ||
68 | + int thour = Integer.parseInt(date.substring(8,10)); | ||
69 | + date = date.substring(4,8); | ||
70 | + | ||
71 | + if (thour >= 21) { | ||
72 | + date = String.format("%4s",String.valueOf(Integer.parseInt(date) + 1)).replace(" ", "0"); | ||
73 | + } | ||
74 | + | ||
75 | + // 파싱할 tag | ||
76 | + NodeList nList = doc.getElementsByTagName("data"); | ||
77 | + for(int temp = 0; temp < nList.getLength(); temp++){ | ||
78 | + Node nNode = nList.item(temp); | ||
79 | + ArrayList<String> tData = new ArrayList<String>(); | ||
80 | + if(nNode.getNodeType() == Node.ELEMENT_NODE){ | ||
81 | + | ||
82 | + Element eElement = (Element) nNode; | ||
83 | + String hour = getTagValue("hour",eElement); | ||
84 | + hour = String.format("%2s",hour).replace(" ","0"); | ||
85 | + tData.add(date + hour); // 0.시간 | ||
86 | + if (getTagValue("hour",eElement).equals("24")){ | ||
87 | + int tmp; | ||
88 | + tmp = Integer.parseInt(date); | ||
89 | + tmp += 1; | ||
90 | + date = String.format("%4s",String.valueOf(tmp)).replace(" ", "0"); | ||
91 | + } | ||
92 | + tData.add(IntCast(getTagValue("temp", eElement))); // 1.온도 | ||
93 | + tData.add(GetTemperature(IntCast(getTagValue("tmx", eElement)))); // 2.최고 온도 | ||
94 | + tData.add(GetTemperature(IntCast(getTagValue("tmn", eElement)))); // 3.최저 온도 | ||
95 | + tData.add(IntCast(getTagValue("ws", eElement))); // 4.풍속 | ||
96 | + tData.add(getTagValue("wfEn", eElement)); // 5.하늘상태 | ||
97 | + tData.add(getTagValue("pop", eElement)); // 6.강수확률 | ||
98 | + } // for end | ||
99 | + wData.add(tData); | ||
100 | + } // if end | ||
101 | + } catch (MalformedURLException e) { | ||
102 | + e.printStackTrace(); | ||
103 | + } catch (IOException e) { | ||
104 | + e.printStackTrace(); | ||
105 | + } catch (ParserConfigurationException e) { | ||
106 | + e.printStackTrace(); | ||
107 | + } catch (SAXException e) { | ||
108 | + e.printStackTrace(); | ||
109 | + } | ||
110 | + | ||
111 | + return wData; | ||
112 | + } | ||
113 | + | ||
114 | + public String IntCast(String tmp){ | ||
115 | + double temp = Double.parseDouble(tmp); | ||
116 | + int result = (int) temp; | ||
117 | + | ||
118 | + return String.valueOf(result); | ||
119 | + } | ||
120 | + | ||
121 | + // 체감온도에 필요한 값만 Return | ||
122 | + public ArrayList<ArrayList<String>> GetPerceived(String code) | ||
123 | + { | ||
124 | + ArrayList<ArrayList<String>> gData = new ArrayList<ArrayList<String>>(); | ||
125 | + | ||
126 | + try{ | ||
127 | + String url = "http://www.kma.go.kr/wid/queryDFSRSS.jsp?zone="+ code; | ||
128 | + | ||
129 | + DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); | ||
130 | + DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); | ||
131 | + Document doc = dBuilder.parse(url); | ||
132 | + | ||
133 | + // root tag | ||
134 | + doc.getDocumentElement().normalize(); | ||
135 | + | ||
136 | + NodeList nlDate = doc.getElementsByTagName("header"); | ||
137 | + Node ndate = nlDate.item(0); | ||
138 | + Element eDate = (Element) ndate; | ||
139 | + String date = getTagValue("tm", eDate); | ||
140 | + date = date.substring(4,8); | ||
141 | + | ||
142 | + // 파싱할 tag | ||
143 | + NodeList nList = doc.getElementsByTagName("data"); | ||
144 | + | ||
145 | + for(int temp = 0; temp < nList.getLength(); temp++){ | ||
146 | + Node nNode = nList.item(temp); | ||
147 | + ArrayList<String> data = new ArrayList<String>(); | ||
148 | + if(nNode.getNodeType() == Node.ELEMENT_NODE){ | ||
149 | + Element eElement = (Element) nNode; | ||
150 | + String hour = getTagValue("hour",eElement); | ||
151 | + hour = String.format("%2s",hour).replace(" ","0"); | ||
152 | + data.add(date + hour); | ||
153 | + | ||
154 | + if (getTagValue("hour",eElement).equals("24")){ | ||
155 | + int tmp; | ||
156 | + tmp = Integer.parseInt(date); | ||
157 | + tmp += 1; | ||
158 | + date = String.format("%4s",String.valueOf(tmp)).replace(" ", "0"); | ||
159 | + } | ||
160 | + data.add(getTagValue("temp",eElement)); | ||
161 | + data.add(getTagValue("ws",eElement)); | ||
162 | + } // for end | ||
163 | + gData.add(data); | ||
164 | + } // if end | ||
165 | + } catch (MalformedURLException e) { | ||
166 | + e.printStackTrace(); | ||
167 | + } catch (IOException e) { | ||
168 | + e.printStackTrace(); | ||
169 | + } catch (ParserConfigurationException e) { | ||
170 | + e.printStackTrace(); | ||
171 | + } catch (SAXException e) { | ||
172 | + e.printStackTrace(); | ||
173 | + } | ||
174 | + | ||
175 | + return gData; | ||
176 | + } | ||
177 | + | ||
178 | + public String GetTemperature(String temp) | ||
179 | + { | ||
180 | + if (temp.equals("999")) | ||
181 | + return "정보 없음"; | ||
182 | + else if (temp.equals("-999")) | ||
183 | + return "정보 없음"; | ||
184 | + | ||
185 | + return temp; | ||
186 | + } | ||
187 | + | ||
188 | + public String GetPerceived(String temp, String velo){ | ||
189 | + int perceived; | ||
190 | + double temper = Double.parseDouble(temp); | ||
191 | + double veloc = Double.parseDouble(velo); | ||
192 | + perceived = (int) (13.12 + 0.6215 * temper - 11.37 * Math.pow(veloc, 0.16) + 0.3965 * Math.pow(veloc, 0.16) * temper); | ||
193 | + | ||
194 | + return String.valueOf(perceived); | ||
195 | + } | ||
196 | + | ||
197 | + @Override | ||
198 | + public void run() { | ||
199 | + super.run(); | ||
200 | + if (android.os.Build.VERSION.SDK_INT > 9) { | ||
201 | + StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); | ||
202 | + StrictMode.setThreadPolicy(policy); | ||
203 | + } | ||
204 | + } | ||
205 | +} |
1 | +<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
2 | + xmlns:aapt="http://schemas.android.com/aapt" | ||
3 | + android:width="108dp" | ||
4 | + android:height="108dp" | ||
5 | + android:viewportWidth="108" | ||
6 | + android:viewportHeight="108"> | ||
7 | + <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> | ||
8 | + <aapt:attr name="android:fillColor"> | ||
9 | + <gradient | ||
10 | + android:endX="85.84757" | ||
11 | + android:endY="92.4963" | ||
12 | + android:startX="42.9492" | ||
13 | + android:startY="49.59793" | ||
14 | + android:type="linear"> | ||
15 | + <item | ||
16 | + android:color="#44000000" | ||
17 | + android:offset="0.0" /> | ||
18 | + <item | ||
19 | + android:color="#00000000" | ||
20 | + android:offset="1.0" /> | ||
21 | + </gradient> | ||
22 | + </aapt:attr> | ||
23 | + </path> | ||
24 | + <path | ||
25 | + android:fillColor="#FFFFFF" | ||
26 | + android:fillType="nonZero" | ||
27 | + android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" | ||
28 | + android:strokeWidth="1" | ||
29 | + android:strokeColor="#00000000" /> | ||
30 | +</vector> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
4.56 KB
6.19 KB
8.18 KB
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + android:width="108dp" | ||
4 | + android:height="108dp" | ||
5 | + android:viewportWidth="108" | ||
6 | + android:viewportHeight="108"> | ||
7 | + <path | ||
8 | + android:fillColor="#3DDC84" | ||
9 | + android:pathData="M0,0h108v108h-108z" /> | ||
10 | + <path | ||
11 | + android:fillColor="#00000000" | ||
12 | + android:pathData="M9,0L9,108" | ||
13 | + android:strokeWidth="0.8" | ||
14 | + android:strokeColor="#33FFFFFF" /> | ||
15 | + <path | ||
16 | + android:fillColor="#00000000" | ||
17 | + android:pathData="M19,0L19,108" | ||
18 | + android:strokeWidth="0.8" | ||
19 | + android:strokeColor="#33FFFFFF" /> | ||
20 | + <path | ||
21 | + android:fillColor="#00000000" | ||
22 | + android:pathData="M29,0L29,108" | ||
23 | + android:strokeWidth="0.8" | ||
24 | + android:strokeColor="#33FFFFFF" /> | ||
25 | + <path | ||
26 | + android:fillColor="#00000000" | ||
27 | + android:pathData="M39,0L39,108" | ||
28 | + android:strokeWidth="0.8" | ||
29 | + android:strokeColor="#33FFFFFF" /> | ||
30 | + <path | ||
31 | + android:fillColor="#00000000" | ||
32 | + android:pathData="M49,0L49,108" | ||
33 | + android:strokeWidth="0.8" | ||
34 | + android:strokeColor="#33FFFFFF" /> | ||
35 | + <path | ||
36 | + android:fillColor="#00000000" | ||
37 | + android:pathData="M59,0L59,108" | ||
38 | + android:strokeWidth="0.8" | ||
39 | + android:strokeColor="#33FFFFFF" /> | ||
40 | + <path | ||
41 | + android:fillColor="#00000000" | ||
42 | + android:pathData="M69,0L69,108" | ||
43 | + android:strokeWidth="0.8" | ||
44 | + android:strokeColor="#33FFFFFF" /> | ||
45 | + <path | ||
46 | + android:fillColor="#00000000" | ||
47 | + android:pathData="M79,0L79,108" | ||
48 | + android:strokeWidth="0.8" | ||
49 | + android:strokeColor="#33FFFFFF" /> | ||
50 | + <path | ||
51 | + android:fillColor="#00000000" | ||
52 | + android:pathData="M89,0L89,108" | ||
53 | + android:strokeWidth="0.8" | ||
54 | + android:strokeColor="#33FFFFFF" /> | ||
55 | + <path | ||
56 | + android:fillColor="#00000000" | ||
57 | + android:pathData="M99,0L99,108" | ||
58 | + android:strokeWidth="0.8" | ||
59 | + android:strokeColor="#33FFFFFF" /> | ||
60 | + <path | ||
61 | + android:fillColor="#00000000" | ||
62 | + android:pathData="M0,9L108,9" | ||
63 | + android:strokeWidth="0.8" | ||
64 | + android:strokeColor="#33FFFFFF" /> | ||
65 | + <path | ||
66 | + android:fillColor="#00000000" | ||
67 | + android:pathData="M0,19L108,19" | ||
68 | + android:strokeWidth="0.8" | ||
69 | + android:strokeColor="#33FFFFFF" /> | ||
70 | + <path | ||
71 | + android:fillColor="#00000000" | ||
72 | + android:pathData="M0,29L108,29" | ||
73 | + android:strokeWidth="0.8" | ||
74 | + android:strokeColor="#33FFFFFF" /> | ||
75 | + <path | ||
76 | + android:fillColor="#00000000" | ||
77 | + android:pathData="M0,39L108,39" | ||
78 | + android:strokeWidth="0.8" | ||
79 | + android:strokeColor="#33FFFFFF" /> | ||
80 | + <path | ||
81 | + android:fillColor="#00000000" | ||
82 | + android:pathData="M0,49L108,49" | ||
83 | + android:strokeWidth="0.8" | ||
84 | + android:strokeColor="#33FFFFFF" /> | ||
85 | + <path | ||
86 | + android:fillColor="#00000000" | ||
87 | + android:pathData="M0,59L108,59" | ||
88 | + android:strokeWidth="0.8" | ||
89 | + android:strokeColor="#33FFFFFF" /> | ||
90 | + <path | ||
91 | + android:fillColor="#00000000" | ||
92 | + android:pathData="M0,69L108,69" | ||
93 | + android:strokeWidth="0.8" | ||
94 | + android:strokeColor="#33FFFFFF" /> | ||
95 | + <path | ||
96 | + android:fillColor="#00000000" | ||
97 | + android:pathData="M0,79L108,79" | ||
98 | + android:strokeWidth="0.8" | ||
99 | + android:strokeColor="#33FFFFFF" /> | ||
100 | + <path | ||
101 | + android:fillColor="#00000000" | ||
102 | + android:pathData="M0,89L108,89" | ||
103 | + android:strokeWidth="0.8" | ||
104 | + android:strokeColor="#33FFFFFF" /> | ||
105 | + <path | ||
106 | + android:fillColor="#00000000" | ||
107 | + android:pathData="M0,99L108,99" | ||
108 | + android:strokeWidth="0.8" | ||
109 | + android:strokeColor="#33FFFFFF" /> | ||
110 | + <path | ||
111 | + android:fillColor="#00000000" | ||
112 | + android:pathData="M19,29L89,29" | ||
113 | + android:strokeWidth="0.8" | ||
114 | + android:strokeColor="#33FFFFFF" /> | ||
115 | + <path | ||
116 | + android:fillColor="#00000000" | ||
117 | + android:pathData="M19,39L89,39" | ||
118 | + android:strokeWidth="0.8" | ||
119 | + android:strokeColor="#33FFFFFF" /> | ||
120 | + <path | ||
121 | + android:fillColor="#00000000" | ||
122 | + android:pathData="M19,49L89,49" | ||
123 | + android:strokeWidth="0.8" | ||
124 | + android:strokeColor="#33FFFFFF" /> | ||
125 | + <path | ||
126 | + android:fillColor="#00000000" | ||
127 | + android:pathData="M19,59L89,59" | ||
128 | + android:strokeWidth="0.8" | ||
129 | + android:strokeColor="#33FFFFFF" /> | ||
130 | + <path | ||
131 | + android:fillColor="#00000000" | ||
132 | + android:pathData="M19,69L89,69" | ||
133 | + android:strokeWidth="0.8" | ||
134 | + android:strokeColor="#33FFFFFF" /> | ||
135 | + <path | ||
136 | + android:fillColor="#00000000" | ||
137 | + android:pathData="M19,79L89,79" | ||
138 | + android:strokeWidth="0.8" | ||
139 | + android:strokeColor="#33FFFFFF" /> | ||
140 | + <path | ||
141 | + android:fillColor="#00000000" | ||
142 | + android:pathData="M29,19L29,89" | ||
143 | + android:strokeWidth="0.8" | ||
144 | + android:strokeColor="#33FFFFFF" /> | ||
145 | + <path | ||
146 | + android:fillColor="#00000000" | ||
147 | + android:pathData="M39,19L39,89" | ||
148 | + android:strokeWidth="0.8" | ||
149 | + android:strokeColor="#33FFFFFF" /> | ||
150 | + <path | ||
151 | + android:fillColor="#00000000" | ||
152 | + android:pathData="M49,19L49,89" | ||
153 | + android:strokeWidth="0.8" | ||
154 | + android:strokeColor="#33FFFFFF" /> | ||
155 | + <path | ||
156 | + android:fillColor="#00000000" | ||
157 | + android:pathData="M59,19L59,89" | ||
158 | + android:strokeWidth="0.8" | ||
159 | + android:strokeColor="#33FFFFFF" /> | ||
160 | + <path | ||
161 | + android:fillColor="#00000000" | ||
162 | + android:pathData="M69,19L69,89" | ||
163 | + android:strokeWidth="0.8" | ||
164 | + android:strokeColor="#33FFFFFF" /> | ||
165 | + <path | ||
166 | + android:fillColor="#00000000" | ||
167 | + android:pathData="M79,19L79,89" | ||
168 | + android:strokeWidth="0.8" | ||
169 | + android:strokeColor="#33FFFFFF" /> | ||
170 | +</vector> |
Code/Test/app/src/main/res/drawable/main.png
0 → 100644
21.7 KB
8.06 KB
8.73 KB
Code/Test/app/src/main/res/drawable/rain.png
0 → 100644
8.18 KB
Code/Test/app/src/main/res/drawable/snow.png
0 → 100644
8.89 KB
8.55 KB
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > | ||
3 | + | ||
4 | + <item | ||
5 | + android:bottom="1dp" | ||
6 | + android:left="1dp" | ||
7 | + android:right="1dp" | ||
8 | + android:top="1dp"> | ||
9 | + <shape android:shape="rectangle" > | ||
10 | + <stroke | ||
11 | + android:width="2dp" | ||
12 | + android:color="#000000" /> | ||
13 | + | ||
14 | + <solid android:color="#FFF" /> | ||
15 | + </shape> | ||
16 | + </item> | ||
17 | + | ||
18 | +</layer-list> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
Code/Test/app/src/main/res/font/scdream3.ttf
0 → 100644
No preview for this file type
Code/Test/app/src/main/res/font/scdream4.ttf
0 → 100644
No preview for this file type
Code/Test/app/src/main/res/font/scdream5.ttf
0 → 100644
No preview for this file type
Code/Test/app/src/main/res/font/scdream6.ttf
0 → 100644
No preview for this file type
Code/Test/app/src/main/res/font/scdream7.ttf
0 → 100644
No preview for this file type
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | + xmlns:tools="http://schemas.android.com/tools" | ||
5 | + android:layout_width="match_parent" | ||
6 | + android:layout_height="match_parent" | ||
7 | + tools:context=".ClothesActivity"> | ||
8 | + | ||
9 | + <ScrollView | ||
10 | + android:layout_width="match_parent" | ||
11 | + android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" | ||
12 | + android:paddingRight="@dimen/activity_horizontal_margin" | ||
13 | + android:paddingTop="@dimen/activity_vertical_margin" | ||
14 | + android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".ClothesActivity"> | ||
15 | + | ||
16 | + <LinearLayout | ||
17 | + android:layout_width="match_parent" | ||
18 | + android:layout_height="wrap_content" | ||
19 | + android:orientation="vertical" | ||
20 | + android:weightSum="1"> | ||
21 | + | ||
22 | + <FrameLayout | ||
23 | + android:layout_width="match_parent" | ||
24 | + android:layout_height="wrap_content" | ||
25 | + android:layout_gravity="center_vertical"></FrameLayout> | ||
26 | + | ||
27 | + <LinearLayout | ||
28 | + android:orientation="horizontal" | ||
29 | + android:layout_width="match_parent" | ||
30 | + android:layout_height="wrap_content" | ||
31 | + android:layout_gravity="center_horizontal" | ||
32 | + android:weightSum="1"> | ||
33 | + <ImageView | ||
34 | + android:layout_width="90px" | ||
35 | + android:layout_height="wrap_content" | ||
36 | + android:id="@+id/Img_location" | ||
37 | + /> | ||
38 | + | ||
39 | + <TextView | ||
40 | + android:id="@+id/txt_location" | ||
41 | + android:layout_width="wrap_content" | ||
42 | + android:layout_height="wrap_content" | ||
43 | + android:fontFamily="@font/scdream6" | ||
44 | + android:text="위치 정보" | ||
45 | + android:textColor="#000000" | ||
46 | + android:layout_gravity="center_vertical"/> | ||
47 | + </LinearLayout> | ||
48 | + | ||
49 | + | ||
50 | + <ImageView | ||
51 | + android:layout_width="match_parent" | ||
52 | + android:layout_height="360px" | ||
53 | + android:id="@+id/main_weather" | ||
54 | + android:layout_centerHorizontal="true" | ||
55 | + android:layout_margin = "10dp"/> | ||
56 | + | ||
57 | + | ||
58 | + <LinearLayout | ||
59 | + android:orientation="horizontal" | ||
60 | + android:layout_width="match_parent" | ||
61 | + android:layout_height="150px" | ||
62 | + android:layout_gravity="center_horizontal" | ||
63 | + android:weightSum="2"> | ||
64 | + | ||
65 | + <LinearLayout | ||
66 | + android:layout_width="match_parent" | ||
67 | + android:layout_height="match_parent" | ||
68 | + android:layout_gravity="center_horizontal" | ||
69 | + android:layout_weight="1" | ||
70 | + android:orientation="horizontal"> | ||
71 | + | ||
72 | + <ImageView | ||
73 | + android:layout_width="110px" | ||
74 | + android:layout_height="110px" | ||
75 | + android:id="@+id/Img_aver" | ||
76 | + android:layout_centerHorizontal="true" | ||
77 | + android:layout_margin = "10dp"/> | ||
78 | + | ||
79 | + <LinearLayout | ||
80 | + android:layout_width="wrap_content" | ||
81 | + android:layout_height="wrap_content" | ||
82 | + android:layout_gravity="center_vertical" | ||
83 | + android:orientation="vertical"> | ||
84 | + | ||
85 | + <TextView | ||
86 | + android:id="@+id/txt_aver" | ||
87 | + android:layout_width="wrap_content" | ||
88 | + android:layout_height="wrap_content" | ||
89 | + android:fontFamily="@font/scdream6" | ||
90 | + android:text="평균 온도" | ||
91 | + android:textColor="#000000"/> | ||
92 | + | ||
93 | + <TextView | ||
94 | + android:id="@+id/input_aver" | ||
95 | + android:layout_width="wrap_content" | ||
96 | + android:layout_height="wrap_content" | ||
97 | + android:fontFamily="@font/scdream3" | ||
98 | + android:text="평균 온도 input" /> | ||
99 | + </LinearLayout> | ||
100 | + </LinearLayout> | ||
101 | + | ||
102 | + <LinearLayout | ||
103 | + android:orientation="horizontal" | ||
104 | + android:layout_width="match_parent" | ||
105 | + android:layout_height="150px" | ||
106 | + android:layout_gravity="center_horizontal" | ||
107 | + android:layout_weight="1"> | ||
108 | + <ImageView | ||
109 | + android:layout_width="110px" | ||
110 | + android:layout_height="110px" | ||
111 | + android:id="@+id/Img_perceived" | ||
112 | + android:layout_centerHorizontal="true" | ||
113 | + android:layout_marginTop="10dp" | ||
114 | + android:layout_marginBottom="10dp" | ||
115 | + android:layout_marginRight="10dp"/> | ||
116 | + | ||
117 | + <LinearLayout | ||
118 | + android:orientation="vertical" | ||
119 | + android:layout_width="wrap_content" | ||
120 | + android:layout_height="wrap_content" | ||
121 | + android:layout_gravity="center_vertical" | ||
122 | + android:weightSum="1"> | ||
123 | + <TextView | ||
124 | + android:id="@+id/txt_perceived" | ||
125 | + android:layout_width="wrap_content" | ||
126 | + android:layout_height="wrap_content" | ||
127 | + android:fontFamily="@font/scdream6" | ||
128 | + android:text="체감 온도" | ||
129 | + android:textColor="#000000"/> | ||
130 | + | ||
131 | + <TextView | ||
132 | + android:id="@+id/input_perceived" | ||
133 | + android:layout_width="wrap_content" | ||
134 | + android:layout_height="wrap_content" | ||
135 | + android:fontFamily="@font/scdream3" | ||
136 | + android:text="체감 온도 input" /> | ||
137 | + </LinearLayout> | ||
138 | + </LinearLayout> | ||
139 | + </LinearLayout> | ||
140 | + | ||
141 | + <LinearLayout | ||
142 | + android:orientation="horizontal" | ||
143 | + android:layout_width="match_parent" | ||
144 | + android:layout_height="150px" | ||
145 | + android:layout_gravity="center_horizontal" | ||
146 | + android:weightSum="2"> | ||
147 | + | ||
148 | + <LinearLayout | ||
149 | + android:layout_width="match_parent" | ||
150 | + android:layout_height="match_parent" | ||
151 | + android:layout_gravity="center_horizontal" | ||
152 | + android:layout_weight="1" | ||
153 | + android:orientation="horizontal"> | ||
154 | + | ||
155 | + <ImageView | ||
156 | + android:layout_width="110px" | ||
157 | + android:layout_height="110px" | ||
158 | + android:id="@+id/Img_wind" | ||
159 | + android:layout_centerHorizontal="true" | ||
160 | + android:layout_margin = "10dp"/> | ||
161 | + | ||
162 | + <LinearLayout | ||
163 | + android:layout_width="wrap_content" | ||
164 | + android:layout_height="wrap_content" | ||
165 | + android:layout_gravity="center_vertical" | ||
166 | + android:orientation="vertical"> | ||
167 | + | ||
168 | + <TextView | ||
169 | + android:id="@+id/txt_wind" | ||
170 | + android:layout_width="wrap_content" | ||
171 | + android:layout_height="wrap_content" | ||
172 | + android:fontFamily="@font/scdream6" | ||
173 | + android:text="풍속" | ||
174 | + android:textColor="#000000"/> | ||
175 | + | ||
176 | + <TextView | ||
177 | + android:id="@+id/input_wind" | ||
178 | + android:layout_width="wrap_content" | ||
179 | + android:layout_height="wrap_content" | ||
180 | + android:fontFamily="@font/scdream3" | ||
181 | + android:text="풍속 input" /> | ||
182 | + </LinearLayout> | ||
183 | + </LinearLayout> | ||
184 | + | ||
185 | + <LinearLayout | ||
186 | + android:orientation="horizontal" | ||
187 | + android:layout_width="match_parent" | ||
188 | + android:layout_height="150px" | ||
189 | + android:layout_gravity="center_horizontal" | ||
190 | + android:layout_weight="1"> | ||
191 | + <ImageView | ||
192 | + android:layout_width="110px" | ||
193 | + android:layout_height="110px" | ||
194 | + android:id="@+id/Img_pop" | ||
195 | + android:layout_centerHorizontal="true" | ||
196 | + android:layout_marginTop="10dp" | ||
197 | + android:layout_marginBottom="10dp" | ||
198 | + android:layout_marginRight="10dp"/> | ||
199 | + | ||
200 | + <LinearLayout | ||
201 | + android:orientation="vertical" | ||
202 | + android:layout_width="wrap_content" | ||
203 | + android:layout_height="wrap_content" | ||
204 | + android:layout_gravity="center_vertical" | ||
205 | + android:weightSum="1"> | ||
206 | + <TextView | ||
207 | + android:id="@+id/txt_pop" | ||
208 | + android:layout_width="wrap_content" | ||
209 | + android:layout_height="wrap_content" | ||
210 | + android:fontFamily="@font/scdream6" | ||
211 | + android:text="강수 확률" | ||
212 | + android:textColor="#000000"/> | ||
213 | + <TextView | ||
214 | + android:id="@+id/input_pop" | ||
215 | + android:layout_width="wrap_content" | ||
216 | + android:layout_height="wrap_content" | ||
217 | + android:fontFamily="@font/scdream3" | ||
218 | + android:text="강수 확률 input" /> | ||
219 | + </LinearLayout> | ||
220 | + </LinearLayout> | ||
221 | + </LinearLayout> | ||
222 | + | ||
223 | + <ImageView | ||
224 | + android:layout_width="match_parent" | ||
225 | + android:layout_height="wrap_content" | ||
226 | + android:id="@+id/today_cloth" | ||
227 | + android:layout_centerHorizontal="true" | ||
228 | + android:layout_margin = "10dp"/> | ||
229 | + | ||
230 | + <ImageView | ||
231 | + android:layout_width="match_parent" | ||
232 | + android:layout_height="wrap_content" | ||
233 | + android:id="@+id/recommend" | ||
234 | + android:layout_centerHorizontal="true" | ||
235 | + android:layout_margin = "10dp"/> | ||
236 | + | ||
237 | + <RelativeLayout | ||
238 | + android:layout_width="match_parent" | ||
239 | + android:layout_height="wrap_content" | ||
240 | + app:layout_behavior="@string/appbar_scrolling_view_behavior" | ||
241 | + tools:context="com.example.madwin.customlistviewexample.ClothesActivity" | ||
242 | + tools:showIn="@layout/activity_clothes"> | ||
243 | + | ||
244 | + <ListView | ||
245 | + android:id="@+id/checklist" | ||
246 | + android:layout_width="match_parent" | ||
247 | + android:layout_height="wrap_content" | ||
248 | + android:divider="#00ff0000"/> | ||
249 | + | ||
250 | + </RelativeLayout> | ||
251 | + | ||
252 | + <LinearLayout | ||
253 | + android:orientation="horizontal" | ||
254 | + android:layout_width="match_parent" | ||
255 | + android:layout_height="wrap_content" | ||
256 | + android:layout_gravity="center_horizontal" | ||
257 | + android:weightSum="2"> | ||
258 | + | ||
259 | + <Button | ||
260 | + android:id="@+id/btn_weather" | ||
261 | + android:layout_width="150dp" | ||
262 | + android:layout_height="wrap_content" | ||
263 | + android:layout_weight="1" | ||
264 | + android:fontFamily="@font/scdream5" | ||
265 | + android:layout_margin = "10dp" | ||
266 | + android:text="날씨 알아보기" | ||
267 | + /> | ||
268 | + | ||
269 | + <Button | ||
270 | + android:id="@+id/btn_main" | ||
271 | + android:layout_width="150dp" | ||
272 | + android:layout_height="wrap_content" | ||
273 | + android:layout_weight="1" | ||
274 | + android:fontFamily="@font/scdream5" | ||
275 | + android:layout_margin = "10dp" | ||
276 | + android:text="메인 페이지" /> | ||
277 | + </LinearLayout> | ||
278 | + </LinearLayout> | ||
279 | + </ScrollView> | ||
280 | + | ||
281 | +</androidx.constraintlayout.widget.ConstraintLayout> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | + | ||
3 | + | ||
4 | +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
5 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
6 | + xmlns:tools="http://schemas.android.com/tools" | ||
7 | + android:layout_width="match_parent" | ||
8 | + android:layout_height="match_parent" | ||
9 | + tools:context=".MainActivity"> | ||
10 | + | ||
11 | + <ScrollView | ||
12 | + android:layout_width="match_parent" | ||
13 | + android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" | ||
14 | + android:paddingRight="@dimen/activity_horizontal_margin" | ||
15 | + android:paddingTop="@dimen/activity_vertical_margin" | ||
16 | + android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"> | ||
17 | + | ||
18 | + <LinearLayout | ||
19 | + android:layout_width="match_parent" | ||
20 | + android:layout_height="wrap_content" | ||
21 | + android:orientation="vertical" | ||
22 | + android:weightSum="1"> | ||
23 | + | ||
24 | + <ImageView | ||
25 | + android:layout_width="match_parent" | ||
26 | + android:layout_height="wrap_content" | ||
27 | + android:id="@+id/angel" | ||
28 | + android:layout_centerHorizontal="true" /> | ||
29 | + | ||
30 | + <FrameLayout | ||
31 | + android:layout_width="match_parent" | ||
32 | + android:layout_height="wrap_content" | ||
33 | + android:layout_gravity="center_vertical"></FrameLayout> | ||
34 | + | ||
35 | + <TextView | ||
36 | + android:id="@+id/select_city" | ||
37 | + android:layout_width="wrap_content" | ||
38 | + android:layout_height="wrap_content" | ||
39 | + android:textSize="7pt" | ||
40 | + android:text="1. 도시를 입력해주세요." | ||
41 | + android:layout_margin = "10dp" | ||
42 | + android:fontFamily="@font/scdream5" | ||
43 | + android:textColor="#000000"/> | ||
44 | + | ||
45 | + <LinearLayout | ||
46 | + android:orientation="horizontal" | ||
47 | + android:layout_width="match_parent" | ||
48 | + android:layout_height="wrap_content" | ||
49 | + android:layout_gravity="center_horizontal" | ||
50 | + android:weightSum="3" | ||
51 | + android:layout_margin = "10dp"> | ||
52 | + <Spinner | ||
53 | + android:id="@+id/TopList" | ||
54 | + android:layout_width="match_parent" | ||
55 | + android:layout_height="wrap_content" | ||
56 | + android:layout_weight="1" /> | ||
57 | + | ||
58 | + <Spinner | ||
59 | + android:id="@+id/MdlList" | ||
60 | + android:layout_width="match_parent" | ||
61 | + android:layout_height="wrap_content" | ||
62 | + android:layout_weight="1" /> | ||
63 | + | ||
64 | + <Spinner | ||
65 | + android:id="@+id/LeafList" | ||
66 | + android:layout_width="match_parent" | ||
67 | + android:layout_height="wrap_content" | ||
68 | + android:layout_weight="1" /> | ||
69 | + | ||
70 | + | ||
71 | + </LinearLayout> | ||
72 | + | ||
73 | + <TextView | ||
74 | + android:id="@+id/select_date" | ||
75 | + android:layout_width="wrap_content" | ||
76 | + android:layout_height="wrap_content" | ||
77 | + android:fontFamily="@font/scdream5" | ||
78 | + android:text="2. 날짜 및 시간을 입력해주세요." | ||
79 | + android:textSize="7pt" | ||
80 | + android:layout_margin = "10dp" | ||
81 | + android:textColor="#000000"/> | ||
82 | + | ||
83 | + <LinearLayout | ||
84 | + android:orientation="horizontal" | ||
85 | + android:layout_width="match_parent" | ||
86 | + android:layout_height="wrap_content" | ||
87 | + android:layout_gravity="center_horizontal" | ||
88 | + android:weightSum="1" | ||
89 | + android:layout_marginTop="10dp" | ||
90 | + android:layout_marginLeft="10dp" | ||
91 | + android:layout_marginRight="10dp"> | ||
92 | + <Spinner | ||
93 | + android:layout_width="100dp" | ||
94 | + android:layout_height="wrap_content" | ||
95 | + android:id="@+id/start_month" | ||
96 | + android:layout_weight="0.33" | ||
97 | + android:fontFamily="@font/scdream3" | ||
98 | + android:textSize="6pt" /> | ||
99 | + <Spinner | ||
100 | + android:layout_width="100dp" | ||
101 | + android:layout_height="wrap_content" | ||
102 | + android:id="@+id/start_day" | ||
103 | + android:layout_weight="0.33" | ||
104 | + android:fontFamily="@font/scdream3" | ||
105 | + android:textSize="6pt" /> | ||
106 | + <Spinner | ||
107 | + android:layout_width="100dp" | ||
108 | + android:layout_height="wrap_content" | ||
109 | + android:id="@+id/start_hour" | ||
110 | + android:layout_weight="0.33" | ||
111 | + android:fontFamily="@font/scdream3" | ||
112 | + android:textSize="6pt" /> | ||
113 | + </LinearLayout> | ||
114 | + | ||
115 | + <LinearLayout | ||
116 | + android:orientation="horizontal" | ||
117 | + android:layout_width="match_parent" | ||
118 | + android:layout_height="wrap_content" | ||
119 | + android:layout_gravity="center_horizontal" | ||
120 | + android:weightSum="1" | ||
121 | + android:layout_marginBottom="10dp" | ||
122 | + android:layout_marginLeft="10dp" | ||
123 | + android:layout_marginRight="10dp"> | ||
124 | + <Spinner | ||
125 | + android:layout_width="100dp" | ||
126 | + android:layout_height="wrap_content" | ||
127 | + android:id="@+id/from_month" | ||
128 | + android:layout_weight="0.33" | ||
129 | + android:fontFamily="@font/scdream3" | ||
130 | + /> | ||
131 | + <Spinner | ||
132 | + android:layout_width="100dp" | ||
133 | + android:layout_height="wrap_content" | ||
134 | + android:id="@+id/from_day" | ||
135 | + android:layout_weight="0.33" | ||
136 | + android:fontFamily="@font/scdream3" | ||
137 | + /> | ||
138 | + <Spinner | ||
139 | + android:layout_width="100dp" | ||
140 | + android:layout_height="wrap_content" | ||
141 | + android:id="@+id/from_hour" | ||
142 | + android:layout_weight="0.33" | ||
143 | + android:fontFamily="@font/scdream3" | ||
144 | + /> | ||
145 | + </LinearLayout> | ||
146 | + | ||
147 | + <TextView | ||
148 | + android:id="@+id/select_gender" | ||
149 | + android:layout_width="wrap_content" | ||
150 | + android:layout_height="wrap_content" | ||
151 | + android:textSize="7pt" | ||
152 | + android:text="3. 성별을 입력해주세요." | ||
153 | + android:fontFamily="@font/scdream5" | ||
154 | + android:textColor="#000000" | ||
155 | + android:layout_margin = "10dp"/> | ||
156 | + | ||
157 | + <RadioGroup | ||
158 | + android:id="@+id/radioGender" | ||
159 | + android:layout_width="match_parent" | ||
160 | + android:layout_height="wrap_content" | ||
161 | + android:orientation="horizontal" | ||
162 | + android:layout_margin = "10dp"> | ||
163 | + | ||
164 | + <RadioButton | ||
165 | + android:id="@+id/select_woman" | ||
166 | + android:layout_width="wrap_content" | ||
167 | + android:layout_height="wrap_content" | ||
168 | + android:checked="true" | ||
169 | + android:layout_weight="1" | ||
170 | + android:text="여자" | ||
171 | + android:fontFamily="@font/scdream3" | ||
172 | + android:textSize="6pt"/> | ||
173 | + | ||
174 | + <RadioButton | ||
175 | + android:id="@+id/select_man" | ||
176 | + android:layout_width="wrap_content" | ||
177 | + android:layout_height="wrap_content" | ||
178 | + android:layout_weight="1" | ||
179 | + android:text="남자" | ||
180 | + android:fontFamily="@font/scdream3" | ||
181 | + android:textSize="6pt" /> | ||
182 | + | ||
183 | + </RadioGroup> | ||
184 | + | ||
185 | + <LinearLayout | ||
186 | + android:orientation="horizontal" | ||
187 | + android:layout_width="match_parent" | ||
188 | + android:layout_height="wrap_content" | ||
189 | + android:layout_gravity="center_horizontal" | ||
190 | + android:weightSum="2"> | ||
191 | + | ||
192 | + <Button | ||
193 | + android:id="@+id/btn_weather" | ||
194 | + android:layout_width="150dp" | ||
195 | + android:layout_height="wrap_content" | ||
196 | + android:layout_weight="1" | ||
197 | + android:fontFamily="@font/scdream5" | ||
198 | + android:layout_margin = "10dp" | ||
199 | + android:text="날씨 알아보기" /> | ||
200 | + | ||
201 | + <Button | ||
202 | + android:id="@+id/btn_clothes" | ||
203 | + android:layout_width="150dp" | ||
204 | + android:layout_height="wrap_content" | ||
205 | + android:layout_weight="1" | ||
206 | + android:fontFamily="@font/scdream5" | ||
207 | + android:layout_margin = "10dp" | ||
208 | + android:text="옷 추천받기" /> | ||
209 | + </LinearLayout> | ||
210 | + </LinearLayout> | ||
211 | + </ScrollView> | ||
212 | + | ||
213 | +</androidx.constraintlayout.widget.ConstraintLayout> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | + | ||
3 | + | ||
4 | +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
5 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
6 | + xmlns:tools="http://schemas.android.com/tools" | ||
7 | + android:layout_width="match_parent" | ||
8 | + android:layout_height="match_parent" | ||
9 | + android:background="@color/splash" | ||
10 | + tools:context=".SplashActivity"> | ||
11 | + | ||
12 | + <ImageView | ||
13 | + android:id="@+id/splash" | ||
14 | + android:layout_width="match_parent" | ||
15 | + android:layout_height="match_parent" | ||
16 | + android:src="@drawable/main" | ||
17 | + app:layout_constraintBottom_toBottomOf="parent" | ||
18 | + app:layout_constraintEnd_toEndOf="parent" | ||
19 | + app:layout_constraintHorizontal_bias="0.495" | ||
20 | + app:layout_constraintStart_toStartOf="parent" | ||
21 | + app:layout_constraintTop_toTopOf="parent" | ||
22 | + app:layout_constraintVertical_bias="0.532" /> | ||
23 | + | ||
24 | + | ||
25 | + | ||
26 | +</androidx.constraintlayout.widget.ConstraintLayout> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | + xmlns:tools="http://schemas.android.com/tools" | ||
5 | + android:layout_width="match_parent" | ||
6 | + android:layout_height="match_parent" | ||
7 | + tools:context=".WeatherActivity"> | ||
8 | + | ||
9 | + <ScrollView | ||
10 | + android:layout_width="match_parent" | ||
11 | + android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" | ||
12 | + android:paddingRight="@dimen/activity_horizontal_margin" | ||
13 | + android:paddingTop="@dimen/activity_vertical_margin" | ||
14 | + android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".WeatherActivity"> | ||
15 | + | ||
16 | + <LinearLayout | ||
17 | + android:layout_width="match_parent" | ||
18 | + android:layout_height="wrap_content" | ||
19 | + android:orientation="vertical" | ||
20 | + android:weightSum="1"> | ||
21 | + | ||
22 | + <FrameLayout | ||
23 | + android:layout_width="match_parent" | ||
24 | + android:layout_height="wrap_content" | ||
25 | + android:layout_gravity="center_vertical"></FrameLayout> | ||
26 | + | ||
27 | + <LinearLayout | ||
28 | + android:orientation="horizontal" | ||
29 | + android:layout_width="match_parent" | ||
30 | + android:layout_height="wrap_content" | ||
31 | + android:layout_gravity="center_horizontal" | ||
32 | + android:weightSum="1"> | ||
33 | + <ImageView | ||
34 | + android:layout_width="90px" | ||
35 | + android:layout_height="wrap_content" | ||
36 | + android:id="@+id/Img_location" /> | ||
37 | + | ||
38 | + <TextView | ||
39 | + android:id="@+id/txt_location" | ||
40 | + android:layout_width="wrap_content" | ||
41 | + android:layout_height="wrap_content" | ||
42 | + android:fontFamily="@font/scdream6" | ||
43 | + android:text="위치 정보" | ||
44 | + android:layout_gravity="center_vertical" | ||
45 | + android:textColor="#000000"/> | ||
46 | + </LinearLayout> | ||
47 | + | ||
48 | + <ImageView | ||
49 | + android:layout_width="match_parent" | ||
50 | + android:layout_height="360px" | ||
51 | + android:id="@+id/main_weather" | ||
52 | + android:layout_centerHorizontal="true" | ||
53 | + android:layout_margin = "10dp"/> | ||
54 | + | ||
55 | + <LinearLayout | ||
56 | + android:orientation="horizontal" | ||
57 | + android:layout_width="match_parent" | ||
58 | + android:layout_height="150px" | ||
59 | + android:layout_gravity="center_horizontal" | ||
60 | + android:weightSum="2"> | ||
61 | + | ||
62 | + <LinearLayout | ||
63 | + android:layout_width="match_parent" | ||
64 | + android:layout_height="match_parent" | ||
65 | + android:layout_gravity="center_horizontal" | ||
66 | + android:layout_weight="1" | ||
67 | + android:orientation="horizontal"> | ||
68 | + | ||
69 | + <ImageView | ||
70 | + android:layout_width="110px" | ||
71 | + android:layout_height="110px" | ||
72 | + android:id="@+id/Img_aver" | ||
73 | + android:layout_centerHorizontal="true" | ||
74 | + android:layout_margin = "10dp"/> | ||
75 | + | ||
76 | + <LinearLayout | ||
77 | + android:layout_width="wrap_content" | ||
78 | + android:layout_height="wrap_content" | ||
79 | + android:layout_gravity="center_vertical" | ||
80 | + android:orientation="vertical"> | ||
81 | + | ||
82 | + <TextView | ||
83 | + android:id="@+id/txt_now" | ||
84 | + android:layout_width="wrap_content" | ||
85 | + android:layout_height="wrap_content" | ||
86 | + android:fontFamily="@font/scdream6" | ||
87 | + android:text="현재 온도" | ||
88 | + android:textColor="#000000"/> | ||
89 | + | ||
90 | + <TextView | ||
91 | + android:id="@+id/input_now" | ||
92 | + android:layout_width="wrap_content" | ||
93 | + android:layout_height="wrap_content" | ||
94 | + android:fontFamily="@font/scdream3" | ||
95 | + android:text="현재 온도 input" | ||
96 | + android:textColor="#000000"/> | ||
97 | + </LinearLayout> | ||
98 | + </LinearLayout> | ||
99 | + | ||
100 | + <LinearLayout | ||
101 | + android:layout_width="match_parent" | ||
102 | + android:layout_height="match_parent" | ||
103 | + android:layout_gravity="center_horizontal" | ||
104 | + android:layout_weight="1" | ||
105 | + android:orientation="horizontal"> | ||
106 | + | ||
107 | + <ImageView | ||
108 | + android:id="@+id/Img_minmax" | ||
109 | + android:layout_width="110px" | ||
110 | + android:layout_height="110px" | ||
111 | + android:layout_centerHorizontal="true" | ||
112 | + android:layout_marginTop="10dp" | ||
113 | + android:layout_marginBottom="10dp" | ||
114 | + android:layout_marginRight="10dp" /> | ||
115 | + | ||
116 | + <LinearLayout | ||
117 | + android:layout_width="wrap_content" | ||
118 | + android:layout_height="wrap_content" | ||
119 | + android:layout_gravity="center_vertical" | ||
120 | + android:orientation="vertical" | ||
121 | + android:weightSum="1"> | ||
122 | + | ||
123 | + <TextView | ||
124 | + android:id="@+id/txt_perceived" | ||
125 | + android:layout_width="wrap_content" | ||
126 | + android:layout_height="wrap_content" | ||
127 | + android:fontFamily="@font/scdream6" | ||
128 | + android:text="체감 온도" | ||
129 | + android:textColor="#000000" /> | ||
130 | + | ||
131 | + <TextView | ||
132 | + android:id="@+id/input_perceived" | ||
133 | + android:layout_width="wrap_content" | ||
134 | + android:layout_height="wrap_content" | ||
135 | + android:fontFamily="@font/scdream3" | ||
136 | + android:text="체감 input" | ||
137 | + android:textColor="#000000" /> | ||
138 | + </LinearLayout> | ||
139 | + </LinearLayout> | ||
140 | + </LinearLayout> | ||
141 | + | ||
142 | + <LinearLayout | ||
143 | + android:orientation="horizontal" | ||
144 | + android:layout_width="match_parent" | ||
145 | + android:layout_height="150px" | ||
146 | + android:layout_gravity="center_horizontal" | ||
147 | + android:weightSum="2"> | ||
148 | + | ||
149 | + <LinearLayout | ||
150 | + android:layout_width="match_parent" | ||
151 | + android:layout_height="match_parent" | ||
152 | + android:layout_gravity="center_horizontal" | ||
153 | + android:layout_weight="1" | ||
154 | + android:orientation="horizontal"> | ||
155 | + | ||
156 | + <ImageView | ||
157 | + android:layout_width="110px" | ||
158 | + android:layout_height="110px" | ||
159 | + android:id="@+id/Img_wind" | ||
160 | + android:layout_centerHorizontal="true" | ||
161 | + android:layout_margin = "10dp"/> | ||
162 | + | ||
163 | + <LinearLayout | ||
164 | + android:layout_width="wrap_content" | ||
165 | + android:layout_height="wrap_content" | ||
166 | + android:layout_gravity="center_vertical" | ||
167 | + android:orientation="vertical"> | ||
168 | + | ||
169 | + <TextView | ||
170 | + android:id="@+id/txt_wind" | ||
171 | + android:layout_width="wrap_content" | ||
172 | + android:layout_height="wrap_content" | ||
173 | + android:fontFamily="@font/scdream6" | ||
174 | + android:text="풍속" | ||
175 | + android:textColor="#000000"/> | ||
176 | + | ||
177 | + <TextView | ||
178 | + android:id="@+id/input_wind" | ||
179 | + android:layout_width="wrap_content" | ||
180 | + android:layout_height="wrap_content" | ||
181 | + android:fontFamily="@font/scdream3" | ||
182 | + android:text="풍속 input" | ||
183 | + android:textColor="#000000"/> | ||
184 | + </LinearLayout> | ||
185 | + </LinearLayout> | ||
186 | + | ||
187 | + <LinearLayout | ||
188 | + android:orientation="horizontal" | ||
189 | + android:layout_width="match_parent" | ||
190 | + android:layout_height="match_parent" | ||
191 | + android:layout_gravity="center_horizontal" | ||
192 | + android:layout_weight="1"> | ||
193 | + <ImageView | ||
194 | + android:layout_width="110px" | ||
195 | + android:layout_height="110px" | ||
196 | + android:id="@+id/Img_pop" | ||
197 | + android:layout_centerHorizontal="true" | ||
198 | + android:layout_marginTop="10dp" | ||
199 | + android:layout_marginBottom="10dp" | ||
200 | + android:layout_marginRight="10dp"/> | ||
201 | + | ||
202 | + <LinearLayout | ||
203 | + android:orientation="vertical" | ||
204 | + android:layout_width="wrap_content" | ||
205 | + android:layout_height="wrap_content" | ||
206 | + android:layout_gravity="center_vertical" | ||
207 | + android:weightSum="1"> | ||
208 | + <TextView | ||
209 | + android:id="@+id/txt_pop" | ||
210 | + android:layout_width="wrap_content" | ||
211 | + android:layout_height="wrap_content" | ||
212 | + android:fontFamily="@font/scdream6" | ||
213 | + android:text="강수 확률" | ||
214 | + android:textColor="#000000"/> | ||
215 | + <TextView | ||
216 | + android:id="@+id/input_pop" | ||
217 | + android:layout_width="wrap_content" | ||
218 | + android:layout_height="wrap_content" | ||
219 | + android:fontFamily="@font/scdream3" | ||
220 | + android:text="강수 확률 input" | ||
221 | + android:textColor="#000000"/> | ||
222 | + </LinearLayout> | ||
223 | + </LinearLayout> | ||
224 | + </LinearLayout> | ||
225 | + | ||
226 | + <ImageView | ||
227 | + android:layout_width="match_parent" | ||
228 | + android:layout_height="wrap_content" | ||
229 | + android:id="@+id/today_weather" | ||
230 | + android:layout_centerHorizontal="true" | ||
231 | + android:layout_margin = "10dp"/> | ||
232 | + | ||
233 | + <TextView | ||
234 | + android:id="@+id/select_time" | ||
235 | + android:layout_width="match_parent" | ||
236 | + android:layout_height="match_parent" | ||
237 | + android:fontFamily="@font/scdream3" | ||
238 | + android:text="select_time" | ||
239 | + android:textSize="5pt" | ||
240 | + android:gravity="right" | ||
241 | + android:layout_marginRight="10dp" /> | ||
242 | + | ||
243 | + <LinearLayout | ||
244 | + android:orientation="horizontal" | ||
245 | + android:layout_width="match_parent" | ||
246 | + android:layout_height="105px" | ||
247 | + android:layout_weight="5"> | ||
248 | + | ||
249 | + <TextView | ||
250 | + android:id="@+id/txt_time" | ||
251 | + android:layout_width="100px" | ||
252 | + android:layout_height="match_parent" | ||
253 | + android:layout_weight="1" | ||
254 | + android:fontFamily="@font/scdream6" | ||
255 | + android:gravity="center" | ||
256 | + android:text="시간" | ||
257 | + android:textColor="#000000" /> | ||
258 | + | ||
259 | + <TextView | ||
260 | + android:layout_width="100px" | ||
261 | + android:layout_height="match_parent" | ||
262 | + android:text="날씨" | ||
263 | + android:id="@+id/txt_weather" | ||
264 | + android:textColor="#000000" | ||
265 | + android:fontFamily="@font/scdream6" | ||
266 | + android:gravity="center" | ||
267 | + android:layout_weight="1" /> | ||
268 | + | ||
269 | + <TextView | ||
270 | + android:layout_width="100px" | ||
271 | + android:layout_height="match_parent" | ||
272 | + android:text="기온" | ||
273 | + android:id="@+id/txt_temperature" | ||
274 | + android:textColor="#000000" | ||
275 | + android:fontFamily="@font/scdream6" | ||
276 | + android:gravity="center" | ||
277 | + android:layout_weight="1" /> | ||
278 | + | ||
279 | + <TextView | ||
280 | + android:layout_width="100px" | ||
281 | + android:layout_height="match_parent" | ||
282 | + android:text="풍속" | ||
283 | + android:id="@+id/txt_windspeed" | ||
284 | + android:textColor="#000000" | ||
285 | + android:fontFamily="@font/scdream6" | ||
286 | + android:gravity="center" | ||
287 | + android:layout_weight="1" /> | ||
288 | + | ||
289 | + <TextView | ||
290 | + android:layout_width="100px" | ||
291 | + android:layout_height="match_parent" | ||
292 | + android:text="강수확률" | ||
293 | + android:id="@+id/txt_precipitation" | ||
294 | + android:textColor="#000000" | ||
295 | + android:fontFamily="@font/scdream6" | ||
296 | + android:gravity="center" | ||
297 | + android:layout_weight="1" /> | ||
298 | + | ||
299 | + </LinearLayout> | ||
300 | + | ||
301 | + <ImageView | ||
302 | + android:layout_width="match_parent" | ||
303 | + android:layout_height="wrap_content" | ||
304 | + android:id="@+id/Img_blank" | ||
305 | + android:layout_centerHorizontal="true" /> | ||
306 | + | ||
307 | + <RelativeLayout | ||
308 | + android:layout_width="match_parent" | ||
309 | + android:layout_height="wrap_content" | ||
310 | + app:layout_behavior="@string/appbar_scrolling_view_behavior" | ||
311 | + tools:context="com.example.madwin.customlistviewexample.WeatherActivity" | ||
312 | + tools:showIn="@layout/activity_weather"> | ||
313 | + | ||
314 | + <ListView | ||
315 | + android:id="@+id/listview1" | ||
316 | + android:layout_width="match_parent" | ||
317 | + android:layout_height="wrap_content" /> | ||
318 | + | ||
319 | + </RelativeLayout> | ||
320 | + | ||
321 | + <LinearLayout | ||
322 | + android:orientation="horizontal" | ||
323 | + android:layout_width="match_parent" | ||
324 | + android:layout_height="wrap_content" | ||
325 | + android:layout_gravity="center_horizontal" | ||
326 | + android:weightSum="2"> | ||
327 | + | ||
328 | + <Button | ||
329 | + android:id="@+id/btn_clothes" | ||
330 | + android:layout_width="150dp" | ||
331 | + android:layout_height="wrap_content" | ||
332 | + android:layout_weight="1" | ||
333 | + android:fontFamily="@font/scdream5" | ||
334 | + android:layout_margin = "10dp" | ||
335 | + android:text="옷 추천받기" /> | ||
336 | + | ||
337 | + <Button | ||
338 | + android:id="@+id/btn_main" | ||
339 | + android:layout_width="150dp" | ||
340 | + android:layout_height="wrap_content" | ||
341 | + android:layout_weight="1" | ||
342 | + android:fontFamily="@font/scdream5" | ||
343 | + android:layout_margin = "10dp" | ||
344 | + android:text="메인 페이지" /> | ||
345 | + </LinearLayout> | ||
346 | + </LinearLayout> | ||
347 | + </ScrollView> | ||
348 | + | ||
349 | +</androidx.constraintlayout.widget.ConstraintLayout> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + android:layout_width="match_parent" | ||
4 | + android:layout_height="match_parent"> | ||
5 | + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
6 | + android:orientation="horizontal" | ||
7 | + android:layout_width="match_parent" | ||
8 | + android:layout_height="match_parent"> | ||
9 | + <LinearLayout | ||
10 | + android:orientation="horizontal" | ||
11 | + android:layout_width="match_parent" | ||
12 | + android:layout_height="wrap_content" | ||
13 | + android:layout_weight="5" | ||
14 | + android:layout_marginRight="25dp" | ||
15 | + android:layout_marginLeft="25dp"> | ||
16 | + | ||
17 | + <ImageView | ||
18 | + android:layout_width="80px" | ||
19 | + android:layout_height="80px" | ||
20 | + android:id="@+id/check_icon" | ||
21 | + android:gravity="center_horizontal"/> | ||
22 | + | ||
23 | + <TextView | ||
24 | + android:layout_width="match_parent" | ||
25 | + android:layout_height="match_parent" | ||
26 | + android:text="체크리스트" | ||
27 | + android:id="@+id/input_checklist" | ||
28 | + android:textColor="#000000" | ||
29 | + android:gravity="center_vertical" | ||
30 | + android:layout_marginLeft="5dp" | ||
31 | + android:fontFamily="@font/scdream4" | ||
32 | + android:layout_weight="1" /> | ||
33 | + | ||
34 | + | ||
35 | + </LinearLayout> | ||
36 | + </LinearLayout> | ||
37 | + | ||
38 | +</androidx.constraintlayout.widget.ConstraintLayout> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + android:layout_width="match_parent" | ||
4 | + android:layout_height="match_parent"> | ||
5 | + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
6 | + android:orientation="horizontal" | ||
7 | + android:layout_width="match_parent" | ||
8 | + android:layout_height="match_parent"> | ||
9 | + <LinearLayout | ||
10 | + android:orientation="horizontal" | ||
11 | + android:layout_width="match_parent" | ||
12 | + android:layout_height="wrap_content" | ||
13 | + android:layout_weight="5"> | ||
14 | + | ||
15 | + <TextView | ||
16 | + android:layout_width="100px" | ||
17 | + android:layout_height="match_parent" | ||
18 | + android:text="시간" | ||
19 | + android:id="@+id/input_time" | ||
20 | + android:textColor="#000000" | ||
21 | + android:gravity="center" | ||
22 | + android:fontFamily="@font/scdream3" | ||
23 | + android:layout_weight="1" /> | ||
24 | + | ||
25 | + <ImageView | ||
26 | + android:layout_width="100px" | ||
27 | + android:layout_height="110px" | ||
28 | + android:id="@+id/input_weather" | ||
29 | + android:layout_weight="0.8" | ||
30 | + android:gravity="center_horizontal"/> | ||
31 | + | ||
32 | + <TextView | ||
33 | + android:layout_width="100px" | ||
34 | + android:layout_height="match_parent" | ||
35 | + android:text="기온" | ||
36 | + android:id="@+id/input_temperature" | ||
37 | + android:textColor="#000000" | ||
38 | + android:gravity="center" | ||
39 | + android:fontFamily="@font/scdream3" | ||
40 | + android:layout_weight="1" /> | ||
41 | + | ||
42 | + <TextView | ||
43 | + android:layout_width="100px" | ||
44 | + android:layout_height="match_parent" | ||
45 | + android:text="풍속" | ||
46 | + android:id="@+id/input_wind" | ||
47 | + android:textColor="#000000" | ||
48 | + android:gravity="center" | ||
49 | + android:fontFamily="@font/scdream3" | ||
50 | + android:layout_weight="1" /> | ||
51 | + | ||
52 | + <TextView | ||
53 | + android:layout_width="wrap_content" | ||
54 | + android:layout_height="match_parent" | ||
55 | + android:text="강수확률" | ||
56 | + android:id="@+id/input_precipitation" | ||
57 | + android:textColor="#000000" | ||
58 | + android:gravity="center" | ||
59 | + android:fontFamily="@font/scdream3" | ||
60 | + android:layout_weight="1" /> | ||
61 | + | ||
62 | + </LinearLayout> | ||
63 | + </LinearLayout> | ||
64 | + | ||
65 | +</androidx.constraintlayout.widget.ConstraintLayout> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <background android:drawable="@color/ic_clothes_background"/> | ||
4 | + <foreground android:drawable="@mipmap/ic_clothes_foreground"/> | ||
5 | +</adaptive-icon> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <background android:drawable="@color/ic_clothes_background"/> | ||
4 | + <foreground android:drawable="@mipmap/ic_clothes_foreground"/> | ||
5 | +</adaptive-icon> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <background android:drawable="@drawable/ic_launcher_background" /> | ||
4 | + <foreground android:drawable="@drawable/ic_launcher_foreground" /> | ||
5 | +</adaptive-icon> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <background android:drawable="@drawable/ic_launcher_background" /> | ||
4 | + <foreground android:drawable="@drawable/ic_launcher_foreground" /> | ||
5 | +</adaptive-icon> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
3.35 KB
4.81 KB
5.62 KB
9.3 KB
9.27 KB
2.12 KB
3.05 KB
3.37 KB
6.49 KB
6.51 KB
4.83 KB
6.83 KB
8.21 KB
11.8 KB
11.9 KB
7.67 KB
11.2 KB
13 KB
17.1 KB
17.3 KB
10.7 KB
16.4 KB
18.8 KB
20.8 KB
20.8 KB
1 | +<resources xmlns:tools="http://schemas.android.com/tools"> | ||
2 | + <!-- Base application theme. --> | ||
3 | + <style name="Theme.Test" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> | ||
4 | + <!-- Primary brand color. --> | ||
5 | + <item name="colorPrimary">@color/purple_200</item> | ||
6 | + <item name="colorPrimaryVariant">@color/purple_700</item> | ||
7 | + <item name="colorOnPrimary">@color/black</item> | ||
8 | + <!-- Secondary brand color. --> | ||
9 | + <item name="colorSecondary">@color/teal_200</item> | ||
10 | + <item name="colorSecondaryVariant">@color/teal_200</item> | ||
11 | + <item name="colorOnSecondary">@color/black</item> | ||
12 | + <!-- Status bar color. --> | ||
13 | + <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> | ||
14 | + <!-- Customize your theme here. --> | ||
15 | + </style> | ||
16 | +</resources> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
Code/Test/app/src/main/res/values/arrays.xml
0 → 100644
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<resources> | ||
3 | + <string-array name="planets_array"> | ||
4 | + <item>Mercury</item> | ||
5 | + <item>Venus</item> | ||
6 | + <item>Earth</item> | ||
7 | + <item>Mars</item> | ||
8 | + <item>Jupiter</item> | ||
9 | + <item>Saturn</item> | ||
10 | + <item>Uranus</item> | ||
11 | + <item>Neptune</item> | ||
12 | + </string-array> | ||
13 | +</resources> |
Code/Test/app/src/main/res/values/colors.xml
0 → 100644
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<resources> | ||
3 | + <color name="purple_200">#FFBB86FC</color> | ||
4 | + <color name="purple_500">#FF6200EE</color> | ||
5 | + <color name="purple_700">#FF3700B3</color> | ||
6 | + <color name="teal_200">#FF03DAC5</color> | ||
7 | + <color name="teal_700">#FF018786</color> | ||
8 | + <color name="black">#FF000000</color> | ||
9 | + <color name="white">#FFFFFFFF</color> | ||
10 | + <color name="splash">#a8cfee</color> | ||
11 | +</resources> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
Code/Test/app/src/main/res/values/dimens.xml
0 → 100644
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<resources> | ||
3 | + <!-- Default screen margins, per the Android Design guidelines. --> | ||
4 | + <dimen name="activity_horizontal_margin">16dp</dimen> | ||
5 | + <dimen name="activity_vertical_margin">16dp</dimen> | ||
6 | +</resources> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
Code/Test/app/src/main/res/values/themes.xml
0 → 100644
1 | +<resources xmlns:tools="http://schemas.android.com/tools"> | ||
2 | + <!-- Base application theme. --> | ||
3 | + <style name="Theme.Test" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> | ||
4 | + <!-- Primary brand color. --> | ||
5 | + <item name="colorPrimary">#7385e1</item> | ||
6 | + <item name="colorPrimaryVariant">#a7b5ff</item> | ||
7 | + <item name="colorOnPrimary">@color/white</item> | ||
8 | + <!-- Secondary brand color. --> | ||
9 | + <item name="colorSecondary">@color/teal_200</item> | ||
10 | + <item name="colorSecondaryVariant">@color/teal_700</item> | ||
11 | + <item name="colorOnSecondary">@color/black</item> | ||
12 | + <!-- Status bar color. --> | ||
13 | + <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> | ||
14 | + <!-- Customize your theme here. --> | ||
15 | + </style> | ||
16 | +</resources> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment