-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from WonderWoman-Team/feature/10-location-ui
feat: 학교 건물설정 UI
- Loading branch information
Showing
11 changed files
with
534 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
app/src/main/java/com/example/wonderwoman/CustomAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Data>) : 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<ImageView>(R.id.location_icon) | ||
val name = view.findViewById<TextView>(R.id.list_text) | ||
val data = DataList[position] | ||
|
||
profile.setImageResource(data.profile) | ||
name.text = data.name | ||
return view | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.example.wonderwoman | ||
|
||
class MainListItem (val icon: String, val title: String, val subTitle: String) |
55 changes: 55 additions & 0 deletions
55
app/src/main/java/com/example/wonderwoman/SookmyungActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
} | ||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<!-- 체크박스 해제 상태 --> | ||
<item android:state_checked="false" | ||
android:drawable="@drawable/img"/> | ||
<!-- 체크박스 선택 상태 --> | ||
<item android:state_checked="true" | ||
android:drawable="@drawable/check"/> | ||
</selector> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<FrameLayout | ||
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:id="@+id/text" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
tools:context="."> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="195dp" | ||
android:background="@drawable/gradient" | ||
android:orientation="vertical"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="105dp" | ||
android:orientation="horizontal"> | ||
|
||
<ImageView | ||
android:id="@+id/location_x" | ||
android:layout_width="50dp" | ||
android:layout_height="30dp" | ||
android:layout_gravity="center" | ||
android:layout_marginLeft="20dp" | ||
android:layout_marginTop="20dp" | ||
android:src="@drawable/x_white" /> | ||
|
||
<TextView | ||
android:layout_width="50dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="40dp" | ||
android:layout_marginRight="70dp" | ||
android:layout_weight="1" | ||
android:fontFamily="@font/notofont" | ||
android:gravity="center" | ||
android:shadowColor="#666666" | ||
android:shadowDy="1.0" | ||
android:shadowRadius="3.0" | ||
android:text="건물 설정" | ||
android:textSize="20dp" | ||
android:textColor="#FFFFFF"/> | ||
|
||
|
||
|
||
</LinearLayout> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:layout_weight="1" | ||
android:gravity="center" | ||
android:fontFamily="@font/notofont" | ||
android:shadowColor="#666666" | ||
android:shadowDy="1.0" | ||
android:shadowRadius="3.0" | ||
android:text="이화여자대학교" | ||
android:textColor="#FFFFFF" /> | ||
|
||
|
||
</LinearLayout> | ||
|
||
</LinearLayout> | ||
|
||
|
||
<androidx.core.widget.NestedScrollView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:layout_marginTop="158dp" | ||
android:background="@drawable/scroll" | ||
android:orientation="vertical" > | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical"> | ||
|
||
<ListView | ||
android:id="@+id/list1" | ||
android:dividerHeight="0px" | ||
android:divider="#FFFFFF" | ||
android:layout_marginTop="10dp" | ||
android:layout_marginBottom="5dp" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"/> | ||
|
||
<View | ||
android:layout_width="match_parent" | ||
android:layout_height="4dp" | ||
android:layout_centerInParent="true" | ||
android:background="#F9DCCE"/> | ||
|
||
<ListView | ||
android:id="@+id/list2" | ||
android:dividerHeight="0px" | ||
android:divider="#FFFFFF" | ||
android:layout_marginBottom="5dp" | ||
android:layout_width="match_parent" | ||
android:layout_height="230dp"/> | ||
|
||
<View | ||
android:layout_width="match_parent" | ||
android:layout_height="4dp" | ||
android:layout_centerInParent="true" | ||
android:background="#F9DCCE"/> | ||
|
||
<ListView | ||
android:id="@+id/list3" | ||
android:dividerHeight="0px" | ||
android:divider="#FFFFFF" | ||
android:layout_marginBottom="5dp" | ||
android:layout_width="match_parent" | ||
android:layout_height="300dp"/> | ||
|
||
<View | ||
android:layout_width="match_parent" | ||
android:layout_height="4dp" | ||
android:layout_centerInParent="true" | ||
android:background="#F9DCCE"/> | ||
|
||
<ListView | ||
android:id="@+id/list4" | ||
android:dividerHeight="0px" | ||
android:divider="#FFFFFF" | ||
android:layout_marginBottom="5dp" | ||
android:layout_width="match_parent" | ||
android:layout_height="480dp"/> | ||
|
||
<View | ||
android:layout_width="match_parent" | ||
android:layout_height="4dp" | ||
android:layout_centerInParent="true" | ||
android:background="#F9DCCE"/> | ||
|
||
<ListView | ||
android:id="@+id/list5" | ||
android:dividerHeight="0px" | ||
android:divider="#FFFFFF" | ||
android:layout_marginBottom="5dp" | ||
android:layout_width="match_parent" | ||
android:layout_height="350dp"/> | ||
|
||
<View | ||
android:layout_width="match_parent" | ||
android:layout_height="4dp" | ||
android:layout_centerInParent="true" | ||
android:background="#F9DCCE"/> | ||
<ListView | ||
android:id="@+id/list6" | ||
android:dividerHeight="0px" | ||
android:divider="#FFFFFF" | ||
android:layout_marginBottom="5dp" | ||
android:layout_width="match_parent" | ||
android:layout_height="250dp"/> | ||
|
||
</LinearLayout> | ||
|
||
</androidx.core.widget.NestedScrollView> | ||
|
||
</FrameLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="50dp" | ||
android:orientation="horizontal" | ||
android:gravity="center_vertical"> | ||
|
||
<ImageView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="10dp" | ||
android:id="@+id/location_icon" | ||
android:src="@drawable/list_icon" /> | ||
|
||
<TextView | ||
android:id="@+id/list_text" | ||
android:layout_width="wrap_content" | ||
android:layout_height="50dp" | ||
android:layout_margin="5dp" | ||
android:gravity="center" | ||
android:text="list" /> | ||
|
||
<View | ||
android:layout_width="0dp" | ||
android:layout_height="0dp" | ||
android:layout_weight="1" /> | ||
|
||
<CheckBox | ||
android:layout_width="20dp" | ||
android:layout_height="20dp" | ||
android:layout_marginRight="30dp" | ||
android:button="@null" | ||
android:background="@drawable/list_check" /> | ||
|
||
|
||
</LinearLayout> |
Oops, something went wrong.