Skip to content

Commit

Permalink
Merge pull request #32 from GDSC-snowflowerthon/re-feat/#27
Browse files Browse the repository at this point in the history
[Re feat/#27] μ•„μΉ΄μ΄λΈŒ νŒμ—… ν™”λ©΄ 이동
  • Loading branch information
HI-JIN2 authored Jan 12, 2024
2 parents f4b1c27 + b2b3ada commit e7de8c0
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 34 deletions.
28 changes: 16 additions & 12 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.snowflowerthon.snowman">

<!--인터넷 μ‚¬μš© κΆŒν•œ μ„€μ •-->
<uses-permission android:name="android.permission.INTERNET"/>

<uses-permission android:name="android.permission.INTERNET"/>
<!-- 인터넷 μ‚¬μš© κΆŒν•œ μ„€μ • -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

Expand All @@ -20,34 +18,40 @@
android:supportsRtl="true"
android:theme="@style/Theme.Snowman"
tools:targetApi="31">
<activity
android:name=".PopupActivity"
android:exported="false" />
<activity
android:name=".PopUpActivity"
android:exported="false" />
<activity
android:name=".PopUpPengdolli"
android:exported="false" />
<activity
android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="oauth"
android:scheme="kakao69a3cfd1a816a40b18dc20cd4b8a300d" />
</intent-filter>
</activity>

<activity
android:name=".ui.MainActivity"
android:exported="true" >

</activity>

android:exported="true" />
<activity
android:name=".ui.LoginActivity"
android:exported="true" >
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

</activity>
</application>

Expand Down
12 changes: 12 additions & 0 deletions app/src/main/java/com/snowflowerthon/snowman/PopupActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.snowflowerthon.snowman

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle

class PopupActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_popup)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.snowflowerthon.snowman.ui.archive

import android.app.AlertDialog
import android.os.Bundle
import android.util.Log
import androidx.fragment.app.Fragment
Expand All @@ -9,6 +10,7 @@ import android.view.ViewGroup
import android.widget.Toast
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.snowflowerthon.snowman.PopupActivity
import com.snowflowerthon.snowman.R
import com.snowflowerthon.snowman.data.ApiService
import com.snowflowerthon.snowman.data.RetrofitClient
Expand All @@ -26,6 +28,7 @@ class ArchiveFragment : Fragment() {
private var _binding: FragmentArchiveBinding? = null
private val binding get() = _binding!!


private lateinit var recyclerView: RecyclerView
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
Expand All @@ -39,7 +42,6 @@ class ArchiveFragment : Fragment() {
super.onViewCreated(view, savedInstanceState)
recyclerView = binding.rvArchive


lodeData()
}

Expand Down Expand Up @@ -72,6 +74,8 @@ class ArchiveFragment : Fragment() {
// Log.d("VoteFragment", response.body()?.success.toString() + response.body()?.data.toString())
}
})
}
}



}
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package com.snowflowerthon.snowman.ui.archive

