Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2f2e05d4c | ||
|
|
8888150c84 |
@@ -20,8 +20,8 @@ android {
|
|||||||
applicationId = "com.example.shiftalarm"
|
applicationId = "com.example.shiftalarm"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 116
|
versionCode = 118
|
||||||
versionName = "1.1.6"
|
versionName = "1.1.8"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [1.1.8] - 2026-08-17
|
||||||
|
### Fixed
|
||||||
|
- **교육 근무 변경 시 상단 알람 표시 및 실제 알람 완전 유지**: 교육으로 변경해도 상단 오늘/내일 알람 시간이 정상 표시되고 원래 근무 알람이 그대로 울림
|
||||||
|
|
||||||
|
## [1.1.7] - 2026-08-17
|
||||||
|
### Fixed
|
||||||
|
- **교육 근무 변경 시 원래 근무 알람 완전 유지**: 달력에서 교육으로 변경해도 원래 근무 알람이 정상 울리고, 상단 오늘/내일 알람 시간 표시도 정상 유지
|
||||||
|
|
||||||
## [1.1.6] - 2026-08-15
|
## [1.1.6] - 2026-08-15
|
||||||
### Fixed
|
### Fixed
|
||||||
- **알람 추가 시 기본 볼륨 0 버그 수정**: 시스템 알람 스트림 볼륨을 항상 최대치로 강제 설정하여 새 알람 추가 시 볼륨이 0이 되는 문제 원천 차단
|
- **알람 추가 시 기본 볼륨 0 버그 수정**: 시스템 알람 스트림 볼륨을 항상 최대치로 강제 설정하여 새 알람 추가 시 볼륨이 0이 되는 문제 원천 차단
|
||||||
|
|||||||
@@ -63,7 +63,18 @@ object AlarmSyncManager {
|
|||||||
.getString("selected_factory", "Jeonju") ?: "Jeonju"
|
.getString("selected_factory", "Jeonju") ?: "Jeonju"
|
||||||
)
|
)
|
||||||
|
|
||||||
if (addedAlarm.shiftType == "기타" || addedAlarm.shiftType == shift) {
|
// 교육으로 변경된 경우 원래 근무의 알람이 울리도록 원래 근무 타입을 사용
|
||||||
|
val alarmMatchShift = if (shift == "교육") {
|
||||||
|
val team = context.getSharedPreferences("ShiftAlarmPrefs", Context.MODE_PRIVATE)
|
||||||
|
.getString("selected_team", "A") ?: "A"
|
||||||
|
val factory = context.getSharedPreferences("ShiftAlarmPrefs", Context.MODE_PRIVATE)
|
||||||
|
.getString("selected_factory", "Jeonju") ?: "Jeonju"
|
||||||
|
ShiftCalculator.getShift(targetDate, team, factory)
|
||||||
|
} else {
|
||||||
|
shift
|
||||||
|
}
|
||||||
|
|
||||||
|
if (addedAlarm.shiftType == "기타" || addedAlarm.shiftType == alarmMatchShift) {
|
||||||
scheduleCustomAlarm(
|
scheduleCustomAlarm(
|
||||||
context,
|
context,
|
||||||
targetDate,
|
targetDate,
|
||||||
@@ -117,7 +128,18 @@ object AlarmSyncManager {
|
|||||||
.getString("selected_factory", "Jeonju") ?: "Jeonju"
|
.getString("selected_factory", "Jeonju") ?: "Jeonju"
|
||||||
)
|
)
|
||||||
|
|
||||||
if (alarm.shiftType == "기타" || alarm.shiftType == shift) {
|
// 교육으로 변경된 경우 원래 근무의 알람이 울리도록 원래 근무 타입을 사용
|
||||||
|
val alarmMatchShift = if (shift == "교육") {
|
||||||
|
val team = context.getSharedPreferences("ShiftAlarmPrefs", Context.MODE_PRIVATE)
|
||||||
|
.getString("selected_team", "A") ?: "A"
|
||||||
|
val factory = context.getSharedPreferences("ShiftAlarmPrefs", Context.MODE_PRIVATE)
|
||||||
|
.getString("selected_factory", "Jeonju") ?: "Jeonju"
|
||||||
|
ShiftCalculator.getShift(targetDate, team, factory)
|
||||||
|
} else {
|
||||||
|
shift
|
||||||
|
}
|
||||||
|
|
||||||
|
if (alarm.shiftType == "기타" || alarm.shiftType == alarmMatchShift) {
|
||||||
scheduleCustomAlarm(
|
scheduleCustomAlarm(
|
||||||
context,
|
context,
|
||||||
targetDate,
|
targetDate,
|
||||||
@@ -248,7 +270,14 @@ object AlarmSyncManager {
|
|||||||
val targetDate = today.plusDays(i.toLong())
|
val targetDate = today.plusDays(i.toLong())
|
||||||
val shift = repo.getShift(targetDate, team, factory)
|
val shift = repo.getShift(targetDate, team, factory)
|
||||||
|
|
||||||
if (alarm.shiftType == "기타" || alarm.shiftType == shift) {
|
// 교육으로 변경된 경우 원래 근무의 알람이 울리도록 원래 근무 타입을 사용
|
||||||
|
val alarmMatchShift = if (shift == "교육") {
|
||||||
|
ShiftCalculator.getShift(targetDate, team, factory)
|
||||||
|
} else {
|
||||||
|
shift
|
||||||
|
}
|
||||||
|
|
||||||
|
if (alarm.shiftType == "기타" || alarm.shiftType == alarmMatchShift) {
|
||||||
scheduleCustomAlarm(
|
scheduleCustomAlarm(
|
||||||
context,
|
context,
|
||||||
targetDate,
|
targetDate,
|
||||||
|
|||||||
@@ -352,11 +352,18 @@ suspend fun syncAllAlarms(context: Context) {
|
|||||||
val targetDate = today.plusDays(i.toLong())
|
val targetDate = today.plusDays(i.toLong())
|
||||||
val shift = repo.getShift(targetDate, team, factory)
|
val shift = repo.getShift(targetDate, team, factory)
|
||||||
|
|
||||||
|
// 교육으로 변경된 경우 원래 근무의 알람이 울리도록 원래 근무 타입을 사용
|
||||||
|
val alarmMatchShift = if (shift == "교육") {
|
||||||
|
ShiftCalculator.getShift(targetDate, team, factory)
|
||||||
|
} else {
|
||||||
|
shift
|
||||||
|
}
|
||||||
|
|
||||||
for (alarm in customAlarms) {
|
for (alarm in customAlarms) {
|
||||||
if (!alarm.isEnabled) continue
|
if (!alarm.isEnabled) continue
|
||||||
|
|
||||||
// 근무 연동 조건 확인
|
// 근무 연동 조건 확인
|
||||||
if (alarm.shiftType == "기타" || alarm.shiftType == shift) {
|
if (alarm.shiftType == "기타" || alarm.shiftType == alarmMatchShift) {
|
||||||
scheduleCustomAlarm(
|
scheduleCustomAlarm(
|
||||||
context,
|
context,
|
||||||
targetDate,
|
targetDate,
|
||||||
|
|||||||
@@ -524,8 +524,18 @@ class MainActivity : AppCompatActivity() {
|
|||||||
val alarmTimes = mutableListOf<String>()
|
val alarmTimes = mutableListOf<String>()
|
||||||
val isOff = shift == "휴무" || shift == "휴가"
|
val isOff = shift == "휴무" || shift == "휴가"
|
||||||
|
|
||||||
|
// 교육으로 변경된 경우 원래 근무의 알람을 표시
|
||||||
|
val prefs = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
|
||||||
|
val matchShift = if (shift == "교육") {
|
||||||
|
val team = prefs.getString(KEY_TEAM, "A") ?: "A"
|
||||||
|
val factory = prefs.getString("selected_factory", "Jeonju") ?: "Jeonju"
|
||||||
|
ShiftCalculator.getShift(date, team, factory)
|
||||||
|
} else {
|
||||||
|
shift
|
||||||
|
}
|
||||||
|
|
||||||
for (alarm in allAlarms) {
|
for (alarm in allAlarms) {
|
||||||
if (alarm.isEnabled && (alarm.shiftType == "기타" || (!isOff && alarm.shiftType == shift))) {
|
if (alarm.isEnabled && (alarm.shiftType == "기타" || (!isOff && alarm.shiftType == matchShift))) {
|
||||||
if (!alarmTimes.contains(alarm.time)) {
|
if (!alarmTimes.contains(alarm.time)) {
|
||||||
alarmTimes.add(alarm.time)
|
alarmTimes.add(alarm.time)
|
||||||
}
|
}
|
||||||
@@ -733,8 +743,15 @@ class MainActivity : AppCompatActivity() {
|
|||||||
syncAllAlarms(this)
|
syncAllAlarms(this)
|
||||||
android.widget.Toast.makeText(this, "${selected}로 설정되었습니다. 알람이 해제됩니다.", android.widget.Toast.LENGTH_SHORT).show()
|
android.widget.Toast.makeText(this, "${selected}로 설정되었습니다. 알람이 해제됩니다.", android.widget.Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
|
"교육" -> {
|
||||||
|
// 교육은 원래 근무 알람을 유지
|
||||||
|
repo.setOverride(date, selected, team, factory)
|
||||||
|
updateCalendar()
|
||||||
|
syncAllAlarms(this)
|
||||||
|
android.widget.Toast.makeText(this, "교육으로 기록되었습니다. 원래 근무 알람이 유지됩니다.", android.widget.Toast.LENGTH_SHORT).show()
|
||||||
|
}
|
||||||
else -> {
|
else -> {
|
||||||
// New Types: 월차, 연차, 반월, 반년, 교육 -> Saved as Override with no time
|
// New Types: 월차, 연차, 반월, 반년 -> Saved as Override with no time
|
||||||
repo.setOverride(date, selected, team, factory)
|
repo.setOverride(date, selected, team, factory)
|
||||||
// 연차 계산을 먼저 수행하고 달력 업데이트
|
// 연차 계산을 먼저 수행하고 달력 업데이트
|
||||||
repo.updateRemainingAnnualLeave()
|
repo.updateRemainingAnnualLeave()
|
||||||
|
|||||||
+12
-18
@@ -6,17 +6,16 @@ import shutil
|
|||||||
|
|
||||||
token = "e3b515eaa0a6683c921ca3bf718e281ed30a6075"
|
token = "e3b515eaa0a6683c921ca3bf718e281ed30a6075"
|
||||||
owner_repo = "sanjeok77/ShiftRing"
|
owner_repo = "sanjeok77/ShiftRing"
|
||||||
tag = "v1.1.6"
|
tag = "v1.1.8"
|
||||||
title = "v1.1.6 - 알람 볼륨 0 버그 수정 및 최초 설치 권한 모달 루프 버그 수정"
|
title = "v1.1.8 - 교육 근무 변경 시 상단 알람 표시 및 실제 알람 완전 유지"
|
||||||
body = """## 🚀 ShiftRing v1.1.6 릴리즈
|
body = """## 🚀 ShiftRing v1.1.8 릴리즈
|
||||||
|
|
||||||
### 🐛 버그 수정
|
### 🐛 버그 수정
|
||||||
1. **🔊 알람 추가 시 기본 볼륨 0 버그 수정 (`AlarmSyncManager.kt`, `FragmentSettingsAlarm.kt`)**:
|
1. **⏰ 교육 근무 변경 시 알람 완전 유지 (`MainActivity.kt`, `AlarmUtils.kt`, `AlarmSyncManager.kt`)**:
|
||||||
- 시스템 알람 스트림 볼륨을 항상 최대치로 강제 설정하여 새 알람 추가 시 볼륨이 0이 되는 문제를 원천 차단
|
- 달력에서 교육으로 변경해도 상단 오늘/내일 알람 시간이 정상 표시
|
||||||
- 조건부(currVol == 0)가 아닌 무조건 최대 볼륨 적용으로 안정성 극대화
|
- 원래 근무(주간/석간/야간 등) 알람이 그대로 울림
|
||||||
2. **🔐 최초 설치 시 권한 모달 팝업 루프 버그 수정 (`AlarmPermissionUtil.kt`, `MainActivity.kt`)**:
|
- 토스트 메시지: "교육으로 기록되었습니다. 원래 근무 알람이 유지됩니다."
|
||||||
- 시스템 설정 화면이 잠깐 보였다가 모달로 되돌아가는 현상을 `isPermissionFlowActive` / `isDialogShowing` 이중 플래그로 완전 차단
|
- 교육을 월차/연차 등과 분리하여 독립 처리"""
|
||||||
- `MainActivity.onResume()` 재진입 시 권한 플로우 진행 중이면 `checkAndRequestAllPermissions()` 호출을 스킵하여 중복 모달 표시 방지"""
|
|
||||||
|
|
||||||
apk_path = "app/build/outputs/apk/release/app-release.apk"
|
apk_path = "app/build/outputs/apk/release/app-release.apk"
|
||||||
if not os.path.exists(apk_path):
|
if not os.path.exists(apk_path):
|
||||||
@@ -25,7 +24,6 @@ if not os.path.exists(apk_path):
|
|||||||
|
|
||||||
print(f"Using APK at: {apk_path}")
|
print(f"Using APK at: {apk_path}")
|
||||||
|
|
||||||
# Create Gitea Release
|
|
||||||
url = f"https://git.webpluss.net/api/v1/repos/{owner_repo}/releases"
|
url = f"https://git.webpluss.net/api/v1/repos/{owner_repo}/releases"
|
||||||
headers = {"Authorization": f"token {token}", "Content-Type": "application/json"}
|
headers = {"Authorization": f"token {token}", "Content-Type": "application/json"}
|
||||||
|
|
||||||
@@ -36,7 +34,6 @@ with urllib.request.urlopen(req) as response:
|
|||||||
release_id = result["id"]
|
release_id = result["id"]
|
||||||
print(f"Created Gitea Release successfully. Release ID: {release_id}")
|
print(f"Created Gitea Release successfully. Release ID: {release_id}")
|
||||||
|
|
||||||
# Upload APK asset
|
|
||||||
upload_url = f"https://git.webpluss.net/api/v1/repos/{owner_repo}/releases/{release_id}/assets"
|
upload_url = f"https://git.webpluss.net/api/v1/repos/{owner_repo}/releases/{release_id}/assets"
|
||||||
print(f"Uploading APK to {upload_url}...")
|
print(f"Uploading APK to {upload_url}...")
|
||||||
|
|
||||||
@@ -48,16 +45,14 @@ upload_json = json.loads(upload_result.stdout)
|
|||||||
apk_uuid = upload_json.get("uuid")
|
apk_uuid = upload_json.get("uuid")
|
||||||
direct_url = upload_json.get("browser_download_url", f"https://git.webpluss.net/attachments/{apk_uuid}")
|
direct_url = upload_json.get("browser_download_url", f"https://git.webpluss.net/attachments/{apk_uuid}")
|
||||||
|
|
||||||
# Copy APK to project root
|
|
||||||
shutil.copy2(apk_path, "app.apk")
|
shutil.copy2(apk_path, "app.apk")
|
||||||
print("Updated app.apk at project root.")
|
print("Updated app.apk at project root.")
|
||||||
|
|
||||||
# Update version.json
|
|
||||||
v_info = {
|
v_info = {
|
||||||
"versionCode": 116,
|
"versionCode": 118,
|
||||||
"versionName": "1.1.6",
|
"versionName": "1.1.8",
|
||||||
"apkUrl": direct_url,
|
"apkUrl": direct_url,
|
||||||
"changelog": "v1.1.6: 알람 볼륨 0 버그 수정, 최초 설치 권한 모달 루프 버그 수정",
|
"changelog": "v1.1.8: 교육 근무 변경 시 상단 알람 표시 및 실제 알람 완전 유지",
|
||||||
"forceUpdate": False
|
"forceUpdate": False
|
||||||
}
|
}
|
||||||
with open("version.json", "w", encoding="utf-8") as f:
|
with open("version.json", "w", encoding="utf-8") as f:
|
||||||
@@ -65,11 +60,10 @@ with open("version.json", "w", encoding="utf-8") as f:
|
|||||||
|
|
||||||
print(f"Updated version.json with apkUrl: {direct_url}")
|
print(f"Updated version.json with apkUrl: {direct_url}")
|
||||||
|
|
||||||
# Git commit and push
|
|
||||||
git_path = r"C:\Users\work\AppData\Roaming\MobaXterm\slash\mx86_64b\bin"
|
git_path = r"C:\Users\work\AppData\Roaming\MobaXterm\slash\mx86_64b\bin"
|
||||||
os.environ["PATH"] = git_path + os.pathsep + os.environ.get("PATH", "")
|
os.environ["PATH"] = git_path + os.pathsep + os.environ.get("PATH", "")
|
||||||
|
|
||||||
commit_msg = "v1.1.6 - 알람 볼륨 0 버그 수정 및 최초 설치 권한 모달 루프 버그 수정"
|
commit_msg = "v1.1.8 - 교육 근무 변경 시 상단 알람 표시 및 실제 알람 완전 유지"
|
||||||
subprocess.run(["git", "add", "."], check=True)
|
subprocess.run(["git", "add", "."], check=True)
|
||||||
subprocess.run(["git", "commit", "-m", commit_msg], check=True)
|
subprocess.run(["git", "commit", "-m", commit_msg], check=True)
|
||||||
subprocess.run(["git", "push", "origin", "main"], check=True)
|
subprocess.run(["git", "push", "origin", "main"], check=True)
|
||||||
|
|||||||
+4
-4
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"versionCode": 116,
|
"versionCode": 118,
|
||||||
"versionName": "1.1.6",
|
"versionName": "1.1.8",
|
||||||
"apkUrl": "https://git.webpluss.net/attachments/f6df2b0d-f520-4c26-a2c6-6acdb794ff52",
|
"apkUrl": "https://git.webpluss.net/attachments/219203d6-2f0f-4e23-984d-438f96c7d193",
|
||||||
"changelog": "v1.1.6: 알람 볼륨 0 버그 수정, 최초 설치 권한 모달 루프 버그 수정",
|
"changelog": "v1.1.8: 교육 근무 변경 시 상단 알람 표시 및 실제 알람 완전 유지",
|
||||||
"forceUpdate": false
|
"forceUpdate": false
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user