모든 위젯 크기에서 한 달 전체를 축소하는 선택 추가
2×2·2×4·4×2·4×4에서도 한 달 전체를 확인할 수 있도록 위젯별 monthFit 선택과 크기 맞춤 월간 배치를 추가했다. 작은 칸은 날짜를 우선 배치하고 여유 높이에 따라 근무와 이름 및 음력 등을 표시한다. 기존 기본 배치와 개인 근무 설정을 유지한다. 주요 파일은 WidgetStyle과 DutyWidget 및 MonthWidgetViews와 월간 축소 레이아웃이다. 사용 설명서와 Android 제작 매뉴얼 및 변경 기록과 설치 번호를 함께 갱신했다. 앱 단위 42개와 빌드 및 정적 검사 통과. 정적 오류 0개와 경고 86개. API 36에서 네 종류와 두 주 시작 및 세 배율과 최소·확장 크기의 42칸과 마지막 주 및 글자 생략 없음 확인. 연말 월 이동과 오늘 복귀 및 구버전 설정 보존 확인. 실제 홈 화면에서 선택 저장과 월 이동을 확인했다. 공개 ZIP 별도 폴더 빌드 통과. 0.13.1 설치 번호 18을 운영에 반영했다. DB 구조 변경과 자료 이전은 없다. 기존 회원·근무·소속 자료와 월요일 시작 및 다른 서비스와 원격 세션을 보존했다. 변경 전 소스와 DB는 비공개 20261121-widget-month 백업에 보관했다. APK와 전체 소스는 당직근무 포럼에 게시한다. 실물 휴대폰과 제조사별 홈 화면은 미확인이다. 작은 위젯은 날짜 우선 표시이며 글자 배율은 영역에 맞춰 제한된다. 기존 개발용 서명을 유지한다.
This commit is contained in:
1 parent
45ca9f675e
commit
1fc9243c63
15 files changed
+328
-34
No files matched your search
@@ -93,6 +93,54 @@ object WidgetAppearanceCheck {
|
||||
check(Color.alpha((root.background as ColorDrawable).color)==128)
|
||||
}
|
||||
}
|
||||
// 예전 저장 자료는 기존 배치로 열고 새 선택은 위젯별로 보관한다.
|
||||
check(!WidgetStyle.parse("{}").monthFit)
|
||||
check(WidgetStyle.parse(WidgetStyle(monthFit=true).json().toString()).monthFit)
|
||||
// 최소 크기와 넓힌 크기에서 윤곽만 맞는 것이 아니라 42칸의 실제 글줄과
|
||||
// 모든 날짜 및 마지막 주가 잘리지 않는지 측정한다. 주 시작도 각각 검사한다.
|
||||
for(start in 0..1) for(kind in WidgetKind.entries) for(scale in listOf(80,100,120)) {
|
||||
val current=ScheduleStore.load(app)
|
||||
ScheduleStore.saveDisplay(app,current.dutyAsWeekday,current.showLunar,current.offAsHoliday,start,fromSync=true)
|
||||
for(dimensions in listOf(kind.width to kind.height,320 to 440)) {
|
||||
val (width,height)=dimensions
|
||||
positions.edit().putString("month_99004","2026-08").commit()
|
||||
WidgetStyle.save(app,99004,WidgetStyle(monthFit=true,scale=scale,transparency=50))
|
||||
val options=Bundle().apply {
|
||||
putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH,width);putInt(AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH,width)
|
||||
putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT,height);putInt(AppWidgetManager.OPTION_APPWIDGET_MAX_HEIGHT,height)
|
||||
}
|
||||
val root=DutyWidget.buildViews(app,99004,options,kind).apply(app,FrameLayout(app))
|
||||
root.measure(View.MeasureSpec.makeMeasureSpec((width*density).toInt(),View.MeasureSpec.EXACTLY),View.MeasureSpec.makeMeasureSpec((height*density).toInt(),View.MeasureSpec.EXACTLY))
|
||||
root.layout(0,0,root.measuredWidth,root.measuredHeight)
|
||||
check(Color.alpha((root.background as ColorDrawable).color)==128)
|
||||
check(root.findViewById<TextView>(R.id.widget_sun).text==if(start==1)"월" else "일")
|
||||
val dates=calendarDays(java.time.YearMonth.of(2026,8),start)
|
||||
DutyWidget.DAY_IDS.forEachIndexed { index,cellId ->
|
||||
val cell=root.findViewById<TextView>(cellId)
|
||||
check(cell.text.toString().lineSequence().first().removeSuffix("+")==dates[index].dayOfMonth.toString())
|
||||
check(cell.layout!=null&&cell.layout.height<=cell.height){"월간 ${kind.title} $width×$height $scale 날짜 $index 높이 초과 ${cell.layout.height}/${cell.height}"}
|
||||
check((0 until cell.layout.lineCount).all{cell.layout.getEllipsisCount(it)==0}){"월간 날짜 $index 생략 발생"}
|
||||
val rect=android.graphics.Rect();cell.getDrawingRect(rect);(root as android.view.ViewGroup).offsetDescendantRectToMyCoords(cell,rect)
|
||||
check(rect.top>=0&&rect.bottom<=root.height&&rect.left>=0&&rect.right<=root.width){"마지막 주 또는 날짜 칸이 위젯 밖입니다."}
|
||||
}
|
||||
check(dates.count{it.monthValue==8}==31)
|
||||
}
|
||||
}
|
||||
// 각 제공자의 월 이동은 월간 선택을 따르며 기존 목록의 주 이동 값은 건드리지 않는다.
|
||||
for(kind in WidgetKind.entries) {
|
||||
val id=manager.getAppWidgetIds(kind.component(app)).firstOrNull()?:continue
|
||||
WidgetStyle.save(app,id,WidgetStyle(monthFit=true))
|
||||
positions.edit().putString("month_$id","2026-12").putInt("offset_$id",14).commit()
|
||||
val receiver=kind.receiver.getDeclaredConstructor().newInstance()
|
||||
receiver.onReceive(app,android.content.Intent(DutyWidget.NEXT).putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,id))
|
||||
check(positions.getString("month_$id",null)=="2027-01")
|
||||
check(positions.getInt("offset_$id",0)==14)
|
||||
receiver.onReceive(app,android.content.Intent(DutyWidget.PREVIOUS).putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,id))
|
||||
check(positions.getString("month_$id",null)=="2026-12")
|
||||
receiver.onReceive(app,android.content.Intent(DutyWidget.TODAY).putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,id))
|
||||
check(!positions.contains("month_$id")&&!positions.contains("offset_$id"))
|
||||
WidgetStyle.save(app,id,WidgetStyle())
|
||||
}
|
||||
// 실제 홈 화면에 배치된 새 종류는 자신의 날짜 범위만 이동하고 오늘로 돌아와야 한다.
|
||||
for(kind in listOf(WidgetKind.WIDE,WidgetKind.TALL)) {
|
||||
val id=manager.getAppWidgetIds(kind.component(app)).firstOrNull()?:continue
|
||||
@@ -107,7 +155,7 @@ object WidgetAppearanceCheck {
|
||||
}
|
||||
failure?.let{throw it}
|
||||
success=true
|
||||
message="월요일·일요일 시작 저장과 월간 머리글·첫 날짜 및 두 주 위젯의 시작과 일요일 색상 확인. 네 위젯의 기본 칸 수와 최소 글자 높이 및 기간 이동과 개별 설정 확인."
|
||||
message="네 종류의 기본 배치와 한 달 전체 선택 확인. 월·일 시작과 80·100·120% 및 최소·확장 크기에서 42칸과 모든 날짜 및 마지막 주의 글자 높이와 생략 없음 확인. 월 이동과 연말 넘김 및 오늘 복귀와 개별 저장 및 구버전 설정 보존 확인."
|
||||
} catch(error:Throwable) {message=error.stackTraceToString()}
|
||||
finally {
|
||||
val scheduleRestore=schedulePrefs.edit()
|
||||
|
||||
Reference in new issue
Block a user