From e365dfc8aea702eaf0cd15294505bf69982ee7e9 Mon Sep 17 00:00:00 2001 From: seminnn <2014178@sookmyung.ac.kr> Date: Tue, 1 Aug 2023 23:37:37 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=ED=95=99=EA=B5=90=20=EA=B1=B4=EB=AC=BC?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/example/wonderwoman/CustomAdapter.kt | 40 +++++ .../com/example/wonderwoman/EwhaActivity.kt | 67 +++++++ .../com/example/wonderwoman/MainListItem.kt | 3 + .../example/wonderwoman/SookmyungActivity.kt | 55 ++++++ app/src/main/res/drawable/check.png | Bin 0 -> 271 bytes app/src/main/res/drawable/img.png | Bin 0 -> 2218 bytes app/src/main/res/drawable/list_check.xml | 9 + app/src/main/res/drawable/list_icon.png | Bin 0 -> 322 bytes app/src/main/res/layout/ewha_location.xml | 168 ++++++++++++++++++ app/src/main/res/layout/list1_item.xml | 37 ++++ .../main/res/layout/sookmyung_location.xml | 155 ++++++++++++++++ 11 files changed, 534 insertions(+) create mode 100644 app/src/main/java/com/example/wonderwoman/CustomAdapter.kt create mode 100644 app/src/main/java/com/example/wonderwoman/EwhaActivity.kt create mode 100644 app/src/main/java/com/example/wonderwoman/MainListItem.kt create mode 100644 app/src/main/java/com/example/wonderwoman/SookmyungActivity.kt create mode 100644 app/src/main/res/drawable/check.png create mode 100644 app/src/main/res/drawable/img.png create mode 100644 app/src/main/res/drawable/list_check.xml create mode 100644 app/src/main/res/drawable/list_icon.png create mode 100644 app/src/main/res/layout/ewha_location.xml create mode 100644 app/src/main/res/layout/list1_item.xml create mode 100644 app/src/main/res/layout/sookmyung_location.xml diff --git a/app/src/main/java/com/example/wonderwoman/CustomAdapter.kt b/app/src/main/java/com/example/wonderwoman/CustomAdapter.kt new file mode 100644 index 0000000..dceb5d6 --- /dev/null +++ b/app/src/main/java/com/example/wonderwoman/CustomAdapter.kt @@ -0,0 +1,40 @@ +package com.example.wonderwoman + +import android.content.Context +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 com.example.wonderwoman.databinding.List1ItemBinding + + +// 프로필사진(이미지뷰), 이름(텍스트뷰) +// 이미지를 숫자로 참조하기 위해 int로 받음 +class Data(val profile: Int, val name: String) + +// 매개변수, 상속 +class CustomAdapter(val context: Context, val DataList: ArrayList) : BaseAdapter() +{ + + override fun getCount() = DataList.size + + // any + override fun getItem(position: Int) = DataList[position] + + // long + override fun getItemId(position: Int) = 0L + + override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View { + val view: View = LayoutInflater.from(context).inflate(R.layout.list1_item, null) + val profile = view.findViewById(R.id.location_icon) + val name = view.findViewById(R.id.list_text) + val data = DataList[position] + + profile.setImageResource(data.profile) + name.text = data.name + return view + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/example/wonderwoman/EwhaActivity.kt b/app/src/main/java/com/example/wonderwoman/EwhaActivity.kt new file mode 100644 index 0000000..89b8e1f --- /dev/null +++ b/app/src/main/java/com/example/wonderwoman/EwhaActivity.kt @@ -0,0 +1,67 @@ +package com.example.wonderwoman + +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import com.example.wonderwoman.databinding.EwhaLocationBinding + +class EwhaActivity : AppCompatActivity() { + + val TAG: String = "로그" + + private var vBinding : EwhaLocationBinding? = null + private val binding get() = vBinding!! + + var Data1List = arrayListOf( + Data(R.drawable.list_icon, "전체")) + var Data2List = arrayListOf( + Data(R.drawable.list_icon, "ECC(이화캠퍼스복합단지)"), + Data(R.drawable.list_icon, "포스코관"), + Data(R.drawable.list_icon, "학문관(학생문화관)"), + Data(R.drawable.list_icon, "학관")) + var Data3List = arrayListOf( + Data(R.drawable.list_icon, "국교관(국제교육관)"), + Data(R.drawable.list_icon, "SK관(이화SK텔레콤관)"), + Data(R.drawable.list_icon, "경영관(이화신세계관)"), + Data(R.drawable.list_icon, "생활관(생활환경관)"), + Data(R.drawable.list_icon, "대강당")) + var Data4List = arrayListOf( + Data(R.drawable.list_icon, "중도(중앙도서관)"), + Data(R.drawable.list_icon, "음악관"), + Data(R.drawable.list_icon, "조형A(조형예술관A동)"), + Data(R.drawable.list_icon, "조형B(조형예술관B동)"), + Data(R.drawable.list_icon, "체육A(체육관A동)"), + Data(R.drawable.list_icon, "체육B(체육관B동)"), + Data(R.drawable.list_icon, "체육C(체육관C동)"), + Data(R.drawable.list_icon, "헬렌관")) + var Data5List = arrayListOf( + Data(R.drawable.list_icon, "약학관A동"), + Data(R.drawable.list_icon, "약학관B동"), + Data(R.drawable.list_icon, "종과A(종학과학관A동)"), + Data(R.drawable.list_icon, "종과B(종학과학관B동)"), + Data(R.drawable.list_icon, "종과C(종학과학관C동)"), + Data(R.drawable.list_icon, "종과D(종학과학관D동)")) + var Data6List = arrayListOf( + Data(R.drawable.list_icon, "교육A(교육관A동)"), + Data(R.drawable.list_icon, "교육B(교육관B동)"), + Data(R.drawable.list_icon, "공학A(아산공학관)"), + Data(R.drawable.list_icon, "공학B(신공학관)")) + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + vBinding = EwhaLocationBinding.inflate(layoutInflater) + setContentView(binding.root) + + binding.list1.adapter = CustomAdapter(this, Data1List) + binding.list2.adapter = CustomAdapter(this, Data2List) + binding.list3.adapter = CustomAdapter(this, Data3List) + binding.list4.adapter = CustomAdapter(this, Data4List) + binding.list5.adapter = CustomAdapter(this, Data5List) + binding.list6.adapter = CustomAdapter(this, Data6List) + } + + override fun onDestroy() { + vBinding = null + super.onDestroy() + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/example/wonderwoman/MainListItem.kt b/app/src/main/java/com/example/wonderwoman/MainListItem.kt new file mode 100644 index 0000000..5b1d7a9 --- /dev/null +++ b/app/src/main/java/com/example/wonderwoman/MainListItem.kt @@ -0,0 +1,3 @@ +package com.example.wonderwoman + +class MainListItem (val icon: String, val title: String, val subTitle: String) \ No newline at end of file diff --git a/app/src/main/java/com/example/wonderwoman/SookmyungActivity.kt b/app/src/main/java/com/example/wonderwoman/SookmyungActivity.kt new file mode 100644 index 0000000..5cac1ff --- /dev/null +++ b/app/src/main/java/com/example/wonderwoman/SookmyungActivity.kt @@ -0,0 +1,55 @@ +package com.example.wonderwoman + +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity +import com.example.wonderwoman.databinding.SookmyungLocationBinding + +class SookmyungActivity : AppCompatActivity() { + + val TAG: String = "로그" + + private var vBinding : SookmyungLocationBinding? = null + private val binding get() = vBinding!! + + var Data1List = arrayListOf( + Data(R.drawable.list_icon, "전체")) + var Data2List = arrayListOf( + Data(R.drawable.list_icon, "순헌관"), + Data(R.drawable.list_icon, "명신관"), + Data(R.drawable.list_icon, "학생회관"), + Data(R.drawable.list_icon, "프라임관"), + Data(R.drawable.list_icon, "중앙도서관")) + var Data3List = arrayListOf( + Data(R.drawable.list_icon, "진리관"), + Data(R.drawable.list_icon, "새힘관"), + Data(R.drawable.list_icon, "행정관")) + var Data4List = arrayListOf( + Data(R.drawable.list_icon, "르네상스플라자"), + Data(R.drawable.list_icon, "음악대학"), + Data(R.drawable.list_icon, "사회교육관"), + Data(R.drawable.list_icon, "약학대학"), + Data(R.drawable.list_icon, "미술대학")) + var Data5List = arrayListOf( + Data(R.drawable.list_icon, "백주년기념관"), + Data(R.drawable.list_icon, "과학관"), + Data(R.drawable.list_icon, "다목적관"), + Data(R.drawable.list_icon, "새빛관")) + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + vBinding = SookmyungLocationBinding.inflate(layoutInflater) + setContentView(binding.root) + + binding.list1.adapter = CustomAdapter(this, Data1List) + binding.list2.adapter = CustomAdapter(this, Data2List) + binding.list3.adapter = CustomAdapter(this, Data3List) + binding.list4.adapter = CustomAdapter(this, Data4List) + binding.list5.adapter = CustomAdapter(this, Data5List) + } + + override fun onDestroy() { + vBinding = null + super.onDestroy() + } + +} \ No newline at end of file diff --git a/app/src/main/res/drawable/check.png b/app/src/main/res/drawable/check.png new file mode 100644 index 0000000000000000000000000000000000000000..e992705a8dcd38df32cdd5710cf1b343446ba9ac GIT binary patch literal 271 zcmeAS@N?(olHy`uVBq!ia0vp^{6NgZ!3HGvIz4{^q&N#aB8wRqxP?KOkzv*x37{Zj zage(c!@6@aFM%AEbVpxD28NCO+mdKI;Vst0N-|I-v9sr literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable/img.png b/app/src/main/res/drawable/img.png new file mode 100644 index 0000000000000000000000000000000000000000..9f817a65bbffe036f5e13d08e0f48f38b5bd4086 GIT binary patch literal 2218 zcmeAS@N?(olHy`uVBq!ia0y~yV7~yuj6eZ~P0l~B04bJqM_)$E)e-c@Ne1&9> zAYTTCDm4a%h86~fUqGRT7Yq!g1`G_Z5*Qe)W-u^_7tGleXakgBO7eDhVPL%5CAqj6f?nm=ylczb4Ph?{U9t*C-ebfzc2c z4S~@R7!85Z5Ev{W@QamsW%7p`iW_ALfEBuGiEBhjN@7W>RdP`(kYX@0Ff`XSumGYE w0}Cq?3o9cFZ36=<1B16$y + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/list_icon.png b/app/src/main/res/drawable/list_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce7f1a2b365ec50b7d1b83d4ce3e675e498ebedf GIT binary patch literal 322 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`j)FbFd;%$g$s6l5$8 za(7}_cTVOdki(Mh=dVtUNkWB!3{ikh1f>y4AVAJ`u7YP<>ACv7Dx7H%jdy!?i4+PAkV|C#f}Y`Hch zzg%I;vt-HRBC880e7ZhOb-HnG=E8eD4pRlB-UjBkzPZi4=hB3`XG0ovI<1%gt7u&= zH7V>u%aS;~34gaL`Y{*1e6uSzH9_(z(@OKsqoOC~2l_N043wPl@|5?^>9dTyxt2V% zV3=#YBVVecf7i@#w>P=U-`;qr{+_w;Poq8a6BpIcP|i-)_exhwYMjj + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/list1_item.xml b/app/src/main/res/layout/list1_item.xml new file mode 100644 index 0000000..a1a2ab9 --- /dev/null +++ b/app/src/main/res/layout/list1_item.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/sookmyung_location.xml b/app/src/main/res/layout/sookmyung_location.xml new file mode 100644 index 0000000..3d3d90b --- /dev/null +++ b/app/src/main/res/layout/sookmyung_location.xml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file