diff --git a/FashionToday_App/.DS_Store b/FashionToday_App/.DS_Store index 4a3ad784..f9f9158f 100644 Binary files a/FashionToday_App/.DS_Store and b/FashionToday_App/.DS_Store differ diff --git a/FashionToday_App/Pashion_Today/app/build.gradle b/FashionToday_App/Pashion_Today/app/build.gradle index 448cbefc..646a402c 100644 --- a/FashionToday_App/Pashion_Today/app/build.gradle +++ b/FashionToday_App/Pashion_Today/app/build.gradle @@ -8,11 +8,11 @@ android { compileSdkVersion 29 buildToolsVersion "29.0.0" defaultConfig { - applicationId "com.example.pashion_today" + applicationId "com.soma.pashion_today" minSdkVersion 15 targetSdkVersion 29 - versionCode 1 - versionName "1.0" + versionCode 2 + versionName "1.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { @@ -43,4 +43,5 @@ dependencies { androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' implementation("com.squareup.okhttp3:okhttp:4.0.1") + implementation 'com.prolificinteractive:material-calendarview:1.4.3' } diff --git a/FashionToday_App/Pashion_Today/app/release/app-release.apk b/FashionToday_App/Pashion_Today/app/release/app-release.apk new file mode 100644 index 00000000..bf723637 Binary files /dev/null and b/FashionToday_App/Pashion_Today/app/release/app-release.apk differ diff --git a/FashionToday_App/Pashion_Today/app/release/output.json b/FashionToday_App/Pashion_Today/app/release/output.json new file mode 100644 index 00000000..dcd57fd9 --- /dev/null +++ b/FashionToday_App/Pashion_Today/app/release/output.json @@ -0,0 +1 @@ +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":2,"versionName":"1.1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] \ No newline at end of file diff --git a/FashionToday_App/Pashion_Today/app/src/androidTest/java/com/example/pashion_today/ExampleInstrumentedTest.kt b/FashionToday_App/Pashion_Today/app/src/androidTest/java/com/soma/pashion_today/ExampleInstrumentedTest.kt similarity index 94% rename from FashionToday_App/Pashion_Today/app/src/androidTest/java/com/example/pashion_today/ExampleInstrumentedTest.kt rename to FashionToday_App/Pashion_Today/app/src/androidTest/java/com/soma/pashion_today/ExampleInstrumentedTest.kt index 83ae1601..4de873e8 100644 --- a/FashionToday_App/Pashion_Today/app/src/androidTest/java/com/example/pashion_today/ExampleInstrumentedTest.kt +++ b/FashionToday_App/Pashion_Today/app/src/androidTest/java/com/soma/pashion_today/ExampleInstrumentedTest.kt @@ -1,4 +1,4 @@ -package com.example.pashion_today +package com.soma.pashion_today import androidx.test.InstrumentationRegistry import androidx.test.runner.AndroidJUnit4 diff --git a/FashionToday_App/Pashion_Today/app/src/main/AndroidManifest.xml b/FashionToday_App/Pashion_Today/app/src/main/AndroidManifest.xml index 982dc704..cf3e9414 100644 --- a/FashionToday_App/Pashion_Today/app/src/main/AndroidManifest.xml +++ b/FashionToday_App/Pashion_Today/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="com.soma.pashion_today"> - - + - + - diff --git a/FashionToday_App/Pashion_Today/app/src/main/java/com/example/pashion_today/Page/CalendarActivity.kt b/FashionToday_App/Pashion_Today/app/src/main/java/com/example/pashion_today/Page/CalendarActivity.kt deleted file mode 100644 index 065fb4e8..00000000 --- a/FashionToday_App/Pashion_Today/app/src/main/java/com/example/pashion_today/Page/CalendarActivity.kt +++ /dev/null @@ -1,107 +0,0 @@ -package com.example.pashion_today.Page - -import android.graphics.Color -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -import android.view.Menu -import android.view.MenuItem -import android.widget.CalendarView -import androidx.appcompat.app.ActionBarDrawerToggle -import androidx.appcompat.widget.Toolbar -import androidx.core.view.GravityCompat -import androidx.drawerlayout.widget.DrawerLayout -import com.example.pashion_today.R -import com.google.android.material.navigation.NavigationView - - - -/***** - * 프로그램 ID : HAM-PA-500 - * 프로그램명 : CalendarActivity.kt - * 작성자명 : 오원석 - * 작성일자 : 2019.09.01 - * 버전 : v0.1 - */ -class CalendarActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener { - - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.calendar_activity) - val toolbar: Toolbar = findViewById(R.id.toolbar) - setSupportActionBar(toolbar) - - - var calendar=findViewById(R.id.calendarView) - - - - - - val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout) - val navView: NavigationView = findViewById(R.id.nav_view) - val toggle = ActionBarDrawerToggle( - this, drawerLayout, toolbar, - R.string.navigation_drawer_open, - R.string.navigation_drawer_close - ) - drawerLayout.addDrawerListener(toggle) - toggle.syncState() - - navView.setNavigationItemSelectedListener(this) - } - - override fun onBackPressed() { - val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout) - if (drawerLayout.isDrawerOpen(GravityCompat.START)) { - drawerLayout.closeDrawer(GravityCompat.START) - } else { - super.onBackPressed() - } - } - - override fun onCreateOptionsMenu(menu: Menu): Boolean { - // Inflate the menu; this adds items to the action bar if it is present. - menuInflater.inflate(R.menu.pashion, menu) - return true - } - - override fun onOptionsItemSelected(item: MenuItem): Boolean { - // Handle action bar item clicks here. The action bar will - // automatically handle clicks on the Home/Up button, so long - // as you specify a parent activity in AndroidManifest.xml. - return when (item.itemId) { - R.id.my_page_menu -> true - R.id.notice_menu -> true - else -> super.onOptionsItemSelected(item) - } - } - - override fun onNavigationItemSelected(item: MenuItem): Boolean { - // Handle navigation view item clicks here. - when (item.itemId) { - R.id.menu_closet -> { - } - R.id.menu_daily_look -> { - - } - R.id.menu_calendar -> { - - } - R.id.menu_recommend -> { - - } - R.id.nav_share -> { - - } - R.id.nav_send -> { - - } - } - - val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout) - drawerLayout.closeDrawer(GravityCompat.START) - return true - } -} - diff --git a/FashionToday_App/Pashion_Today/app/src/main/java/com/example/pashion_today/Login/LoginActivity.kt b/FashionToday_App/Pashion_Today/app/src/main/java/com/soma/pashion_today/Login/LoginActivity.kt similarity index 96% rename from FashionToday_App/Pashion_Today/app/src/main/java/com/example/pashion_today/Login/LoginActivity.kt rename to FashionToday_App/Pashion_Today/app/src/main/java/com/soma/pashion_today/Login/LoginActivity.kt index 9c6408d3..768c7f01 100644 --- a/FashionToday_App/Pashion_Today/app/src/main/java/com/example/pashion_today/Login/LoginActivity.kt +++ b/FashionToday_App/Pashion_Today/app/src/main/java/com/soma/pashion_today/Login/LoginActivity.kt @@ -1,11 +1,11 @@ -package com.example.pashion_today.Login +package com.soma.pashion_today.Login import android.content.Intent import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.widget.Toast -import com.example.pashion_today.Page.PashionActivity -import com.example.pashion_today.R +import com.soma.pashion_today.Page.PashionActivity +import com.soma.pashion_today.R import kotlinx.android.synthetic.main.login_acitivity.* import okhttp3.* import org.json.JSONArray diff --git a/FashionToday_App/Pashion_Today/app/src/main/java/com/example/pashion_today/Login/RegisterActivity.kt b/FashionToday_App/Pashion_Today/app/src/main/java/com/soma/pashion_today/Login/RegisterActivity.kt similarity index 97% rename from FashionToday_App/Pashion_Today/app/src/main/java/com/example/pashion_today/Login/RegisterActivity.kt rename to FashionToday_App/Pashion_Today/app/src/main/java/com/soma/pashion_today/Login/RegisterActivity.kt index 6e82a8b4..36dffee1 100644 --- a/FashionToday_App/Pashion_Today/app/src/main/java/com/example/pashion_today/Login/RegisterActivity.kt +++ b/FashionToday_App/Pashion_Today/app/src/main/java/com/soma/pashion_today/Login/RegisterActivity.kt @@ -1,9 +1,9 @@ -package com.example.pashion_today.Login +package com.soma.pashion_today.Login import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import androidx.appcompat.app.AlertDialog -import com.example.pashion_today.R +import com.soma.pashion_today.R import kotlinx.android.synthetic.main.register_activity.* import okhttp3.* import java.io.IOException diff --git a/FashionToday_App/Pashion_Today/app/src/main/java/com/soma/pashion_today/Page/CalendarActivity.kt b/FashionToday_App/Pashion_Today/app/src/main/java/com/soma/pashion_today/Page/CalendarActivity.kt new file mode 100644 index 00000000..a11424df --- /dev/null +++ b/FashionToday_App/Pashion_Today/app/src/main/java/com/soma/pashion_today/Page/CalendarActivity.kt @@ -0,0 +1,245 @@ +package com.soma.pashion_today.Page + +import android.app.Activity +import android.content.DialogInterface +import android.content.Intent +import android.graphics.Color +import android.graphics.Typeface +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.text.style.ForegroundColorSpan +import android.text.style.RelativeSizeSpan +import android.text.style.StyleSpan +import android.view.Menu +import android.view.MenuItem +import android.widget.DatePicker +import androidx.appcompat.app.ActionBarDrawerToggle +import androidx.appcompat.app.AlertDialog +import androidx.appcompat.widget.Toolbar +import androidx.core.view.GravityCompat +import androidx.drawerlayout.widget.DrawerLayout +import com.soma.pashion_today.R +import com.google.android.material.navigation.NavigationView +import com.prolificinteractive.materialcalendarview.CalendarDay +import com.prolificinteractive.materialcalendarview.DayViewDecorator +import com.prolificinteractive.materialcalendarview.DayViewFacade +import com.prolificinteractive.materialcalendarview.MaterialCalendarView +import com.prolificinteractive.materialcalendarview.OnDateSelectedListener +import com.prolificinteractive.materialcalendarview.spans.DotSpan +import kotlinx.android.synthetic.main.calendar_content.* +import kotlinx.android.synthetic.main.calendar_content.view.* +import kotlinx.android.synthetic.main.calendar_do.view.* +import java.util.* +import kotlin.collections.HashSet + + +/***** + * 프로그램 ID : HAM-PA-500 + * 프로그램명 : CalendarActivity.kt + * 작성자명 : 오원석 + * 작성일자 : 2019.09.05 + * 버전 : v0.1 + */ +class CalendarActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener { + + var date_list=ArrayList() + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.calendar_activity) + val toolbar: Toolbar = findViewById(R.id.toolbar) + setSupportActionBar(toolbar) + + var calendar_view=findViewById(R.id.calendarview) + calendar_view.addDecorators(SundayDecorator(),SaturdayDecorator(),TodayDecorator()) + + calendar_view.setOnDateChangedListener(OnDateSelectedListener { widget, date, selected -> + var idx=0; + while(idx true + R.id.notice_menu -> true + R.id.plus_menu->{ + var dialog=AlertDialog.Builder(this) + + var v1=layoutInflater.inflate(R.layout.calendar_do,null) + dialog.setView(v1) + + + var listener=object:DialogInterface.OnClickListener{ + override fun onClick(p0: DialogInterface?, p1: Int) { + when(p1){ + DialogInterface.BUTTON_POSITIVE->{ + var calendar_view=findViewById(R.id.calendarview) + var year=v1.date_picker.year + var month=v1.date_picker.month + var day=v1.date_picker.dayOfMonth + var date=CalendarDay(year,month,day) + date_list.add(date) + calendar_view.addDecorator(EventDecorator(Color.RED,date_list)) + } + DialogInterface.BUTTON_NEUTRAL->{ + + } + } + } + } + + dialog.setPositiveButton("확인",listener) + dialog.setNeutralButton("취소",listener) + dialog.show() + + + + + return true + } + else -> super.onOptionsItemSelected(item) + } + } + + override fun onNavigationItemSelected(item: MenuItem): Boolean { + // Handle navigation view item clicks here. + when (item.itemId) { + R.id.menu_closet -> { + var intent=Intent(this,ClosetActivity::class.java) + startActivity(intent) + + } + R.id.menu_daily_look -> { + + } + R.id.menu_calendar -> { + + } + R.id.menu_recommend -> { + + } + R.id.nav_share -> { + + } + R.id.nav_send -> { + + } + } + + val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout) + drawerLayout.closeDrawer(GravityCompat.START) + return true + } +} + +/** + * 일요일 빨간색으로 데코레이션 하기 위한 클래스 + */ +class SundayDecorator : DayViewDecorator{ + + val calendar=Calendar.getInstance() + + + override fun shouldDecorate(day: CalendarDay?): Boolean { + day?.copyTo(calendar) + var weekday:Int=calendar.get(Calendar.DAY_OF_WEEK) + return weekday==Calendar.SUNDAY + } + + override fun decorate(view: DayViewFacade?) { + view?.addSpan(ForegroundColorSpan(Color.RED)) + } +} + +/** + * 토요일 파란색으로 데코레이션 하기 위한 클래스 + */ +class SaturdayDecorator : DayViewDecorator{ + val calendar=Calendar.getInstance() + + override fun shouldDecorate(day: CalendarDay?): Boolean { + day?.copyTo(calendar) + var weekday:Int=calendar.get(Calendar.DAY_OF_WEEK) + return weekday==Calendar.SATURDAY + } + + override fun decorate(view: DayViewFacade?) { + view?.addSpan(ForegroundColorSpan(Color.BLUE)) + } +} + +/** + * 오늘 날짜 데코레이션을 위한 클래스 + */ +class TodayDecorator : DayViewDecorator{ + + var date=CalendarDay() + + constructor(){ + date=CalendarDay.today() + } + + override fun shouldDecorate(day: CalendarDay?): Boolean { + return date!=null && day?.equals(date)!! + } + + override fun decorate(view: DayViewFacade?) { + view?.addSpan(StyleSpan(Typeface.BOLD)) + view?.addSpan(RelativeSizeSpan(1.4f)) + view?.addSpan(ForegroundColorSpan(Color.GREEN)) + } +} + +class EventDecorator : DayViewDecorator{ + var Color:Int?=null + var dates=HashSet() + + constructor(color : Int, dates : Collection){ + this.Color=color + this.dates=HashSet(dates) + } + override fun shouldDecorate(day: CalendarDay?): Boolean { + return dates.contains(day) + } + + override fun decorate(view: DayViewFacade?) { + view?.addSpan(DotSpan(5.toFloat(),Color!!)) + } + +} \ No newline at end of file diff --git a/FashionToday_App/Pashion_Today/app/src/main/java/com/example/pashion_today/Page/ClosetActivity.kt b/FashionToday_App/Pashion_Today/app/src/main/java/com/soma/pashion_today/Page/ClosetActivity.kt similarity index 53% rename from FashionToday_App/Pashion_Today/app/src/main/java/com/example/pashion_today/Page/ClosetActivity.kt rename to FashionToday_App/Pashion_Today/app/src/main/java/com/soma/pashion_today/Page/ClosetActivity.kt index 4507108f..97f6792a 100644 --- a/FashionToday_App/Pashion_Today/app/src/main/java/com/example/pashion_today/Page/ClosetActivity.kt +++ b/FashionToday_App/Pashion_Today/app/src/main/java/com/soma/pashion_today/Page/ClosetActivity.kt @@ -1,13 +1,11 @@ -package com.example.pashion_today.Page +package com.soma.pashion_today.Page import android.Manifest import android.app.Activity import android.app.AlertDialog -import android.content.Context import android.content.DialogInterface import android.content.Intent import android.content.pm.PackageManager -import android.graphics.Bitmap import android.graphics.BitmapFactory import android.net.Uri import android.os.Build @@ -24,9 +22,8 @@ import androidx.appcompat.widget.Toolbar import androidx.core.content.FileProvider import androidx.core.view.GravityCompat import androidx.drawerlayout.widget.DrawerLayout -import com.example.pashion_today.R +import com.soma.pashion_today.R import com.google.android.material.navigation.NavigationView -import kotlinx.android.synthetic.main.closet_camera.* import kotlinx.android.synthetic.main.closet_camera.view.* import kotlinx.android.synthetic.main.closet_content.* import java.io.File @@ -41,13 +38,14 @@ import java.io.File */ class ClosetActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener { - val CAMERA_ACTIVITY=1 + val CAMERA_ACTIVITY = 1 // 옷 타입 분류 변수 - var clothes_type = arrayOf("전체","상의","하의","신발") - var color_type=arrayOf("빨","주","노","초","파","남","보") + var clothes_type = arrayOf("전체", "상의", "하의", "신발") + var color_type = arrayOf("빨", "주", "노", "초", "파", "남", "보") + // 임시 변수 - var closet_list= intArrayOf( + var closet_list = intArrayOf( R.drawable.top, R.drawable.top2, R.drawable.top3, @@ -59,18 +57,18 @@ class ClosetActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelec ) // 사진, 내부저장소 허가 권한 배열 - var permission_list=arrayOf( + var permission_list = arrayOf( Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE ) // 폴더경로 - var dirPath:String?=null + var dirPath: String? = null // 파일의 전체 uri - var contentUri:Uri?=null + var contentUri: Uri? = null // 파일 전체경로 - var pic_path:String?=null + var pic_path: String? = null // 액티비티 create 메서드 override fun onCreate(savedInstanceState: Bundle?) { @@ -93,95 +91,103 @@ class ClosetActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelec navView.setNavigationItemSelectedListener(this) // 스피너 adapter - var adapter=ArrayAdapter(this,android.R.layout.simple_spinner_item,clothes_type); + var adapter = ArrayAdapter(this, android.R.layout.simple_spinner_item, clothes_type); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item) - closet_spinner.adapter=adapter + closet_spinner.adapter = adapter // 스피너 클릭 리스너 구현 - closet_spinner.onItemSelectedListener=object:AdapterView.OnItemSelectedListener{ + closet_spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { override fun onItemSelected(p0: AdapterView<*>?, p1: View?, p2: Int, p3: Long) { - when(p2) { + when (p2) { // 전체 출력 0 -> { - var list=ArrayList>() - var idx=0; - while(idx() - map.put("img",closet_list[idx]) + var list = ArrayList>() + var idx = 0; + while (idx < closet_list.size) { + var map = HashMap() + map.put("img", closet_list[idx]) list.add(map) idx++ } - var keys=arrayOf("img") - var ids= intArrayOf(R.id.ClosetImage) + var keys = arrayOf("img") + var ids = intArrayOf(R.id.ClosetImage) - var closet_adapter=SimpleAdapter(applicationContext,list, - R.layout.closet_image,keys,ids) - gridview.adapter=closet_adapter + var closet_adapter = SimpleAdapter( + applicationContext, list, + R.layout.closet_image, keys, ids + ) + gridview.adapter = closet_adapter } // 상의 출력 1 -> { - var list=ArrayList>() - var idx=0; - while(idx<3){ - var map=HashMap() - map.put("img",closet_list[idx]) + var list = ArrayList>() + var idx = 0; + while (idx < 3) { + var map = HashMap() + map.put("img", closet_list[idx]) list.add(map) idx++ } - var keys=arrayOf("img") - var ids= intArrayOf(R.id.ClosetImage) + var keys = arrayOf("img") + var ids = intArrayOf(R.id.ClosetImage) - var closet_adapter=SimpleAdapter(applicationContext,list, - R.layout.closet_image,keys,ids) - gridview.adapter=closet_adapter + var closet_adapter = SimpleAdapter( + applicationContext, list, + R.layout.closet_image, keys, ids + ) + gridview.adapter = closet_adapter } // 하의 출력 2 -> { - var list=ArrayList>() - var idx=3; - while(idx<6){ - var map=HashMap() - map.put("img",closet_list[idx]) + var list = ArrayList>() + var idx = 3; + while (idx < 6) { + var map = HashMap() + map.put("img", closet_list[idx]) list.add(map) idx++ } - var keys=arrayOf("img") - var ids= intArrayOf(R.id.ClosetImage) + var keys = arrayOf("img") + var ids = intArrayOf(R.id.ClosetImage) - var closet_adapter=SimpleAdapter(applicationContext,list, - R.layout.closet_image,keys,ids) - gridview.adapter=closet_adapter + var closet_adapter = SimpleAdapter( + applicationContext, list, + R.layout.closet_image, keys, ids + ) + gridview.adapter = closet_adapter } // 신발 출력 - 3->{ - var list=ArrayList>() - var idx=6; - while(idx<8){ - var map=HashMap() - map.put("img",closet_list[idx]) + 3 -> { + var list = ArrayList>() + var idx = 6; + while (idx < 8) { + var map = HashMap() + map.put("img", closet_list[idx]) list.add(map) idx++ } - var keys=arrayOf("img") - var ids= intArrayOf(R.id.ClosetImage) + var keys = arrayOf("img") + var ids = intArrayOf(R.id.ClosetImage) - var closet_adapter=SimpleAdapter(applicationContext,list, - R.layout.closet_image,keys,ids) - gridview.adapter=closet_adapter + var closet_adapter = SimpleAdapter( + applicationContext, list, + R.layout.closet_image, keys, ids + ) + gridview.adapter = closet_adapter } } @@ -206,7 +212,7 @@ class ClosetActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelec // 메뉴생성 메서드 override fun onCreateOptionsMenu(menu: Menu): Boolean { // Inflate the menu; this adds items to the action bar if it is present. - menuInflater.inflate(R.menu.closet_camera, menu) + menuInflater.inflate(R.menu.closet_menu, menu) return true } @@ -218,11 +224,10 @@ class ClosetActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelec when (item.itemId) { R.id.my_page_menu -> true R.id.notice_menu -> true - R.id.camera_menu->{ - if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.M){ - requestPermissions(permission_list,0) - } - else{ + R.id.plus_menu -> { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + requestPermissions(permission_list, 0) + } else { camera_capture() } } @@ -232,8 +237,8 @@ class ClosetActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelec // requestPermission의 결과로 모두가 권한 허가이면 실행, 아니면 return override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray) { - for(result in grantResults){ - if(result==PackageManager.PERMISSION_DENIED){ + for (result in grantResults) { + if (result == PackageManager.PERMISSION_DENIED) { return } } @@ -245,14 +250,14 @@ class ClosetActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelec when (item.itemId) { R.id.menu_closet -> { - var intent= Intent(this, ClosetActivity::class.java) + var intent = Intent(this, ClosetActivity::class.java) startActivity(intent) } R.id.menu_daily_look -> { } R.id.menu_calendar -> { - var intent= Intent(this, CalendarActivity::class.java) + var intent = Intent(this, CalendarActivity::class.java) startActivity(intent) } R.id.menu_recommend -> { @@ -271,78 +276,76 @@ class ClosetActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelec return true } - fun camera_capture(){ + fun camera_capture() { - var tempPath=Environment.getExternalStorageDirectory().absolutePath - dirPath="${tempPath}/Android/data/${packageName}" + var tempPath = Environment.getExternalStorageDirectory().absolutePath + dirPath = "${tempPath}/Android/data/${packageName}" - var file=File(dirPath) + var file = File(dirPath) - if(file.exists()==false){ + if (file.exists() == false) { file.mkdir() } - var camera_intent=Intent(MediaStore.ACTION_IMAGE_CAPTURE) + var camera_intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE) - var fileName="temp_${System.currentTimeMillis()}.jpg" - var picPath="${dirPath}/${fileName}" + var fileName = "temp_${System.currentTimeMillis()}.jpg" + var picPath = "${dirPath}/${fileName}" - var file2=File(picPath); + var file2 = File(picPath); - if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N){ - contentUri=FileProvider.getUriForFile(this,"com.example.pashion_today.httpmultipart.file_provider",file2) - } - else{ - contentUri=Uri.fromFile(file2) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + contentUri = FileProvider.getUriForFile(this, "com.soma.pashion_today.httpmultipart.file_provider", file2) + } else { + contentUri = Uri.fromFile(file2) } - camera_intent.putExtra(MediaStore.EXTRA_OUTPUT,contentUri) - startActivityForResult(camera_intent,CAMERA_ACTIVITY) + camera_intent.putExtra(MediaStore.EXTRA_OUTPUT, contentUri) + startActivityForResult(camera_intent, CAMERA_ACTIVITY) } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) - if(requestCode== CAMERA_ACTIVITY){ - - if(resultCode== Activity.RESULT_OK){ + if (requestCode == CAMERA_ACTIVITY) { + if (resultCode == Activity.RESULT_OK) { - var builder=AlertDialog.Builder(this) + var builder = AlertDialog.Builder(this) builder.setTitle(" 옷 등록 ") - var v1=layoutInflater.inflate(R.layout.closet_camera,null) + var v1 = layoutInflater.inflate(R.layout.closet_camera, null) - var type_adapter=ArrayAdapter(this,android.R.layout.simple_spinner_item,clothes_type) + var type_adapter = ArrayAdapter(this, android.R.layout.simple_spinner_item, clothes_type) type_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item) - v1.type_spinner.adapter=type_adapter + v1.type_spinner.adapter = type_adapter - var color_adapter=ArrayAdapter(this,android.R.layout.simple_spinner_item,color_type) + var color_adapter = ArrayAdapter(this, android.R.layout.simple_spinner_item, color_type) color_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item) - v1.color_spinner.adapter=color_adapter + v1.color_spinner.adapter = color_adapter - var bitmap=BitmapFactory.decodeFile(contentUri?.path) + var bitmap = BitmapFactory.decodeFile(contentUri?.path) v1.capture_img.setImageBitmap(bitmap) builder.setView(v1) - var listener=object:DialogInterface.OnClickListener{ + var listener = object : DialogInterface.OnClickListener { override fun onClick(p0: DialogInterface?, p1: Int) { - when(p1){ - DialogInterface.BUTTON_POSITIVE->{ + when (p1) { + DialogInterface.BUTTON_POSITIVE -> { } - DialogInterface.BUTTON_NEUTRAL->{ + DialogInterface.BUTTON_NEUTRAL -> { } } } } - builder.setNeutralButton("취소",null) - builder.setPositiveButton("확인",null) + builder.setNeutralButton("취소", null) + builder.setPositiveButton("확인", null) builder.show() diff --git a/FashionToday_App/Pashion_Today/app/src/main/java/com/example/pashion_today/Page/PashionActivity.kt b/FashionToday_App/Pashion_Today/app/src/main/java/com/soma/pashion_today/Page/PashionActivity.kt similarity index 93% rename from FashionToday_App/Pashion_Today/app/src/main/java/com/example/pashion_today/Page/PashionActivity.kt rename to FashionToday_App/Pashion_Today/app/src/main/java/com/soma/pashion_today/Page/PashionActivity.kt index 8f141245..9dac4705 100644 --- a/FashionToday_App/Pashion_Today/app/src/main/java/com/example/pashion_today/Page/PashionActivity.kt +++ b/FashionToday_App/Pashion_Today/app/src/main/java/com/soma/pashion_today/Page/PashionActivity.kt @@ -1,4 +1,4 @@ -package com.example.pashion_today.Page +package com.soma.pashion_today.Page import android.content.Intent import android.os.Bundle @@ -10,7 +10,7 @@ import com.google.android.material.navigation.NavigationView import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.widget.Toolbar import android.view.Menu -import com.example.pashion_today.R +import com.soma.pashion_today.R /***** @@ -23,7 +23,6 @@ import com.example.pashion_today.R class PashionActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener { - override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.pashion_activity) @@ -75,14 +74,14 @@ class PashionActivity : AppCompatActivity(), NavigationView.OnNavigationItemSele when (item.itemId) { R.id.menu_closet -> { - var intent=Intent(this, ClosetActivity::class.java) + var intent = Intent(this, ClosetActivity::class.java) startActivity(intent) } R.id.menu_daily_look -> { } R.id.menu_calendar -> { - var intent=Intent(this, CalendarActivity::class.java) + var intent = Intent(this, CalendarActivity::class.java) startActivity(intent) } R.id.menu_recommend -> { diff --git a/FashionToday_App/Pashion_Today/app/src/main/res/layout/calendar_content.xml b/FashionToday_App/Pashion_Today/app/src/main/res/layout/calendar_content.xml index 448a6c50..1df1322f 100644 --- a/FashionToday_App/Pashion_Today/app/src/main/res/layout/calendar_content.xml +++ b/FashionToday_App/Pashion_Today/app/src/main/res/layout/calendar_content.xml @@ -9,8 +9,15 @@ app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:showIn="@layout/calendar_app_bar" tools:context=".Page.CalendarActivity" android:orientation="vertical"> - + + + \ No newline at end of file diff --git a/FashionToday_App/Pashion_Today/app/src/main/res/layout/calendar_do.xml b/FashionToday_App/Pashion_Today/app/src/main/res/layout/calendar_do.xml new file mode 100644 index 00000000..7a979c20 --- /dev/null +++ b/FashionToday_App/Pashion_Today/app/src/main/res/layout/calendar_do.xml @@ -0,0 +1,68 @@ + + + + + + + + + + \ No newline at end of file diff --git a/FashionToday_App/Pashion_Today/app/src/main/res/menu/calendar_menu.xml b/FashionToday_App/Pashion_Today/app/src/main/res/menu/calendar_menu.xml new file mode 100644 index 00000000..61343e53 --- /dev/null +++ b/FashionToday_App/Pashion_Today/app/src/main/res/menu/calendar_menu.xml @@ -0,0 +1,10 @@ + + + + + + diff --git a/FashionToday_App/Pashion_Today/app/src/main/res/menu/closet_camera.xml b/FashionToday_App/Pashion_Today/app/src/main/res/menu/closet_menu.xml similarity index 84% rename from FashionToday_App/Pashion_Today/app/src/main/res/menu/closet_camera.xml rename to FashionToday_App/Pashion_Today/app/src/main/res/menu/closet_menu.xml index 6dacb832..7d748588 100644 --- a/FashionToday_App/Pashion_Today/app/src/main/res/menu/closet_camera.xml +++ b/FashionToday_App/Pashion_Today/app/src/main/res/menu/closet_menu.xml @@ -3,7 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> - diff --git a/FashionToday_App/Pashion_Today/app/src/test/java/com/example/pashion_today/ExampleUnitTest.kt b/FashionToday_App/Pashion_Today/app/src/test/java/com/soma/pashion_today/ExampleUnitTest.kt similarity index 90% rename from FashionToday_App/Pashion_Today/app/src/test/java/com/example/pashion_today/ExampleUnitTest.kt rename to FashionToday_App/Pashion_Today/app/src/test/java/com/soma/pashion_today/ExampleUnitTest.kt index 1344539b..08477e40 100644 --- a/FashionToday_App/Pashion_Today/app/src/test/java/com/example/pashion_today/ExampleUnitTest.kt +++ b/FashionToday_App/Pashion_Today/app/src/test/java/com/soma/pashion_today/ExampleUnitTest.kt @@ -1,4 +1,4 @@ -package com.example.pashion_today +package com.soma.pashion_today import org.junit.Test