2017103976

android code

Showing 110 changed files with 3560 additions and 0 deletions
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_clothes"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_clothes_round"
android:supportsRtl="true"
android:theme="@style/Theme.Test"
android:usesCleartextTraffic="true">
<activity android:name=".ClothesActivity"></activity>
<activity android:name=".WeatherActivity" />
<activity android:name=".MainActivity"/>
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
package com.example.test;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
public class CheckListAdapter extends BaseAdapter {
// Adapter에 추가된 데이터를 저장하기 위한 ArrayList
private ArrayList<CheckListItem> CheckListItemList = new ArrayList<CheckListItem>();
// ListViewAdapter의 생성자
public CheckListAdapter() {
}
// Adapter에 사용되는 데이터의 개수를 리턴.
@Override
public int getCount() {
return CheckListItemList.size();
}
// position에 위치한 데이터를 화면에 출력하는데 사용될 View를 리턴.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final int pos = position;
final Context context = parent.getContext();
// "listview_check" Layout을 inflate하여 convertView 참조 획득.
if (convertView == null) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.listview_check, parent, false);
}
// 화면에 표시될 View(Layout이 inflate된)으로부터 위젯에 대한 참조 획득
ImageView icon = (ImageView) convertView.findViewById(R.id.check_icon);
TextView checklist = (TextView) convertView.findViewById(R.id.input_checklist);
// Data Set(listViewItemList)에서 position에 위치한 데이터 참조 획득
CheckListItem checklistItem = CheckListItemList.get(position);
// 아이템 내 각 위젯에 데이터 반영
icon.setImageDrawable(checklistItem.getIcon());
checklist.setText(checklistItem.getCheckList());
return convertView;
}
// 지정한 위치(position)에 있는 데이터와 관계된 아이템(row)의 ID를 리턴.
@Override
public long getItemId(int position) {
return position;
}
// 지정한 위치(position)에 있는 데이터 리턴
@Override
public Object getItem(int position) {
return CheckListItemList.get(position) ;
}
// 아이템 데이터 추가를 위한 함수
public void addItem(Drawable icon, String temp) {
CheckListItem item = new CheckListItem();
item.setIcon(icon);
item.setCheckList(temp);
CheckListItemList.add(item);
}
}
\ No newline at end of file
package com.example.test;
import android.graphics.drawable.Drawable;
public class CheckListItem {
private Drawable check;
private String list;
public void setIcon(Drawable icon) {
check = icon ;
}
public void setCheckList(String checklist) {
list = checklist ;
}
public Drawable getIcon() {
return this.check ;
}
public String getCheckList() {
return this.list ;
}
}
package com.example.test;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import java.io.InputStream;
import java.util.ArrayList;
public class ClothesActivity extends AppCompatActivity {
private Button btn_main;
private Button btn_weather;
public static String start = "";
public static String from = "";
TextView Location;
ClothesRecommend mClothes;
ClothesActivity cThis;
TextView input_Average;
TextView input_Perceived;
TextView input_Wind;
TextView input_Precipiation;
ImageView main_Weather;
ImageView main_Location;
ImageView main_Average;
ImageView main_Perceived;
ImageView main_Wind;
ImageView main_Precipitation;
ImageView today_Cloth;
ImageView recommend;
Bitmap bitmap_Weather;
Bitmap bitmap_Location;
Bitmap bitmap_temperature;
Bitmap bitmap_Wind;
Bitmap bitmap_Precipitation;
Bitmap bitmap_Today;
Bitmap bitmap_Recommend;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_clothes);
Initialize();
}
public void Initialize(){
cThis = this;
Location = (TextView) findViewById(R.id.txt_location);
btn_main = findViewById(R.id.btn_main);//btn_main 아이디 찾기
btn_main.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//버튼 클릭시 WeatherActivity 에서 MainActivity 로 이동
Intent intent = new Intent(ClothesActivity.this, MainActivity.class);
startActivity(intent);// 이동
}
});
Intent intent = getIntent();
String code = intent.getStringExtra("code");
String start = intent.getStringExtra("start");
String from = intent.getStringExtra("from");
String leaf = intent.getStringExtra("leaf");
String gender = intent.getStringExtra("gender");
btn_weather = findViewById(R.id.btn_weather);//btn_weather 아이디 찾기
btn_weather.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//버튼 클릭시 ClothesActivity 에서 WeatherActivity 로 이동 경로
Intent intent = new Intent(ClothesActivity.this, WeatherActivity.class);
intent.putExtra("code", code); //code에 있는 값 이동
intent.putExtra("start", start); //start에 있는 값 이동
intent.putExtra("from", from); //from에 있는 값 이동
intent.putExtra("leaf", leaf); //leaf에 있는 값 이동
intent.putExtra("gender", gender); //gender에 있는 값 이동
startActivity(intent);// 이동
}
});
Location.setText(leaf);
mClothes = new ClothesRecommend((ClothesActivity) cThis);
ImgUpload();
Recommend(start, from, code, gender);
}
public void ImgUpload(){
main_Location = (ImageView)findViewById(R.id.Img_location);
main_Average = (ImageView)findViewById(R.id.Img_aver);
main_Perceived = (ImageView)findViewById(R.id.Img_perceived);
main_Wind = (ImageView)findViewById(R.id.Img_wind);
main_Precipitation = (ImageView)findViewById(R.id.Img_pop);
today_Cloth = (ImageView)findViewById(R.id.today_cloth);
AssetManager as = getResources().getAssets();
InputStream is = null;
try{
is = as.open("location.png");
bitmap_Location = BitmapFactory.decodeStream(is);
main_Location.setImageBitmap(bitmap_Location);
is.close();
}catch(Exception e){
e.printStackTrace();
}
try{
is = as.open("temperature.png");
bitmap_temperature = BitmapFactory.decodeStream(is);
main_Average.setImageBitmap(bitmap_temperature);
main_Perceived.setImageBitmap(bitmap_temperature);
is.close();
}catch(Exception e){
e.printStackTrace();
}
try{
is = as.open("wind.png");
bitmap_Wind = BitmapFactory.decodeStream(is);
main_Wind.setImageBitmap(bitmap_Wind);
is.close();
}catch(Exception e){
e.printStackTrace();
}
try{
is = as.open("pop.png");
bitmap_Precipitation = BitmapFactory.decodeStream(is);
main_Precipitation.setImageBitmap(bitmap_Precipitation);
is.close();
}catch(Exception e){
e.printStackTrace();
}
try{
is = as.open("today_cloth.png");
bitmap_Today = BitmapFactory.decodeStream(is);
today_Cloth.setImageBitmap(bitmap_Today);
is.close();
}catch(Exception e){
e.printStackTrace();
}
}
public void Recommend(String start, String from, String code, String gender){
ArrayList<ArrayList<String>> gData = new ArrayList<ArrayList<String>>();
input_Average = (TextView)findViewById(R.id.input_aver);
input_Perceived = (TextView)findViewById(R.id.input_perceived);
input_Wind = (TextView)findViewById(R.id.input_wind);
input_Precipiation = (TextView)findViewById(R.id.input_pop);
// 날씨 정보 Get
mClothes = new ClothesRecommend((ClothesActivity) cThis);
gData = mClothes.AccessWeather(code);
try {
int tmp = 0;
int tmx = -50; // 가장 높은 온도
int tmn = 50; // 가장 낮은 온도
int vmx = 0; // 가장 센 풍속
int temp = 0; // 평균 온도를 구하기 위한 temp
int stmp = 0; // 평균 온도를 구하기 위한 sumtmp
int cnt = 0; // 평균 온도를 구하기 위한 cnt
int gen = 0; // 성별
int pop = 0; // 강수확률
int mpop = 0; // 최대 강수확률
ArrayList<Integer> wNum = new ArrayList<>();
// gData에 접근
for (int i = 0; i < gData.size(); i++) {
String hour = gData.get(i).get(0);
System.out.println(start);
System.out.println(from);
if (start.compareTo(hour) <= 0 && from.compareTo(hour) >= 0) {
wNum.add(i);
temp = Integer.parseInt(gData.get(i).get(1));
stmp += temp;
cnt += 1;
tmp = mClothes.Cal_Perceived(gData.get(i).get(1), gData.get(i).get(4));
// 최고 체감온도 설정
if (tmp > tmx) tmx = tmp;
// 최저 체감온도 설정
if (tmp < tmn) tmn = tmp;
double velo = Double.parseDouble(gData.get(i).get(4));
// 최대 풍속 설정
if (vmx < (int) velo)
vmx = (int) velo;
pop = Integer.parseInt(gData.get(i).get(6));
if (pop > mpop) {
mpop = pop;
}
}
}
String main = gData.get(wNum.get(0)).get(5);
main = GetMainWeather(main);
AssetManager as = getResources().getAssets();
InputStream is = null;
main_Weather = (ImageView) findViewById(R.id.main_weather);
try {
is = as.open(main + ".png");
bitmap_Weather = BitmapFactory.decodeStream(is);
main_Weather.setImageBitmap(bitmap_Weather);
is.close();
} catch (Exception e) {
e.printStackTrace();
}
if (cnt != 0) stmp = (stmp / cnt);
if (gender.equals("여자")) gen = 1;
int gap = tmx - tmn;
ArrayList<Integer> perceived = new ArrayList<Integer>();
perceived.add(mClothes.Cal_Perceived(String.valueOf(stmp),String.valueOf(vmx)));
perceived.add(gen);
ArrayList<ArrayList<String>> clothes = new ArrayList<ArrayList<String>>();
clothes = mClothes.Recommend(perceived);
ArrayList<String> wCode = clothes.get(0);
ArrayList<String> Top = clothes.get(1);
ArrayList<String> Bottom = clothes.get(2);
// 옷 이미지 정보 불러오기
String mCode = wCode.get(0);
recommend = (ImageView)findViewById(R.id.recommend);
try{
is = as.open(mCode + ".png");
bitmap_Recommend = BitmapFactory.decodeStream(is);
recommend.setImageBitmap(bitmap_Recommend);
is.close();
} catch(Exception e){
e.printStackTrace();
}
input_Average.setText(String.valueOf(stmp) + "°C");
input_Perceived.setText(String.valueOf(tmn) + "°C ~ " + String.valueOf(tmx) + "°C");
input_Wind.setText(String.valueOf(vmx) + "m/s");
input_Precipiation.setText(String.valueOf(mpop) + "%");
int rain;
if (mpop < 60) {
rain = 0;
} else {
rain = 1;
}
GetCheckList(MergeList(Top),MergeList(Bottom), gap, vmx, rain);
} catch(Exception e){
AlertDialog.Builder dlg = new AlertDialog.Builder(ClothesActivity.this);
dlg.setMessage("선택한 시간대에 맞는 날씨를 불러올 수 없어 \n현재 날씨로 대체합니다."); // 메시지
dlg.setPositiveButton("확인",new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int which) {
}
});
dlg.show();
ArrayList<String> Now = new ArrayList<>();
Now = gData.get(0);
String main = Now.get(5);
main = GetMainWeather(main);
AssetManager as = getResources().getAssets();
InputStream is = null;
main_Weather = (ImageView) findViewById(R.id.main_weather);
try {
is = as.open(main + ".png");
bitmap_Weather = BitmapFactory.decodeStream(is);
main_Weather.setImageBitmap(bitmap_Weather);
is.close();
} catch (Exception E) {
E.printStackTrace();
}
int temp = mClothes.Cal_Perceived(Now.get(1), Now.get(4));
input_Average.setText(Now.get(1) + "°C");
input_Perceived.setText(String.valueOf(temp) + "°C");
input_Wind.setText(Now.get(4) + "m/s");
input_Precipiation.setText(Now.get(6) + "%");
int rain;
if (Integer.parseInt(Now.get(6)) < 60) {
rain = 0;
} else {
rain = 1;
}
int gen = 0;
if (gender.equals("여자"))
gen = 1;
ArrayList<Integer> perceived = new ArrayList<Integer>();
perceived.add(temp);
perceived.add(gen);
ArrayList<ArrayList<String>> clothes = new ArrayList<ArrayList<String>>();
clothes = mClothes.Recommend(perceived);
ArrayList<String> wCode = clothes.get(0);
ArrayList<String> Top = clothes.get(1);
ArrayList<String> Bottom = clothes.get(2);
// 옷 이미지 정보 불러오기
String mCode = wCode.get(0);
recommend = (ImageView)findViewById(R.id.recommend);
try{
is = as.open(mCode + ".png");
bitmap_Recommend = BitmapFactory.decodeStream(is);
recommend.setImageBitmap(bitmap_Recommend);
is.close();
} catch(Exception E){
E.printStackTrace();
}
GetCheckList(MergeList(Top),MergeList(Bottom), 0, Integer.parseInt(Now.get(4)), rain);
}
}
public String MergeList(ArrayList<String> list){
String result = list.get(0);
for (int i = 1; i < list.size(); i++){
result = result + ", " + list.get(i);
}
return result;
}
public String GetMainWeather(String main){
if (main.equals("Clear")) {
main = "wClear";
} else if (main.equals("Partly Cloudy")) {
main = "wPartcloudy";
} else if (main.equals("Mostly Cloudy")) {
main = "wMostcloudy";
} else if (main.equals("Cloudy")) {
main = "wCloudy";
} else if (main.equals("Rain")) {
main = "wRain";
} else if (main.equals("Snow/Rain")) {
main = "wSnowrain";
} else if (main.equals("Snow")) {
main = "wSnow";
}
return main;
}
public void GetCheckList(String top, String bottom, int gap, int velo, int rain){
ListView listview ;
CheckListAdapter adapter;
// Adapter 생성
adapter = new CheckListAdapter() ;
// 리스트뷰 참조 및 Adapter달기
listview = (ListView) findViewById(R.id.checklist);
listview.setAdapter(adapter);
adapter.addItem(ContextCompat.getDrawable(this, R.drawable.check), "상의는 " + top + "을 추천해요!");
adapter.addItem(ContextCompat.getDrawable(this, R.drawable.check), "하의는 " + bottom + "을 추천해요!");
// 일교차 경고
if (gap >= 10) {
adapter.addItem(ContextCompat.getDrawable(this, R.drawable.check), "일교차가 크니 옷차림에 주의하세요.");
}
// 풍속에 따른 옷 추천
if (velo < 4) {
adapter.addItem(ContextCompat.getDrawable(this, R.drawable.check), "바람이 많이 불지 않아요~");
} else if (velo >= 4 && velo < 9) {
adapter.addItem(ContextCompat.getDrawable(this, R.drawable.check), "바람이 조금 부니 긴팔이나 가디건을 챙겨주세요.");
} else if (velo >= 9 && velo < 14) {
adapter.addItem(ContextCompat.getDrawable(this, R.drawable.check), "바람이 강하니 바람막이나 겉옷을 챙겨주세요.");
} else {
adapter.addItem(ContextCompat.getDrawable(this, R.drawable.check), "아주 강한 바람이므로 외출을 자제해주세요.");
}
// 강수 확률에 따른 옷 추천
if (rain == 0){
adapter.addItem(ContextCompat.getDrawable(this, R.drawable.check), "오늘은 비소식이 없네요!");
} else if (rain == 1){
adapter.addItem(ContextCompat.getDrawable(this, R.drawable.check), "오늘 비소식이 있으니 우산이나 우비를 챙기세요!!");
}
setListViewHeightBasedOnChildren(listview);
}
// 리스트뷰 전체 목록 보이는 함수
public static void setListViewHeightBasedOnChildren(ListView listView) {
ListAdapter listAdapter = listView.getAdapter();
if (listAdapter == null) {
// pre-condition
return;
}
int totalHeight = 0;
int desiredWidth = View.MeasureSpec.makeMeasureSpec(listView.getWidth(), View.MeasureSpec.AT_MOST);
for (int i = 0; i < listAdapter.getCount(); i++) {
View listItem = listAdapter.getView(i, null, listView);
listItem.measure(desiredWidth, View.MeasureSpec.UNSPECIFIED);
totalHeight += listItem.getMeasuredHeight();
}
ViewGroup.LayoutParams params = listView.getLayoutParams();
params.height = totalHeight + (listView.getDividerHeight() * (listAdapter.getCount() - 1));
listView.setLayoutParams(params);
listView.requestLayout();
}
}
\ No newline at end of file
package com.example.test;
import android.os.StrictMode;
import java.util.ArrayList;
public class ClothesRecommend extends Thread {
ClothesActivity cContext;
WeatherActivity wContext;
WeatherForCast mWeather;
public ClothesRecommend(ClothesActivity mContext) {
this.cContext = cContext;
}
public int Cal_Perceived(String Temper, String Velo) {
int perceived;
double temper = Double.parseDouble(Temper);
double velo = Double.parseDouble(Velo);
perceived = (int) (13.12 + 0.6215 * temper - 11.37 * Math.pow(velo, 0.16) + 0.3965 * Math.pow(velo, 0.16) * temper);
return perceived;
}
// 체감온도에 따른 옷추천 (Recommend는 [체감온도, 성별]으로 이루어진 배열)
public ArrayList<ArrayList<String>> Recommend(ArrayList<Integer> Recommend){
int perceived = Recommend.get(0);
int gender = Recommend.get(1);
ArrayList<String> code = new ArrayList<String>();
ArrayList<String> top = new ArrayList<String>();
ArrayList<String> bottom = new ArrayList<String>();
ArrayList<ArrayList<String>> clothes = new ArrayList<ArrayList<String>>();
if (perceived >= 28){
top.add("민소매");
top.add("반팔");
bottom.add("반바지");
if (gender == 1){
bottom.add("치마");
top.add("원피스");
code.add("11");
} else { code.add("10"); }
} else if (perceived >= 23) {
top.add("반팔");
top.add("얇은 셔츠");
top.add("긴팔");
bottom.add("반바지");
bottom.add("면바지");
if (gender == 1){
bottom.add("치마");
code.add("21");
} else { code.add("20"); }
} else if (perceived >= 20) {
top.add("긴팔");
top.add("가디건");
bottom.add("면바지");
bottom.add("슬랙스");
bottom.add("스키니");
code.add("30");
} else if (perceived >= 17) {
top.add("가디건");
top.add("후드티");
top.add("맨투맨");
bottom.add("청바지");
bottom.add("면바지");
code.add("40");
} else if (perceived >= 12) {
top.add("후드티");
top.add("셔츠");
top.add("가디건");
bottom.add("긴바지");
bottom.add("청바지");
if (gender == 1){
bottom.add("살색스타킹");
code.add("51");
} else { code.add("50"); }
} else if (perceived >= 10) {
top.add("자켓");
top.add("니트");
top.add("트렌치코트");
bottom.add("긴바지");
if (gender == 1){
bottom.add("검정스타킹");
code.add("61");
} else { code.add("60"); }
} else if (perceived >= 4) {
top.add("코트");
top.add("자켓");
top.add("히트텍");
bottom.add("긴바지");
if (gender == 1){
bottom.add("레깅스");
code.add("71");
} else { code.add("70"); }
} else {
top.add("패딩");
top.add("두꺼운 코트");
bottom.add("긴바지");
if (gender == 1) {
bottom.add("레깅스");
code.add("81");
} else { code.add("80"); }
}
clothes.add(code);
clothes.add(top);
clothes.add(bottom);
// Return [[이미지 코드], [상의], [하의]]
return clothes;
}
public ArrayList<ArrayList<String>> AccessWeather(String code){
ArrayList<ArrayList<String>> gData = new ArrayList<ArrayList<String>>();
mWeather = new WeatherForCast(code, (WeatherActivity) wContext);
gData = mWeather.GetOpenWeather(code);
return gData;
}
@Override
public void run() {
super.run();
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
}
}
package com.example.test;
import android.content.ContentValues;
import android.os.StrictMode;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
public class GetAreaCode extends Thread {
MainActivity mContext;
public GetAreaCode(MainActivity mContext)
{
this.mContext = mContext;
}
// 시 리스트 받아오는 함수
public LinkedList GetTopCode(){
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
String result;
URL url = null;
URLConnection conn;
JSONParser parser;
JSONArray jArr;
JSONObject jobj;
//시 검색
try {
url = new URL("http://www.kma.go.kr/DFSROOT/POINT/DATA/top.json.txt");
conn = url.openConnection();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
LinkedList mArea = new LinkedList();
try {
InputStreamReader isr = new InputStreamReader(url.openStream(), "UTF-8");
BufferedReader br = new BufferedReader(isr);
result = br.readLine().toString();
br.close();
parser = new JSONParser();
jArr = (JSONArray) parser.parse(result);
for (int i = 0; i < jArr.size(); i++) {
jobj = (JSONObject) jArr.get(i);
mArea.add(jobj.get("value"));
}
} catch (IOException | ParseException e) {
e.printStackTrace();
}
return mArea;
}
// 시 코드 받아와서 구 검색하는 함수
public LinkedList GetMdlCode(String Top){
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
String result;
String areaMdl = "종로구";
String code = ""; //지역 코드
URL url = null;
URLConnection conn;
JSONParser parser;
JSONArray jArr;
JSONObject jobj;
//시 검색
try {
url = new URL("http://www.kma.go.kr/DFSROOT/POINT/DATA/mdl."+Top+".json.txt");
conn = url.openConnection();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
LinkedList mArea = new LinkedList();
try {
InputStreamReader isr = new InputStreamReader(url.openStream(), "UTF-8");
BufferedReader br = new BufferedReader(isr);
result = br.readLine().toString();
br.close();
parser = new JSONParser();
jArr = (JSONArray) parser.parse(result);
for (int i = 0; i < jArr.size(); i++) {
jobj = (JSONObject) jArr.get(i);
mArea.add(jobj.get("value"));
if (jobj.get("value").equals(areaMdl)) {
code = (String) jobj.get("code");
}
}
} catch (IOException | ParseException e) {
e.printStackTrace();
}
return mArea;
}
// 구 코드 받아와서 동 검색 함수
public LinkedList GetLeafCode(String Mdl){
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
String result;
String areaLeaf = "종로1가동";
String code = "";
URL url = null;
URLConnection conn;
JSONParser parser;
JSONArray jArr;
JSONObject jobj;
//시 검색
try {
url = new URL("http://www.kma.go.kr/DFSROOT/POINT/DATA/leaf."+Mdl+".json.txt");
conn = url.openConnection();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
LinkedList mArea = new LinkedList();
try {
InputStreamReader isr = new InputStreamReader(url.openStream(), "UTF-8");
BufferedReader br = new BufferedReader(isr);
result = br.readLine().toString();
br.close();
parser = new JSONParser();
jArr = (JSONArray) parser.parse(result);
for (int i = 0; i < jArr.size(); i++) {
jobj = (JSONObject) jArr.get(i);
mArea.add(jobj.get("value"));
if (jobj.get("value").equals(areaLeaf)) {
code = (String) jobj.get("code");
}
}
} catch (IOException | ParseException e) {
e.printStackTrace();
}
return mArea;
}
// 시 코드 검색하는 함수
public String SearchTop(Object areaTop) {
//areaTop은 시 이름!!! (코드가 아님)
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
String result;
String code = ""; //지역 코드
URL url = null;
URLConnection conn;
JSONParser parser;
JSONArray jArr;
JSONObject jobj;
//시 검색
try {
url = new URL("http://www.kma.go.kr/DFSROOT/POINT/DATA/top.json.txt");
conn = url.openConnection();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
try {
InputStreamReader isr = new InputStreamReader(url.openStream(), "UTF-8");
BufferedReader br = new BufferedReader(isr);
result = br.readLine().toString();
br.close();
parser = new JSONParser();
jArr = (JSONArray) parser.parse(result);
for (int i = 0; i < jArr.size(); i++) {
jobj = (JSONObject) jArr.get(i);
if (jobj.get("value").equals(areaTop)) {
code = (String) jobj.get("code");
break;
}
}
} catch (IOException | ParseException e) {
e.printStackTrace();
}
return code;
}
// 구 코드 검색하는 함수
public String SearchMdl(Object areaMdl, Object Top) {
// areaMdl은 구 이름!! 코드가 아님
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
String result;
String code = ""; //지역 코드
URL url = null;
URLConnection conn;
JSONParser parser;
JSONArray jArr;
JSONObject jobj;
//시 검색
try {
url = new URL("http://www.kma.go.kr/DFSROOT/POINT/DATA/mdl."+Top+".json.txt");
conn = url.openConnection();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
try {
InputStreamReader isr = new InputStreamReader(url.openStream(), "UTF-8");
BufferedReader br = new BufferedReader(isr);
result = br.readLine().toString();
br.close();
parser = new JSONParser();
jArr = (JSONArray) parser.parse(result);
for (int i = 0; i < jArr.size(); i++) {
jobj = (JSONObject) jArr.get(i);
if (jobj.get("value").equals(areaMdl)) {
code = (String) jobj.get("code");
break;
}
}
} catch (IOException | ParseException e) {
e.printStackTrace();
}
return code;
}
// 동 검색하는 함수
public String SearchLeaf(Object areaLeaf, Object Mdl) {
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
String result;
String code = ""; //지역 코드
URL url = null;
URLConnection conn;
JSONParser parser;
JSONArray jArr;
JSONObject jobj;
//시 검색
try {
url = new URL("http://www.kma.go.kr/DFSROOT/POINT/DATA/leaf."+Mdl+".json.txt");
conn = url.openConnection();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
try {
InputStreamReader isr = new InputStreamReader(url.openStream(), "UTF-8");
BufferedReader br = new BufferedReader(isr);
result = br.readLine().toString();
br.close();
parser = new JSONParser();
jArr = (JSONArray) parser.parse(result);
for (int i = 0; i < jArr.size(); i++) {
jobj = (JSONObject) jArr.get(i);
if (jobj.get("value").equals(areaLeaf)) {
code = (String) jobj.get("code");
break;
}
}
} catch (IOException | ParseException e) {
e.printStackTrace();
}
return code;
}
@Override
public void run() {
super.run();
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
}
}
package com.example.test;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
public class ListViewAdapter extends BaseAdapter {
// Adapter에 추가된 데이터를 저장하기 위한 ArrayList
private ArrayList<ListViewItem> listViewItemList = new ArrayList<ListViewItem>();
// ListViewAdapter의 생성자
public ListViewAdapter() {
}
// Adapter에 사용되는 데이터의 개수를 리턴.
@Override
public int getCount() {
return listViewItemList.size();
}
// position에 위치한 데이터를 화면에 출력하는데 사용될 View를 리턴.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final int pos = position;
final Context context = parent.getContext();
// "listview_item" Layout을 inflate하여 convertView 참조 획득.
if (convertView == null) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.listview_item, parent, false);
}
// 화면에 표시될 View(Layout이 inflate된)으로부터 위젯에 대한 참조 획득
TextView time = (TextView) convertView.findViewById(R.id.input_time);
ImageView weather = (ImageView) convertView.findViewById(R.id.input_weather);
TextView temperature = (TextView) convertView.findViewById(R.id.input_temperature);
TextView wind = (TextView) convertView.findViewById(R.id.input_wind);
TextView pop = (TextView) convertView.findViewById(R.id.input_precipitation);
// Data Set(listViewItemList)에서 position에 위치한 데이터 참조 획득
ListViewItem listViewItem = listViewItemList.get(position);
// 아이템 내 각 위젯에 데이터 반영
time.setText(listViewItem.getTime());
weather.setImageDrawable(listViewItem.getWeather());
temperature.setText(listViewItem.getTemperature());
wind.setText(listViewItem.getWind());
pop.setText(listViewItem.getPrecipitation());
return convertView;
}
// 지정한 위치(position)에 있는 데이터와 관계된 아이템(row)의 ID를 리턴.
@Override
public long getItemId(int position) {
return position;
}
// 지정한 위치(position)에 있는 데이터 리턴
@Override
public Object getItem(int position) {
return listViewItemList.get(position) ;
}
// 아이템 데이터 추가를 위한 함수
public void addItem(String time, Drawable weather, String temp, String wind, String pop) {
ListViewItem item = new ListViewItem();
item.setTime(time);
item.setWeather(weather);
item.setTemperature(temp);
item.setWind(wind);
item.setPrecipitation(pop);
listViewItemList.add(item);
}
}
\ No newline at end of file
package com.example.test;
import android.graphics.drawable.Drawable;
public class ListViewItem {
private Drawable weather;
private String time;
private String temperature;
private String wind;
private String precipitation;
public void setWeather(Drawable icon) {
weather = icon ;
}
public void setTime(String mtime) {
time = mtime ;
}
public void setTemperature(String temp) {
temperature = temp ;
}
public void setWind(String mwind) {
wind = mwind ;
}
public void setPrecipitation(String prec) {
precipitation = prec ;
}
public Drawable getWeather() {
return this.weather ;
}
public String getTime() {
return this.time ;
}
public String getTemperature() {
return this.temperature ;
}
public String getWind() {
return this.wind;
}
public String getPrecipitation() {
return this.precipitation;
}
}
package com.example.test;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.location.Address;
import android.location.Geocoder;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import java.io.InputStream;
import java.util.ArrayList;
import java.io.IOException;
import java.util.Calendar;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
public class MainActivity extends AppCompatActivity {
public static String start = "";
public static String from = "";
private Spinner spinner;
ArrayList<String> arrayArea;
ArrayAdapter<String> arrayAdapter;
MainActivity mThis;
GetAreaCode mArea;
Button btn_clothes;
String code;
private static final int GPS_ENABLE_REQUEST_CODE = 2000;
// 날짜 받아오는 함수 초기화
Spinner sMonth;
Spinner sDay;
Spinner sHour;
Spinner fMonth;
Spinner fDay;
Spinner fHour;
ArrayAdapter<String> ArrayAdapter2;
ArrayAdapter<String> ArrayAdapter3;
ArrayAdapter<String> ArrayAdapter4;
ImageView Angel;
Bitmap bitmap_angel;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Initialize();
}
public void Initialize() {
mThis = this;
Angel = (ImageView)findViewById(R.id.angel);
AssetManager as = getResources().getAssets();
InputStream is = null;
try{
is = as.open("angel.png");
bitmap_angel = BitmapFactory.decodeStream(is);
Angel.setImageBitmap(bitmap_angel);
is.close();
}catch(Exception e){
e.printStackTrace();
}
SelectDate();
SaveTop();
}
public void SaveTop() {
mArea = new GetAreaCode(this);
LinkedList area = new LinkedList();
area = mArea.GetTopCode();
arrayAdapter = new ArrayAdapter<>(getApplicationContext(),
android.R.layout.simple_spinner_dropdown_item, area);
spinner = (Spinner)findViewById(R.id.TopList);
spinner.setAdapter(arrayAdapter);
LinkedList finalArea = area;
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
SaveMdl(mArea.SearchTop(finalArea.get(i)));
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
}
public void SaveMdl(String Top) {
arrayArea = new ArrayList<>();
mArea = new GetAreaCode(this);
LinkedList area = new LinkedList();
area = mArea.GetMdlCode(Top);
arrayAdapter = new ArrayAdapter<>(getApplicationContext(),
android.R.layout.simple_spinner_dropdown_item, area);
spinner = (Spinner)findViewById(R.id.MdlList);
spinner.setAdapter(arrayAdapter);
LinkedList finalArea = area;
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
System.out.println(mArea.SearchMdl(finalArea.get(i), Top));
SaveLeaf(mArea.SearchMdl(finalArea.get(i), Top));
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
}
public void SaveLeaf(String Mdl) {
arrayArea = new ArrayList<>();
mArea = new GetAreaCode(this);
final RadioGroup rg = (RadioGroup)findViewById(R.id.radioGender);
LinkedList area = new LinkedList();
area = mArea.GetLeafCode(Mdl);
arrayAdapter = new ArrayAdapter<>(getApplicationContext(),
android.R.layout.simple_spinner_dropdown_item, area);
spinner = (Spinner)findViewById(R.id.LeafList);
spinner.setAdapter(arrayAdapter);
LinkedList finalArea = area;
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
code = mArea.SearchLeaf(finalArea.get(i), Mdl);
View.OnClickListener listener = new View.OnClickListener()
{
@Override
public void onClick(View v) {
start = "";
String month = sMonth.getSelectedItem().toString();
start += String.format("%2s",month.substring(0,month.length()-1)).replace(" ","0");
String day = sDay.getSelectedItem().toString();
start += String.format("%2s",day.substring(0,day.length()-1)).replace(" ","0");
String hour = sHour.getSelectedItem().toString();
start += String.format("%2s",hour.substring(0,hour.length()-1)).replace(" ","0");
from = "";
String month2 = fMonth.getSelectedItem().toString();
from += String.format("%2s",month2.substring(0,month2.length()-1)).replace(" ","0");
String day2 = fDay.getSelectedItem().toString();
from += String.format("%2s",day2.substring(0,day2.length()-1)).replace(" ","0");
String hour2 = fHour.getSelectedItem().toString();
from += String.format("%2s",hour2.substring(0,hour2.length()-1)).replace(" ","0");
String leaf = spinner.getSelectedItem().toString();
int gender = rg.getCheckedRadioButtonId();
RadioButton rb = (RadioButton)findViewById(gender);
Intent intent = new Intent(MainActivity.this, WeatherActivity.class);
intent.putExtra("code", code); //code에 있는 값 이동
intent.putExtra("start", start); //start에 있는 값 이동
intent.putExtra("from", from); //from에 있는 값 이동
intent.putExtra("leaf", leaf); //leaf에 있는 값 이동
intent.putExtra("gender", rb.getText().toString());
startActivity(intent); // 이동
}
};
Button btn_weather = (Button) findViewById(R.id.btn_weather);
btn_weather.setOnClickListener(listener);
btn_clothes = findViewById(R.id.btn_clothes);
btn_clothes.setOnClickListener(new View.OnClickListener() { //선언
@Override
public void onClick(View v) {
//MainActivity 에서 ClothesActivity 로 이동
start = "";
String month = sMonth.getSelectedItem().toString();
start += String.format("%2s",month.substring(0,month.length()-1)).replace(" ","0");
String day = sDay.getSelectedItem().toString();
start += String.format("%2s",day.substring(0,day.length()-1)).replace(" ","0");
String hour = sHour.getSelectedItem().toString();
start += String.format("%2s",hour.substring(0,hour.length()-1)).replace(" ","0");
from = "";
String month2 = fMonth.getSelectedItem().toString();
from += String.format("%2s",month2.substring(0,month2.length()-1)).replace(" ","0");
String day2 = fDay.getSelectedItem().toString();
from += String.format("%2s",day2.substring(0,day2.length()-1)).replace(" ","0");
String hour2 = fHour.getSelectedItem().toString();
from += String.format("%2s",hour2.substring(0,hour2.length()-1)).replace(" ","0");
String leaf = spinner.getSelectedItem().toString();
int gender = rg.getCheckedRadioButtonId();
RadioButton rb = (RadioButton)findViewById(gender);
Intent intent = new Intent(MainActivity.this, ClothesActivity.class);
intent.putExtra("code", code); //code에 있는 값 이동
intent.putExtra("start", start); //start에 있는 값 이동
intent.putExtra("from", from); //from에 있는 값 이동
intent.putExtra("leaf", leaf); //leaf에 있는 값 이동
intent.putExtra("code", code);//code에 있는 값 이동
intent.putExtra("gender", rb.getText().toString()); //gender에 있는 값 이동
startActivity(intent);//액티비티 이동
}
});
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
}
public void SelectDate(){
Calendar cal = Calendar.getInstance();
int month = cal.get(Calendar.MONTH) + 1;
int day = cal.get(Calendar.DAY_OF_MONTH);
int hour = cal.get(Calendar.HOUR_OF_DAY);
// *** 초기 위젯에 현재 시각 박기
LinkedList LMonth = new LinkedList();
LinkedList LDay = new LinkedList();
LinkedList LHour = new LinkedList();
LMonth.add(String.valueOf(month) + "월");
int day1 = day;
int day2 = day + 1;
int day3 = day + 2;
int day4 = day + 3;
switch(month){
case 1: case 3: case 5: case 7: case 8: case 10: case 12:
if (day4 > 31){
LMonth.add(String.valueOf(month + 1) + "월");
if (day1 > 31){
day1 -= 31;
day2 -= 31;
day3 -= 31;
day4 -= 31;
break;
} else if (day2 > 31){
day2 -= 31;
day3 -= 31;
day4 -= 31;
break;
} else if (day3 > 31){
day3 -= 31;
day4 -= 31;
break;
} else if (day4 > 31) {
day4 -= 31;
}
} else{
break;
}
case 2:
if (day4 > 28){
LMonth.add(String.valueOf(month + 1) + "월");
if (day1 > 28){
day1 -= 28;
day2 -= 28;
day3 -= 28;
day4 -= 28;
break;
} else if (day2 > 28){
day2 -= 28;
day3 -= 28;
day4 -= 28;
break;
} else if (day3 > 28){
day3 -= 28;
day4 -= 28;
break;
} else if (day4 > 28) {
day4 -= 28;
}
} else{
break;
}
case 4: case 6: case 9: case 11:
if (day4 > 30){
LMonth.add(String.valueOf(month + 1) + "월");
if (day1 > 30){
day1 -= 30;
day2 -= 30;
day3 -= 30;
day4 -= 30;
break;
} else if (day2 > 30){
day2 -= 30;
day3 -= 30;
day4 -= 30;
break;
} else if (day3 > 30){
day3 -= 30;
day4 -= 30;
break;
} else if (day4 > 30) {
day4 -= 30;
}
} else {
break;
}
}
LDay.add(String.valueOf(day1) + "일");
LDay.add(String.valueOf(day2) + "일");
LDay.add(String.valueOf(day3) + "일");
LDay.add(String.valueOf(day4) + "일");
for (int i = 1; i <= 24; i++){
LHour.add(String.valueOf(i)+"시");
}
// 월 select
ArrayAdapter2 = new ArrayAdapter<>(getApplicationContext(),
android.R.layout.simple_spinner_dropdown_item, LMonth);
sMonth = (Spinner)findViewById(R.id.start_month);
sMonth.setAdapter(ArrayAdapter2);
sMonth.setSelection(getIndex(sMonth, String.valueOf(month) + "월"));
LinkedList finalmonth = LMonth;
sMonth.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
fMonth = (Spinner)findViewById(R.id.from_month);
fMonth.setAdapter(ArrayAdapter2);
fMonth.setSelection(getIndex(fMonth, String.valueOf(month) + "월"));
LinkedList frommonth = LMonth;
fMonth.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
// 일 select
ArrayAdapter3 = new ArrayAdapter<>(getApplicationContext(),
android.R.layout.simple_spinner_dropdown_item, LDay);
sDay = (Spinner)findViewById(R.id.start_day);
sDay.setAdapter(ArrayAdapter3);
sDay.setSelection(getIndex(sDay, String.valueOf(day) + "일"));
LinkedList finalday = LDay;
sDay.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
fDay = (Spinner)findViewById(R.id.from_day);
fDay.setAdapter(ArrayAdapter3);
fDay.setSelection(getIndex(fDay, String.valueOf(day) + "일"));
LinkedList fromday = LDay;
fDay.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
// 시간 select
ArrayAdapter4 = new ArrayAdapter<>(getApplicationContext(),
android.R.layout.simple_spinner_dropdown_item, LHour);
sHour = (Spinner)findViewById(R.id.start_hour);
sHour.setAdapter(ArrayAdapter4);
sHour.setSelection(getIndex(sHour, String.valueOf(hour) + "시"));
LinkedList finalhour = LHour;
sHour.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
fHour = (Spinner)findViewById(R.id.from_hour);
fHour.setAdapter(ArrayAdapter4);
fHour.setSelection(getIndex(fHour, String.valueOf(hour) + "시"));
LinkedList fromhour = LHour;
fHour.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
}
private int getIndex(Spinner spinner, String item){
for (int i = 0; i < spinner.getCount(); i++){
if (spinner.getItemAtPosition(i).toString().equalsIgnoreCase(item)){
return i;
}
}
return 0;
}
}
\ No newline at end of file
package com.example.test;
import android.app.Activity;
import android.content.Intent;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Handler;
import android.widget.ImageView;
import java.io.InputStream;
public class SplashActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
try {
Thread.sleep(3000); //대기 초 설정
startActivity(new Intent(SplashActivity.this, MainActivity.class));
finish();
} catch (Exception e) {
e.printStackTrace();
}
}
}
package com.example.test;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import android.content.Intent;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import java.io.InputStream;
import java.util.ArrayList;
public class WeatherActivity extends AppCompatActivity {
private Button btn_main;
private Button btn_clothes;
TextView Location;
WeatherForCast mForeCast;
WeatherActivity wThis;
ImageView main_Weather;
ImageView main_Location;
ImageView main_Average;
ImageView main_MinMax;
ImageView main_Perceived;
ImageView main_Wind;
ImageView main_Precipitation;
ImageView today_Weather;
ImageView weather_Blank;
Bitmap bitmap_Weather;
Bitmap bitmap_Location;
Bitmap bitmap_temperature;
Bitmap bitmap_wind;
Bitmap bitmap_Precipitation;
Bitmap bitmap_Today;
Bitmap bitmap_Blank;
TextView Now;
TextView Perceived;
TextView Wind;
TextView Precipitation;
TextView Select;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_weather);
Initialize();
}
public void Initialize(){
wThis = this;
Location = (TextView) findViewById(R.id.txt_location);
Intent intent = getIntent();
String code = intent.getStringExtra("code");
mForeCast = new WeatherForCast(code, (WeatherActivity) wThis);
String start = intent.getStringExtra("start");
String from = intent.getStringExtra("from");
String leaf = intent.getStringExtra("leaf");
String gender = intent.getStringExtra("gender");
Location.setText(leaf);
main_Location = (ImageView)findViewById(R.id.Img_location);
AssetManager as = getResources().getAssets();
InputStream is = null;
try{
is = as.open("location.png");
bitmap_Location = BitmapFactory.decodeStream(is);
main_Location.setImageBitmap(bitmap_Location);
is.close();
}catch(Exception e){
e.printStackTrace();
}
ImgUpload();
GetWeather(start, from, code);
btn_main = findViewById(R.id.btn_main);//btn_first 아이디을 찾아라
btn_main.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//버튼 클릭시 SecondActivity 에서 MainActivity 로 이동 경로
Intent intent = new Intent(WeatherActivity.this, MainActivity.class);
startActivity(intent);// 이동
}
});
btn_clothes = findViewById(R.id.btn_clothes);//btn_clothes 아이디 찾기
btn_clothes.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//버튼 클릭시 WeatherActivity 에서 ClothesActivity 로 이동 경로
Intent intent = new Intent(WeatherActivity.this, ClothesActivity.class);
intent.putExtra("code", code); //code에 있는 값 이동
intent.putExtra("start", start); //start에 있는 값 이동
intent.putExtra("from", from); //from에 있는 값 이동
intent.putExtra("leaf", leaf); //leaf에 있는 값 이동
intent.putExtra("gender", gender); //gender에 있는 값 이동
startActivity(intent);// 이동
}
});
}
public void ImgUpload(){
main_Location = (ImageView)findViewById(R.id.Img_location);
main_Average = (ImageView)findViewById(R.id.Img_aver);
main_MinMax = (ImageView)findViewById(R.id.Img_minmax);
main_Perceived = (ImageView)findViewById(R.id.Img_perceived);
main_Wind = (ImageView)findViewById(R.id.Img_wind);
main_Precipitation = (ImageView)findViewById(R.id.Img_pop);
today_Weather = (ImageView)findViewById(R.id.today_weather);
AssetManager as = getResources().getAssets();
InputStream is = null;
try{
is = as.open("location.png");
bitmap_Location = BitmapFactory.decodeStream(is);
main_Location.setImageBitmap(bitmap_Location);
is.close();
}catch(Exception e){
e.printStackTrace();
}
try{
is = as.open("wind.png");
bitmap_wind = BitmapFactory.decodeStream(is);
main_Wind.setImageBitmap(bitmap_wind);
is.close();
}catch(Exception e){
e.printStackTrace();
}
try{
is = as.open("temperature.png");
bitmap_temperature = BitmapFactory.decodeStream(is);
main_Average.setImageBitmap(bitmap_temperature);
main_MinMax.setImageBitmap(bitmap_temperature);
is.close();
}catch(Exception e){
e.printStackTrace();
}
try{
is = as.open("pop.png");
bitmap_Precipitation = BitmapFactory.decodeStream(is);
main_Precipitation.setImageBitmap(bitmap_Precipitation);
is.close();
}catch(Exception e){
e.printStackTrace();
}
try{
is = as.open("today_weather.png");
bitmap_Today = BitmapFactory.decodeStream(is);
today_Weather.setImageBitmap(bitmap_Today);
is.close();
}catch(Exception e){
e.printStackTrace();
}
}
public void GetWeather(String start, String from, String code){
ArrayList<ArrayList<String>> wData = new ArrayList<ArrayList<String>>();
wData = mForeCast.GetOpenWeather(code);
System.out.println("Start GetWeather");
System.out.println(wData);
String mData = "";
int sMonth = Integer.parseInt(start.substring(0,2));
int sDay = Integer.parseInt(start.substring(2,4));
int sHour = Integer.parseInt(start.substring(4,6));
int fMonth = Integer.parseInt(from.substring(0,2));
int fDay = Integer.parseInt(from.substring(2,4));
int fHour = Integer.parseInt(from.substring(4,6));
String select = String.valueOf(sMonth) + "월 " + String.valueOf(sDay) + "일 " + String.valueOf(sHour) + "시부터 "
+ String.valueOf(fMonth) + "월 " + String.valueOf(fDay) + "일 " + String.valueOf(fHour) + "시까지";
// TextView 연결
Now = (TextView)findViewById(R.id.input_now);
Perceived = (TextView)findViewById(R.id.input_perceived);
Wind = (TextView)findViewById(R.id.input_wind);
Precipitation = (TextView)findViewById(R.id.input_pop);
Select = (TextView)findViewById(R.id.select_time);
// 현재 날씨 input
Now.setText(wData.get(0).get(1) + "°C");
Perceived.setText(mForeCast.GetPerceived(wData.get(0).get(1), wData.get(0).get(4)) + "°C");
Wind.setText(wData.get(0).get(4) + "m/s");
Precipitation.setText(wData.get(0).get(6) + "%");
Select.setText(select);
ListView listview ;
ListViewAdapter adapter;
// Adapter 생성
adapter = new ListViewAdapter() ;
// 리스트뷰 참조 및 Adapter달기
listview = (ListView) findViewById(R.id.listview1);
listview.setAdapter(adapter);
// 날씨에 맞는 id값 받아오기
int clear = R.drawable.clear;
int cloudy = R.drawable.cloudy;
int mostcloudy = R.drawable.mostcloudy;
int partcloudy = R.drawable.partcloudy;
int rain = R.drawable.rain;
int snow = R.drawable.snow;
int snowrain = R.drawable.snowrain;
int weather = clear;
String main = wData.get(0).get(5);
if (main.equals("Clear")){
main = "wClear";
} else if (main.equals("Partly Cloudy")){
main = "wPartcloudy";
} else if (main.equals("Mostly Cloudy")){
main = "wMostcloudy";
} else if (main.equals("Cloudy")){
main = "wCloudy";
} else if (main.equals("Rain")){
main = "wRain";
} else if (main.equals("Snow/Rain")){
main = "wSnowrain";
} else if (main.equals("Snow")){
main = "wSnow";
}
AssetManager as = getResources().getAssets();
InputStream is = null;
main_Weather = (ImageView)findViewById(R.id.main_weather);
try{
is = as.open(main + ".png");
bitmap_Weather = BitmapFactory.decodeStream(is);
main_Weather.setImageBitmap(bitmap_Weather);
is.close();
}catch(Exception e){
e.printStackTrace();
}
for (int i = 0; i < wData.size(); i++){
String hour = wData.get(i).get(0);
String time = "";
time = hour.substring(4,6);
int num = Integer.parseInt(time);
if (num <= 12){
time = "오전 " + String.valueOf(num) + "시";
} else {
time = "오후 " + String.valueOf(num) + "시";
}
if (start.compareTo(hour) <= 0 && from.compareTo(hour) >= 0){
if (wData.get(i).get(5).equals("Clear")){
weather = clear;
} else if (wData.get(i).get(5).equals("Partly Cloudy")){
weather = partcloudy;
} else if (wData.get(i).get(5).equals("Mostly Cloudy")){
weather = mostcloudy;
} else if (wData.get(i).get(5).equals("Cloudy")){
weather = cloudy;
} else if (wData.get(i).get(5).equals("Rain")){
weather = rain;
} else if (wData.get(i).get(5).equals("Snow/Rain")){
weather = snowrain;
} else if (wData.get(i).get(5).equals("Snow")){
weather = snow;
}
adapter.addItem(time,ContextCompat.getDrawable(this, weather),
wData.get(i).get(1) + "°C", wData.get(i).get(4) + "m/s", wData.get(i).get(6) + "%") ;
}
}
setListViewHeightBasedOnChildren(listview);
if (adapter.getCount() == 0){
weather_Blank = (ImageView)findViewById(R.id.Img_blank);
try{
is = as.open("blank.png");
bitmap_Blank = BitmapFactory.decodeStream(is);
weather_Blank.setImageBitmap(bitmap_Blank);
is.close();
}catch(Exception e){
e.printStackTrace();
}
}
}
// 리스트뷰 전체 목록 보이는 함수
public static void setListViewHeightBasedOnChildren(ListView listView) {
ListAdapter listAdapter = listView.getAdapter();
if (listAdapter == null) {
// pre-condition
return;
}
int totalHeight = 0;
int desiredWidth = View.MeasureSpec.makeMeasureSpec(listView.getWidth(), View.MeasureSpec.AT_MOST);
for (int i = 0; i < listAdapter.getCount(); i++) {
View listItem = listAdapter.getView(i, null, listView);
listItem.measure(desiredWidth, View.MeasureSpec.UNSPECIFIED);
totalHeight += listItem.getMeasuredHeight();
}
ViewGroup.LayoutParams params = listView.getLayoutParams();
params.height = totalHeight + (listView.getDividerHeight() * (listAdapter.getCount() - 1));
listView.setLayoutParams(params);
listView.requestLayout();
}
}
\ No newline at end of file
package com.example.test;
import android.os.StrictMode;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Calendar;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
public class WeatherForCast extends Thread {
String code;
//MainActivity mContext;
WeatherActivity wContext;
String mWeather;
ArrayList<ArrayList<String>> gWeather;
public String getWeather()
{
return mWeather;
}
public WeatherForCast(String code, WeatherActivity wContext)
{
this.code = code;
this.wContext = wContext;
}
// tag값의 정보를 가져오는 메소드
private static String getTagValue(String tag, Element eElement) {
NodeList nlList = eElement.getElementsByTagName(tag).item(0).getChildNodes();
Node nValue = (Node) nlList.item(0);
if(nValue == null)
return null;
return nValue.getNodeValue();
}
public ArrayList<ArrayList<String>> GetOpenWeather(String code)
{
ArrayList<ArrayList<String>> wData = new ArrayList<ArrayList<String>>();
try{
String url = "http://www.kma.go.kr/wid/queryDFSRSS.jsp?zone="+ code;
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(url);
// root tag
doc.getDocumentElement().normalize();
NodeList nlDate = doc.getElementsByTagName("header");
Node ndate = nlDate.item(0);
Element eDate = (Element) ndate;
String date = getTagValue("tm", eDate);
int thour = Integer.parseInt(date.substring(8,10));
date = date.substring(4,8);
if (thour >= 21) {
date = String.format("%4s",String.valueOf(Integer.parseInt(date) + 1)).replace(" ", "0");
}
// 파싱할 tag
NodeList nList = doc.getElementsByTagName("data");
for(int temp = 0; temp < nList.getLength(); temp++){
Node nNode = nList.item(temp);
ArrayList<String> tData = new ArrayList<String>();
if(nNode.getNodeType() == Node.ELEMENT_NODE){
Element eElement = (Element) nNode;
String hour = getTagValue("hour",eElement);
hour = String.format("%2s",hour).replace(" ","0");
tData.add(date + hour); // 0.시간
if (getTagValue("hour",eElement).equals("24")){
int tmp;
tmp = Integer.parseInt(date);
tmp += 1;
date = String.format("%4s",String.valueOf(tmp)).replace(" ", "0");
}
tData.add(IntCast(getTagValue("temp", eElement))); // 1.온도
tData.add(GetTemperature(IntCast(getTagValue("tmx", eElement)))); // 2.최고 온도
tData.add(GetTemperature(IntCast(getTagValue("tmn", eElement)))); // 3.최저 온도
tData.add(IntCast(getTagValue("ws", eElement))); // 4.풍속
tData.add(getTagValue("wfEn", eElement)); // 5.하늘상태
tData.add(getTagValue("pop", eElement)); // 6.강수확률
} // for end
wData.add(tData);
} // if end
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
}
return wData;
}
public String IntCast(String tmp){
double temp = Double.parseDouble(tmp);
int result = (int) temp;
return String.valueOf(result);
}
// 체감온도에 필요한 값만 Return
public ArrayList<ArrayList<String>> GetPerceived(String code)
{
ArrayList<ArrayList<String>> gData = new ArrayList<ArrayList<String>>();
try{
String url = "http://www.kma.go.kr/wid/queryDFSRSS.jsp?zone="+ code;
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(url);
// root tag
doc.getDocumentElement().normalize();
NodeList nlDate = doc.getElementsByTagName("header");
Node ndate = nlDate.item(0);
Element eDate = (Element) ndate;
String date = getTagValue("tm", eDate);
date = date.substring(4,8);
// 파싱할 tag
NodeList nList = doc.getElementsByTagName("data");
for(int temp = 0; temp < nList.getLength(); temp++){
Node nNode = nList.item(temp);
ArrayList<String> data = new ArrayList<String>();
if(nNode.getNodeType() == Node.ELEMENT_NODE){
Element eElement = (Element) nNode;
String hour = getTagValue("hour",eElement);
hour = String.format("%2s",hour).replace(" ","0");
data.add(date + hour);
if (getTagValue("hour",eElement).equals("24")){
int tmp;
tmp = Integer.parseInt(date);
tmp += 1;
date = String.format("%4s",String.valueOf(tmp)).replace(" ", "0");
}
data.add(getTagValue("temp",eElement));
data.add(getTagValue("ws",eElement));
} // for end
gData.add(data);
} // if end
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
}
return gData;
}
public String GetTemperature(String temp)
{
if (temp.equals("999"))
return "정보 없음";
else if (temp.equals("-999"))
return "정보 없음";
return temp;
}
public String GetPerceived(String temp, String velo){
int perceived;
double temper = Double.parseDouble(temp);
double veloc = Double.parseDouble(velo);
perceived = (int) (13.12 + 0.6215 * temper - 11.37 * Math.pow(veloc, 0.16) + 0.3965 * Math.pow(veloc, 0.16) * temper);
return String.valueOf(perceived);
}
@Override
public void run() {
super.run();
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
}
}
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<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">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
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"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:top="1dp">
<shape android:shape="rectangle" >
<stroke
android:width="2dp"
android:color="#000000" />
<solid android:color="#FFF" />
</shape>
</item>
</layer-list>
\ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ClothesActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".ClothesActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="1">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"></FrameLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:weightSum="1">
<ImageView
android:layout_width="90px"
android:layout_height="wrap_content"
android:id="@+id/Img_location"
/>
<TextView
android:id="@+id/txt_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream6"
android:text="위치 정보"
android:textColor="#000000"
android:layout_gravity="center_vertical"/>
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="360px"
android:id="@+id/main_weather"
android:layout_centerHorizontal="true"
android:layout_margin = "10dp"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="150px"
android:layout_gravity="center_horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:layout_width="110px"
android:layout_height="110px"
android:id="@+id/Img_aver"
android:layout_centerHorizontal="true"
android:layout_margin = "10dp"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/txt_aver"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream6"
android:text="평균 온도"
android:textColor="#000000"/>
<TextView
android:id="@+id/input_aver"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream3"
android:text="평균 온도 input" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="150px"
android:layout_gravity="center_horizontal"
android:layout_weight="1">
<ImageView
android:layout_width="110px"
android:layout_height="110px"
android:id="@+id/Img_perceived"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_marginRight="10dp"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:weightSum="1">
<TextView
android:id="@+id/txt_perceived"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream6"
android:text="체감 온도"
android:textColor="#000000"/>
<TextView
android:id="@+id/input_perceived"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream3"
android:text="체감 온도 input" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="150px"
android:layout_gravity="center_horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:layout_width="110px"
android:layout_height="110px"
android:id="@+id/Img_wind"
android:layout_centerHorizontal="true"
android:layout_margin = "10dp"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/txt_wind"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream6"
android:text="풍속"
android:textColor="#000000"/>
<TextView
android:id="@+id/input_wind"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream3"
android:text="풍속 input" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="150px"
android:layout_gravity="center_horizontal"
android:layout_weight="1">
<ImageView
android:layout_width="110px"
android:layout_height="110px"
android:id="@+id/Img_pop"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_marginRight="10dp"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:weightSum="1">
<TextView
android:id="@+id/txt_pop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream6"
android:text="강수 확률"
android:textColor="#000000"/>
<TextView
android:id="@+id/input_pop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream3"
android:text="강수 확률 input" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/today_cloth"
android:layout_centerHorizontal="true"
android:layout_margin = "10dp"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/recommend"
android:layout_centerHorizontal="true"
android:layout_margin = "10dp"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.madwin.customlistviewexample.ClothesActivity"
tools:showIn="@layout/activity_clothes">
<ListView
android:id="@+id/checklist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="#00ff0000"/>
</RelativeLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:weightSum="2">
<Button
android:id="@+id/btn_weather"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/scdream5"
android:layout_margin = "10dp"
android:text="날씨 알아보기"
/>
<Button
android:id="@+id/btn_main"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/scdream5"
android:layout_margin = "10dp"
android:text="메인 페이지" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="1">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/angel"
android:layout_centerHorizontal="true" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"></FrameLayout>
<TextView
android:id="@+id/select_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="7pt"
android:text="1. 도시를 입력해주세요."
android:layout_margin = "10dp"
android:fontFamily="@font/scdream5"
android:textColor="#000000"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:weightSum="3"
android:layout_margin = "10dp">
<Spinner
android:id="@+id/TopList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<Spinner
android:id="@+id/MdlList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<Spinner
android:id="@+id/LeafList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<TextView
android:id="@+id/select_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream5"
android:text="2. 날짜 및 시간을 입력해주세요."
android:textSize="7pt"
android:layout_margin = "10dp"
android:textColor="#000000"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:weightSum="1"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">
<Spinner
android:layout_width="100dp"
android:layout_height="wrap_content"
android:id="@+id/start_month"
android:layout_weight="0.33"
android:fontFamily="@font/scdream3"
android:textSize="6pt" />
<Spinner
android:layout_width="100dp"
android:layout_height="wrap_content"
android:id="@+id/start_day"
android:layout_weight="0.33"
android:fontFamily="@font/scdream3"
android:textSize="6pt" />
<Spinner
android:layout_width="100dp"
android:layout_height="wrap_content"
android:id="@+id/start_hour"
android:layout_weight="0.33"
android:fontFamily="@font/scdream3"
android:textSize="6pt" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:weightSum="1"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">
<Spinner
android:layout_width="100dp"
android:layout_height="wrap_content"
android:id="@+id/from_month"
android:layout_weight="0.33"
android:fontFamily="@font/scdream3"
/>
<Spinner
android:layout_width="100dp"
android:layout_height="wrap_content"
android:id="@+id/from_day"
android:layout_weight="0.33"
android:fontFamily="@font/scdream3"
/>
<Spinner
android:layout_width="100dp"
android:layout_height="wrap_content"
android:id="@+id/from_hour"
android:layout_weight="0.33"
android:fontFamily="@font/scdream3"
/>
</LinearLayout>
<TextView
android:id="@+id/select_gender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="7pt"
android:text="3. 성별을 입력해주세요."
android:fontFamily="@font/scdream5"
android:textColor="#000000"
android:layout_margin = "10dp"/>
<RadioGroup
android:id="@+id/radioGender"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_margin = "10dp">
<RadioButton
android:id="@+id/select_woman"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:layout_weight="1"
android:text="여자"
android:fontFamily="@font/scdream3"
android:textSize="6pt"/>
<RadioButton
android:id="@+id/select_man"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="남자"
android:fontFamily="@font/scdream3"
android:textSize="6pt" />
</RadioGroup>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:weightSum="2">
<Button
android:id="@+id/btn_weather"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/scdream5"
android:layout_margin = "10dp"
android:text="날씨 알아보기" />
<Button
android:id="@+id/btn_clothes"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/scdream5"
android:layout_margin = "10dp"
android:text="옷 추천받기" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/splash"
tools:context=".SplashActivity">
<ImageView
android:id="@+id/splash"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/main"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.495"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.532" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".WeatherActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".WeatherActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="1">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"></FrameLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:weightSum="1">
<ImageView
android:layout_width="90px"
android:layout_height="wrap_content"
android:id="@+id/Img_location" />
<TextView
android:id="@+id/txt_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream6"
android:text="위치 정보"
android:layout_gravity="center_vertical"
android:textColor="#000000"/>
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="360px"
android:id="@+id/main_weather"
android:layout_centerHorizontal="true"
android:layout_margin = "10dp"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="150px"
android:layout_gravity="center_horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:layout_width="110px"
android:layout_height="110px"
android:id="@+id/Img_aver"
android:layout_centerHorizontal="true"
android:layout_margin = "10dp"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/txt_now"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream6"
android:text="현재 온도"
android:textColor="#000000"/>
<TextView
android:id="@+id/input_now"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream3"
android:text="현재 온도 input"
android:textColor="#000000"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:id="@+id/Img_minmax"
android:layout_width="110px"
android:layout_height="110px"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_marginRight="10dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical"
android:weightSum="1">
<TextView
android:id="@+id/txt_perceived"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream6"
android:text="체감 온도"
android:textColor="#000000" />
<TextView
android:id="@+id/input_perceived"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream3"
android:text="체감 input"
android:textColor="#000000" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="150px"
android:layout_gravity="center_horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:layout_width="110px"
android:layout_height="110px"
android:id="@+id/Img_wind"
android:layout_centerHorizontal="true"
android:layout_margin = "10dp"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/txt_wind"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream6"
android:text="풍속"
android:textColor="#000000"/>
<TextView
android:id="@+id/input_wind"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream3"
android:text="풍속 input"
android:textColor="#000000"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_weight="1">
<ImageView
android:layout_width="110px"
android:layout_height="110px"
android:id="@+id/Img_pop"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_marginRight="10dp"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:weightSum="1">
<TextView
android:id="@+id/txt_pop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream6"
android:text="강수 확률"
android:textColor="#000000"/>
<TextView
android:id="@+id/input_pop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/scdream3"
android:text="강수 확률 input"
android:textColor="#000000"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/today_weather"
android:layout_centerHorizontal="true"
android:layout_margin = "10dp"/>
<TextView
android:id="@+id/select_time"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fontFamily="@font/scdream3"
android:text="select_time"
android:textSize="5pt"
android:gravity="right"
android:layout_marginRight="10dp" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="105px"
android:layout_weight="5">
<TextView
android:id="@+id/txt_time"
android:layout_width="100px"
android:layout_height="match_parent"
android:layout_weight="1"
android:fontFamily="@font/scdream6"
android:gravity="center"
android:text="시간"
android:textColor="#000000" />
<TextView
android:layout_width="100px"
android:layout_height="match_parent"
android:text="날씨"
android:id="@+id/txt_weather"
android:textColor="#000000"
android:fontFamily="@font/scdream6"
android:gravity="center"
android:layout_weight="1" />
<TextView
android:layout_width="100px"
android:layout_height="match_parent"
android:text="기온"
android:id="@+id/txt_temperature"
android:textColor="#000000"
android:fontFamily="@font/scdream6"
android:gravity="center"
android:layout_weight="1" />
<TextView
android:layout_width="100px"
android:layout_height="match_parent"
android:text="풍속"
android:id="@+id/txt_windspeed"
android:textColor="#000000"
android:fontFamily="@font/scdream6"
android:gravity="center"
android:layout_weight="1" />
<TextView
android:layout_width="100px"
android:layout_height="match_parent"
android:text="강수확률"
android:id="@+id/txt_precipitation"
android:textColor="#000000"
android:fontFamily="@font/scdream6"
android:gravity="center"
android:layout_weight="1" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/Img_blank"
android:layout_centerHorizontal="true" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.madwin.customlistviewexample.WeatherActivity"
tools:showIn="@layout/activity_weather">
<ListView
android:id="@+id/listview1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:weightSum="2">
<Button
android:id="@+id/btn_clothes"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/scdream5"
android:layout_margin = "10dp"
android:text="옷 추천받기" />
<Button
android:id="@+id/btn_main"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/scdream5"
android:layout_margin = "10dp"
android:text="메인 페이지" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="5"
android:layout_marginRight="25dp"
android:layout_marginLeft="25dp">
<ImageView
android:layout_width="80px"
android:layout_height="80px"
android:id="@+id/check_icon"
android:gravity="center_horizontal"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="체크리스트"
android:id="@+id/input_checklist"
android:textColor="#000000"
android:gravity="center_vertical"
android:layout_marginLeft="5dp"
android:fontFamily="@font/scdream4"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="5">
<TextView
android:layout_width="100px"
android:layout_height="match_parent"
android:text="시간"
android:id="@+id/input_time"
android:textColor="#000000"
android:gravity="center"
android:fontFamily="@font/scdream3"
android:layout_weight="1" />
<ImageView
android:layout_width="100px"
android:layout_height="110px"
android:id="@+id/input_weather"
android:layout_weight="0.8"
android:gravity="center_horizontal"/>
<TextView
android:layout_width="100px"
android:layout_height="match_parent"
android:text="기온"
android:id="@+id/input_temperature"
android:textColor="#000000"
android:gravity="center"
android:fontFamily="@font/scdream3"
android:layout_weight="1" />
<TextView
android:layout_width="100px"
android:layout_height="match_parent"
android:text="풍속"
android:id="@+id/input_wind"
android:textColor="#000000"
android:gravity="center"
android:fontFamily="@font/scdream3"
android:layout_weight="1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="강수확률"
android:id="@+id/input_precipitation"
android:textColor="#000000"
android:gravity="center"
android:fontFamily="@font/scdream3"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_clothes_background"/>
<foreground android:drawable="@mipmap/ic_clothes_foreground"/>
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_clothes_background"/>
<foreground android:drawable="@mipmap/ic_clothes_foreground"/>
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.Test" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="planets_array">
<item>Mercury</item>
<item>Venus</item>
<item>Earth</item>
<item>Mars</item>
<item>Jupiter</item>
<item>Saturn</item>
<item>Uranus</item>
<item>Neptune</item>
</string-array>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="splash">#a8cfee</color>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_clothes_background">#3F60B8</color>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">Smart Today</string>
<string name="cancel" />
<string name="confirm" />
</resources>
\ No newline at end of file
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.Test" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">#7385e1</item>
<item name="colorPrimaryVariant">#a7b5ff</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>
\ No newline at end of file