Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8a2dacb104 | |||
| 2f4b2ebe4c | |||
| 89068b4d05 | |||
| 7835d0ab65 | |||
| 819495323e | |||
| 5a0f6de646 | |||
| f884e991a3 | |||
| b8454f76d1 | |||
| a4482f0b7b | |||
| 29cc215346 | |||
| 666e38558d | |||
| 8e7f212352 | |||
| 639b22948b | |||
| 03c3fcd6f0 | |||
| b832f87a7b | |||
| 0e60b62fd2 | |||
| 597880e807 | |||
| 6fb83848f5 | |||
| fef630d266 | |||
| fdcbb615ab | |||
| 161cc8060d | |||
| 6c2dec6cd3 | |||
| fa4c50a054 | |||
| 707d81d850 | |||
| 4d8861d79c | |||
| b60aa517b9 | |||
| 357788adb9 | |||
| a17eee8884 | |||
| f4f5599117 |
@@ -1,143 +0,0 @@
|
||||
# Git 푸시 성공 가이드
|
||||
|
||||
## 빠른 실행
|
||||
|
||||
```bash
|
||||
# 1. gh CLI 인증 확인
|
||||
./gh.exe auth status
|
||||
|
||||
# 2. 인증이 안 되어 있으면 로그인
|
||||
./gh.exe auth login --web
|
||||
|
||||
# 3. Git에 gh 인증 설정
|
||||
./gh.exe auth setup-git
|
||||
|
||||
# 4. 푸시
|
||||
git push shiftring main
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 상세 절차
|
||||
|
||||
### 1. GitHub CLI 인증
|
||||
|
||||
```bash
|
||||
# 인증 상태 확인
|
||||
./gh.exe auth status
|
||||
```
|
||||
|
||||
**인증이 안 된 경우:**
|
||||
```bash
|
||||
./gh.exe auth login --web
|
||||
```
|
||||
- One-time code가 표시됨 (예: C7EF-30B3)
|
||||
- https://github.com/login/device 접속
|
||||
- 코드 입력 후 인증 완료
|
||||
|
||||
### 2. Git에 gh 인증 연동
|
||||
|
||||
```bash
|
||||
./gh.exe auth setup-git
|
||||
```
|
||||
|
||||
### 3. 푸시 실행
|
||||
|
||||
```bash
|
||||
# shiftring remote 사용 (agent.md에 정의됨)
|
||||
git push shiftring main
|
||||
|
||||
# 또는 origin 사용
|
||||
git push origin main
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 저장소 정보
|
||||
|
||||
| Remote | URL | 용도 |
|
||||
|--------|-----|------|
|
||||
| origin | https://github.com/sanjeok77-tech/ShiftRing.git | 코드 저장소 |
|
||||
| shiftring | https://github.com/sanjeok77-tech/ShiftRing.git | 코드 저장소 (동일) |
|
||||
|
||||
---
|
||||
|
||||
## 문제 해결
|
||||
|
||||
### "Cannot prompt because user interactivity has been disabled"
|
||||
|
||||
**원인**: 환경 변수로 인해 인터랙티브 프롬프트가 비활성화됨
|
||||
|
||||
**해결**:
|
||||
```bash
|
||||
# gh CLI로 인증 설정
|
||||
./gh.exe auth setup-git
|
||||
|
||||
# 그 다음 푸시
|
||||
git push shiftring main
|
||||
```
|
||||
|
||||
### "Host key verification failed" (SSH)
|
||||
|
||||
**원인**: SSH 키가 설정되지 않음
|
||||
|
||||
**해결**: HTTPS 사용
|
||||
```bash
|
||||
git remote set-url origin https://github.com/sanjeok77-tech/ShiftRing.git
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 릴리즈 푸시 (dakjaba-releases)
|
||||
|
||||
```bash
|
||||
# 1. 버전 파일 업데이트
|
||||
# version.json, CHANGELOG.md, README.md 수정
|
||||
|
||||
# 2. APK 복사
|
||||
cp app/build/outputs/apk/release/app-release.apk app.apk
|
||||
|
||||
# 3. GitHub Release 생성
|
||||
./gh.exe release create v1.1.4 "app.apk" \
|
||||
--title "Shiftring v1.1.4" \
|
||||
--notes "릴리즈 노트" \
|
||||
-R "sanjeok77-tech/dakjaba-releases"
|
||||
|
||||
# 4. dakjaba-releases 저장소 업데이트
|
||||
./gh.exe repo clone sanjeok77-tech/dakjaba-releases ../dakjaba-releases-temp
|
||||
cp version.json ../dakjaba-releases-temp/
|
||||
cp app.apk ../dakjaba-releases-temp/
|
||||
cd ../dakjaba-releases-temp
|
||||
git add . && git commit -m "update: vX.X.X" && git push origin main
|
||||
cd ..
|
||||
rm -rf dakjaba-releases-temp
|
||||
|
||||
# 5. 소스 코드 커밋 및 푸시
|
||||
cd /c/Users/work/Desktop/1.0.0
|
||||
git add . && git commit -m "chore: release vX.X.X"
|
||||
git push shiftring main
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 성공 사례 (2026-02-21)
|
||||
|
||||
```bash
|
||||
$ ./gh.exe auth status
|
||||
github.com
|
||||
✓ Logged in to github.com account sanjeok77-tech (keyring)
|
||||
- Active account: true
|
||||
- Git operations protocol: https
|
||||
- Token: gho_************************************
|
||||
|
||||
$ ./gh.exe auth setup-git
|
||||
git: authorization completed
|
||||
|
||||
$ git push shiftring main
|
||||
To https://github.com/sanjeok77-tech/ShiftRing.git
|
||||
a848cd8..c72db7f main -> main
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**최종 수정**: 2026-02-21
|
||||
@@ -1,70 +0,0 @@
|
||||
---
|
||||
description: 릴리즈 빌드 및 배포 자동화 가이드 (GitHub CLI 기반)
|
||||
---
|
||||
|
||||
# 🚀 릴리즈 빌드 및 배포 워크플로우
|
||||
|
||||
이 가이드는 교대링(Shiftring) 프로젝트의 최신 버전을 빌드하고, APK를 배포 저장소(`dakjaba-releases`)에 업로드하며, 버전을 갱신하는 절차를 설명합니다.
|
||||
|
||||
## // turbo-all
|
||||
## 1. 전제 조건
|
||||
- **GitHub CLI (gh)**가 설치되어 있고 로그인되어 있어야 함 (`gh auth status`)
|
||||
- `release.jks`와 `keystore.properties`가 루트 폴더에 존재해야 함
|
||||
|
||||
## 2. 배포 단계
|
||||
|
||||
### 단계 1: 프로젝트 버전 확인 및 갱신
|
||||
- `app/build.gradle.kts`의 `versionCode`와 `versionName`을 확인 및 갱신합니다.
|
||||
- `version.json`의 정보를 동일하게 맞춥니다.
|
||||
- `CHANGELOG.md`에 변경 사항을 기록합니다.
|
||||
- `README.md`의 다운로드 링크 및 버전을 갱신합니다.
|
||||
|
||||
### 단계 2: 릴리즈 빌드 수행
|
||||
```powershell
|
||||
./gradlew.bat assembleRelease
|
||||
```
|
||||
- 빌드 결과물은 `app/build/outputs/apk/release/app-release.apk`에 생성됩니다.
|
||||
|
||||
### 단계 3: APK 서명 확인 (선택 사항)
|
||||
- 생성된 APK가 정상적으로 서명되었는지 확인합니다.
|
||||
|
||||
### 단계 4: 배포 저장소 업데이트 및 릴리즈 생성
|
||||
// turbo
|
||||
```powershell
|
||||
# 1. APK 파일 복사 (배포용 이름으로 변경)
|
||||
copy-item "app/build/outputs/apk/release/app-release.apk" "app.apk" -Force
|
||||
|
||||
# 2. 버전 정보 설정 (현재 버전에 맞춰 수정)
|
||||
$VERSION = "v1.0.4"
|
||||
|
||||
# 3. GitHub Release 생성 (dakjaba-releases 저장소)
|
||||
# tip: 이미 존재하는 태그라면 삭제 후 생성하거나 gh release edit 사용
|
||||
gh release create $VERSION "app.apk" --title "Shiftring $VERSION" --notes-file "CHANGELOG.md" -R "sanjeok77-tech/dakjaba-releases"
|
||||
|
||||
# 4. 배포 저장소(dakjaba-releases)의 version.json 및 최신 APK 갱신 (인앱 업데이트용)
|
||||
gh repo clone sanjeok77-tech/dakjaba-releases ..\dakjaba-releases-temp
|
||||
copy-item "version.json" "..\dakjaba-releases-temp\version.json" -Force
|
||||
copy-item "app.apk" "..\dakjaba-releases-temp\app.apk" -Force
|
||||
|
||||
# 5. README.md 자동 업데이트 (v1.1.1 패턴 기반 교체 예시 - 실제 버전변수로 대체 필요)
|
||||
# tip: sed나 powershell replace를 사용하여 README의 vX.X.X 및 다운로드 링크를 갱신합니다.
|
||||
(Get-Content README.md) -replace 'v\d+\.\d+\.\d+', "$VERSION" | Set-Content README.md
|
||||
(Get-Content ..\dakjaba-releases-temp\README.md) -replace 'v\d+\.\d+\.\d+', "$VERSION" | Set-Content ..\dakjaba-releases-temp\README.md
|
||||
|
||||
pushd ..\dakjaba-releases-temp
|
||||
git add .
|
||||
git commit -m "update: $VERSION"
|
||||
git push origin main
|
||||
popd
|
||||
Remove-Item -Recurse -Force ..\dakjaba-releases-temp
|
||||
```
|
||||
|
||||
### 단계 5: 소스 코드 커밋 및 푸시
|
||||
```powershell
|
||||
git add .
|
||||
git commit -m "chore: release $VERSION"
|
||||
git push origin main
|
||||
```
|
||||
|
||||
---
|
||||
*주의: 배포 저장소(`dakjaba-releases`)는 퍼블릭이며, 코드 저장소(`dakjaba`)는 프라이빗입니다. 배포 시 중요한 키 파일이 배포 저장소에 포함되지 않도록 주의하십시오.*
|
||||
206
GITEA_RELEASE_GUIDE.md
Normal file
206
GITEA_RELEASE_GUIDE.md
Normal file
@@ -0,0 +1,206 @@
|
||||
# Gitea 릴리즈 작업 가이드
|
||||
|
||||
> ShiftRing 프로젝트 Gitea 릴리즈 자동화 문서
|
||||
> 저장소: https://git.webpluss.net/sanjeok77/ShiftRing
|
||||
|
||||
---
|
||||
|
||||
## 🔐 인증 정보
|
||||
|
||||
**Personal Access Token (PAT)**
|
||||
- 위치: `.env.local` 파일
|
||||
- 형식: `e3b515eaa0a6683c921ca3bf718e281ed30a6075`
|
||||
- 사용자: `sanjeok77`
|
||||
|
||||
**인증 헤더**
|
||||
```bash
|
||||
-u "sanjeok77:TOKEN"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📋 릴리즈 생성 절차
|
||||
|
||||
### 1. 버전 업데이트 (3곳)
|
||||
|
||||
#### 1.1 `app/build.gradle.kts` - 앱 날부 버전
|
||||
```kotlin
|
||||
defaultConfig {
|
||||
versionCode = 1125 // ← 이전: 1124
|
||||
versionName = "1.2.5" // ← 이전: "1.2.4"
|
||||
}
|
||||
```
|
||||
|
||||
#### 1.2 `version.json` - 서버 버전 정보
|
||||
```json
|
||||
{
|
||||
"versionCode": 1125,
|
||||
"versionName": "1.2.5",
|
||||
"apkUrl": "https://git.webpluss.net/attachments/{UUID}",
|
||||
"changelog": "v1.2.5: 변경사항 요약",
|
||||
"forceUpdate": false
|
||||
}
|
||||
```
|
||||
|
||||
#### 1.3 Git 태그 및 릴리즈
|
||||
- 태그: `v1.2.5`
|
||||
- 브랜치: `dev` (개발) → `main` (배포)
|
||||
|
||||
---
|
||||
|
||||
### 2. 릴리즈 생성 (API)
|
||||
|
||||
**엔드포인트**
|
||||
```bash
|
||||
POST https://git.webpluss.net/api/v1/repos/sanjeok77/ShiftRing/releases
|
||||
```
|
||||
|
||||
**요청 예시**
|
||||
```bash
|
||||
curl -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-u "sanjeok77:TOKEN" \
|
||||
"https://git.webpluss.net/api/v1/repos/sanjeok77/ShiftRing/releases" \
|
||||
-d '{
|
||||
"tag_name": "v1.2.5",
|
||||
"name": "v1.2.5 - 릴리즈 제목",
|
||||
"body": "## 변경사항\n\n- 기능1\n- 기능2",
|
||||
"prerelease": false,
|
||||
"target_commitish": "dev"
|
||||
}'
|
||||
```
|
||||
|
||||
**응답 예시**
|
||||
```json
|
||||
{
|
||||
"id": 30,
|
||||
"tag_name": "v1.2.5",
|
||||
"upload_url": "https://git.webpluss.net/api/v1/repos/sanjeok77/ShiftRing/releases/30/assets"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 3. APK 빌드
|
||||
|
||||
**릴리즈 빌드**
|
||||
```bash
|
||||
./gradlew :app:assembleRelease
|
||||
```
|
||||
|
||||
**출력 경로**
|
||||
```
|
||||
app/build/outputs/apk/release/app-release.apk
|
||||
```
|
||||
|
||||
**서명 설정** (`keystore.properties`)
|
||||
```properties
|
||||
storePassword=비밀번호
|
||||
keyAlias=별칭
|
||||
keyPassword=비밀번호
|
||||
storeFile=../release.jks
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 4. APK 업로드 (API)
|
||||
|
||||
**엔드포인트**
|
||||
```bash
|
||||
POST https://git.webpluss.net/api/v1/repos/sanjeok77/ShiftRing/releases/{release_id}/assets
|
||||
```
|
||||
|
||||
**요청 예시**
|
||||
```bash
|
||||
curl -X POST \
|
||||
-u "sanjeok77:TOKEN" \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F "attachment=@app/build/outputs/apk/release/app-release.apk" \
|
||||
"https://git.webpluss.net/api/v1/repos/sanjeok77/ShiftRing/releases/30/assets?name=app.apk"
|
||||
```
|
||||
|
||||
**응답 예시**
|
||||
```json
|
||||
{
|
||||
"id": 37,
|
||||
"name": "app.apk",
|
||||
"size": 5236988,
|
||||
"browser_download_url": "https://git.webpluss.net/attachments/b8f53c11-743f-416c-87ae-bd478c781abf"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 5. version.json 업데이트
|
||||
|
||||
**APK URL 업데이트**
|
||||
```json
|
||||
{
|
||||
"apkUrl": "https://git.webpluss.net/attachments/{UUID}"
|
||||
}
|
||||
```
|
||||
|
||||
**주의**: `releases/download/v1.2.5/app.apk` 형식이 아닌 `attachments/{UUID}` 형식 사용
|
||||
|
||||
---
|
||||
|
||||
## 🔧 유틸리티 명령어
|
||||
|
||||
### 릴리즈 조회
|
||||
```bash
|
||||
curl -s -u "sanjeok77:TOKEN" \
|
||||
"https://git.webpluss.net/api/v1/repos/sanjeok77/ShiftRing/releases" | jq '.[].tag_name'
|
||||
```
|
||||
|
||||
### 특정 릴리즈 조회
|
||||
```bash
|
||||
curl -s -u "sanjeok77:TOKEN" \
|
||||
"https://git.webpluss.net/api/v1/repos/sanjeok77/ShiftRing/releases/30"
|
||||
```
|
||||
|
||||
### 첨부파일 삭제
|
||||
```bash
|
||||
curl -s -u "sanjeok77:TOKEN" \
|
||||
-X DELETE \
|
||||
"https://git.webpluss.net/api/v1/repos/sanjeok77/ShiftRing/releases/30/assets/{asset_id}"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ 주의사항
|
||||
|
||||
1. **버전 일치**: `build.gradle.kts`, `version.json`, Git 태그 3곳 모두 동일 버전 사용
|
||||
2. **APK 파일명**: 반드시 `app.apk`로 업로드 (클리어 이름 지정)
|
||||
3. **UUID**: 업로드 후 반환된 UUID를 `version.json`에 반영
|
||||
4. **브랜치**:
|
||||
- 개발: `dev` 브랜치에 커밋
|
||||
- 배포: `main` 브랜치에 cherry-pick
|
||||
|
||||
---
|
||||
|
||||
## 📁 관련 파일
|
||||
|
||||
| 파일 | 설명 |
|
||||
|------|------|
|
||||
| `app/build.gradle.kts` | 앱 날부 버전 설정 |
|
||||
| `version.json` | 서버 버전 정보 |
|
||||
| `keystore.properties` | 서명 키 설정 |
|
||||
| `release.jks` | 서명 키스토어 |
|
||||
| `.env.local` | API 토큰 저장 |
|
||||
|
||||
---
|
||||
|
||||
## 📝 변경 이력
|
||||
|
||||
| 날짜 | 버전 | 작업 |
|
||||
|------|------|------|
|
||||
| 2026-02-28 | v1.2.5 | 알람 시스템 단순화 릴리즈 |
|
||||
| 2026-02-28 | v1.2.4 | 버그 수정 릴리즈 |
|
||||
|
||||
---
|
||||
|
||||
## 🔗 참고 링크
|
||||
|
||||
- 릴리즈 페이지: https://git.webpluss.net/sanjeok77/ShiftRing/releases
|
||||
- API 문서: https://git.webpluss.net/api/swagger
|
||||
- Swagger UI: https://git.webpluss.net/api/swagger#/repository/repoCreateRelease
|
||||
@@ -1,7 +1,9 @@
|
||||
# Shift Alarm (교대링 - 전주/논산)
|
||||
|
||||
<p align="center">
|
||||
<img src="https://img.shields.io/badge/Download-Release_v1.1.9-blue?style=for-the-badge&logo=android&logoColor=white">
|
||||
<a href="https://git.webpluss.net/sanjeok77/ShiftRing/releases/tag/v1.1.9">
|
||||
<img src="https://img.shields.io/badge/Download-Release_v1.1.9-blue?style=for-the-badge&logo=android&logoColor=white">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
[** 최신 버전 (v1.1.9) 다운로드 (APK)**](https://git.webpluss.net/sanjeok77/ShiftRing/releases/download/v1.1.9/app.apk)
|
||||
|
||||
55
RELEASE_UPLOAD_GUIDE.md
Normal file
55
RELEASE_UPLOAD_GUIDE.md
Normal file
@@ -0,0 +1,55 @@
|
||||
# Gitea Release에 APK 업로드 방법
|
||||
|
||||
## 환경
|
||||
- Git 호스팅: git.webpluss.net (Gitea)
|
||||
- 저장소: sanjeok77/ShiftRing
|
||||
- 태그: v1.1.9
|
||||
- APK 경로: C:\Users\work\Desktop\1.0.0\app.apk
|
||||
|
||||
## 1. Release ID 확인
|
||||
|
||||
```bash
|
||||
# Release 목록 조회
|
||||
curl -s "https://git.webpluss.net/api/v1/repos/sanjeok77/ShiftRing/releases"
|
||||
```
|
||||
|
||||
응답에서 Release ID 확인 (예: `id: 5`)
|
||||
|
||||
## 2. APK 업로드
|
||||
|
||||
```bash
|
||||
# Personal Access Token 사용
|
||||
curl -s -u "username:TOKEN" \
|
||||
-X POST "https://git.webpluss.net/api/v1/repos/sanjeok77/ShiftRing/releases/5/assets" \
|
||||
-F "attachment=@C:/Users/work/Desktop/1.0.0/app.apk" \
|
||||
-F "name=app.apk"
|
||||
```
|
||||
|
||||
## 3. 릴리즈 설명 수정 (한글 깨짐 방지)
|
||||
|
||||
```bash
|
||||
# --data-binary 사용하고 stdin으로 JSON 전달
|
||||
curl -s -u "sanjeok77:TOKEN" \
|
||||
-X PATCH "https://git.webpluss.net/api/v1/repos/sanjeok77/ShiftRing/releases/5" \
|
||||
-H "Content-Type: application/json; charset=utf-8" \
|
||||
--data-binary @- << 'EOF'
|
||||
{"body":"## v1.1.9 - 수정 내용\n\n- 수정사항 1\n- 수정사항 2\n\nNo description provided"}
|
||||
EOF
|
||||
```
|
||||
|
||||
### 한글 깨짐 방지 팁
|
||||
- `-H "Content-Type: application/json; charset=utf-8"` 추가
|
||||
- `--data-binary @-` 사용 (stdin에서 읽기)
|
||||
- `<< 'EOF'` 로 HEREDOC 사용 (변수展開 방지)
|
||||
|
||||
## 4. 확인
|
||||
|
||||
```bash
|
||||
# 릴리즈 정보 조회
|
||||
curl -s "https://git.webpluss.net/api/v1/repos/sanjeok77/ShiftRing/releases/5"
|
||||
```
|
||||
|
||||
## 참고
|
||||
- GitLab이 아닌 **Gitea** 이므로 API 경로가 다름
|
||||
- GitLab: `/api/v4/projects/:id/releases`
|
||||
- Gitea: `/api/v1/repos/:owner/:repo/releases/:id`
|
||||
31
agent.md
31
agent.md
@@ -46,42 +46,31 @@
|
||||
```
|
||||
|
||||
### 3.3 릴리즈 순서
|
||||
|
||||
> **참고**: Gitea Release APK 업로드 방법은 [RELEASE_UPLOAD_GUIDE.md](./RELEASE_UPLOAD_GUIDE.md) 문서를 참조하세요.
|
||||
|
||||
1. **버전 업데이트**: `build.gradle.kts`에서 `versionCode`와 `versionName`을 올린다.
|
||||
- 예: `versionCode = 101`, `versionName = "1.0.1"`
|
||||
- 예: `versionCode = 1120`, `versionName = "1.2.0"`
|
||||
2. **빌드**: 릴리즈 빌드 수행
|
||||
```bash
|
||||
./gradlew assembleRelease
|
||||
```
|
||||
3. **릴리즈 생성**: GitLab 웹 인터페이스 또는 CLI 사용
|
||||
```bash
|
||||
# 1) ShiftRing 리포지토리에 푸시
|
||||
git push shiftring main
|
||||
|
||||
# 2) 기존 릴리즈 삭제 (필요시)
|
||||
gh release delete v1.0.1 --repo sanjeok77/ShiftRing -y
|
||||
|
||||
# 3) 신규 릴리즈 생성
|
||||
gh release create v1.0.1 \
|
||||
--repo sanjeok77/ShiftRing \
|
||||
--title "v1.0.1 - 릴리즈 제목" \
|
||||
--notes "릴리즈 노트 내용" \
|
||||
app/build/outputs/apk/release/app-release.apk
|
||||
```
|
||||
3. **릴리즈 생성**: Gitea API 또는 웹 인터페이스 사용
|
||||
- 자세한 방법은 [RELEASE_UPLOAD_GUIDE.md](./RELEASE_UPLOAD_GUIDE.md) 참조
|
||||
4. **version.json 업데이트**: ShiftRing 리포지토리 루트에 `version.json` 파일 생성/수정
|
||||
```json
|
||||
{
|
||||
"versionCode": 101,
|
||||
"versionName": "1.0.1",
|
||||
"apkUrl": "https://git.webpluss.net/sanjeok77/ShiftRing/releases/download/v1.0.0/app.apk",
|
||||
"versionCode": 1120,
|
||||
"versionName": "1.2.0",
|
||||
"apkUrl": "https://git.webpluss.net/sanjeok77/ShiftRing/releases/download/v1.2.0/app.apk",
|
||||
"changelog": "수정사항 요약"
|
||||
}
|
||||
```
|
||||
5. **소스 코드 커밋**: 코드 저장소에 변경 사항 푸시
|
||||
```bash
|
||||
git add -A
|
||||
git commit -m "Release v1.0.1"
|
||||
git commit -m "Release v1.2.0"
|
||||
git push origin main
|
||||
git push shiftring main
|
||||
```
|
||||
|
||||
### 3.4 저장소 정보 (단일 저장소 전략)
|
||||
|
||||
@@ -16,15 +16,15 @@ android {
|
||||
namespace = "com.example.shiftalarm"
|
||||
compileSdk = 35
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.shiftalarm"
|
||||
minSdk = 26
|
||||
targetSdk = 35
|
||||
versionCode = 1119
|
||||
versionName = "1.1.9"
|
||||
defaultConfig {
|
||||
applicationId = "com.example.shiftalarm"
|
||||
minSdk = 26
|
||||
targetSdk = 35
|
||||
versionCode = 1142
|
||||
versionName = "1.4.2"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
|
||||
@@ -78,6 +78,14 @@ class AlarmActivity : AppCompatActivity() {
|
||||
|
||||
// 알람 시작 (화면 상태와 무관하게 항상 실행)
|
||||
startAlarm()
|
||||
|
||||
// 마스터 알람이 꺼져있으면 알람 화면을 즉시 종료
|
||||
val prefs = getSharedPreferences("ShiftAlarmPrefs", Context.MODE_PRIVATE)
|
||||
if (!ShiftAlarmDefaults.isMasterAlarmEnabled(prefs)) {
|
||||
Toast.makeText(this, "전체 알람이 꺼져있습니다.", Toast.LENGTH_SHORT).show()
|
||||
finish()
|
||||
return
|
||||
}
|
||||
setupControls()
|
||||
|
||||
// 5분 후 자동 스누즈
|
||||
@@ -209,6 +217,7 @@ class AlarmActivity : AppCompatActivity() {
|
||||
val dx = event.rawX - startX
|
||||
if (abs(dx) > maxSwipe * 0.8f) {
|
||||
// Trigger Dismiss
|
||||
@Suppress("DEPRECATION")
|
||||
(getSystemService(Context.VIBRATOR_SERVICE) as? Vibrator)?.vibrate(50)
|
||||
Toast.makeText(this, "알람 해제 완료", Toast.LENGTH_SHORT).show()
|
||||
stopAlarm(); finish()
|
||||
@@ -247,6 +256,7 @@ class AlarmActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
private fun handleSnooze() {
|
||||
@Suppress("DEPRECATION")
|
||||
(getSystemService(Context.VIBRATOR_SERVICE) as? Vibrator)?.vibrate(50)
|
||||
val snoozeRepeat = intent.getIntExtra("EXTRA_SNOOZE_REPEAT", 3)
|
||||
val text = if (snoozeRepeat == 99) "다시 울림 설정됨" else "다시 울림 (${snoozeRepeat}회 남음)"
|
||||
@@ -274,21 +284,25 @@ class AlarmActivity : AppCompatActivity() {
|
||||
else android.provider.Settings.System.DEFAULT_ALARM_ALERT_URI
|
||||
}
|
||||
|
||||
// AudioAttributes 강화: 화면 켜진 상태에서도 알람음이 울리도록
|
||||
// AudioAttributes 강화: 무음/진동 모드에서도 알람음이 울리도록
|
||||
val audioAttrs = AudioAttributes.Builder()
|
||||
.setUsage(AudioAttributes.USAGE_ALARM)
|
||||
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
|
||||
.setFlags(AudioAttributes.FLAG_AUDIBILITY_ENFORCED) // 볼륨 강제 적용
|
||||
.setFlags(AudioAttributes.FLAG_AUDIBILITY_ENFORCED)
|
||||
.build()
|
||||
|
||||
// AudioManager를 통해 알람 볼륨 설정
|
||||
// AudioManager를 통해 알람 볼륨 설정 및 무음 모드 우회
|
||||
val audioManager = getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||
val originalVolume = audioManager.getStreamVolume(AudioManager.STREAM_ALARM)
|
||||
val maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_ALARM)
|
||||
|
||||
// 무음 모드에서도 알람음이 울리도록 STREAM_ALARM 사용 (벨소리와 독립)
|
||||
// 알람 스트림은 다른 스트림과 달리 무음 모드에서도 울림
|
||||
val originalRingerMode = audioManager.ringerMode
|
||||
|
||||
// 알람 볼륨을 최대로 설정 (사용자가 나중에 조정 가능)
|
||||
try {
|
||||
val maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_ALARM)
|
||||
audioManager.setStreamVolume(AudioManager.STREAM_ALARM, maxVolume, 0)
|
||||
Log.d("AlarmActivity", "알람 볼륨 설정: $maxVolume (RingerMode: $originalRingerMode)")
|
||||
} catch (e: Exception) {
|
||||
Log.w("AlarmActivity", "알람 볼륨 설정 실패", e)
|
||||
}
|
||||
|
||||
@@ -15,6 +15,13 @@ class AlarmReceiver : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent?) {
|
||||
Log.d(TAG, "===== 알람 수신 (Receiver) =====")
|
||||
|
||||
// 마스터 알람이 꺼져있으면 알람 무시
|
||||
val prefs = context.getSharedPreferences("ShiftAlarmPrefs", Context.MODE_PRIVATE)
|
||||
if (!ShiftAlarmDefaults.isMasterAlarmEnabled(prefs)) {
|
||||
Log.w(TAG, "마스터 알람이 꺼져있어 알람을 무시합니다.")
|
||||
return
|
||||
}
|
||||
|
||||
val alarmId = intent?.getIntExtra("EXTRA_ALARM_ID", -1) ?: -1
|
||||
val isCustom = intent?.getBooleanExtra("EXTRA_IS_CUSTOM", false) ?: false
|
||||
|
||||
@@ -50,6 +57,7 @@ class AlarmReceiver : BroadcastReceiver() {
|
||||
private fun startAlarm(context: Context, intent: Intent?) {
|
||||
// WakeLock 획득 (화면 켜기 및 Activity 실행 보장)
|
||||
val pm = context.getSystemService(Context.POWER_SERVICE) as PowerManager
|
||||
@Suppress("DEPRECATION")
|
||||
val wakeLock = pm.newWakeLock(
|
||||
PowerManager.PARTIAL_WAKE_LOCK or PowerManager.ACQUIRE_CAUSES_WAKEUP,
|
||||
"ShiftAlarm::AlarmWakeLock"
|
||||
@@ -71,6 +79,8 @@ class AlarmReceiver : BroadcastReceiver() {
|
||||
context.startService(serviceIntent)
|
||||
}
|
||||
|
||||
Log.d(TAG, "ForegroundService 시작 완료")
|
||||
|
||||
// 2. AlarmActivity 직접 실행 (알람 화면 표시)
|
||||
val activityIntent = Intent(context, AlarmActivity::class.java).apply {
|
||||
putExtra("EXTRA_SHIFT", intent?.getStringExtra("EXTRA_SHIFT") ?: "근무")
|
||||
@@ -88,8 +98,15 @@ class AlarmReceiver : BroadcastReceiver() {
|
||||
addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
|
||||
}
|
||||
|
||||
context.startActivity(activityIntent)
|
||||
Log.d(TAG, "AlarmActivity 실행 완료")
|
||||
// 지연 후 Activity 시작 (ForegroundService가 알림을 먼저 표시하도록)
|
||||
android.os.Handler(android.os.Looper.getMainLooper()).postDelayed({
|
||||
try {
|
||||
context.startActivity(activityIntent)
|
||||
Log.d(TAG, "AlarmActivity 실행 완료")
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "AlarmActivity 실행 실패", e)
|
||||
}
|
||||
}, 500)
|
||||
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "알람 실행 실패", e)
|
||||
|
||||
@@ -16,6 +16,47 @@ import java.util.concurrent.TimeUnit
|
||||
val SEOUL_ZONE: ZoneId = ZoneId.of("Asia/Seoul")
|
||||
const val TAG = "ShiftAlarm"
|
||||
|
||||
/**
|
||||
* 다크모드 지원 커스텀 토스트 표시
|
||||
*/
|
||||
fun showCustomToast(context: Context, message: String, duration: Int = android.widget.Toast.LENGTH_SHORT) {
|
||||
try {
|
||||
val inflater = android.view.LayoutInflater.from(context)
|
||||
val layout = inflater.inflate(R.layout.custom_toast, null)
|
||||
val textView = layout.findViewById<android.widget.TextView>(R.id.toastText)
|
||||
textView.text = message
|
||||
|
||||
val toast = android.widget.Toast(context)
|
||||
toast.duration = duration
|
||||
toast.view = layout
|
||||
toast.setGravity(android.view.Gravity.BOTTOM or android.view.Gravity.CENTER_HORIZONTAL, 0, 150)
|
||||
toast.show()
|
||||
} catch (e: Exception) {
|
||||
// Fallback to default toast if custom toast fails
|
||||
android.widget.Toast.makeText(context, message, duration).show()
|
||||
}
|
||||
}
|
||||
* 다크모드 지원 커스텀 토스트 표시
|
||||
*/
|
||||
fun showCustomToast(context: Context, message: String, duration: Int = android.widget.Toast.LENGTH_SHORT) {
|
||||
try {
|
||||
// Use application context with theme for proper dark mode support
|
||||
val themedContext = android.view.ContextThemeWrapper(context.applicationContext, R.style.Theme_ShiftAlarm)
|
||||
val inflater = android.view.LayoutInflater.from(themedContext)
|
||||
val layout = inflater.inflate(R.layout.custom_toast, null)
|
||||
val textView = layout.findViewById<android.widget.TextView>(R.id.toastText)
|
||||
textView.text = message
|
||||
|
||||
val toast = android.widget.Toast(context.applicationContext)
|
||||
toast.duration = duration
|
||||
toast.view = layout
|
||||
toast.setGravity(android.view.Gravity.BOTTOM or android.view.Gravity.CENTER_HORIZONTAL, 0, 100)
|
||||
toast.show()
|
||||
} catch (e: Exception) {
|
||||
// Fallback to default toast if custom toast fails
|
||||
android.widget.Toast.makeText(context, message, duration).show()
|
||||
}
|
||||
}
|
||||
// ============================================
|
||||
// 알람 ID 생성
|
||||
// ============================================
|
||||
@@ -137,7 +178,9 @@ private fun cancelAllPendingIntentsForUniqueId(context: Context, uniqueId: Int)
|
||||
for (day in 1..31) {
|
||||
try {
|
||||
val alarmId = 200000000 + year * 1000000 + month * 10000 + day * 100 + baseId
|
||||
val intent = Intent(context, AlarmReceiver::class.java)
|
||||
val intent = Intent(context, AlarmReceiver::class.java).apply {
|
||||
action = "com.example.shiftalarm.ALARM_TRIGGER"
|
||||
}
|
||||
val pendingIntent = PendingIntent.getBroadcast(
|
||||
context, alarmId, intent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||
@@ -200,7 +243,9 @@ private fun cancelTestAlarm(context: Context) {
|
||||
|
||||
private fun cancelAlarmInternal(context: Context, alarmId: Int) {
|
||||
val alarmManager = context.getSystemService(Context.ALARM_SERVICE) as AlarmManager
|
||||
val intent = Intent(context, AlarmReceiver::class.java)
|
||||
val intent = Intent(context, AlarmReceiver::class.java).apply {
|
||||
action = "com.example.shiftalarm.ALARM_TRIGGER"
|
||||
}
|
||||
val pendingIntent = PendingIntent.getBroadcast(
|
||||
context, alarmId, intent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package com.example.shiftalarm
|
||||
|
||||
import android.content.Context
|
||||
import androidx.room.*
|
||||
import androidx.room.Database
|
||||
import androidx.room.Room
|
||||
import androidx.room.RoomDatabase
|
||||
import androidx.room.migration.Migration
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
|
||||
@Database(entities = [ShiftOverride::class, DailyMemo::class, CustomAlarm::class], version = 3, exportSchema = false)
|
||||
@Database(entities = [ShiftOverride::class, DailyMemo::class, CustomAlarm::class, AnnualLeave::class], version = 4, exportSchema = false)
|
||||
abstract class AppDatabase : RoomDatabase() {
|
||||
abstract fun shiftDao(): ShiftDao
|
||||
|
||||
@@ -11,6 +15,23 @@ abstract class AppDatabase : RoomDatabase() {
|
||||
@Volatile
|
||||
private var INSTANCE: AppDatabase? = null
|
||||
|
||||
// Migration from version 3 to 4: Add AnnualLeave table
|
||||
private val MIGRATION_3_4 = object : Migration(3, 4) {
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
// Create AnnualLeave table
|
||||
database.execSQL(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS annual_leave (
|
||||
id INTEGER PRIMARY KEY NOT NULL,
|
||||
totalDays REAL NOT NULL,
|
||||
remainingDays REAL NOT NULL,
|
||||
updatedAt INTEGER NOT NULL
|
||||
)
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun getDatabase(context: Context): AppDatabase {
|
||||
return INSTANCE ?: synchronized(this) {
|
||||
val instance = Room.databaseBuilder(
|
||||
@@ -18,7 +39,7 @@ abstract class AppDatabase : RoomDatabase() {
|
||||
AppDatabase::class.java,
|
||||
"shift_database"
|
||||
)
|
||||
.fallbackToDestructiveMigration() // Simple for now
|
||||
.addMigrations(MIGRATION_3_4)
|
||||
.build()
|
||||
INSTANCE = instance
|
||||
instance
|
||||
|
||||
@@ -39,14 +39,21 @@ object AppUpdateManager {
|
||||
reader.close()
|
||||
|
||||
val json = JSONObject(result)
|
||||
val serverVersionCode = json.getInt("versionCode")
|
||||
val serverVersionName = json.getString("versionName")
|
||||
val apkUrl = json.getString("apkUrl")
|
||||
val changelog = json.optString("changelog", "버그 수정 및 성능 향상")
|
||||
|
||||
val pInfo = ctx.packageManager.getPackageInfo(ctx.packageName, 0)
|
||||
val currentVersionCode = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
pInfo.longVersionCode.toInt()
|
||||
} else {
|
||||
@Suppress("DEPRECATION")
|
||||
pInfo.versionCode
|
||||
}
|
||||
val currentVersionName = pInfo.versionName ?: "0.0.0"
|
||||
|
||||
if (isNewerVersion(serverVersionName, currentVersionName)) {
|
||||
if (serverVersionCode > currentVersionCode) {
|
||||
activity.runOnUiThread {
|
||||
showUpdateDialog(activity, serverVersionName, changelog, apkUrl)
|
||||
}
|
||||
@@ -71,29 +78,6 @@ object AppUpdateManager {
|
||||
}.start()
|
||||
}
|
||||
|
||||
private fun isNewerVersion(server: String, current: String): Boolean {
|
||||
try {
|
||||
// Clean version strings (remove non-numeric suffixes if any)
|
||||
val sClean = server.split("-")[0].split(" ")[0]
|
||||
val cClean = current.split("-")[0].split(" ")[0]
|
||||
|
||||
val sParts = sClean.split(".").map { it.filter { char -> char.isDigit() }.let { p -> if (p.isEmpty()) 0 else p.toInt() } }
|
||||
val cParts = cClean.split(".").map { it.filter { char -> char.isDigit() }.let { p -> if (p.isEmpty()) 0 else p.toInt() } }
|
||||
|
||||
val length = Math.max(sParts.size, cParts.size)
|
||||
for (i in 0 until length) {
|
||||
val s = if (i < sParts.size) sParts[i] else 0
|
||||
val c = if (i < cParts.size) cParts[i] else 0
|
||||
if (s > c) return true
|
||||
if (s < c) return false
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
android.util.Log.e("AppUpdateManager", "Version comparison failed: ${e.message}")
|
||||
return false
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
private fun showUpdateDialog(activity: Activity, version: String, changelog: String, apkUrl: String) {
|
||||
com.google.android.material.dialog.MaterialAlertDialogBuilder(activity)
|
||||
.setTitle("새로운 업데이트 발견 (v$version)")
|
||||
|
||||
@@ -13,18 +13,18 @@ import androidx.recyclerview.widget.RecyclerView
|
||||
import java.time.LocalDate
|
||||
|
||||
data class DayShift(
|
||||
val date: LocalDate?,
|
||||
val shift: String?,
|
||||
val hasMemo: Boolean = false,
|
||||
val memoContent: String? = null
|
||||
val date: LocalDate?,
|
||||
val shift: String?,
|
||||
val hasMemo: Boolean = false,
|
||||
val memoContent: String? = null
|
||||
)
|
||||
|
||||
class CalendarAdapter(
|
||||
var days: List<DayShift>,
|
||||
private val listener: OnDayClickListener,
|
||||
var showHolidays: Boolean = true
|
||||
var days: List<DayShift>,
|
||||
private val listener: OnDayClickListener,
|
||||
var showHolidays: Boolean = true,
|
||||
private val rowCount: Int = 6 // Default to 6 rows
|
||||
) : RecyclerView.Adapter<CalendarAdapter.ViewHolder>() {
|
||||
|
||||
interface OnDayClickListener {
|
||||
fun onDayClick(date: LocalDate, currentShift: String)
|
||||
}
|
||||
@@ -48,19 +48,27 @@ class CalendarAdapter(
|
||||
return (dp * context.resources.displayMetrics.density).toInt()
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val item = days[position]
|
||||
val context = holder.itemView.context
|
||||
|
||||
if (item.date == null) {
|
||||
holder.itemView.visibility = View.INVISIBLE
|
||||
return
|
||||
}
|
||||
|
||||
holder.itemView.visibility = View.VISIBLE
|
||||
|
||||
// Day Number
|
||||
holder.dayNumber.text = item.date.dayOfMonth.toString()
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val item = days[position]
|
||||
val context = holder.itemView.context
|
||||
|
||||
// Fixed item height - square cells based on screen width
|
||||
val displayMetrics = context.resources.displayMetrics
|
||||
val screenWidth = displayMetrics.widthPixels
|
||||
val itemHeight = screenWidth / 7
|
||||
|
||||
val layoutParams = holder.itemView.layoutParams
|
||||
layoutParams.height = itemHeight
|
||||
holder.itemView.layoutParams = layoutParams
|
||||
|
||||
if (item.date == null) {
|
||||
holder.itemView.visibility = View.INVISIBLE
|
||||
return
|
||||
}
|
||||
|
||||
holder.itemView.visibility = View.VISIBLE
|
||||
|
||||
// Day Number
|
||||
|
||||
// Holiday / Weekend logic
|
||||
val isSunday = item.date.dayOfWeek == java.time.DayOfWeek.SUNDAY
|
||||
@@ -99,7 +107,7 @@ class CalendarAdapter(
|
||||
holder.shiftChar.background = null
|
||||
holder.shiftChar.text = ""
|
||||
holder.holidayNameSmall.visibility = View.GONE
|
||||
holder.shiftChar.textSize = 13f
|
||||
holder.shiftChar.textSize = 15f
|
||||
|
||||
// "반월", "반년" (Half-Monthly, Half-Yearly) Special Logic
|
||||
// These are overrides or specific shifts that user sets.
|
||||
@@ -111,7 +119,7 @@ class CalendarAdapter(
|
||||
// Holiday Mode (Priority): Show full holiday name, no circle
|
||||
holder.shiftChar.text = fullHolidayName
|
||||
holder.shiftChar.setTextColor(Color.parseColor("#FF5252"))
|
||||
holder.shiftChar.textSize = 10f
|
||||
holder.shiftChar.textSize = 11f
|
||||
holder.shiftChar.background = null
|
||||
} else if (item.shift != null && item.shift != "비번") {
|
||||
// Shift Mode
|
||||
@@ -120,7 +128,7 @@ class CalendarAdapter(
|
||||
if (item.shift == "반월" || item.shift == "반년") {
|
||||
holder.shiftChar.text = if (item.shift == "반월") "월" else "년"
|
||||
holder.shiftChar.setTextColor(ContextCompat.getColor(context, R.color.black)) // Black for contrast on Half Red/Transparent
|
||||
holder.shiftChar.textSize = 13f
|
||||
holder.shiftChar.textSize = 15f
|
||||
holder.shiftChar.background = ContextCompat.getDrawable(context, R.drawable.bg_shift_half_red)
|
||||
} else {
|
||||
// Standard Logic
|
||||
@@ -137,7 +145,7 @@ class CalendarAdapter(
|
||||
else -> item.shift.take(1)
|
||||
}
|
||||
holder.shiftChar.text = shiftAbbreviation
|
||||
holder.shiftChar.textSize = 15f
|
||||
holder.shiftChar.textSize = 17f
|
||||
holder.shiftChar.setTypeface(null, android.graphics.Typeface.BOLD)
|
||||
|
||||
val shiftColorRes = when (item.shift) {
|
||||
@@ -205,7 +213,7 @@ class CalendarAdapter(
|
||||
// holder.holidayNameSmall.text = HolidayManager.getLunarDateString(item.date)
|
||||
|
||||
holder.shiftChar.text = HolidayManager.getLunarDateString(item.date)
|
||||
holder.shiftChar.textSize = 10f
|
||||
holder.shiftChar.textSize = 11f
|
||||
holder.shiftChar.setTextColor(ContextCompat.getColor(context, R.color.text_tertiary))
|
||||
holder.shiftChar.background = null
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.example.shiftalarm
|
||||
|
||||
import androidx.room.*
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
|
||||
@Entity(tableName = "shift_overrides", primaryKeys = ["factory", "team", "date"])
|
||||
data class ShiftOverride(
|
||||
@@ -28,3 +29,12 @@ data class CustomAlarm(
|
||||
val snoozeInterval: Int = 5,
|
||||
val snoozeRepeat: Int = 3
|
||||
)
|
||||
|
||||
@Entity(tableName = "annual_leave")
|
||||
data class AnnualLeave(
|
||||
@PrimaryKey
|
||||
val id: Int = 1, // Single row for app-wide annual leave
|
||||
val totalDays: Float, // 총 연차 (1~25)
|
||||
val remainingDays: Float, // 남은 연차
|
||||
val updatedAt: Long = System.currentTimeMillis()
|
||||
)
|
||||
|
||||
@@ -93,6 +93,7 @@ class FragmentSettingsAdditional : Fragment() {
|
||||
|
||||
// Tide Switch
|
||||
binding.switchTide.isChecked = prefs.getBoolean("show_tide", false)
|
||||
loadAppVersion()
|
||||
}
|
||||
|
||||
private fun setupListeners() {
|
||||
@@ -211,6 +212,18 @@ class FragmentSettingsAdditional : Fragment() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private fun loadAppVersion() {
|
||||
try {
|
||||
val packageInfo = requireContext().packageManager.getPackageInfo(requireContext().packageName, 0)
|
||||
val versionName = packageInfo.versionName
|
||||
binding.tvAppVersion.text = "버전 $versionName"
|
||||
} catch (e: Exception) {
|
||||
binding.tvAppVersion.text = "버전 1.4.0"
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
|
||||
@@ -451,13 +451,18 @@ class FragmentSettingsAlarm : Fragment(), SharedPreferences.OnSharedPreferenceCh
|
||||
if (android.os.Build.VERSION.SDK_INT >= 23) {
|
||||
timePicker.hour = parts[0].toInt(); timePicker.minute = parts[1].toInt()
|
||||
} else {
|
||||
timePicker.currentHour = parts[0].toInt(); timePicker.currentMinute = parts[1].toInt()
|
||||
@Suppress("DEPRECATION")
|
||||
timePicker.currentHour = parts[0].toInt()
|
||||
@Suppress("DEPRECATION")
|
||||
timePicker.currentMinute = parts[1].toInt()
|
||||
}
|
||||
|
||||
btnSelectSound.setOnClickListener {
|
||||
val intent = Intent(android.media.RingtoneManager.ACTION_RINGTONE_PICKER).apply {
|
||||
putExtra(android.media.RingtoneManager.EXTRA_RINGTONE_TYPE, android.media.RingtoneManager.TYPE_ALARM)
|
||||
putExtra(android.media.RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, if (currentDialogSoundUri != null) android.net.Uri.parse(currentDialogSoundUri) else null as android.net.Uri?)
|
||||
// 무음 선택 방지: 시스템 알람음만 선택 가능
|
||||
putExtra(android.media.RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, false)
|
||||
}
|
||||
startActivityForResult(intent, 100)
|
||||
}
|
||||
@@ -485,7 +490,9 @@ class FragmentSettingsAlarm : Fragment(), SharedPreferences.OnSharedPreferenceCh
|
||||
|
||||
btnCancel.setOnClickListener { dialog.dismiss() }
|
||||
btnSave.setOnClickListener {
|
||||
@Suppress("DEPRECATION")
|
||||
val h = if (android.os.Build.VERSION.SDK_INT >= 23) timePicker.hour else timePicker.currentHour
|
||||
@Suppress("DEPRECATION")
|
||||
val m = if (android.os.Build.VERSION.SDK_INT >= 23) timePicker.minute else timePicker.currentMinute
|
||||
val time = String.format("%02d:%02d", h, m)
|
||||
|
||||
|
||||
@@ -4,8 +4,11 @@ import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Toast
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.example.shiftalarm.databinding.FragmentSettingsLabBinding
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class FragmentSettingsLab : Fragment() {
|
||||
|
||||
@@ -20,6 +23,56 @@ class FragmentSettingsLab : Fragment() {
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
setupNumberPicker()
|
||||
loadAnnualLeave()
|
||||
setupSaveButton()
|
||||
}
|
||||
|
||||
private fun setupNumberPicker() {
|
||||
binding.npTotalDays.apply {
|
||||
minValue = 1
|
||||
maxValue = 25
|
||||
wrapSelectorWheel = false
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadAnnualLeave() {
|
||||
lifecycleScope.launch {
|
||||
val repo = ShiftRepository(requireContext())
|
||||
|
||||
val annualLeave = repo.getAnnualLeave()
|
||||
annualLeave?.let {
|
||||
binding.npTotalDays.value = it.totalDays.toInt()
|
||||
binding.tvRemainingDays.text = String.format("%.1f", it.remainingDays)
|
||||
} ?: run {
|
||||
// Default: 15 days
|
||||
binding.npTotalDays.value = 15
|
||||
binding.tvRemainingDays.text = "15.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupSaveButton() {
|
||||
binding.btnSaveAnnualLeave.setOnClickListener {
|
||||
val totalDays = binding.npTotalDays.value.toFloat()
|
||||
|
||||
lifecycleScope.launch {
|
||||
val repo = ShiftRepository(requireContext())
|
||||
|
||||
repo.recalculateAndSaveAnnualLeave(totalDays)
|
||||
|
||||
val updated = repo.getAnnualLeave()
|
||||
updated?.let {
|
||||
binding.tvRemainingDays.text = String.format("%.1f", it.remainingDays)
|
||||
showCustomToast(requireContext(), "연차가 저장되었습니다. (남은 연차: ${String.format("%.1f", it.remainingDays)}일)")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
|
||||
@@ -187,22 +187,33 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
val prefs = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
|
||||
currentViewTeam = prefs.getString(KEY_TEAM, "A") ?: "A"
|
||||
|
||||
updateTideButtonVisibility()
|
||||
updateCalendar()
|
||||
|
||||
// 일원화된 통합 권한 체크 실행 (신뢰도 100% 보장)
|
||||
AlarmPermissionUtil.checkAndRequestAllPermissions(this)
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
val prefs = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
|
||||
currentViewTeam = prefs.getString(KEY_TEAM, "A") ?: "A"
|
||||
|
||||
// 설정 변경 시 즉시 반영을 위한 강제 동기화 (30일 스케줄링)
|
||||
lifecycleScope.launch {
|
||||
syncAllAlarms(this@MainActivity)
|
||||
}
|
||||
}
|
||||
updateTideButtonVisibility()
|
||||
updateCalendar()
|
||||
|
||||
// 일원화된 통합 권한 체크 실행 (신뢰도 100% 보장)
|
||||
AlarmPermissionUtil.checkAndRequestAllPermissions(this)
|
||||
|
||||
// 설정 변경 시 즉시 반영을 위한 강제 동기화 (30일 스케줄링)
|
||||
lifecycleScope.launch {
|
||||
syncAllAlarms(this@MainActivity)
|
||||
}
|
||||
|
||||
// 연차 정보 업데이트
|
||||
lifecycleScope.launch {
|
||||
val repo = ShiftRepository(this@MainActivity)
|
||||
val annualLeave = repo.getAnnualLeave()
|
||||
annualLeave?.let {
|
||||
binding.tvAnnualLeave.text = "연차: ${String.format("%.1f", it.remainingDays)}"
|
||||
} ?: run {
|
||||
binding.tvAnnualLeave.text = "연차: --"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showMonthYearPicker() {
|
||||
val dialogView = layoutInflater.inflate(R.layout.dialog_month_year_picker, null)
|
||||
@@ -255,10 +266,11 @@ class MainActivity : AppCompatActivity() {
|
||||
return (dp * resources.displayMetrics.density).toInt()
|
||||
}
|
||||
|
||||
private fun setupCalendar() {
|
||||
binding.calendarGrid.layoutManager = GridLayoutManager(this, 7)
|
||||
updateCalendar()
|
||||
}
|
||||
private fun setupCalendar() {
|
||||
binding.calendarGrid.layoutManager = GridLayoutManager(this, 7)
|
||||
binding.calendarGrid.setHasFixedSize(false) // Allow dynamic item sizing
|
||||
updateCalendar()
|
||||
}
|
||||
|
||||
private fun updateCalendar() {
|
||||
val prefs = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
|
||||
@@ -294,15 +306,36 @@ class MainActivity : AppCompatActivity() {
|
||||
dao.getMemosForMonth(monthStr).associateBy { memoItem -> memoItem.date }
|
||||
}
|
||||
|
||||
val days = generateDaysForMonthWithData(currentViewMonth, currentViewTeam, factory, overrides, memos)
|
||||
|
||||
val adapter = CalendarAdapter(days, object : CalendarAdapter.OnDayClickListener {
|
||||
override fun onDayClick(date: LocalDate, currentShift: String) {
|
||||
showDaySettingsDialog(date, currentShift)
|
||||
}
|
||||
}, binding.cbShowHolidays.isChecked)
|
||||
|
||||
binding.calendarGrid.adapter = adapter
|
||||
val days = generateDaysForMonthWithData(currentViewMonth, currentViewTeam, factory, overrides, memos)
|
||||
|
||||
// Calculate row count (5 or 6 rows)
|
||||
val daysInMonth = currentViewMonth.lengthOfMonth()
|
||||
val firstDayOfMonth = currentViewMonth.atDay(1).dayOfWeek.value % 7
|
||||
val actualDayCount = firstDayOfMonth + daysInMonth
|
||||
val rowCount = if (actualDayCount <= 35) 5 else 6
|
||||
|
||||
val adapter = CalendarAdapter(days, object : CalendarAdapter.OnDayClickListener {
|
||||
override fun onDayClick(date: LocalDate, currentShift: String) {
|
||||
showDaySettingsDialog(date, currentShift)
|
||||
}
|
||||
}, binding.cbShowHolidays.isChecked, rowCount)
|
||||
|
||||
binding.calendarGrid.adapter = adapter
|
||||
|
||||
// Set RecyclerView height based on row count
|
||||
// 5 rows: fixed height to fill space, no scroll
|
||||
// 6 rows: max height (5 rows worth), enable scroll
|
||||
val displayMetrics = resources.displayMetrics
|
||||
val screenWidth = displayMetrics.widthPixels
|
||||
val cellHeight = screenWidth / 7 // Square cells
|
||||
val recyclerViewHeight = cellHeight * rowCount
|
||||
val layoutParams = binding.calendarGrid.layoutParams
|
||||
layoutParams.height = recyclerViewHeight
|
||||
binding.calendarGrid.layoutParams = layoutParams
|
||||
|
||||
// Disable scroll for 5 rows, enable for 6 rows
|
||||
binding.calendarGrid.isNestedScrollingEnabled = rowCount > 5
|
||||
|
||||
binding.monthTitle.text = currentViewMonth.format(DateTimeFormatter.ofPattern("yyyy년 MM월"))
|
||||
|
||||
// Update Header Status Text with Permission Warning if needed
|
||||
@@ -314,10 +347,17 @@ class MainActivity : AppCompatActivity() {
|
||||
binding.todayStatusText.setTextColor(androidx.core.content.ContextCompat.getColor(this@MainActivity, R.color.warning_red))
|
||||
} else {
|
||||
binding.todayStatusText.text = "오늘의 근무: $shiftForViewingTeam$teamSuffix"
|
||||
binding.todayStatusText.setTextColor(androidx.core.content.ContextCompat.getColor(this@MainActivity, R.color.text_secondary))
|
||||
}
|
||||
}
|
||||
binding.todayStatusText.setTextColor(androidx.core.content.ContextCompat.getColor(this@MainActivity, R.color.text_secondary))
|
||||
}
|
||||
|
||||
// Update Annual Leave display
|
||||
val annualLeave = withContext(Dispatchers.IO) { repo.getAnnualLeave() }
|
||||
annualLeave?.let {
|
||||
binding.tvAnnualLeave.text = "연차: ${String.format("%.1f", it.remainingDays)}"
|
||||
} ?: run {
|
||||
binding.tvAnnualLeave.text = "연차: --"
|
||||
}
|
||||
}
|
||||
updateOtherTeamsLayout(today, factory, prefs)
|
||||
}
|
||||
|
||||
@@ -373,13 +413,13 @@ class MainActivity : AppCompatActivity() {
|
||||
setMargins(4, 0, 4, 0)
|
||||
}
|
||||
|
||||
setOnClickListener {
|
||||
if (currentViewTeam != t) {
|
||||
currentViewTeam = t
|
||||
updateCalendar()
|
||||
Toast.makeText(context, "${t}반 근무표를 표시합니다.", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
setOnClickListener {
|
||||
if (currentViewTeam != t) {
|
||||
currentViewTeam = t
|
||||
updateCalendar()
|
||||
showCustomToast(context, "${t}반 근무표를 표시합니다.")
|
||||
}
|
||||
}
|
||||
}
|
||||
rowLayout.addView(textView)
|
||||
}
|
||||
@@ -595,6 +635,7 @@ class MainActivity : AppCompatActivity() {
|
||||
android.widget.Toast.makeText(this, "원래 근무로 복구되었습니다.", android.widget.Toast.LENGTH_SHORT).show()
|
||||
syncAllAlarms(this)
|
||||
updateCalendar()
|
||||
repo.updateRemainingAnnualLeave()
|
||||
}
|
||||
"직접 입력" -> {
|
||||
showCustomInputDialog(date, repo, team, factory)
|
||||
@@ -620,6 +661,7 @@ class MainActivity : AppCompatActivity() {
|
||||
updateCalendar()
|
||||
syncAllAlarms(this)
|
||||
android.widget.Toast.makeText(this, "${selected}(으)로 기록되었습니다. 알람이 해제됩니다.", android.widget.Toast.LENGTH_SHORT).show()
|
||||
repo.updateRemainingAnnualLeave()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
package com.example.shiftalarm
|
||||
|
||||
import androidx.room.*
|
||||
import androidx.room.Dao
|
||||
import androidx.room.Delete
|
||||
import androidx.room.Insert
|
||||
import androidx.room.OnConflictStrategy
|
||||
import androidx.room.Query
|
||||
import androidx.room.Update
|
||||
|
||||
@Dao
|
||||
interface ShiftDao {
|
||||
@@ -57,4 +62,17 @@ interface ShiftDao {
|
||||
|
||||
@Query("DELETE FROM custom_alarms")
|
||||
suspend fun clearCustomAlarms()
|
||||
|
||||
// Annual Leave Queries
|
||||
@Query("SELECT * FROM annual_leave WHERE id = 1")
|
||||
suspend fun getAnnualLeave(): AnnualLeave?
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
suspend fun insertAnnualLeave(annualLeave: AnnualLeave)
|
||||
|
||||
@Query("UPDATE annual_leave SET remainingDays = :remainingDays, updatedAt = :timestamp WHERE id = 1")
|
||||
suspend fun updateRemainingDays(remainingDays: Float, timestamp: Long = System.currentTimeMillis())
|
||||
|
||||
@Query("DELETE FROM annual_leave")
|
||||
suspend fun clearAnnualLeave()
|
||||
}
|
||||
|
||||
@@ -57,4 +57,47 @@ class ShiftRepository(private val context: Context) {
|
||||
suspend fun clearAllCustomAlarms() = withContext(Dispatchers.IO) {
|
||||
dao.clearCustomAlarms()
|
||||
}
|
||||
|
||||
// Annual Leave
|
||||
suspend fun calculateUsedAnnualLeave(): Float = withContext(Dispatchers.IO) {
|
||||
val currentYear = java.time.Year.now(java.time.ZoneId.of("Asia/Seoul")).toString()
|
||||
val overrides = dao.getAllOverrides()
|
||||
|
||||
var usedDays = 0f
|
||||
|
||||
for (override in overrides) {
|
||||
if (override.date.startsWith(currentYear)) {
|
||||
when (override.shift) {
|
||||
"연차" -> usedDays += 1f
|
||||
"반년" -> usedDays += 0.5f
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
usedDays
|
||||
}
|
||||
|
||||
suspend fun getAnnualLeave(): AnnualLeave? = withContext(Dispatchers.IO) {
|
||||
dao.getAnnualLeave()
|
||||
}
|
||||
|
||||
suspend fun recalculateAndSaveAnnualLeave(totalDays: Float) {
|
||||
val usedDays = calculateUsedAnnualLeave()
|
||||
val remainingDays = totalDays - usedDays
|
||||
|
||||
dao.insertAnnualLeave(AnnualLeave(
|
||||
id = 1,
|
||||
totalDays = totalDays,
|
||||
remainingDays = remainingDays
|
||||
))
|
||||
}
|
||||
|
||||
suspend fun updateRemainingAnnualLeave() {
|
||||
val annualLeave = dao.getAnnualLeave()
|
||||
annualLeave?.let {
|
||||
val usedDays = calculateUsedAnnualLeave()
|
||||
val remainingDays = it.totalDays - usedDays
|
||||
dao.insertAnnualLeave(it.copy(remainingDays = remainingDays))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
10
app/src/main/res/drawable/bg_custom_toast.xml
Normal file
10
app/src/main/res/drawable/bg_custom_toast.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<!-- 배경색: 다크모드에서도 잘 보이도록 surface 색상 사용 -->
|
||||
<solid android:color="#CC333333" />
|
||||
<corners android:radius="16dp" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/outline" />
|
||||
</shape>
|
||||
@@ -8,7 +8,7 @@
|
||||
<shape android:shape="oval">
|
||||
<stroke android:width="1.5dp" android:color="@color/shift_red"/>
|
||||
<solid android:color="@android:color/transparent"/>
|
||||
<size android:width="44dp" android:height="44dp"/>
|
||||
<size android:width="52dp" android:height="52dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/primary" />
|
||||
<size android:width="44dp" android:height="44dp" />
|
||||
<size android:width="52dp" android:height="52dp" />
|
||||
</shape>
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<stroke android:width="1.5dp" android:color="@color/primary" />
|
||||
<size android:width="44dp" android:height="44dp" />
|
||||
<size android:width="52dp" android:height="52dp" />
|
||||
</shape>
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="44dp"
|
||||
android:height="44dp"
|
||||
android:viewportWidth="44"
|
||||
android:viewportHeight="44">
|
||||
android:width="52dp"
|
||||
android:height="52dp"
|
||||
android:viewportWidth="52"
|
||||
android:viewportHeight="52">
|
||||
<!-- Left Half Red -->
|
||||
<path
|
||||
android:name="left_half"
|
||||
android:fillColor="@color/shift_red"
|
||||
android:pathData="M22,0 A22,22 0 0 0 22,44 L22,0 Z" />
|
||||
android:pathData="M26,0 A26,26 0 0 0 26,52 L26,0 Z" />
|
||||
|
||||
</vector>
|
||||
|
||||
@@ -58,12 +58,12 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- Maximized Calendar Card -->
|
||||
<!-- Maximized Calendar Card - Reduced margins for wider calendar -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/calendarCard"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:layout_marginHorizontal="4dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:cardCornerRadius="28dp"
|
||||
app:cardElevation="0dp"
|
||||
@@ -160,7 +160,20 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/btnTideLocation"/>
|
||||
app:layout_constraintEnd_toStartOf="@id/tvAnnualLeave"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAnnualLeave"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="연차: 0.0"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/primary"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_constraintEnd_toStartOf="@id/btnTideLocation"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/btnTideLocation"
|
||||
@@ -227,7 +240,7 @@
|
||||
android:id="@+id/otherTeamsCard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:layout_marginHorizontal="4dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:cardCornerRadius="20dp"
|
||||
app:cardElevation="0dp"
|
||||
@@ -261,5 +274,4 @@
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
20
app/src/main/res/layout/custom_toast.xml
Normal file
20
app/src/main/res/layout/custom_toast.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/bg_custom_toast"
|
||||
android:paddingHorizontal="20dp"
|
||||
android:paddingVertical="12dp"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/toastText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@android:color/white"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -29,7 +29,7 @@
|
||||
android:text="알람 추가"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/text_primary"
|
||||
android:layout_centerInParent="true"/>
|
||||
|
||||
<TextView
|
||||
@@ -80,7 +80,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="24dp"
|
||||
app:cardElevation="0dp"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardBackgroundColor="@color/surface"
|
||||
android:layout_marginBottom="16dp">
|
||||
|
||||
<LinearLayout
|
||||
@@ -116,7 +116,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="24dp"
|
||||
app:cardElevation="0dp"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardBackgroundColor="@color/surface"
|
||||
android:layout_marginBottom="16dp">
|
||||
<LinearLayout
|
||||
android:id="@+id/btnSelectSound"
|
||||
@@ -162,7 +162,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="24dp"
|
||||
app:cardElevation="0dp"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardBackgroundColor="@color/surface"
|
||||
android:layout_marginBottom="16dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -56,16 +56,32 @@
|
||||
<TextView android:id="@+id/btnYaMat" style="@style/ShiftCircleButton" android:text="야맞" android:textSize="13sp" android:textColor="@color/shift_yamat"/>
|
||||
|
||||
<!-- Row 2 -->
|
||||
<TextView android:id="@+id/btnOff" style="@style/ShiftCircleButton" android:text="휴" android:textColor="@color/shift_off"/>
|
||||
<TextView android:id="@+id/btnWolcha" style="@style/ShiftCircleButton" android:text="월차" android:textSize="13sp" android:textColor="@color/secondary"/>
|
||||
<TextView android:id="@+id/btnYeoncha" style="@style/ShiftCircleButton" android:text="연차" android:textSize="13sp" android:textColor="@color/secondary"/>
|
||||
<TextView android:id="@+id/btnBanwol" style="@style/ShiftCircleButton" android:text="반월" android:textSize="13sp" android:textColor="@color/shift_red"/>
|
||||
<TextView android:id="@+id/btnBannyeon" style="@style/ShiftCircleButton" android:text="반년" android:textSize="13sp" android:textColor="@color/shift_red"/>
|
||||
<TextView android:id="@+id/btnOff" style="@style/ShiftCircleButton" android:text="휴" android:textColor="@color/shift_off"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
<TextView android:id="@+id/btnWolcha" style="@style/ShiftCircleButton" android:text="월차" android:textSize="13sp" android:textColor="@color/secondary"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
<TextView android:id="@+id/btnYeoncha" style="@style/ShiftCircleButton" android:text="연차" android:textSize="13sp" android:textColor="@color/secondary"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
<TextView android:id="@+id/btnBanwol" style="@style/ShiftCircleButton" android:text="반월" android:textSize="13sp" android:textColor="@color/shift_red"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
<TextView android:id="@+id/btnBannyeon" style="@style/ShiftCircleButton" android:text="반년" android:textSize="13sp" android:textColor="@color/shift_red"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
|
||||
<!-- Row 3 -->
|
||||
<TextView android:id="@+id/btnEdu" style="@style/ShiftCircleButton" android:text="교육" android:textSize="13sp" android:textColor="@color/primary"/>
|
||||
<TextView android:id="@+id/btnReset" style="@style/ShiftCircleButton" android:text="초기" android:textSize="13sp" android:textColor="@color/text_secondary"/>
|
||||
<TextView android:id="@+id/btnManual" style="@style/ShiftCircleButton" android:text="직접" android:textSize="14sp" android:textColor="@color/shift_gray"/>
|
||||
<TextView android:id="@+id/btnEdu" style="@style/ShiftCircleButton" android:text="교육" android:textSize="13sp" android:textColor="@color/primary"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
<TextView android:id="@+id/btnReset" style="@style/ShiftCircleButton" android:text="초기" android:textSize="13sp" android:textColor="@color/text_secondary"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
<TextView android:id="@+id/btnManual" style="@style/ShiftCircleButton" android:text="직접" android:textSize="14sp" android:textColor="@color/shift_gray"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
|
||||
<androidx.constraintlayout.helper.widget.Flow
|
||||
android:id="@+id/gridFlow"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
android:text="날짜 이동"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/text_primary"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:layout_gravity="center_horizontal"/>
|
||||
|
||||
|
||||
@@ -361,5 +361,17 @@
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- App Version -->
|
||||
<TextView
|
||||
android:id="@+id/tvAppVersion"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="버전 1.4.0"
|
||||
android:textColor="@color/text_tertiary"
|
||||
android:textSize="12sp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="16dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
@@ -1,36 +1,135 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="24dp"
|
||||
android:gravity="center">
|
||||
android:fillViewport="true">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:src="@drawable/ic_settings"
|
||||
app:tint="@color/text_tertiary"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:alpha="0.5"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="실험실 기능 준비 중"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
android:orientation="vertical"
|
||||
android:padding="24dp"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="더욱 편리한 기능을 개발하고 있습니다.\n다음 업데이트를 기대해 주세요!"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/text_tertiary"
|
||||
android:gravity="center"
|
||||
android:lineSpacingExtra="4dp"/>
|
||||
<!-- Header Title -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="나의 연차 설정"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/text_primary"
|
||||
android:layout_marginBottom="32dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
<!-- Total Annual Leave Setting -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="24dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="4dp"
|
||||
app:cardBackgroundColor="@color/surface">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="24dp"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="총 연차"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:layout_marginBottom="16dp"/>
|
||||
|
||||
<!-- NumberPicker for Total Days -->
|
||||
<NumberPicker
|
||||
android:id="@+id/npTotalDays"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="일"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/text_tertiary"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- Remaining Annual Leave Display -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="32dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="4dp"
|
||||
app:cardBackgroundColor="@color/surface">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="24dp"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="남은 연차"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvRemainingDays"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0.0"
|
||||
android:textSize="36sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/primary"
|
||||
android:layout_marginBottom="4dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="일"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/text_tertiary"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- Calculation Info -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="※ 연차: -1일 차감 / 반년: -0.5일 차감"
|
||||
android:textSize="13sp"
|
||||
android:textColor="@color/text_tertiary"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:gravity="center"/>
|
||||
|
||||
<!-- Save Button -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnSaveAnnualLeave"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:text="저장"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:cornerRadius="12dp"
|
||||
android:backgroundTint="@color/primary"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/dayRoot"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="92dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="72dp"
|
||||
android:background="@drawable/bg_grid_cell_v4">
|
||||
|
||||
<!-- Day Number (top-left) -->
|
||||
@@ -16,7 +17,7 @@
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="12"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="14sp"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -35,21 +36,21 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- Shift Abbreviation Circular Indicator (Center) -->
|
||||
<!-- Shift Abbreviation Circular Indicator (Center) - Larger size -->
|
||||
<TextView
|
||||
android:id="@+id/shiftChar"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:gravity="center"
|
||||
android:text="주"
|
||||
android:textSize="15sp"
|
||||
android:textSize="17sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/text_primary"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintVertical_bias="0.45"/>
|
||||
app:layout_constraintVertical_bias="0.42"/>
|
||||
|
||||
<!-- Memo Content Text (Below Shift) - Replacing icon logic for visibility -->
|
||||
<TextView
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">shiftring</string>
|
||||
<string name="app_name">Shift Alarm</string>
|
||||
<string name="team_selection">Team selection</string>
|
||||
<string name="current_shift">Current shift: %1$s</string>
|
||||
<string name="next_shift">Next shift: %1$s</string>
|
||||
<string name="alarm_status">Alarm Status</string>
|
||||
<string name="company_selection">Company selection</string>
|
||||
<string name="tab_basic">Basic Settings</string>
|
||||
<string name="tab_alarm">Alarm Settings</string>
|
||||
<string name="tab_additional">Extras</string>
|
||||
<string name="tab_lab">Leave Management</string>
|
||||
<string-array name="factory_array">
|
||||
<item>Jeonju</item>
|
||||
<item>Nonsan</item>
|
||||
</string-array>
|
||||
<string-array name="team_array">
|
||||
<item>A Team</item>
|
||||
<item>B Team</item>
|
||||
<item>C Team</item>
|
||||
<item>D Team</item>
|
||||
</string-array>
|
||||
<string-array name="theme_array">
|
||||
<item>System Settings</item>
|
||||
<item>Light</item>
|
||||
<item>Dark</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<string name="tab_basic">기본 설정</string>
|
||||
<string name="tab_alarm">알람 설정</string>
|
||||
<string name="tab_additional">부가기능</string>
|
||||
<string name="tab_lab">실험실</string>
|
||||
<string name="tab_lab">휴가 관리</string>
|
||||
|
||||
<string-array name="factory_array">
|
||||
<item>전주</item>
|
||||
|
||||
107
docs/gitlab-wiki-guide.md
Normal file
107
docs/gitlab-wiki-guide.md
Normal file
@@ -0,0 +1,107 @@
|
||||
# GitLab Wiki 설정 가이드
|
||||
|
||||
## 개요
|
||||
|
||||
GitLab Wiki는 저장소와 별도로 관리되며, 마크다운 파일로 작성합니다.
|
||||
|
||||
## 시작하기
|
||||
|
||||
### 1. Wiki 저장소 클론
|
||||
|
||||
```bash
|
||||
git clone git@git.webpluss.net:username/project.wiki.git
|
||||
cd project.wiki
|
||||
```
|
||||
|
||||
### 2. 마크다운 파일 작성
|
||||
|
||||
```bash
|
||||
touch my-page.md
|
||||
# 마크다운 작성 후
|
||||
git add .
|
||||
git commit -m "Add wiki page"
|
||||
git push
|
||||
```
|
||||
|
||||
## SSH 키 설정 (권장)
|
||||
|
||||
### 1. SSH 키 생성 (없는 경우)
|
||||
|
||||
```bash
|
||||
ssh-keygen -t ed25519 -C "your_email@example.com"
|
||||
```
|
||||
|
||||
### 2. GitLab에 SSH 키 추가
|
||||
|
||||
- GitLab → Settings → SSH Keys
|
||||
- `~/.ssh/id_ed25519.pub` 내용 복사해서 추가
|
||||
|
||||
### 3. remote 설정
|
||||
|
||||
```bash
|
||||
git remote set-url origin git@git.webpluss.net:username/project.git
|
||||
```
|
||||
|
||||
## HTTPS 사용 시 (토큰 방식)
|
||||
|
||||
### 1. Personal Access Token 생성
|
||||
|
||||
- GitLab → Settings → Access Tokens
|
||||
- 이름: `git_push`
|
||||
- 스코프: `api`
|
||||
- 만료일: 적절히 설정
|
||||
|
||||
### 2. 토큰으로 푸시
|
||||
|
||||
```bash
|
||||
git remote set-url origin https://username:TOKEN@git.webpluss.net/username/project.git
|
||||
git push -u origin main
|
||||
```
|
||||
|
||||
### 3. 토큰 숨기기 (보안)
|
||||
|
||||
```bash
|
||||
# URL에서 토큰 제거
|
||||
git remote set-url origin https://username@git.webpluss.net/username/project.git
|
||||
|
||||
# credential.helper로 토큰 저장
|
||||
git config credential.helper store
|
||||
|
||||
# 이후 푸시 시 토큰 자동 입력됨
|
||||
git push
|
||||
```
|
||||
|
||||
## 저장소 내 문서 폴더 방식
|
||||
|
||||
Wiki 저장소 접근이 어려운 경우, `docs/` 폴더를 사용할 수 있습니다.
|
||||
|
||||
```bash
|
||||
mkdir docs
|
||||
echo "# 프로젝트 문서" > docs/home.md
|
||||
git add docs/
|
||||
git commit -m "Add documentation"
|
||||
git push
|
||||
```
|
||||
|
||||
## 마크다운 문법
|
||||
|
||||
```markdown
|
||||
# 제목
|
||||
## 부제목
|
||||
|
||||
- 목록 项
|
||||
- [링크](url)
|
||||
|
||||
**굵게** *기울임*
|
||||
|
||||
코드:
|
||||
```javascript
|
||||
console.log('hello');
|
||||
```
|
||||
```
|
||||
|
||||
## 참고
|
||||
|
||||
- GitLab Wiki는 `.md` 파일만 지원
|
||||
- 파일명이 페이지 URL이 됨 (home.md → /home)
|
||||
- 사이드바는 GitLab이 자동으로 생성
|
||||
13
docs/home.md
Normal file
13
docs/home.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# ShiftRing 위키에 오신 것을 환영합니다
|
||||
|
||||
이곳은 프로젝트 문서를 작성하는 공간입니다.
|
||||
|
||||
## 목차
|
||||
|
||||
- [시작하기](getting-started)
|
||||
- [API 문서](api-reference)
|
||||
- [설치 방법](installation)
|
||||
|
||||
## 기여하기
|
||||
|
||||
문서 수정에 기여하고 싶으시다면 PR을 보내주세요.
|
||||
@@ -1,6 +1,6 @@
|
||||
# Release signing configuration
|
||||
# You should keep this file out of version control
|
||||
storePassword=my-password
|
||||
keyAlias=my-alias
|
||||
keyPassword=my-password
|
||||
storeFile=../release.jks
|
||||
# Release signing configuration
|
||||
# You should keep this file out of version control
|
||||
storePassword=my-password
|
||||
keyAlias=my-alias
|
||||
keyPassword=my-password
|
||||
storeFile=../release.jks
|
||||
|
||||
12
version.json
12
version.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"versionCode": 1119,
|
||||
"versionName": "1.1.9",
|
||||
"apkUrl": "https://git.webpluss.net/sanjeok77/ShiftRing/releases/download/v1.1.9/app.apk",
|
||||
"changelog": "v1.1.9: version.json URL 수정 (서버 연결 실패 해결)",
|
||||
"forceUpdate": false
|
||||
}
|
||||
"versionCode": 1142,
|
||||
"versionName": "1.4.2",
|
||||
"apkUrl": "https://git.webpluss.net/attachments/96025498-3f84-4410-9f13-7cdd559ef60e",
|
||||
"changelog": "v1.4.2: 달력 5행/6행 스크롤 수정, 토스트 다크모드 완전 지원, 연차 설정 UI 개선",
|
||||
"forceUpdate": false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user