import android.app.AlertDialog
import android.content.Intent
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ListAdapter
import android.widget.TextView
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
import com.snowflowerthon.snowman.PopupActivity
import com.snowflowerthon.snowman.R
import com.snowflowerthon.snowman.data.dto.response.ArchiveDetailiResponseDto
import com.snowflowerthon.snowman.data.dto.response.VoteHistory
Expand All @@ -22,37 +25,75 @@ class GridAdapter(private val dataList: List<VoteHistory>) :
inner class ViewHolder(private val binding: ItemCardBinding) :
RecyclerView.ViewHolder(binding.root) {


fun bind(position: Int) {

binding.tvTime.text = dataList[position].voteTime

when (dataList[position].weatherStatus) {
Weather.CLEAR.toString() -> { binding.ivWeather.setImageResource(R.drawable.img_sunny) }
Weather.RAIN.toString() -> { binding.ivWeather.setImageResource(R.drawable.ic_rainy) }
Weather.SNOW.toString() -> { binding.ivWeather.setImageResource(R.drawable.img_snowy) }
Weather.CLEAR.toString() -> {
binding.ivWeather.setImageResource(R.drawable.img_sunny)
}

Weather.RAIN.toString() -> {
binding.ivWeather.setImageResource(R.drawable.ic_rainy)
}

Weather.SNOW.toString() -> {
binding.ivWeather.setImageResource(R.drawable.img_snowy)
}
}

when (dataList[position].headWear){
Clothes.BALACLAVA.toString() -> { binding.ivHeadWear.setImageResource(R.drawable.img_balaclava) }
Clothes.EAR_MUFFS.toString() -> { binding.ivHeadWear.setImageResource(R.drawable.img_ear) }
Clothes.NONE.toString() -> { binding.ivHeadWear.setImageResource(R.drawable.img_empty) }
when (dataList[position].headWear) {
Clothes.BALACLAVA.toString() -> {
binding.ivHeadWear.setImageResource(R.drawable.img_balaclava)
}

Clothes.EAR_MUFFS.toString() -> {
binding.ivHeadWear.setImageResource(R.drawable.img_ear)
}

Clothes.NONE.toString() -> {
binding.ivHeadWear.setImageResource(R.drawable.img_empty)
}
}

when (dataList[position].neckWear){
Clothes.SCARF.toString() -> { binding.ivNeckWear.setImageResource(R.drawable.img_muffler) }
Clothes.NONE.toString() -> { binding.ivNeckWear.setImageResource(R.drawable.img_empty) }
when (dataList[position].neckWear) {
Clothes.SCARF.toString() -> {
binding.ivNeckWear.setImageResource(R.drawable.img_muffler)
}

Clothes.NONE.toString() -> {
binding.ivNeckWear.setImageResource(R.drawable.img_empty)
}
}

when (dataList[position].outerWear){
Clothes.SHORT_PADDING.toString() -> { binding.ivOuterWear.setImageResource(R.drawable.img_short_padding) }
Clothes.LONG_PADDING.toString() -> { binding.ivOuterWear.setImageResource(R.drawable.img_long_padding) }
Clothes.COAT.toString() -> { binding.ivOuterWear.setImageResource(R.drawable.img_coat) }
Clothes.NONE.toString() -> { binding.ivOuterWear.setImageResource(R.drawable.img_empty) }
when (dataList[position].outerWear) {
Clothes.SHORT_PADDING.toString() -> {
binding.ivOuterWear.setImageResource(R.drawable.img_short_padding)
}

Clothes.LONG_PADDING.toString() -> {
binding.ivOuterWear.setImageResource(R.drawable.img_long_padding)
}

Clothes.COAT.toString() -> {
binding.ivOuterWear.setImageResource(R.drawable.img_coat)
}

Clothes.NONE.toString() -> {
binding.ivOuterWear.setImageResource(R.drawable.img_empty)
}
}

when (dataList[position].topWear){
Clothes.LONG_SLEEVE.toString() -> { binding.ivTopWear.setImageResource(R.drawable.img_long_shirt) }
Clothes.NEAT.toString() -> { binding.ivTopWear.setImageResource(R.drawable.img_neat) }
when (dataList[position].topWear) {
Clothes.LONG_SLEEVE.toString() -> {
binding.ivTopWear.setImageResource(R.drawable.img_long_shirt)
}

Clothes.NEAT.toString() -> {
binding.ivTopWear.setImageResource(R.drawable.img_neat)
}
}
}
}
Expand All @@ -63,9 +104,18 @@ class GridAdapter(private val dataList: List<VoteHistory>) :
return ViewHolder(viewBinding)
}

override fun getItemCount(): Int {

return dataList.size
}

override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.bind(position)
}
holder.itemView.setOnClickListener {
val intent = Intent(holder.itemView.context, PopupActivity::class.java)
intent.putExtra("key", position)
holder.itemView.context.startActivity(intent)
}

override fun getItemCount(): Int = dataList.size
}
}
19 changes: 19 additions & 0 deletions app/src/main/res/layout/activity_popup.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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=".PopupActivity">

<ImageView
android:id="@+id/imageView"
android:layout_width="300dp"
android:layout_height="400dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />


</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit e7de8c0

Please sign in to comment.