-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
32 changed files
with
306 additions
and
17 deletions.
There are no files selected for viewing
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions
17
app/src/main/java/kr/co/sujungvillage_admin/api/HomeService.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,17 @@ | ||
package kr.co.sujungvillage_admin.api | ||
|
||
import kr.co.sujungvillage_admin.retrofit.HomeInfoResultDTO | ||
import retrofit2.Call | ||
import retrofit2.http.GET | ||
import retrofit2.http.Header | ||
import retrofit2.http.Query | ||
|
||
interface HomeService { | ||
// 관리자 홈 화면 정보 조회 | ||
@GET("/api/admin/home_info") | ||
fun homeInfo( | ||
@Header("user_id") userId: String, | ||
@Query("year") year: String, | ||
@Query("month") month: String, | ||
): Call<HomeInfoResultDTO> | ||
} |
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,20 @@ | ||
package kr.co.sujungvillage_admin.retrofit | ||
|
||
import com.google.gson.annotations.SerializedName | ||
import java.io.Serializable | ||
|
||
data class HomeInfoResultDTO( | ||
@SerializedName("adminInfo") | ||
val adminInfo: HomeAdminInfo, | ||
@SerializedName("rollcallDays") | ||
val rollcallDays: List<Int>, | ||
): Serializable {} | ||
|
||
data class HomeAdminInfo( | ||
@SerializedName("name") | ||
val name: String, | ||
@SerializedName("dormitoryName") | ||
val dormitory: String, | ||
@SerializedName("description") | ||
val description: String, | ||
): Serializable {} |
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
34 changes: 34 additions & 0 deletions
34
app/src/main/java/kr/co/sujungvillage_admin/fragment/SettingFragment.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 |
---|---|---|
@@ -1,18 +1,52 @@ | ||
package kr.co.sujungvillage_admin.fragment | ||
|
||
import android.content.Intent | ||
import android.os.Bundle | ||
import android.util.Log | ||
import androidx.fragment.app.Fragment | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import kr.co.sujungvillage_admin.AlarmActivity | ||
import kr.co.sujungvillage_admin.R | ||
import kr.co.sujungvillage_admin.databinding.FragmentSettingBinding | ||
import kr.co.sujungvillage_admin.retrofit.HomeInfoResultDTO | ||
import kr.co.sujungvillage_admin.retrofit.RetrofitBuilder | ||
import retrofit2.Call | ||
import retrofit2.Callback | ||
import retrofit2.Response | ||
|
||
class SettingFragment : Fragment() { | ||
|
||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | ||
val binding = FragmentSettingBinding.inflate(inflater, container, false) | ||
|
||
// ★★★ 재사생 학번 불러오기 | ||
val userNum = "99990001" | ||
|
||
// 알림 버튼 연결 | ||
binding.btnAlarm.setOnClickListener { | ||
var intent = Intent(this.activity, AlarmActivity::class.java) | ||
startActivity(intent) | ||
} | ||
|
||
// 설정 화면 정보 조회 API 연결 (홈 화면 정보 조회 API 활용) | ||
RetrofitBuilder.homeApi.homeInfo(userNum, "2022", "8").enqueue(object : Callback<HomeInfoResultDTO> { | ||
override fun onResponse(call: Call<HomeInfoResultDTO>, response: Response<HomeInfoResultDTO>) { | ||
Log.d("HOME_INFO", "설정 화면 정보 조회 성공") | ||
Log.d("HOME_INFO", "user : " + response.body()?.adminInfo.toString()) | ||
|
||
// 유저 정보 반영 | ||
binding.textName.text = response.body()?.adminInfo?.name | ||
binding.textCharge.text = "담당 : " + response.body()?.adminInfo?.dormitory + " " + response.body()?.adminInfo?.description | ||
} | ||
|
||
override fun onFailure(call: Call<HomeInfoResultDTO>, t: Throwable) { | ||
Log.d("HOME_INFO", "홈 화면 정보 조회 실패") | ||
Log.d("HOME_INFO", t.message.toString()) | ||
} | ||
}) | ||
|
||
return binding.root | ||
} | ||
} |
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
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,74 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<vector | ||
android:height="108dp" | ||
android:width="108dp" | ||
android:viewportHeight="108" | ||
android:viewportWidth="108" | ||
xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="#3DDC84" | ||
android:pathData="M0,0h108v108h-108z"/> | ||
<path android:fillColor="#00000000" android:pathData="M9,0L9,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M19,0L19,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M29,0L29,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M39,0L39,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M49,0L49,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M59,0L59,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M69,0L69,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M79,0L79,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M89,0L89,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M99,0L99,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,9L108,9" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,19L108,19" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,29L108,29" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,39L108,39" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,49L108,49" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,59L108,59" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,69L108,69" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,79L108,79" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,89L108,89" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,99L108,99" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M19,29L89,29" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M19,39L89,39" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M19,49L89,49" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M19,59L89,59" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M19,69L89,69" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M19,79L89,79" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M29,19L29,89" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M39,19L39,89" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M49,19L49,89" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M59,19L59,89" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M69,19L69,89" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M79,19L79,89" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
</vector> |
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,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item | ||
android:top="8.5dp" | ||
android:bottom="8.5dp" | ||
android:right="8.5dp" | ||
android:left="8.5dp"> | ||
<shape> | ||
<solid android:color="#CCD9F17B" /> | ||
<corners android:radius="100dp" /> | ||
</shape> | ||
</item> | ||
</layer-list> |
Oops, something went wrong.