-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Scrum 44] 뽀모도르 알림 UI/UX 개선 #145
base: develop
Are you sure you want to change the base?
Conversation
internal class PomodoroNotificationBitmapGenerator @Inject constructor( | ||
@ApplicationContext private val context: Context | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RemoteViews
가 때려 죽여도 TextView에 Style이 안먹고 시스템 폰트로 가버려서 억지로 Text를 Canvas에 그리고 그 Bitmap을 ImageView에 세팅하는 형태로 구현
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
..오.... 세상에나...... 내 문해력이 부족해서 잘못 이해하고 있나 했어 진짜 많은 일이 있었구나....
private val timeBitmaps: Map<String, Bitmap> by lazy { | ||
generateNumberBitmaps(R.font.pretendard_bold, 40f, R.color.notification_pomodoro_time) | ||
} | ||
|
||
private val overtimeNumberBitmaps: Map<String, Bitmap> by lazy { | ||
generateNumberBitmaps(R.font.pretendard_semibold, 18f, R.color.notification_pomodoro_over_time) | ||
} | ||
|
||
private val colonBitmap: Bitmap by lazy { | ||
createColonBitmap(R.font.pretendard_bold, 40f, R.color.notification_pomodoro_time) | ||
} | ||
|
||
private val overtimeColonBitmap: Bitmap by lazy { | ||
createColonBitmap(R.font.pretendard_semibold, 18f, R.color.notification_pomodoro_over_time) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
자주 사용되는 타이머의 text들은 Bitmap을 미리 갖고 있다가 재사용하는 형태로 구현해서 최소한의 리소스로 UI 표현되게 구현
예를 들어서 number 같은 경우에는 0~9 까지 10개의 Bitmap 만으로도 표현이 가능하기에 Map으로 갖고 있게 했읍니다..
internal class PomodoroNotificationContentFactory @Inject constructor( | ||
@ApplicationContext private val context: Context, | ||
private val bitmapGenerator: PomodoroNotificationBitmapGenerator | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Service에서 Notification의 Content를 만드는 부분만 로직 분리
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oop 맛집이네요
val TIMER_DELAY = if (BuildConfig.DEBUG) 10L else 1_000L | ||
val TIMER_DELAY = if (BuildConfig.DEBUG) 100L else 1_000L |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug라고 해도 10L은 너무 빠른거 같아서 수정
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug모드 위젯 타이머에서는 늘려도 ui 싱크가 조금 밀리긴하네 릴리즈는 잘 돌아가니까 okok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이게 알림 notify를 너무 자주 하면 OS 상에서 그냥 막아버리는거 같더라고 무슨 경고가 로그캣에 계속 떠있더라고
internal abstract class BasePomodoroTimer : PomodoroTimer { | ||
private var timer: Timer? = null | ||
private var timeElapsed = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기본적인 Timer의 로직은 Focus나 Rest나 동일하기에 Base로 하나 만들고 Focus, Rest 각각 로직이 생기면 추가할 수 있게 구현
<ImageView | ||
android:id="@+id/text_status" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="4dp" | ||
android:layout_marginTop="1dp" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ImageView 처럼 보이지만 실제는 10:00
이런 형태의 타이머를 표시하는 중
아직 우측 이미지나, 일부 텍스트가 피그마에 미구현인게 있어서 반영되면 바로 수정할게~! |
@@ -27,6 +27,8 @@ internal object ServiceModule { | |||
): NotificationCompat.Builder = NotificationCompat.Builder(context, POMODORO_NOTIFICATION_CHANNEL_ID) | |||
.setContentTitle(context.getString(R.string.app_name)) | |||
.setSmallIcon(R.drawable.ic_app_notification) | |||
.setVibrate(null) | |||
.setDefaults(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기본값 뭘 준 건지 찾아보다가 봤는데
https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder#setDefaults(int)
26이상부터는 해당이 없는것 같아
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
의도는 노티 알림&진동 없이 주려고 했던건가?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
엉 맞어 노티 알림&진동 없이 주려고 한건데 없어도 되는지만 확인하고 빼버릴게!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
정상 동작 확인해서 아래와 같이 반영했어!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여러의미로 감탄을 자아내는...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
정말 많은 일이 있었다는 증명의 클래스야
internal class PomodoroNotificationContentFactory @Inject constructor( | ||
@ApplicationContext private val context: Context, | ||
private val bitmapGenerator: PomodoroNotificationBitmapGenerator | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oop 맛집이네요
val contentView = createContentView(isRest) | ||
val bigContentView = createBigContentView(category, time, overtime) | ||
val notification = buildNotification(contentView, bigContentView) | ||
notificationManager.notify(POMODORO_NOTIFICATION_ID, notification) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
초당 notify 주는 방식 밖에 없는게 맞구나
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 말고 이것저것 해봤는데 notify가 최선인거 같더라고...
이미 알림에 RemoteView는 세팅된 값이라서 그 값만 수정해도 반영이 안되고...
val TIMER_DELAY = if (BuildConfig.DEBUG) 10L else 1_000L | ||
val TIMER_DELAY = if (BuildConfig.DEBUG) 100L else 1_000L |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug모드 위젯 타이머에서는 늘려도 ui 싱크가 조금 밀리긴하네 릴리즈는 잘 돌아가니까 okok
브랜치 feature/ 안으로 안들어가도 괜찮나? |
아 이거 지라 티켓네임 그대로 들고왔는데 feature 붙이는걸로 할까?
이거 그럼 이번에 들어가자! 어떻게 수정해야 하는지 보고 디자인팀에 요청할게~! |
작업 내용
체크리스트
동작 화면
Screen_recording_20241109_215246.mp4
살려주세요