├── app ├── .gitignore ├── src │ ├── main │ │ ├── ic_logo-playstore.png │ │ ├── ic_main-playstore.png │ │ ├── ic_launcher-playstore.png │ │ ├── res │ │ │ ├── font │ │ │ │ ├── pretendard_bold.otf │ │ │ │ ├── pretendard_medium.otf │ │ │ │ ├── pretendard_regular.otf │ │ │ │ ├── pretendard_semibold.otf │ │ │ │ └── pretendard.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_logo.webp │ │ │ │ └── ic_logo_round.webp │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_logo.webp │ │ │ │ └── ic_logo_round.webp │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_logo.webp │ │ │ │ └── ic_logo_round.webp │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_logo.webp │ │ │ │ └── ic_logo_round.webp │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_logo.webp │ │ │ │ └── ic_logo_round.webp │ │ │ ├── drawable │ │ │ │ ├── img_cafeteria_ramen.png │ │ │ │ ├── img_cafeteria_korean.png │ │ │ │ ├── img_cafeteria_cheese_ramen.png │ │ │ │ ├── img_cafeteria_pork_cutlet.png │ │ │ │ ├── img_cafeteria_seafood_ramen.png │ │ │ │ ├── img_cafeteria_spicy_mayo_rice.png │ │ │ │ ├── img_cafeteria_chicken_mayo_rice.png │ │ │ │ ├── img_cafeteria_cheese_pork_cutlet.png │ │ │ │ ├── ic_circle.xml │ │ │ │ ├── img_cafeteria_spam_kimchi_fried_rice.png │ │ │ │ ├── img_cafeteria_sweet_potato_cheese_pork_cutlet.png │ │ │ │ ├── bg_blue100_radius_6dp.xml │ │ │ │ ├── bg_gray100_rounded_corner.xml │ │ │ │ ├── btn_gray100_radius_10dp.xml │ │ │ │ ├── btn_gray300_radius_10dp.xml │ │ │ │ ├── bg_stroke_blue300_radius_2dp.xml │ │ │ │ ├── bg_stroke_gray300_radius_2dp.xml │ │ │ │ ├── ic_done.xml │ │ │ │ ├── ic_close_black.xml │ │ │ │ ├── ic_popup.xml │ │ │ │ ├── ic_alarm_fill.xml │ │ │ │ ├── btn_gray_to_blue_10dp_enabled.xml │ │ │ │ ├── ic_arrow_right.xml │ │ │ │ ├── ic_refresh.xml │ │ │ │ ├── btn_main_stroke_main_radius_8dp.xml │ │ │ │ ├── ic_menu_home.xml │ │ │ │ ├── ic_back.xml │ │ │ │ ├── ic_arrow_left.xml │ │ │ │ ├── ic_timer.xml │ │ │ │ ├── ic_location.xml │ │ │ │ ├── ic_search.xml │ │ │ │ ├── ic_search_empty.xml │ │ │ │ ├── ic_search_button.xml │ │ │ │ ├── ic_alarm.xml │ │ │ │ ├── ic_close.xml │ │ │ │ ├── ic_menu_cafeteria.xml │ │ │ │ ├── ic_setting_right.xml │ │ │ │ ├── ic_logo_foreground.xml │ │ │ │ ├── ic_search_clear.xml │ │ │ │ ├── ic_menu_setting.xml │ │ │ │ ├── ic_menu_calendar.xml │ │ │ │ ├── ic_launcher_foreground.xml │ │ │ │ └── ic_logo_text.xml │ │ │ ├── values │ │ │ │ ├── ic_logo_background.xml │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── arrays.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── themes.xml │ │ │ │ └── styles.xml │ │ │ ├── drawable-v24 │ │ │ │ └── bg_main_navi.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_logo.xml │ │ │ │ └── ic_logo_round.xml │ │ │ ├── color │ │ │ │ ├── bg_chip_select.xml │ │ │ │ ├── bg_chip_text_select.xml │ │ │ │ └── bg_chip_stroke_select.xml │ │ │ ├── font-v26 │ │ │ │ └── pretendard.xml │ │ │ ├── values-v31 │ │ │ │ └── themes.xml │ │ │ ├── layout │ │ │ │ ├── item_cafeteria_korean.xml │ │ │ │ ├── standard_no_data.xml │ │ │ │ ├── dialog_loading.xml │ │ │ │ ├── activity_splash.xml │ │ │ │ ├── item_image.xml │ │ │ │ ├── item_depart.xml │ │ │ │ ├── item_onboarding_depart.xml │ │ │ │ ├── activity_web.xml │ │ │ │ ├── activity_license.xml │ │ │ │ ├── standard_error.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── item_schedule.xml │ │ │ │ ├── item_license.xml │ │ │ │ ├── activity_alarm.xml │ │ │ │ ├── activity_depart.xml │ │ │ │ ├── item_cafeteria_another.xml │ │ │ │ ├── item_notice.xml │ │ │ │ ├── item_calendar_day.xml │ │ │ │ ├── dialog_permission.xml │ │ │ │ ├── standard_toolbar.xml │ │ │ │ ├── fragment_schedule.xml │ │ │ │ └── activity_detail.xml │ │ │ ├── menu │ │ │ │ └── menu_main.xml │ │ │ └── values-night │ │ │ │ └── themes.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── dongyang │ │ │ │ └── android │ │ │ │ └── youdongknowme │ │ │ │ ├── ui │ │ │ │ ├── view │ │ │ │ │ ├── notice │ │ │ │ │ │ └── NoticeTabType.kt │ │ │ │ │ ├── depart │ │ │ │ │ │ ├── DepartClickListener.kt │ │ │ │ │ │ ├── DepartViewModel.kt │ │ │ │ │ │ └── DepartActivity.kt │ │ │ │ │ ├── web │ │ │ │ │ │ ├── WebViewModel.kt │ │ │ │ │ │ └── WebActivity.kt │ │ │ │ │ ├── license │ │ │ │ │ │ ├── LicenseViewModel.kt │ │ │ │ │ │ ├── LicenseClickListener.kt │ │ │ │ │ │ └── LicenseActivity.kt │ │ │ │ │ ├── alarm │ │ │ │ │ │ ├── AlarmClickListener.kt │ │ │ │ │ │ ├── AlarmViewModel.kt │ │ │ │ │ │ └── AlarmActivity.kt │ │ │ │ │ ├── util │ │ │ │ │ │ ├── ResourceProvider.kt │ │ │ │ │ │ ├── KeyboardUtil.kt │ │ │ │ │ │ ├── Event.kt │ │ │ │ │ │ └── ToastUtil.kt │ │ │ │ │ ├── LoadingDialog.kt │ │ │ │ │ ├── cafeteria │ │ │ │ │ │ ├── CalendarInterface.kt │ │ │ │ │ │ └── CafeteriaContainer.kt │ │ │ │ │ ├── splash │ │ │ │ │ │ └── SplashViewModel.kt │ │ │ │ │ ├── detail │ │ │ │ │ │ └── DetailViewModel.kt │ │ │ │ │ ├── setting │ │ │ │ │ │ ├── PermissionDialog.kt │ │ │ │ │ │ └── OnboardingPermissionActivity.kt │ │ │ │ │ ├── keyword │ │ │ │ │ │ └── KeywordViewModel.kt │ │ │ │ │ ├── schedule │ │ │ │ │ │ └── ScheduleViewModel.kt │ │ │ │ │ └── main │ │ │ │ │ │ └── MainViewModel.kt │ │ │ │ ├── adapter │ │ │ │ │ ├── BindingAdapter.kt │ │ │ │ │ ├── NoticeAdapter.kt │ │ │ │ │ ├── CafeteriaAnotherAdapter.kt │ │ │ │ │ ├── CafeteriaKoreanAdapter.kt │ │ │ │ │ ├── LicenseAdapter.kt │ │ │ │ │ ├── ScheduleAdapter.kt │ │ │ │ │ └── OnboardingDepartAdapter.kt │ │ │ │ └── viewholder │ │ │ │ │ ├── NoticeViewHodler.kt │ │ │ │ │ └── CafeteriaAnotherViewHolder.kt │ │ │ │ ├── data │ │ │ │ ├── model │ │ │ │ │ └── AnotherMenuItem.kt │ │ │ │ ├── repository │ │ │ │ │ ├── SplashRepository.kt │ │ │ │ │ ├── DepartRepository.kt │ │ │ │ │ ├── KeywordRepository.kt │ │ │ │ │ ├── AlarmRepository.kt │ │ │ │ │ ├── ScheduleRepository.kt │ │ │ │ │ ├── MainRepository.kt │ │ │ │ │ ├── NoticeRepository.kt │ │ │ │ │ └── CafeteriaRepository.kt │ │ │ │ ├── remote │ │ │ │ │ ├── entity │ │ │ │ │ │ ├── Cafeteria.kt │ │ │ │ │ │ ├── Setting.kt │ │ │ │ │ │ ├── Token.kt │ │ │ │ │ │ ├── Notice.kt │ │ │ │ │ │ └── Schedule.kt │ │ │ │ │ └── service │ │ │ │ │ │ ├── CafeteriaService.kt │ │ │ │ │ │ ├── ScheduleService.kt │ │ │ │ │ │ ├── TokenService.kt │ │ │ │ │ │ ├── SettingService.kt │ │ │ │ │ │ └── NoticeService.kt │ │ │ │ └── local │ │ │ │ │ ├── entity │ │ │ │ │ ├── KeywordEntity.kt │ │ │ │ │ ├── AlarmEntity.kt │ │ │ │ │ └── OpenSourceEntity.kt │ │ │ │ │ ├── UserDatabase.kt │ │ │ │ │ ├── dao │ │ │ │ │ ├── AlarmDao.kt │ │ │ │ │ └── KeywordDao.kt │ │ │ │ │ └── SharedPreference.kt │ │ │ │ └── standard │ │ │ │ ├── network │ │ │ │ ├── NetworkResult.kt │ │ │ │ ├── NetworkError.kt │ │ │ │ ├── ErrorResponseHandler.kt │ │ │ │ └── RetrofitObject.kt │ │ │ │ ├── util │ │ │ │ ├── Weekdays.kt │ │ │ │ ├── UtilExt.kt │ │ │ │ ├── Constants.kt │ │ │ │ └── Mapping.kt │ │ │ │ ├── base │ │ │ │ ├── BaseViewModel.kt │ │ │ │ ├── BaseFragment.kt │ │ │ │ └── BaseActivity.kt │ │ │ │ └── MyApplication.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── dongyang │ │ │ └── android │ │ │ └── youdongknowme │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── com │ │ └── dongyang │ │ └── android │ │ └── youdongknowme │ │ └── ExampleInstrumentedTest.kt ├── proguard-rules.pro └── google-services.json ├── .idea ├── .name └── .gitignore ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .github ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── android.yml ├── settings.gradle ├── gradle.properties ├── README.md └── gradlew.bat /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | YouDongKnowMe -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /app/src/main/ic_logo-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/ic_logo-playstore.png -------------------------------------------------------------------------------- /app/src/main/ic_main-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/ic_main-playstore.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## 🤔 목적 2 | 3 | > 이슈 등록 목적을 상세하게 적어주세요. 4 | 5 | ## 📝 TO-DO 6 | 7 | - [ ] 구현할 기능을 상세하게 적어주세요. 8 | -------------------------------------------------------------------------------- /app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /app/src/main/res/font/pretendard_bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/font/pretendard_bold.otf -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_logo.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/mipmap-hdpi/ic_logo.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_logo.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/mipmap-mdpi/ic_logo.webp -------------------------------------------------------------------------------- /app/src/main/res/font/pretendard_medium.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/font/pretendard_medium.otf -------------------------------------------------------------------------------- /app/src/main/res/font/pretendard_regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/font/pretendard_regular.otf -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_logo.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_logo.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_logo.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_logo.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_logo.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_logo.webp -------------------------------------------------------------------------------- /app/src/main/res/font/pretendard_semibold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/font/pretendard_semibold.otf -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_cafeteria_ramen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/drawable/img_cafeteria_ramen.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_logo_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/mipmap-hdpi/ic_logo_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_logo_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/mipmap-mdpi/ic_logo_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_logo_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_logo_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_logo_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_logo_round.webp -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_cafeteria_korean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/drawable/img_cafeteria_korean.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_logo_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_logo_round.webp -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_cafeteria_cheese_ramen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/drawable/img_cafeteria_cheese_ramen.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_cafeteria_pork_cutlet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/drawable/img_cafeteria_pork_cutlet.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_cafeteria_seafood_ramen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/drawable/img_cafeteria_seafood_ramen.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_cafeteria_spicy_mayo_rice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/drawable/img_cafeteria_spicy_mayo_rice.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_cafeteria_chicken_mayo_rice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/drawable/img_cafeteria_chicken_mayo_rice.png -------------------------------------------------------------------------------- /app/src/main/res/values/ic_logo_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_cafeteria_cheese_pork_cutlet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/drawable/img_cafeteria_cheese_pork_cutlet.png -------------------------------------------------------------------------------- /app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_circle.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_cafeteria_spam_kimchi_fried_rice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/drawable/img_cafeteria_spam_kimchi_fried_rice.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_cafeteria_sweet_potato_cheese_pork_cutlet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamDMU/DMU-Android/HEAD/app/src/main/res/drawable/img_cafeteria_sweet_potato_cheese_pork_cutlet.png -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/view/notice/NoticeTabType.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.view.notice 2 | 3 | enum class NoticeTabType { 4 | SCHOOL, 5 | FACULTY 6 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/view/depart/DepartClickListener.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.view.depart 2 | 3 | interface DepartClickListener { 4 | fun containerClick(position: Int) 5 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/model/AnotherMenuItem.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.model 2 | 3 | data class AnotherMenu( 4 | val menuNameKr: String, 5 | val name: String, 6 | val price: String 7 | ) 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_blue100_radius_6dp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/view/web/WebViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.view.web 2 | 3 | import com.dongyang.android.youdongknowme.standard.base.BaseViewModel 4 | 5 | class WebViewModel : BaseViewModel() { 6 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_gray100_rounded_corner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Jul 27 10:33:58 KST 2025 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_gray100_radius_10dp.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_gray300_radius_10dp.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## 📮 관련 이슈 2 | - resolved #{issue_number} 3 | 4 | ## ✍️ 구현 내용 5 | - 구현 내용을 상세하게 적어주세요. 6 | 7 | ## 📷 구현 영상 8 | - 구현 영상을 업로드 해주세요. 9 | 10 | ## ✔️ 확인 사항 11 | - [ ] 컨벤션에 맞는 PR 타이틀 12 | - [ ] 관련 이슈 연결 13 | - [ ] PR 관련 정보 연결 (작업자, 라벨, 마일스톤 등) 14 | - [ ] Github Action 통과 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/view/license/LicenseViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.view.license 2 | 3 | import com.dongyang.android.youdongknowme.standard.base.BaseViewModel 4 | 5 | class LicenseViewModel : BaseViewModel() { 6 | // NOT IMPLEMENTS 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_stroke_blue300_radius_2dp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_stroke_gray300_radius_2dp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/view/alarm/AlarmClickListener.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.view.alarm 2 | 3 | import com.dongyang.android.youdongknowme.data.local.entity.AlarmEntity 4 | 5 | interface AlarmClickListener { 6 | fun itemClick(alarmEntity: AlarmEntity) 7 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/bg_main_navi.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_logo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_logo_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/color/bg_chip_select.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/standard/network/NetworkResult.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.standard.network 2 | 3 | sealed class NetworkResult() { 4 | class Success(val data: T) : NetworkResult() 5 | class Error(val errorType: NetworkError) : NetworkResult() 6 | } 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/repository/SplashRepository.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.repository 2 | 3 | import com.dongyang.android.youdongknowme.data.local.SharedPreference 4 | 5 | class SplashRepository { 6 | fun getIsFirstLaunch(): Boolean = SharedPreference.getIsFirstLaunch() 7 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/view/license/LicenseClickListener.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.view.license 2 | 3 | import com.dongyang.android.youdongknowme.data.local.entity.OpenSourceEntity 4 | 5 | interface LicenseClickListener { 6 | fun itemClick(openSourceEntity: OpenSourceEntity) 7 | } -------------------------------------------------------------------------------- /app/src/main/res/color/bg_chip_text_select.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/color/bg_chip_stroke_select.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/remote/entity/Cafeteria.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.remote.entity 2 | 3 | import com.google.gson.annotations.SerializedName 4 | 5 | data class Cafeteria( 6 | @SerializedName("date") 7 | val date: String, 8 | @SerializedName("menus") 9 | val menus: List 10 | ) 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/remote/service/CafeteriaService.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.remote.service 2 | 3 | import com.dongyang.android.youdongknowme.data.remote.entity.Cafeteria 4 | import retrofit2.http.GET 5 | 6 | interface CafeteriaService { 7 | @GET("api/v1/dmu/cafeteria") 8 | suspend fun getMenuList(): List 9 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/standard/network/NetworkError.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.standard.network 2 | 3 | sealed class NetworkError { 4 | object Unknown : NetworkError() 5 | object Timeout : NetworkError() 6 | object InternalServer : NetworkError() 7 | class BadRequest(val code: Int, val message: String) : NetworkError() 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/res/font/pretendard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/remote/service/ScheduleService.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.remote.service 2 | 3 | import com.dongyang.android.youdongknowme.data.remote.entity.Schedule 4 | import retrofit2.http.GET 5 | 6 | interface ScheduleService { 7 | @GET("api/v1/dmu/schedule") 8 | suspend fun getScheduleList(): ArrayList 9 | } -------------------------------------------------------------------------------- /app/src/main/res/font-v26/pretendard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/remote/entity/Setting.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.remote.entity 2 | 3 | data class UpdateDepartment( 4 | val token: String, 5 | val department: String, 6 | ) 7 | 8 | data class RemoveToken( 9 | val token: String, 10 | ) 11 | 12 | data class UpdateTopic( 13 | val token: String, 14 | val topics: List, 15 | ) -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_done.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/adapter/BindingAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.adapter 2 | 3 | import android.view.View 4 | import androidx.databinding.BindingAdapter 5 | 6 | @BindingAdapter("bind_is_loading", "bind_is_error") 7 | fun bindShowScreen(view: View, isLoading: Boolean, isError: Boolean) { 8 | view.visibility = if (isLoading || isError) View.GONE else View.VISIBLE 9 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/view/util/ResourceProvider.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.view.util 2 | 3 | import android.content.Context 4 | import androidx.annotation.StringRes 5 | 6 | class ResourceProvider ( 7 | private val context: Context 8 | ) { 9 | fun getString(@StringRes stringResId: Int): String { 10 | return context.getString(stringResId) 11 | } 12 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/remote/entity/Token.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.remote.entity 2 | 3 | import com.google.gson.annotations.SerializedName 4 | 5 | data class Token ( 6 | @SerializedName("token") 7 | val token: String, 8 | @SerializedName("department") 9 | val department: String, 10 | @SerializedName("topics") 11 | val topics: List, 12 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/remote/service/TokenService.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.remote.service 2 | 3 | import com.dongyang.android.youdongknowme.data.remote.entity.Token 4 | import retrofit2.http.Body 5 | import retrofit2.http.POST 6 | 7 | interface TokenService { 8 | @POST("token/v1/dmu/initToken") 9 | suspend fun setInitToken( 10 | @Body data: Token, 11 | ) 12 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_close_black.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values-v31/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/remote/entity/Notice.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.remote.entity 2 | 3 | import com.google.gson.annotations.SerializedName 4 | 5 | data class Notice( 6 | @SerializedName("title") 7 | val title: String, 8 | @SerializedName("author") 9 | val author: String, 10 | @SerializedName("date") 11 | val date: String, 12 | @SerializedName("url") 13 | val url: String, 14 | ) -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | google() 5 | mavenCentral() 6 | } 7 | } 8 | dependencyResolutionManagement { 9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 10 | repositories { 11 | google() 12 | mavenCentral() 13 | maven { url 'https://jitpack.io'} // calendar 14 | } 15 | } 16 | rootProject.name = "YouDongKnowMe" 17 | include ':app' 18 | -------------------------------------------------------------------------------- /app/src/test/java/com/dongyang/android/youdongknowme/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/local/entity/KeywordEntity.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.local.entity 2 | 3 | import androidx.room.ColumnInfo 4 | import androidx.room.Entity 5 | import androidx.room.PrimaryKey 6 | 7 | @Entity(tableName = "keyword") 8 | data class KeywordEntity( 9 | @PrimaryKey @ColumnInfo(name = "name") var name: String = "", 10 | @ColumnInfo(name = "englishName") var englishName: String = "", 11 | @ColumnInfo(name = "isSubscribe") var isSubscribe: Boolean = false, 12 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/view/LoadingDialog.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.view 2 | 3 | import android.app.Dialog 4 | import android.content.Context 5 | import android.graphics.Color 6 | import android.graphics.drawable.ColorDrawable 7 | import com.dongyang.android.youdongknowme.R 8 | 9 | class LoadingDialog(context: Context) : Dialog(context) { 10 | 11 | init { 12 | setCanceledOnTouchOutside(false) 13 | setCancelable(false) 14 | window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT)) 15 | setContentView(R.layout.dialog_loading) 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/repository/DepartRepository.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.repository 2 | 3 | import com.dongyang.android.youdongknowme.data.local.SharedPreference 4 | import com.dongyang.android.youdongknowme.standard.util.Department 5 | 6 | class DepartRepository { 7 | fun setDepartment(departName: String) { 8 | val department = Department.getDepartment(departName) 9 | SharedPreference.setDepartment(department.name) 10 | SharedPreference.setCode(department.code) 11 | } 12 | 13 | fun getUserDepartment(): String { 14 | return SharedPreference.getDepartment() 15 | } 16 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/view/cafeteria/CalendarInterface.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.view.cafeteria 2 | 3 | import com.kizitonwose.calendarview.CalendarView 4 | import java.time.LocalDate 5 | 6 | interface CalendarInterface { 7 | fun notifyDateChanged( 8 | viewModel: CafeteriaViewModel, 9 | calendarView: CalendarView, 10 | oldDate: LocalDate?, 11 | selectedDate: LocalDate, 12 | ) { 13 | viewModel.updateMenuList(selectedDate) 14 | viewModel.updateDaysMenu(selectedDate) 15 | calendarView.notifyDateChanged(selectedDate) 16 | oldDate?.let { calendarView.notifyDateChanged(it) } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 36dp 4 | 5 | 280dp 6 | 7 | 10dp 8 | 11dp 9 | 12dp 10 | 14dp 11 | 16dp 12 | 18dp 13 | 20dp 14 | 24dp 15 | 32dp 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/remote/entity/Schedule.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.remote.entity 2 | 3 | import com.google.gson.annotations.SerializedName 4 | 5 | data class Schedule( 6 | @SerializedName("year") 7 | val year: Int, 8 | @SerializedName("yearSchedule") 9 | val yearSchedules: List, 10 | ) 11 | 12 | data class YearSchedule( 13 | @SerializedName("month") 14 | val month: Int, 15 | @SerializedName("scheduleEntries") 16 | val scheduleEntries: List 17 | ) 18 | 19 | data class ScheduleEntry( 20 | @SerializedName("content") 21 | val contents: String, 22 | @SerializedName("date") 23 | val dates: List 24 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/view/util/KeyboardUtil.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.view.util 2 | 3 | import android.content.Context 4 | import android.view.View 5 | import android.view.inputmethod.InputMethodManager 6 | 7 | fun Context.showKeyboard(view: View) { 8 | val inputMethodManager = 9 | getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager 10 | inputMethodManager.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT) 11 | } 12 | 13 | fun Context.hideKeyboard(view: View) { 14 | val inputMethodManager = 15 | getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager 16 | inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0) 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/local/UserDatabase.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.local 2 | 3 | 4 | import androidx.room.Database 5 | import androidx.room.RoomDatabase 6 | import com.dongyang.android.youdongknowme.data.local.dao.AlarmDao 7 | import com.dongyang.android.youdongknowme.data.local.dao.KeywordDao 8 | import com.dongyang.android.youdongknowme.data.local.entity.AlarmEntity 9 | import com.dongyang.android.youdongknowme.data.local.entity.KeywordEntity 10 | 11 | @Database(entities = [KeywordEntity::class, AlarmEntity::class], version = 1, exportSchema = false) 12 | abstract class UserDatabase : RoomDatabase() { 13 | abstract fun keywordDao(): KeywordDao 14 | abstract fun alarmDao(): AlarmDao 15 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/item_cafeteria_korean.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/repository/KeywordRepository.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.repository 2 | 3 | import com.dongyang.android.youdongknowme.data.local.SharedPreference 4 | import com.dongyang.android.youdongknowme.data.local.dao.KeywordDao 5 | import com.dongyang.android.youdongknowme.data.local.entity.KeywordEntity 6 | import kotlinx.coroutines.flow.Flow 7 | 8 | class KeywordRepository( 9 | private val keywordDao: KeywordDao 10 | ) { 11 | fun getUserKeywords(): Flow> { 12 | return keywordDao.getAllKeyword() 13 | } 14 | 15 | suspend fun updateUserKeywords(isSubscribe: Boolean, name: String) { 16 | keywordDao.updateKeyword(isSubscribe, name) 17 | } 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/local/entity/AlarmEntity.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.local.entity 2 | 3 | import androidx.room.ColumnInfo 4 | import androidx.room.Entity 5 | import androidx.room.PrimaryKey 6 | 7 | @Entity(tableName = "alarm") 8 | data class AlarmEntity( 9 | @PrimaryKey(autoGenerate = true) @ColumnInfo(name = "id") 10 | var id: Int?, 11 | @ColumnInfo(name = "title") 12 | var title: String = "", 13 | @ColumnInfo(name = "department") 14 | var department: String = "", 15 | @ColumnInfo(name = "keyword") 16 | var keyword: String = "", 17 | @ColumnInfo(name = "num") 18 | var num: Int, 19 | @ColumnInfo(name = "isVisited") 20 | var isVisited: Boolean = false, 21 | ) -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_popup.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_alarm_fill.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/repository/AlarmRepository.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.repository 2 | 3 | import com.dongyang.android.youdongknowme.data.local.dao.AlarmDao 4 | import com.dongyang.android.youdongknowme.data.local.entity.AlarmEntity 5 | import kotlinx.coroutines.flow.Flow 6 | 7 | class AlarmRepository( 8 | private val alarmDao: AlarmDao 9 | ) { 10 | fun getUserAlarms(): Flow> { 11 | return alarmDao.getAllAlarm() 12 | } 13 | 14 | suspend fun insertAlarm(alarmEntity: AlarmEntity) { 15 | alarmDao.insertAlarm(alarmEntity) 16 | } 17 | 18 | suspend fun updateIsVisitedAlarm(isVisited: Boolean, id: Int) { 19 | alarmDao.updateIsVisitedAlarm(isVisited, id) 20 | } 21 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_gray_to_blue_10dp_enabled.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_arrow_right.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/view/splash/SplashViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.view.splash 2 | 3 | import androidx.lifecycle.LiveData 4 | import androidx.lifecycle.MutableLiveData 5 | import com.dongyang.android.youdongknowme.data.repository.SplashRepository 6 | import com.dongyang.android.youdongknowme.standard.base.BaseViewModel 7 | 8 | class SplashViewModel(private val splashRepository: SplashRepository) : BaseViewModel() { 9 | 10 | private val _isFirstLaunch: MutableLiveData = MutableLiveData(false) 11 | val isFirstLaunch: LiveData get() = _isFirstLaunch 12 | 13 | fun checkFirstLaunch() { 14 | if (splashRepository.getIsFirstLaunch()) { 15 | _isFirstLaunch.value = true 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/local/dao/AlarmDao.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.local.dao 2 | 3 | import androidx.room.* 4 | import com.dongyang.android.youdongknowme.data.local.entity.AlarmEntity 5 | import kotlinx.coroutines.flow.Flow 6 | 7 | @Dao 8 | interface AlarmDao { 9 | @Query("SELECT * FROM alarm ORDER BY id DESC") 10 | fun getAllAlarm(): Flow> 11 | 12 | @Insert(onConflict = OnConflictStrategy.REPLACE) 13 | suspend fun insertAlarm(alarm: AlarmEntity) 14 | 15 | @Query("SELECT count(*) FROM alarm WHERE isVisited = 0") 16 | fun getUnVisitedAlarmCount(): Flow 17 | 18 | @Query("UPDATE alarm SET isVisited = :isVisited WHERE id = :id") 19 | suspend fun updateIsVisitedAlarm(isVisited: Boolean, id: Int) 20 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/standard_no_data.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 20 | -------------------------------------------------------------------------------- /.github/workflows/android.yml: -------------------------------------------------------------------------------- 1 | name: Android CI 2 | 3 | on: 4 | pull_request: 5 | branches: [ develop ] 6 | 7 | jobs: 8 | build: 9 | 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v3 14 | - name: set up JDK 11 15 | uses: actions/setup-java@v3 16 | with: 17 | java-version: '11' 18 | distribution: 'temurin' 19 | cache: gradle 20 | 21 | - name: Grant execute permission for gradlew 22 | run: chmod +x gradlew 23 | - name: Access API key 24 | env: 25 | API_KEY: ${{ secrets.API_KEY }} 26 | run: 27 | echo API_KEY=\"$API_KEY\" > ./local.properties 28 | - name: Build with Gradle 29 | env: 30 | BASE_URL: ${{ secrets.BASE_URL }} 31 | run: 32 | echo API_KEY=\"$API_KEY\" > ./local.properties 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_refresh.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 11 | 15 | 19 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/dongyang/android/youdongknowme/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.dongyang.android.youdongknowme", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_main_stroke_main_radius_8dp.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/view/util/Event.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.view.util 2 | 3 | import androidx.lifecycle.Observer 4 | 5 | open class Event(private val content: T) { 6 | 7 | @Suppress("MemberVisibilityCanBePrivate") 8 | var hasBeenHandled = false 9 | private set 10 | 11 | fun getContentIfNotHandled(): T? { 12 | return if (hasBeenHandled) { 13 | null 14 | } else { 15 | hasBeenHandled = true 16 | content 17 | } 18 | } 19 | 20 | fun peekContent(): T = content 21 | } 22 | 23 | class EventObserver(private val onEventUnhandledContent: (T) -> Unit) : Observer> { 24 | override fun onChanged(value: Event) { 25 | value.getContentIfNotHandled()?.let { 26 | onEventUnhandledContent(it) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_loading.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_home.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/standard/util/Weekdays.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.standard.util 2 | 3 | import java.time.DayOfWeek 4 | 5 | enum class Weekdays { 6 | MONDAY, 7 | TUESDAY, 8 | WEDNESDAY, 9 | THURSDAY, 10 | FRIDAY, 11 | SATURDAY, 12 | SUNDAY; 13 | 14 | companion object { 15 | 16 | fun from(dayOfWeek: DayOfWeek): Weekdays { 17 | return when (dayOfWeek) { 18 | DayOfWeek.MONDAY -> MONDAY 19 | DayOfWeek.TUESDAY -> TUESDAY 20 | DayOfWeek.WEDNESDAY -> WEDNESDAY 21 | DayOfWeek.THURSDAY -> THURSDAY 22 | DayOfWeek.FRIDAY -> FRIDAY 23 | DayOfWeek.SATURDAY -> SATURDAY 24 | DayOfWeek.SUNDAY -> SUNDAY 25 | else -> throw IllegalArgumentException("일주일 범위에 해당되지 않습니다.") 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/view/detail/DetailViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.view.detail 2 | 3 | import androidx.lifecycle.LiveData 4 | import androidx.lifecycle.MutableLiveData 5 | import com.dongyang.android.youdongknowme.standard.base.BaseViewModel 6 | import com.dongyang.android.youdongknowme.ui.view.util.Event 7 | 8 | class DetailViewModel: BaseViewModel() { 9 | 10 | private val _errorState: MutableLiveData> = MutableLiveData() 11 | val errorState: LiveData> = _errorState 12 | 13 | private val _isError: MutableLiveData = MutableLiveData() 14 | val isError: LiveData = _isError 15 | 16 | private val _isLoading: MutableLiveData = MutableLiveData() 17 | val isLoading: LiveData get() = _isLoading 18 | 19 | companion object { 20 | private const val DEFAULT_VALUE = 0 21 | } 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/remote/service/SettingService.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.remote.service 2 | 3 | import com.dongyang.android.youdongknowme.data.remote.entity.RemoveToken 4 | import com.dongyang.android.youdongknowme.data.remote.entity.UpdateDepartment 5 | import com.dongyang.android.youdongknowme.data.remote.entity.UpdateTopic 6 | import retrofit2.http.Body 7 | import retrofit2.http.POST 8 | 9 | interface SettingService { 10 | 11 | @POST("department/v1/dmu/updateDepartment") 12 | suspend fun updateDepartment(@Body data: UpdateDepartment) 13 | 14 | @POST("department/v1/dmu/deleteDepartment") 15 | suspend fun deleteDepartment(@Body token: RemoveToken) 16 | 17 | @POST("token/v1/dmu/updateTopic") 18 | suspend fun updateTopic(@Body data: UpdateTopic) 19 | 20 | @POST("token/v1/dmu/deleteTopic") 21 | suspend fun deleteTopic(@Body token: RemoveToken) 22 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_back.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_arrow_left.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/view/util/ToastUtil.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.view.util 2 | 3 | import android.content.Context 4 | import android.widget.Toast 5 | import androidx.annotation.StringRes 6 | 7 | private var toast: Toast? = null 8 | 9 | fun Context.toast(message: CharSequence?) { 10 | toast?.cancel() 11 | toast = message?.let { Toast.makeText(this, it, Toast.LENGTH_SHORT) }?.apply { show() } 12 | } 13 | 14 | fun Context.longToast(message: CharSequence?) { 15 | toast?.cancel() 16 | toast = message?.let { Toast.makeText(this, it, Toast.LENGTH_LONG) }?.apply { show() } 17 | } 18 | 19 | fun Context.toast(@StringRes message: Int) { 20 | toast?.cancel() 21 | toast = Toast.makeText(this, message, Toast.LENGTH_SHORT).apply { show() } 22 | } 23 | 24 | fun Context.longToast(@StringRes message: Int) { 25 | toast?.cancel() 26 | toast = Toast.makeText(this, message, Toast.LENGTH_LONG).apply { show() } 27 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/viewholder/NoticeViewHodler.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.viewholder 2 | 3 | import androidx.recyclerview.widget.RecyclerView 4 | import com.dongyang.android.youdongknowme.data.remote.entity.Notice 5 | import com.dongyang.android.youdongknowme.databinding.ItemNoticeBinding 6 | 7 | class NoticeViewHolder( 8 | private val binding: ItemNoticeBinding, 9 | clickListener: (url: String) -> Unit 10 | ) : 11 | RecyclerView.ViewHolder(binding.root) { 12 | 13 | private var noticeUrl: String? = null 14 | 15 | init { 16 | binding.root.setOnClickListener { 17 | clickListener(noticeUrl ?: "0") 18 | } 19 | } 20 | 21 | fun bind(item: Notice) { 22 | noticeUrl = item.url 23 | 24 | binding.tvNoticeTitle.text = item.title 25 | binding.tvNoticeDate.text = item.date.replace("-", ".") 26 | binding.tvNoticeAuthor.text = item.author 27 | } 28 | } -------------------------------------------------------------------------------- /app/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 기계공학과 5 | 기계설계공학과 6 | 로봇소프트웨어과 7 | 자동화공학과 8 | 전기공학과 9 | 정보전자공학과 10 | 반도체전자공학과 11 | 정보통신공학과 12 | 소방안전관리과 13 | 컴퓨터소프트웨어공학과 14 | 웹응용소프트웨어공학과 15 | 인공지능소프트웨어학과 16 | 생명화학공학과 17 | 바이오융합공학과 18 | 건축과 19 | 실내건축디자인과 20 | 시각디자인과 21 | AR-VR콘텐츠디자인과 22 | 경영학과 23 | 세무회계학과 24 | 유통마케팅학과 25 | 호텔관광학과 26 | 경영정보학과 27 | 빅데이터경영과 28 | 자유전공학과 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_timer.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_location.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/remote/service/NoticeService.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.remote.service 2 | 3 | import com.dongyang.android.youdongknowme.data.remote.entity.Notice 4 | import retrofit2.http.GET 5 | import retrofit2.http.Path 6 | import retrofit2.http.Query 7 | 8 | interface NoticeService { 9 | 10 | @GET("api/v1/dmu/universityNotice") 11 | suspend fun getUniversityNotice( 12 | @Query("page") page: Int, 13 | @Query("size") size: Int 14 | ): List 15 | 16 | @GET("api/v1/dmu/departmentNotice/{department}") 17 | suspend fun getDepartmentNotice( 18 | @Path("department") department: String, 19 | @Query("page") page: Int, 20 | @Query("size") size: Int 21 | ): List 22 | 23 | @GET("api/v1/dmu/notice/{searchWord}") 24 | suspend fun getSearchNotice( 25 | @Path("searchWord") searchWord: String, 26 | @Query("department") department: String, 27 | @Query("page") page: Int, 28 | @Query("size") size: Int 29 | ): List 30 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search_empty.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search_button.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_alarm.xml: -------------------------------------------------------------------------------- 1 | 6 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/standard/util/UtilExt.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.standard.util 2 | 3 | import android.app.Activity 4 | import android.content.Context 5 | import android.view.View 6 | import android.view.inputmethod.InputMethodManager 7 | 8 | fun View.showKeyboard(isForced: Boolean = false) { 9 | val inputMethodManager = 10 | context.getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager 11 | inputMethodManager.showSoftInput( 12 | this, 13 | if (isForced) InputMethodManager.SHOW_FORCED else InputMethodManager.SHOW_IMPLICIT 14 | ) 15 | } 16 | 17 | fun View.hideKeyboard() { 18 | val inputMethodManager = 19 | context.getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager 20 | inputMethodManager.hideSoftInputFromWindow(windowToken, 0) 21 | } 22 | 23 | fun Int.dpToPx(context: Context): Int { 24 | val density = context.resources.displayMetrics.density 25 | return (this * density).toInt() 26 | } 27 | 28 | 29 | object ACTION { 30 | const val FCM_ACTION_NAME = "com.google.firebase.MESSAGING_EVENT" 31 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/item_image.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/standard/network/ErrorResponseHandler.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.standard.network 2 | 3 | import retrofit2.HttpException 4 | import retrofit2.Response 5 | import java.net.SocketTimeoutException 6 | 7 | class ErrorResponseHandler { 8 | 9 | fun getError(exception: Throwable): NetworkError { 10 | return when (exception) { 11 | is SocketTimeoutException -> NetworkError.Timeout 12 | is HttpException -> { 13 | when (exception.code()) { 14 | in 500..599 -> NetworkError.InternalServer 15 | in 400..499 -> { 16 | val code = exception.code() 17 | val message = extractErrorMessage(exception.response()) 18 | NetworkError.BadRequest(code, message) 19 | } 20 | else -> NetworkError.Unknown 21 | } 22 | } 23 | else -> NetworkError.Unknown 24 | } 25 | } 26 | 27 | private fun extractErrorMessage(response: Response<*>?): String { 28 | return response?.message().orEmpty() 29 | } 30 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/local/dao/KeywordDao.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.local.dao 2 | 3 | import androidx.room.Dao 4 | import androidx.room.Insert 5 | import androidx.room.OnConflictStrategy 6 | import androidx.room.Query 7 | import com.dongyang.android.youdongknowme.data.local.entity.KeywordEntity 8 | import kotlinx.coroutines.flow.Flow 9 | 10 | @Dao 11 | interface KeywordDao { 12 | @Query("SELECT * FROM keyword ORDER BY name DESC") 13 | fun getAllKeyword(): Flow> 14 | 15 | @Insert(onConflict = OnConflictStrategy.REPLACE) 16 | suspend fun insertKeywordList(keyword: List) 17 | 18 | @Insert(onConflict = OnConflictStrategy.REPLACE) 19 | suspend fun insertKeyword(keyword: KeywordEntity) 20 | 21 | @Query("UPDATE keyword SET isSubscribe = :isSubscribe WHERE name = :name") 22 | suspend fun updateKeyword(isSubscribe: Boolean, name: String) 23 | 24 | @Query("DELETE FROM keyword WHERE name = :name") 25 | suspend fun deleteKeyword(name: String) 26 | 27 | @Query("SELECT * FROM keyword WHERE isSubscribe = 1") 28 | suspend fun getSubscribedKeywords(): List 29 | } -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #5265FF 4 | #D75265FF 5 | #665265FF 6 | #0F498C 7 | #FF3700B3 8 | #FF0F498C 9 | #FF018786 10 | #FF000000 11 | #CC000000 12 | #FFFFFFFF 13 | #00FFFFFF 14 | 15 | #D9D9D9 16 | 17 | #FF35373F 18 | #FF4F525F 19 | #FF7E8295 20 | #AEB1C5 21 | #FFEBEBF0 22 | #FFF5F6F8 23 | #FF354DAE 24 | #FF4967E1 25 | #FFD0D8F9 26 | #FFEFF2FF 27 | #FFD92727 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/view/depart/DepartViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.view.depart 2 | 3 | import androidx.lifecycle.LiveData 4 | import androidx.lifecycle.MutableLiveData 5 | import com.dongyang.android.youdongknowme.data.repository.DepartRepository 6 | import com.dongyang.android.youdongknowme.standard.base.BaseViewModel 7 | 8 | class DepartViewModel(private val departRepository: DepartRepository) : BaseViewModel() { 9 | private val _myDepartment: MutableLiveData = MutableLiveData() 10 | val myDepartment: LiveData get() = _myDepartment 11 | 12 | private val _selectDepartPosition = MutableLiveData(-1) 13 | val selectDepartPosition: LiveData get() = _selectDepartPosition 14 | 15 | init { 16 | getUserDepartment() 17 | } 18 | 19 | private fun getUserDepartment() { 20 | val myDepartment = departRepository.getUserDepartment() 21 | _myDepartment.postValue(myDepartment) 22 | } 23 | 24 | fun setDepartment(department: String) { 25 | departRepository.setDepartment(department) 26 | } 27 | 28 | fun setSelectPosition(position: Int) { 29 | _selectDepartPosition.postValue(position) 30 | } 31 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_close.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_depart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_onboarding_depart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "216931333525", 4 | "project_id": "dm-for-u", 5 | "storage_bucket": "dm-for-u.appspot.com" 6 | }, 7 | "client": [ 8 | { 9 | "client_info": { 10 | "mobilesdk_app_id": "1:216931333525:android:76b43009912139a0fef29c", 11 | "android_client_info": { 12 | "package_name": "com.dmu.android" 13 | } 14 | }, 15 | "oauth_client": [], 16 | "api_key": [ 17 | { 18 | "current_key": "AIzaSyCAnvMxwnN_XBoZJPv8Ob3oB4qTz_ILtnA" 19 | } 20 | ], 21 | "services": { 22 | "appinvite_service": { 23 | "other_platform_oauth_client": [] 24 | } 25 | } 26 | }, 27 | { 28 | "client_info": { 29 | "mobilesdk_app_id": "1:216931333525:android:be451c8a539f9428fef29c", 30 | "android_client_info": { 31 | "package_name": "com.dongyang.android.youdongknowme" 32 | } 33 | }, 34 | "oauth_client": [], 35 | "api_key": [ 36 | { 37 | "current_key": "AIzaSyCAnvMxwnN_XBoZJPv8Ob3oB4qTz_ILtnA" 38 | } 39 | ], 40 | "services": { 41 | "appinvite_service": { 42 | "other_platform_oauth_client": [] 43 | } 44 | } 45 | } 46 | ], 47 | "configuration_version": "1" 48 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/standard/util/Constants.kt: -------------------------------------------------------------------------------- 1 | object CODE { 2 | const val SCHOOL_CODE = 1 3 | 4 | const val MECHANICAL_ENGINE_CODE = 101 5 | const val MECHANICAL_DESIGN_CODE = 102 6 | 7 | const val AUTOMATION_ENGINE_CODE = 201 8 | const val ROBOT_SOFTWARE_CODE = 202 9 | 10 | const val COMPUTER_SOFTWARE_ENGINE_CODE = 301 11 | const val WEB_APP_SOFTWARE_ENGINE_CODE = 302 12 | const val ARTIFICIAL_ENGINE_CODE = 303 13 | 14 | const val ELECTRICAL_ENGINE_CODE = 401 15 | const val INFO_ELECTRONIC_ENGINE_CODE = 402 16 | const val SEMICONDUCTOR_ENGINE_CODE = 403 17 | const val INFO_COMMUNICATION_ENGINE_CODE = 404 18 | const val FIRE_MANAGEMENT_CODE = 405 19 | 20 | const val BIOCHEMICAL_ENGINE_CODE = 501 21 | const val BIO_CONVERGENCE_ENGINE_CODE = 502 22 | const val ARCHITECTURE_CODE = 503 23 | const val INTERIOR_DESIGN_CODE = 504 24 | const val VISUAL_DESIGN_CODE = 505 25 | const val AR_VR_CONTENT_CODE = 506 26 | 27 | const val BUSINESS_ADMINISTRATION_CODE = 601 28 | const val TAX_ACCOUNTING_CODE = 602 29 | const val DISTRIBUTION_MARKETING_CODE = 603 30 | const val HOTEL_TOURISM_CODE = 604 31 | const val MANAGEMENT_INFORMATION_CODE = 605 32 | const val BIG_DATA_MANAGEMENT_CODE = 606 33 | 34 | const val LIBERAL_MAJOR_CODE = 701 35 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_cafeteria.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_setting_right.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/data/repository/ScheduleRepository.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.data.repository 2 | 3 | import com.dongyang.android.youdongknowme.data.local.SharedPreference 4 | import com.dongyang.android.youdongknowme.data.remote.entity.Schedule 5 | import com.dongyang.android.youdongknowme.data.remote.service.ScheduleService 6 | import com.dongyang.android.youdongknowme.standard.network.ErrorResponseHandler 7 | import com.dongyang.android.youdongknowme.standard.network.NetworkResult 8 | import com.dongyang.android.youdongknowme.standard.network.RetrofitObject 9 | 10 | class ScheduleRepository( 11 | private val errorResponseHandler: ErrorResponseHandler 12 | ) { 13 | suspend fun fetchSchedules(): NetworkResult> { 14 | return try { 15 | val response = RetrofitObject.getNetwork().create(ScheduleService::class.java).getScheduleList() 16 | NetworkResult.Success(response) 17 | } catch (exception: Exception) { 18 | val error = errorResponseHandler.getError(exception) 19 | NetworkResult.Error(error) 20 | } 21 | } 22 | 23 | fun setLocalSchedules(schedule: String) { 24 | SharedPreference.setSchedule(schedule) 25 | } 26 | 27 | fun getLocalSchedules(): String { 28 | return SharedPreference.getSchedule() 29 | } 30 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/adapter/NoticeAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.adapter 2 | 3 | import android.annotation.SuppressLint 4 | import android.view.LayoutInflater 5 | import android.view.ViewGroup 6 | import androidx.recyclerview.widget.RecyclerView 7 | import com.dongyang.android.youdongknowme.data.remote.entity.Notice 8 | import com.dongyang.android.youdongknowme.databinding.ItemNoticeBinding 9 | import com.dongyang.android.youdongknowme.ui.viewholder.NoticeViewHolder 10 | 11 | class NoticeAdapter(private val onItemClick: (url: String) -> Unit) : 12 | RecyclerView.Adapter() { 13 | 14 | private val noticeList = arrayListOf() 15 | 16 | @SuppressLint("NotifyDataSetChanged") 17 | fun submitList(item: List) { 18 | noticeList.clear() 19 | noticeList.addAll(item) 20 | notifyDataSetChanged() 21 | } 22 | 23 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): NoticeViewHolder { 24 | return NoticeViewHolder( 25 | ItemNoticeBinding.inflate( 26 | LayoutInflater.from(parent.context), parent, false 27 | ), onItemClick 28 | ) 29 | } 30 | 31 | override fun onBindViewHolder(holder: NoticeViewHolder, position: Int) { 32 | holder.bind(noticeList[position]) 33 | } 34 | 35 | override fun getItemCount(): Int = noticeList.size 36 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/view/web/WebActivity.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.view.web 2 | 3 | import android.content.Context 4 | import android.content.Intent 5 | import android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP 6 | import com.dongyang.android.youdongknowme.R 7 | import com.dongyang.android.youdongknowme.databinding.ActivityWebBinding 8 | import com.dongyang.android.youdongknowme.standard.base.BaseActivity 9 | import org.koin.androidx.viewmodel.ext.android.viewModel 10 | 11 | class WebActivity : BaseActivity() { 12 | 13 | override val layoutResourceId: Int = R.layout.activity_web 14 | override val viewModel: WebViewModel by viewModel() 15 | 16 | override fun initStartView() { 17 | val url = intent.getStringExtra(KEY_URL) 18 | binding.wvWeb.loadUrl(url.toString()) 19 | binding.btnWebClose.setOnClickListener { 20 | finish() 21 | } 22 | } 23 | 24 | override fun initDataBinding() = Unit 25 | 26 | override fun initAfterBinding() = Unit 27 | 28 | companion object { 29 | private const val KEY_URL = "url" 30 | 31 | fun newIntent(context: Context, url: String): Intent { 32 | return Intent(context, WebActivity::class.java).apply { 33 | putExtra(KEY_URL, url) 34 | flags = FLAG_ACTIVITY_SINGLE_TOP 35 | } 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 21 | 22 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_logo_foreground.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 13 | 17 | 21 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/viewholder/CafeteriaAnotherViewHolder.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.viewholder 2 | 3 | import androidx.core.view.setPadding 4 | import androidx.recyclerview.widget.RecyclerView 5 | import com.dongyang.android.youdongknowme.R 6 | import com.dongyang.android.youdongknowme.data.model.AnotherMenu 7 | import com.dongyang.android.youdongknowme.databinding.ItemCafeteriaAnotherBinding 8 | 9 | class CafeteriaAnotherViewHolder( 10 | private val binding: ItemCafeteriaAnotherBinding 11 | ) : RecyclerView.ViewHolder(binding.root) { 12 | 13 | fun bind(item: AnotherMenu) { 14 | binding.menuKr = item.menuNameKr 15 | binding.menuEn = item.name.split('_') 16 | .joinToString(" ") { word -> 17 | word.lowercase().replaceFirstChar { firstChar -> firstChar.uppercase() } 18 | } 19 | binding.menuPrice = item.price 20 | 21 | val context = binding.root.context 22 | val resourceName = "img_cafeteria_" + item.name.lowercase() 23 | val drawableResId = 24 | context.resources.getIdentifier(resourceName, "drawable", context.packageName) 25 | 26 | if (drawableResId != 0) { 27 | binding.imgAnother.setImageResource(drawableResId) 28 | binding.imgAnother.setPadding(0) 29 | } else { 30 | binding.imgAnother.setImageResource(R.drawable.img_cafeteria_korean) 31 | binding.imgAnother.setPadding(15) 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_license.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 20 | 21 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/standard/network/RetrofitObject.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.standard.network 2 | 3 | import com.dongyang.android.youdongknowme.BuildConfig 4 | import okhttp3.Interceptor 5 | import okhttp3.OkHttpClient 6 | import okhttp3.logging.HttpLoggingInterceptor 7 | import retrofit2.Retrofit 8 | import retrofit2.converter.gson.GsonConverterFactory 9 | import java.util.concurrent.TimeUnit 10 | 11 | object RetrofitObject { 12 | private const val TIME_OUT_COUNT: Long = 40 13 | 14 | fun getNetwork(): Retrofit { 15 | val baseInterceptor = Interceptor { chain -> 16 | val request = chain.request().newBuilder() 17 | val originalHttpUrl = chain.request().url 18 | 19 | val url = originalHttpUrl.newBuilder() 20 | .build() 21 | request.url(url) 22 | chain.proceed(request.build()) 23 | } 24 | 25 | val client = OkHttpClient.Builder() 26 | .connectTimeout(TIME_OUT_COUNT, TimeUnit.SECONDS) 27 | .readTimeout(TIME_OUT_COUNT, TimeUnit.SECONDS) 28 | .addInterceptor(baseInterceptor) 29 | .addNetworkInterceptor(HttpLoggingInterceptor().apply { 30 | level = HttpLoggingInterceptor.Level.BASIC 31 | }).build() 32 | 33 | return Retrofit.Builder() 34 | .baseUrl(BuildConfig.BASE_URL) 35 | .addConverterFactory(GsonConverterFactory.create()) 36 | .client(client) 37 | .build() 38 | } 39 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app"s APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Kotlin code style for this project: "official" or "obsolete": 19 | kotlin.code.style=official 20 | # Enables namespacing of each library's R class so that its R class includes only the 21 | # resources declared in the library itself and none from the library's dependencies, 22 | # thereby reducing the size of the R class for that library 23 | android.nonTransitiveRClass=true 24 | 25 | android.enableJetifier=true 26 | android.defaults.buildfeatures.buildconfig=true 27 | android.nonFinalResIds=false -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/standard/base/BaseViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.standard.base 2 | 3 | import androidx.lifecycle.MutableLiveData 4 | import androidx.lifecycle.ViewModel 5 | import com.dongyang.android.youdongknowme.R 6 | import com.dongyang.android.youdongknowme.standard.network.NetworkError 7 | import com.dongyang.android.youdongknowme.standard.network.NetworkResult 8 | import com.dongyang.android.youdongknowme.ui.view.util.Event 9 | 10 | abstract class BaseViewModel : ViewModel() { 11 | 12 | protected fun handleError( 13 | result: NetworkResult.Error, 14 | errorState: MutableLiveData> 15 | ) { 16 | when (result.errorType) { 17 | is NetworkError.Unknown -> { 18 | errorState.postValue(Event(ERROR_UNKNOWN)) 19 | } 20 | is NetworkError.Timeout -> { 21 | errorState.postValue(Event(ERROR_TIMEOUT)) 22 | } 23 | is NetworkError.InternalServer -> { 24 | errorState.postValue(Event(ERROR_INTERNAL_SERVER)) 25 | } 26 | is NetworkError.BadRequest -> { 27 | errorState.postValue(Event(ERROR_BAD_REQUEST)) 28 | } 29 | } 30 | } 31 | 32 | companion object { 33 | const val ERROR_UNKNOWN = R.string.error_unknown 34 | const val ERROR_TIMEOUT = R.string.error_timeout 35 | const val ERROR_INTERNAL_SERVER = R.string.error_internal_server 36 | const val ERROR_BAD_REQUEST = R.string.error_bad_request 37 | } 38 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dongyang/android/youdongknowme/ui/adapter/CafeteriaAnotherAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.dongyang.android.youdongknowme.ui.adapter 2 | 3 | import android.annotation.SuppressLint 4 | import android.view.LayoutInflater 5 | import android.view.ViewGroup 6 | import androidx.recyclerview.widget.RecyclerView 7 | import com.dongyang.android.youdongknowme.data.model.AnotherMenu 8 | import com.dongyang.android.youdongknowme.databinding.ItemCafeteriaAnotherBinding 9 | import com.dongyang.android.youdongknowme.ui.viewholder.CafeteriaAnotherViewHolder 10 | 11 | class CafeteriaAnotherAdapter : RecyclerView.Adapter() { 12 | 13 | init { 14 | setHasStableIds(true) 15 | } 16 | 17 | private var menu = arrayListOf() 18 | 19 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CafeteriaAnotherViewHolder { 20 | return CafeteriaAnotherViewHolder( 21 | ItemCafeteriaAnotherBinding.inflate( 22 | LayoutInflater.from(parent.context), parent, false 23 | ) 24 | ) 25 | } 26 | 27 | override fun getItemId(position: Int): Long { 28 | return position.toLong() 29 | } 30 | 31 | override fun onBindViewHolder(holder: CafeteriaAnotherViewHolder, position: Int) { 32 | holder.bind(menu[position]) 33 | } 34 | 35 | @SuppressLint("NotifyDataSetChanged") 36 | fun submitList(item: List) { 37 | menu.clear() 38 | menu.addAll(item) 39 | notifyDataSetChanged() 40 | } 41 | 42 | override fun getItemCount(): Int = menu.size 43 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/standard_error.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 15 | 16 | 24 | 25 |