Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update v3.4.0 #250

Merged
merged 72 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
380f69a
#212 Add dining tab
wateralsie Apr 15, 2024
c826c8f
#212 Add dining place enum class
wateralsie Apr 16, 2024
606aed2
#212 Add dining container view pager
wateralsie Apr 16, 2024
3e1e9b8
#212 Change dining container layout
wateralsie Apr 16, 2024
9ba6ee8
#212 Connect menu data
wateralsie Apr 16, 2024
381ab35
#228 Fix issue related to changes in dining place selection
wateralsie Apr 16, 2024
9ee2a27
#212 Show in title if menu is today or tomorrow
wateralsie Apr 16, 2024
f693a32
#212 Add dining container click listener
wateralsie Apr 16, 2024
84b3512
Modify dining detail to respond properly to dining list changes
wateralsie Apr 16, 2024
2213bd7
Divide updateDining to two functions
wateralsie Apr 16, 2024
ece1642
Merge pull request #235 from BCSDLab/release
yunjaena Apr 17, 2024
4eb658d
Change menu layout 10 -> 2 textview
wateralsie Apr 18, 2024
164f040
Merge pull request #231 from BCSDLab/feature/update-main-dining-ui
wateralsie Apr 19, 2024
d15c772
Fix filtering major on timetable
nodobi Apr 22, 2024
d2011e8
Change dining text, image location
ThirFir Apr 24, 2024
56279cf
Set 능수관, 2캠퍼스 image visibility gone
ThirFir Apr 24, 2024
5b2965d
Add Activity analytics event log function
ThirFir Apr 25, 2024
1398d58
Add main page store click event analytics
ThirFir Apr 25, 2024
d06b6cb
Add StoreActivity category click event analytics
ThirFir Apr 25, 2024
48eb8fd
Add Store click event analytics
ThirFir Apr 25, 2024
bd58a08
Add StoreDetail call click event analytics
ThirFir Apr 25, 2024
6f8efda
Add StoreDetail picture click event analytics
ThirFir Apr 25, 2024
16a5940
Merge pull request #239 from BCSDLab/release
Jokwanhee Apr 25, 2024
506d28c
Create EventLogger, move activity logging logic to EventLogger
ThirFir Apr 25, 2024
bf0ff79
Add Hamburger click event analytics
ThirFir Apr 25, 2024
dc6bfe6
Fix SingleLiveEvent call logic
nodobi Apr 25, 2024
6f524e3
Fix to show dash on UserInfoEdit screen
nodobi Apr 25, 2024
2e057ef
Fix to allow change user name
nodobi Apr 25, 2024
9b2b890
Add MainActivity dining click event analytics
ThirFir Apr 25, 2024
a545e9f
Add dining time click/scroll event analytics
ThirFir Apr 25, 2024
047afef
Add MainActivity bus card click event analytics
ThirFir Apr 25, 2024
174b67d
Add MainActivity bus card scroll event analytics
ThirFir Apr 26, 2024
661e3b4
Add BusMainFragment spinner click event analytics
ThirFir Apr 26, 2024
3f61213
Add BusTimetableFragment click event analytics
ThirFir Apr 26, 2024
05d14a7
Add Dining menu image click event analytics
ThirFir Apr 26, 2024
8013c7d
Add toast when nickname is same as before
nodobi Apr 26, 2024
be3a4c8
Add Store search click event analytics, Modify get name logic
ThirFir Apr 26, 2024
5389913
Add Sign up click event analytics
ThirFir Apr 26, 2024
dbfb841
Add Login click event analytics
ThirFir Apr 26, 2024
9dc0eeb
Change dining date background
ThirFir Apr 26, 2024
501bf3c
Change store label
ThirFir Apr 29, 2024
86341b2
Change description store -> shop
ThirFir Apr 29, 2024
97e791e
Add Dining Dialog PhotoView
ThirFir Apr 26, 2024
ce63904
Use Reflection isInitialized
ThirFir Apr 30, 2024
2ccb7a3
Change navi item analytics click event logic
ThirFir Apr 30, 2024
88a12f9
Consider configuration change, use viewmodel
ThirFir Apr 30, 2024
2fbe342
Set not to log if is debug
ThirFir Apr 30, 2024
709fda4
Modify dialog PhotoView logic
ThirFir Apr 30, 2024
af8b1e8
Change date background ui logic
ThirFir Apr 30, 2024
06900a8
Modify text height
ThirFir Apr 30, 2024
1251c4b
Remove unnecessary import
ThirFir Apr 30, 2024
da22668
Remove use of startActivty -> use callDrawerItem
ThirFir Apr 30, 2024
2fa7b4b
Fix visibility logic
ThirFir Apr 30, 2024
d337861
Add dialog close button
ThirFir May 1, 2024
e9f0a96
Make close button invisible until its position fixed
ThirFir May 1, 2024
067592f
Modify unnecessary logic
ThirFir May 1, 2024
cfb6262
Merge remote-tracking branch 'origin/develop' into fix/dining-detail
ThirFir May 1, 2024
0cb2f7f
Set data invisible when it == 0
ThirFir May 1, 2024
e91519e
Set untranslatable type description
ThirFir May 1, 2024
a04c386
Make parameters constant
ThirFir May 1, 2024
824ae39
Remove unnecassary variable usage
ThirFir May 1, 2024
2cc5f5b
Use StoreCategory.All
ThirFir May 1, 2024
be16867
Apply lint
ThirFir May 1, 2024
a9116c0
Merge pull request #245 from BCSDLab/feature/log-event
ThirFir May 1, 2024
6553538
Merge branch 'develop' into fix/dining-detail
ThirFir May 1, 2024
21d4138
Merge pull request #246 from BCSDLab/fix/dining-detail
ThirFir May 1, 2024
9617ba1
Refactor UserInfoEditActivity toast logic
nodobi Apr 26, 2024
5b611d1
Merge pull request #244 from BCSDLab/fix/timetable-user-qa
nodobi May 2, 2024
cd7a667
Update bus timetable api response key
ThirFir May 2, 2024
56dc30d
Merge pull request #247 from BCSDLab/develop
ThirFir May 2, 2024
b00f497
Merge pull request #249 from BCSDLab/hotfix/bus-timetable-api
ThirFir May 2, 2024
6dcfac0
Update v3.4.0
ThirFir May 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ buildscript {
compileSdkVersion = 34
minSdkVersion = 21
targetSdkVersion = 34
versionName = "3.3.1"
minVersionCode = 30301
versionName = "3.4.0"
minVersionCode = 30400
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package `in`.koreatech.koin.core.analytics

import com.google.firebase.analytics.ktx.analytics
import com.google.firebase.analytics.ktx.logEvent
import com.google.firebase.ktx.Firebase
import `in`.koreatech.koin.core.BuildConfig
import `in`.koreatech.koin.core.constant.AnalyticsConstant

object EventLogger {

private const val EVENT_CATEGORY = "event_category"
private const val EVENT_LABEL = "event_label"
private const val VALUE = "value"

/**
* @param action: 이벤트 발생 도메인(BUSINESS, CAMPUS, USER)
* @param label: 이벤트 소분류
* @param value: 이벤트 값
*/
fun logClickEvent(action: String, label: String, value: String) {
logEvent(action, AnalyticsConstant.Category.CLICK, label, value)
}

/**
* @param action: 이벤트 발생 도메인(BUSINESS, CAMPUS, USER)
* @param label: 이벤트 소분류
* @param value: 이벤트 값
*/
fun logScrollEvent(action: String, label: String, value: String) {
logEvent(action, AnalyticsConstant.Category.SCROLL, label, value)
}

/**
* @param action: 이벤트 발생 도메인(BUSINESS, CAMPUS, USER)
* @param category: 이벤트 종류(click, scroll, ...)
* @param label: 이벤트 소분류
* @param value: 이벤트 값
* @sample logEvent("BUSINESS", "click", "main_shop_categories", "전체보기")
*/
private fun logEvent(action: String, category: String, label: String, value: String) {
if (BuildConfig.IS_DEBUG) return
Firebase.analytics.logEvent(action) {
param(EVENT_CATEGORY, category)
param(EVENT_LABEL, label)
param(VALUE, value)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@


import in.koreatech.koin.core.R;
import in.koreatech.koin.core.analytics.EventLogger;
import in.koreatech.koin.core.constant.AnalyticsConstant;


public class AppBarBase extends AppBarLayout {
Expand Down Expand Up @@ -50,7 +52,14 @@ public void setOnClickListener(OnClickListener onClickListener) {
this.onClickListener = onClickListener;
background.setOnClickListener(onClickListener);
leftButton.setOnClickListener(onClickListener);
rightButton.setOnClickListener(onClickListener);
rightButton.setOnClickListener( v -> {
onClickListener.onClick(v);
EventLogger.INSTANCE.logClickEvent(
AnalyticsConstant.Domain.USER,
AnalyticsConstant.Label.HAMBURGER,
getContext().getString(R.string.hamburger)
);
});
title.setOnClickListener(onClickListener);
}

Expand Down Expand Up @@ -107,7 +116,7 @@ private void setTypeArray(TypedArray typedArray) {
leftButton.setBackground(leftButtonBackground);
leftButton.setText(leftButtonString);
leftButton.setVisibility(leftButtonVisibility);
if(leftButtonHeight!= -1 || leftButtonWidth != -1){
if (leftButtonHeight != -1 || leftButtonWidth != -1) {
leftButton.setHeight(leftButtonHeight);
leftButton.setWidth(leftButtonWidth);
}
Expand All @@ -116,7 +125,7 @@ private void setTypeArray(TypedArray typedArray) {
rightButton.setBackground(rightButtonBackground);
rightButton.setText(rightButtonString);
rightButton.setVisibility(rightButtonVisibility);
if(leftButtonHeight!= -1 || leftButtonWidth != -1){
if (leftButtonHeight != -1 || leftButtonWidth != -1) {
rightButton.setHeight(rightButtonHeight);
rightButton.setWidth(rightButtonWidth);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package `in`.koreatech.koin.core.constant

object AnalyticsConstant {

object Domain {
const val BUSINESS = "BUSINESS"
const val CAMPUS = "CAMPUS"
const val USER = "USER"
}

object Category {
const val CLICK = "click"
const val SCROLL = "scroll"
}

object Label {
const val MAIN_SHOP_CATEGORIES = "main_shop_categories"
const val SHOP_CATEGORIES = "shop_categories"
const val SHOP_CATEGORIES_SEARCH = "shop_categories_search"
const val HAMBURGER = "hamburger"
const val HAMBURGER_SHOP = "${HAMBURGER}_shop"
const val HAMBURGER_DINING = "${HAMBURGER}_dining"
const val HAMBURGER_MY_INFO_WITHOUT_LOGIN = "${HAMBURGER}_my_info_without_login"
const val HAMBURGER_MY_INFO_WITH_LOGIN = "${HAMBURGER}_my_info_with_login"
const val HAMBURGER_BUS = "${HAMBURGER}_bus"
const val USER_ONLY_OK = "user_only_ok"
const val MAIN_MENU_MOVEDETAILVIEW = "main_menu_moveDetailView"
const val MAIN_MENU_CORNER = "main_menu_corner"
const val MENU_TIME = "menu_time"
const val MAIN_BUS = "main_bus"
const val MAIN_BUS_CHANGETOFROM = "main_bus_changeToFrom"
const val MAIN_BUS_SCROLL = "main_bus_scroll"
const val BUS_DEPARTURE = "bus_departure"
const val BUS_ARRIVAL = "bus_arrival"
const val BUS_TIMETABLE = "bus_timetable"
const val BUS_TIMETABLE_AREA = "bus_timetable_area"
const val BUS_TIMETABLE_TIME = "bus_timetable_time"
const val BUS_TIMETABLE_EXPRESS = "bus_timetable_express"
const val MENU_IMAGE = "menu_image"
const val LOGIN = "login"
const val START_SIGN_UP = "start_sign_up"
const val COMPLETE_SIGN_UP = "complete_sign_up"
const val SHOP_PICTURE = "shop_picture"
const val SHOP_CALL = "shop_call"
const val SHOP_CLICK = "shop_click"
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ class SingleLiveEvent<T> : MutableLiveData<T>() {

override fun observe(owner: LifecycleOwner, observer: Observer<in T>) {
if (hasActiveObservers()) {
Log.w(TAG,"Multiple observers registered but only one will be notified of changes.")
Log.w(TAG, "Multiple observers registered but only one will be notified of changes.")
}

// Observe the internal MutableLiveData
super.observe(owner) { t ->
super.observe(owner) {
if (pending.compareAndSet(true, false)) {
observer.onChanged(t)
observer.onChanged(it)
}
}
}
Expand All @@ -32,11 +32,12 @@ class SingleLiveEvent<T> : MutableLiveData<T>() {
}

/**
* Used for cases where T is Void, to make calls cleaner.
* Used for cases where T is Unit, to make calls cleaner.
*/
@MainThread
fun call() {
value = null
assert(value is Unit || value is Unit?)
value = Unit as T
}

companion object {
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,5 @@
<string name="navigation_drawer_right_button_ask">문의하기</string>
<string name="navigation_drawer_right_hello_message">님, 안녕하세요!</string>
<string name="navigation_drawer_right_myinfo">내 정보</string>
<string name="hamburger">햄버거</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ data class ShuttleBusRouteResponse(
)

data class ShuttleBusNodeInfoResponse(
@SerializedName("node_name") val nodeName: String,
@SerializedName("arrival_time") val arrivalTime: String
@SerializedName("nodeName") val nodeName: String,
@SerializedName("arrivalTime") val arrivalTime: String
)

data class ExpressBusRouteResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package `in`.koreatech.koin.data.response.bus
import com.google.gson.annotations.SerializedName

data class ShuttleBusTimetableResponse(
@SerializedName("bus_timetables") val routes: List<ShuttleBusRouteResponse>,
@SerializedName("bus_timetable") val routes: List<ShuttleBusRouteResponse>,
@SerializedName("updated_at") val updatedAt: String
)

data class ExpressBusTimetableResponse(
@SerializedName("bus_timetables") val routes: List<ExpressBusRouteResponse>,
@SerializedName("bus_timetable") val routes: List<ExpressBusRouteResponse>,
@SerializedName("updated_at") val updatedAt: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ fun DiningType.localized(context: Context) = when(this) {
DiningType.Breakfast -> context.getString(R.string.dining_breakfast)
DiningType.Lunch -> context.getString(R.string.dining_lunch)
DiningType.Dinner -> context.getString(R.string.dining_dinner)
DiningType.NextBreakfast -> context.getString(R.string.dining_next_breakfast)
else -> context.getString(R.string.dining_breakfast)
}

fun DiningType.todayOrTomorrow(context: Context) = when(this) {
DiningType.NextBreakfast -> context.getString(R.string.dining_tomorrow)
else -> context.getString(R.string.dining_today)
}
4 changes: 3 additions & 1 deletion data/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<string name="bus_name_commuting">통학버스</string>
<string name="bus_name_express">대성고속</string>
<string name="bus_name_shuttle">셔틀버스</string>
<string name="bus_name_school_shuttle">학교셔틀</string>
<string name="city_bus_number_format">%1$d번 버스</string>
<!-- dept -->
<string name="dept_mechanical_engineering">기계공학부</string>
Expand All @@ -61,5 +62,6 @@
<string name="dining_breakfast">아침</string>
<string name="dining_lunch">점심</string>
<string name="dining_dinner">저녁</string>
<string name="dining_next_breakfast">내일 아침</string>
<string name="dining_today">오늘</string>
<string name="dining_tomorrow">내일</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package `in`.koreatech.koin.domain.model.dining

enum class DiningPlace(
val place: String
) {
CornerA("A코너"),
CornerB("B코너"),
CornerC("C코너"),
Nungsu("능수관")
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,14 @@ object DiningUtil {
}
return null
}

fun getKoreanName(type: String): String {
return when (type) {
DiningType.Breakfast.typeEnglish -> DiningType.Breakfast.typeKorean
DiningType.Lunch.typeEnglish -> DiningType.Lunch.typeKorean
DiningType.Dinner.typeEnglish -> DiningType.Dinner.typeKorean
DiningType.NextBreakfast.typeEnglish -> DiningType.NextBreakfast.typeKorean
else -> "Unknown type"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package `in`.koreatech.koin.domain.util.ext

import `in`.koreatech.koin.domain.model.dining.Dining
import `in`.koreatech.koin.domain.model.dining.DiningPlace
import `in`.koreatech.koin.domain.model.dining.DiningType

fun List<Dining>.typeFilter(type: DiningType) = this.filter {
Expand All @@ -9,11 +10,26 @@ fun List<Dining>.typeFilter(type: DiningType) = this.filter {


fun List<Dining>.arrange() = this.let {
val diningList = mutableListOf<Dining>()
val campus2 = this.filter { it.place == "2캠퍼스" }
val campus1 = this.filter { it.place != "2캠퍼스" }
campus1.sortedBy { it.place }
diningList.addAll(campus1)
diningList.addAll(campus2)
diningList.toList()
val allPlaces = DiningPlace.entries.map { it.place }

allPlaces.map { place ->
campus1.find { it.place == place } ?: Dining(
id = 0,
date = "",
type = "",
place = place,
priceCard = "",
priceCash = "",
kcal = "",
menu = listOf(),
imageUrl = "",
createdAt = "",
updatedAt = "",
soldoutAt = "",
changedAt = "",
error = ""
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.recyclerview.widget.LinearLayoutManager
import dagger.hilt.android.AndroidEntryPoint
import `in`.koreatech.koin.core.analytics.EventLogger
import `in`.koreatech.koin.core.constant.AnalyticsConstant
import `in`.koreatech.koin.core.util.dataBinding

@AndroidEntryPoint
Expand All @@ -44,11 +46,36 @@ class BusMainFragment : Fragment(R.layout.bus_main_fragment) {
private fun initView() = with(binding) {
busDepartureSpinner.setSelection(BusNode.Koreatech.spinnerSelection)
busArrivalSpinner.setSelection(BusNode.Terminal.spinnerSelection)
busDepartureSpinner.setOnTouchListener { _, _ ->
viewModel.isUserSelection = true
busDepartureSpinner.performClick()
}
busDepartureSpinner.setOnItemSelectedListener { _, _, position, _ ->
viewModel.setDeparture(position.busNodeSelection)
if(viewModel.isUserSelection) {
EventLogger.logClickEvent(
AnalyticsConstant.Domain.CAMPUS,
AnalyticsConstant.Label.BUS_DEPARTURE,
resources.getStringArray(R.array.bus_place)[position]
)
viewModel.isUserSelection = false
}
}

busArrivalSpinner.setOnTouchListener { _, _ ->
viewModel.isUserSelection = true
busArrivalSpinner.performClick()
}
busArrivalSpinner.setOnItemSelectedListener { _, _, position, _ ->
viewModel.setArrival(position.busNodeSelection)
if(viewModel.isUserSelection) {
EventLogger.logClickEvent(
AnalyticsConstant.Domain.CAMPUS,
AnalyticsConstant.Label.BUS_ARRIVAL,
resources.getStringArray(R.array.bus_place)[position]
)
viewModel.isUserSelection = false
}
}
recyclerView.apply {
layoutManager = LinearLayoutManager(requireContext())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import android.view.View
import androidx.fragment.app.commit
import androidx.fragment.app.viewModels
import dagger.hilt.android.AndroidEntryPoint
import `in`.koreatech.koin.core.analytics.EventLogger
import `in`.koreatech.koin.core.constant.AnalyticsConstant

@AndroidEntryPoint
class BusTimetableFragment : DataBindingFragment<BusTimetableFragmentBinding>() {
Expand Down Expand Up @@ -39,12 +41,27 @@ class BusTimetableFragment : DataBindingFragment<BusTimetableFragmentBinding>()

binding.busTimetableBustypeShuttle.setOnClickListener {
busTimetableViewModel.setBusType(BusType.Shuttle)
EventLogger.logClickEvent(
AnalyticsConstant.Domain.CAMPUS,
AnalyticsConstant.Label.BUS_TIMETABLE,
getString(R.string.bus_name_school_shuttle)
)
}
binding.busTimetableBustypeDaesung.setOnClickListener {
busTimetableViewModel.setBusType(BusType.Express)
EventLogger.logClickEvent(
AnalyticsConstant.Domain.CAMPUS,
AnalyticsConstant.Label.BUS_TIMETABLE,
getString(R.string.bus_name_express)
)
}
binding.busTimetableBustypeCity.setOnClickListener {
busTimetableViewModel.setBusType(BusType.City)
EventLogger.logClickEvent(
AnalyticsConstant.Domain.CAMPUS,
AnalyticsConstant.Label.BUS_TIMETABLE,
getString(R.string.bus_name_city)
)
}
}

Expand Down
Loading
Loading