Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a356b3c581 | ||
|
|
2f7361bbc9 |
@@ -20,8 +20,8 @@ android {
|
|||||||
applicationId = "com.example.shiftalarm"
|
applicationId = "com.example.shiftalarm"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 108
|
versionCode = 110
|
||||||
versionName = "1.0.8"
|
versionName = "1.1.0"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||||
<uses-permission android:name="android.permission.VIBRATE" />
|
<uses-permission android:name="android.permission.VIBRATE" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
@@ -93,6 +94,16 @@
|
|||||||
android:foregroundServiceType="mediaPlayback"
|
android:foregroundServiceType="mediaPlayback"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
|
|
||||||
|
<provider
|
||||||
|
android:name="androidx.core.content.FileProvider"
|
||||||
|
android:authorities="${applicationId}.provider"
|
||||||
|
android:exported="false"
|
||||||
|
android:grantUriPermissions="true">
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||||
|
android:resource="@xml/provider_paths" />
|
||||||
|
</provider>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -108,16 +108,7 @@ object AppUpdateManager {
|
|||||||
|
|
||||||
btnNow.setOnClickListener {
|
btnNow.setOnClickListener {
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
try {
|
downloadAndInstallApk(activity, apkUrl, version)
|
||||||
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(apkUrl)).apply {
|
|
||||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
|
||||||
}
|
|
||||||
activity.startActivity(intent)
|
|
||||||
Toast.makeText(activity, "최신 버전 다운로드 페이지로 이동합니다.", Toast.LENGTH_SHORT).show()
|
|
||||||
} catch (e: Exception) {
|
|
||||||
e.printStackTrace()
|
|
||||||
Toast.makeText(activity, "다운로드 링크 열기 실패: ${e.message}", Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.show()
|
dialog.show()
|
||||||
@@ -125,4 +116,100 @@ object AppUpdateManager {
|
|||||||
val width = (activity.resources.displayMetrics.widthPixels * 0.88).toInt()
|
val width = (activity.resources.displayMetrics.widthPixels * 0.88).toInt()
|
||||||
dialog.window?.setLayout(width, android.view.ViewGroup.LayoutParams.WRAP_CONTENT)
|
dialog.window?.setLayout(width, android.view.ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun downloadAndInstallApk(activity: Activity, apkUrl: String, version: String) {
|
||||||
|
if (activity.isFinishing || activity.isDestroyed) return
|
||||||
|
|
||||||
|
val view = LayoutInflater.from(activity).inflate(R.layout.dialog_update_progress_oneui, null)
|
||||||
|
val tvSub = view.findViewById<TextView>(R.id.tvProgressSub)
|
||||||
|
val progressBar = view.findViewById<ProgressBar>(R.id.downloadProgressBar)
|
||||||
|
val tvPercent = view.findViewById<TextView>(R.id.tvProgressPercent)
|
||||||
|
|
||||||
|
tvSub.text = "v$version 다운로드 중..."
|
||||||
|
|
||||||
|
val progressDialog = AlertDialog.Builder(activity)
|
||||||
|
.setView(view)
|
||||||
|
.setCancelable(false)
|
||||||
|
.create()
|
||||||
|
|
||||||
|
progressDialog.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
||||||
|
progressDialog.show()
|
||||||
|
|
||||||
|
val width = (activity.resources.displayMetrics.widthPixels * 0.88).toInt()
|
||||||
|
progressDialog.window?.setLayout(width, android.view.ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||||
|
|
||||||
|
Thread {
|
||||||
|
try {
|
||||||
|
val url = URL(apkUrl)
|
||||||
|
val connection = url.openConnection() as HttpURLConnection
|
||||||
|
connection.connectTimeout = 15000
|
||||||
|
connection.readTimeout = 15000
|
||||||
|
connection.requestMethod = "GET"
|
||||||
|
connection.connect()
|
||||||
|
|
||||||
|
val fileLength = connection.contentLength
|
||||||
|
val inputStream = BufferedInputStream(connection.inputStream)
|
||||||
|
|
||||||
|
val apkFile = File(activity.cacheDir, "update.apk")
|
||||||
|
val outputStream = FileOutputStream(apkFile)
|
||||||
|
|
||||||
|
val buffer = ByteArray(8192)
|
||||||
|
var total: Long = 0
|
||||||
|
var count: Int
|
||||||
|
|
||||||
|
while (inputStream.read(buffer).also { count = it } != -1) {
|
||||||
|
total += count
|
||||||
|
outputStream.write(buffer, 0, count)
|
||||||
|
|
||||||
|
if (fileLength > 0) {
|
||||||
|
val progress = (total * 100 / fileLength).toInt()
|
||||||
|
activity.runOnUiThread {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
|
progressBar.setProgress(progress, true)
|
||||||
|
} else {
|
||||||
|
progressBar.progress = progress
|
||||||
|
}
|
||||||
|
tvPercent.text = "$progress%"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
outputStream.flush()
|
||||||
|
outputStream.close()
|
||||||
|
inputStream.close()
|
||||||
|
connection.disconnect()
|
||||||
|
|
||||||
|
activity.runOnUiThread {
|
||||||
|
progressDialog.dismiss()
|
||||||
|
installApk(activity, apkFile)
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
|
activity.runOnUiThread {
|
||||||
|
progressDialog.dismiss()
|
||||||
|
Toast.makeText(activity, "다운로드 실패: ${e.message}", Toast.LENGTH_LONG).show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun installApk(activity: Activity, apkFile: File) {
|
||||||
|
try {
|
||||||
|
val apkUri = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
|
FileProvider.getUriForFile(activity, "${activity.packageName}.provider", apkFile)
|
||||||
|
} else {
|
||||||
|
Uri.fromFile(apkFile)
|
||||||
|
}
|
||||||
|
|
||||||
|
val intent = Intent(Intent.ACTION_VIEW).apply {
|
||||||
|
setDataAndType(apkUri, "application/vnd.android.package-archive")
|
||||||
|
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_GRANT_READ_URI_PERMISSION
|
||||||
|
}
|
||||||
|
activity.startActivity(intent)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
|
Toast.makeText(activity, "설치 실패: ${e.message}", Toast.LENGTH_LONG).show()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,9 +63,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(binding.root) { v, insets ->
|
ViewCompat.setOnApplyWindowInsetsListener(binding.root) { v, insets ->
|
||||||
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||||
val density = resources.displayMetrics.density
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
||||||
val p = (8 * density).toInt()
|
|
||||||
v.setPadding(systemBars.left + p, systemBars.top + p, systemBars.right + p, systemBars.bottom + p)
|
|
||||||
insets
|
insets
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
android:id="@+id/headerRoot"
|
android:id="@+id/headerRoot"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="12dp"
|
android:paddingTop="2dp"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="4dp"
|
||||||
android:paddingHorizontal="20dp"
|
android:paddingHorizontal="20dp"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
@@ -35,7 +35,8 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="오늘의 근무"
|
android:text="오늘의 근무"
|
||||||
android:textSize="13sp"
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
android:textColor="@color/text_secondary"
|
android:textColor="@color/text_secondary"
|
||||||
android:fontFamily="sans-serif-medium"
|
android:fontFamily="sans-serif-medium"
|
||||||
android:layout_marginStart="12dp"
|
android:layout_marginStart="12dp"
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:paddingTop="32dp"
|
android:paddingTop="4dp"
|
||||||
android:paddingBottom="16dp"
|
android:paddingBottom="8dp"
|
||||||
android:paddingStart="24dp"
|
android:paddingStart="24dp"
|
||||||
android:paddingEnd="24dp"
|
android:paddingEnd="24dp"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
|||||||
@@ -139,8 +139,7 @@
|
|||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:background="@drawable/bg_spinner_oneui"
|
android:background="@drawable/bg_spinner_oneui"
|
||||||
android:popupBackground="@drawable/bg_spinner_popup_oneui"
|
android:popupBackground="@drawable/bg_spinner_popup_oneui"
|
||||||
android:dropDownVerticalOffset="6dp"
|
android:dropDownVerticalOffset="6dp"/>
|
||||||
android:paddingStart="12dp"/>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|||||||
@@ -25,13 +25,13 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="전체 알람 켜짐"
|
android:text="전체 알람 켜짐"
|
||||||
android:textSize="13sp"
|
android:textSize="16sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:textColor="@color/primary"
|
android:textColor="@color/primary"
|
||||||
android:background="@drawable/bg_glass_pill_v4"
|
android:background="@drawable/bg_glass_pill_v4"
|
||||||
android:backgroundTint="#F2F2F7"
|
android:backgroundTint="#F2F2F7"
|
||||||
android:paddingHorizontal="12dp"
|
android:paddingHorizontal="16dp"
|
||||||
android:paddingVertical="6dp"
|
android:paddingVertical="8dp"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"/>
|
android:focusable="true"/>
|
||||||
|
|
||||||
|
|||||||
@@ -75,8 +75,7 @@
|
|||||||
android:entries="@array/factory_array"
|
android:entries="@array/factory_array"
|
||||||
android:background="@drawable/bg_spinner_oneui"
|
android:background="@drawable/bg_spinner_oneui"
|
||||||
android:popupBackground="@drawable/bg_spinner_popup_oneui"
|
android:popupBackground="@drawable/bg_spinner_popup_oneui"
|
||||||
android:dropDownVerticalOffset="6dp"
|
android:dropDownVerticalOffset="6dp"/>
|
||||||
android:paddingStart="12dp"/>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
@@ -121,8 +120,7 @@
|
|||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:background="@drawable/bg_spinner_oneui"
|
android:background="@drawable/bg_spinner_oneui"
|
||||||
android:popupBackground="@drawable/bg_spinner_popup_oneui"
|
android:popupBackground="@drawable/bg_spinner_popup_oneui"
|
||||||
android:dropDownVerticalOffset="6dp"
|
android:dropDownVerticalOffset="6dp"/>
|
||||||
android:paddingStart="12dp"/>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|||||||
@@ -86,8 +86,7 @@
|
|||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:background="@drawable/bg_spinner_oneui"
|
android:background="@drawable/bg_spinner_oneui"
|
||||||
android:popupBackground="@drawable/bg_spinner_popup_oneui"
|
android:popupBackground="@drawable/bg_spinner_popup_oneui"
|
||||||
android:dropDownVerticalOffset="6dp"
|
android:dropDownVerticalOffset="6dp"/>
|
||||||
android:paddingStart="12dp"/>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
android:id="@android:id/text1"
|
android:id="@android:id/text1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:gravity="center_vertical|end"
|
android:gravity="center"
|
||||||
android:paddingStart="12dp"
|
android:textAlignment="center"
|
||||||
android:paddingEnd="16dp"
|
android:paddingHorizontal="4dp"
|
||||||
android:textColor="@color/text_primary"
|
android:textColor="@color/text_primary"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
|
|||||||
+13
-14
@@ -6,18 +6,17 @@ import shutil
|
|||||||
|
|
||||||
token = "e3b515eaa0a6683c921ca3bf718e281ed30a6075"
|
token = "e3b515eaa0a6683c921ca3bf718e281ed30a6075"
|
||||||
owner_repo = "sanjeok77/ShiftRing"
|
owner_repo = "sanjeok77/ShiftRing"
|
||||||
tag = "v1.0.8"
|
tag = "v1.1.0"
|
||||||
title = "v1.0.8 - 시스템 권한 설정 토글 시 앱 자동 즉시 복귀, 달력 상단 근무 텍스트 컬러화 및 최신 버전 확인 아이콘 개편"
|
title = "v1.1.0 - 오늘의 근무 폰트 확대, 설정 드롭박스 텍스트 중앙 정렬 및 전체 알람 켜짐 타이포 크기 일원화"
|
||||||
body = """## 🚀 ShiftRing v1.0.8 릴리즈
|
body = """## 🚀 ShiftRing v1.1.0 릴리즈
|
||||||
|
|
||||||
### 🌟 주요 변경 및 개선 사항
|
### 🌟 주요 변경 및 개선 사항
|
||||||
1. **🔄 시스템 권한 설정 시 '뒤로가기 없이' 앱 즉시 자동 복귀 (`AlarmPermissionUtil.kt`, `FragmentSettingsBasic.kt`)**:
|
1. **🔍 메인 화면 '오늘의 근무' 폰트 크기 확대 (`activity_main.xml`)**:
|
||||||
- 전체화면 알림, 정확한 알람, 배터리 최적화 등 시스템 설정 화면에서 권한 토글을 켜면 앱이 실시간으로 권한 부여를 감지하여 뒤로가기를 누르지 않아도 즉각 ShiftRing 앱 화면으로 자동 복귀하도록 구현
|
- 기존의 작은 폰트(13sp)에서 교대링 로고(24sp)와 조화를 이루는 18sp 볼드 폰트로 시원하게 확대하여 한눈에 오늘의 근무를 확인할 수 있도록 개선
|
||||||
2. **🏷️ 달력 상단 '오늘의 근무' 레이블 및 색상 정밀 개편 (`MainActivity.kt`)**:
|
2. **🎯 설정 탭 드롭박스(근무 회사, 나의 근무 반, 테마, 총 연차) 텍스트 중앙 정렬 (`spinner_item_oneui.xml`, 각 설정 레이아웃)**:
|
||||||
- 불필요하던 `(내 반)` 텍스트를 완전히 제거
|
- 우측으로 치우쳐 표시되던 스피너 선택 텍스트를 완벽한 중앙 정렬(`gravity="center"`, `textAlignment="center"`)로 정돈하여 깔끔한 One UI 룩앤필 완성
|
||||||
- `오늘의 근무: 휴무`, `오늘의 근무: 주간` 등의 텍스트에서 근무 명칭(휴무, 주간, 석간, 야간 등)에 고유의 근무 색상(빨강, 노랑, 청록, 검정 등) 및 볼드 스타일을 정밀하게 적용
|
3. **⏰ 알람 설정 '전체 알람 켜짐' 폰트 크기 일원화 (`fragment_settings_alarm.xml`)**:
|
||||||
3. **🔄 기본 설정 탭 '최신 버전 확인' 아이콘 전면 개편 (`fragment_settings_basic.xml`, `ic_update.xml`)**:
|
- 기존 13sp에서 그룹 타이틀('주간 알람' 16sp)과 완벽히 동일한 16sp 볼드 타이포그래피로 통일하여 시각적 위계와 터치 편의성 극대화"""
|
||||||
- 기존 벨 아이콘 대신 전용 업데이트/동기화 벡터 아이콘(`ic_update`, 인디고 `#5856D6`)을 적용하여 설정 UI 일관성 완성"""
|
|
||||||
|
|
||||||
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):
|
||||||
@@ -55,10 +54,10 @@ print("Updated app.apk at project root.")
|
|||||||
|
|
||||||
# Update version.json
|
# Update version.json
|
||||||
v_info = {
|
v_info = {
|
||||||
"versionCode": 108,
|
"versionCode": 110,
|
||||||
"versionName": "1.0.8",
|
"versionName": "1.1.0",
|
||||||
"apkUrl": direct_url,
|
"apkUrl": direct_url,
|
||||||
"changelog": "v1.0.8: 권한 설정 시 앱 자동 복귀, 달력 상단 근무 색상 적용, 최신 버전 확인 아이콘 개편",
|
"changelog": "v1.1.0: 오늘의 근무 폰트 확대, 설정 드롭박스 텍스트 중앙 정렬, 전체 알람 타이포 통일",
|
||||||
"forceUpdate": False
|
"forceUpdate": False
|
||||||
}
|
}
|
||||||
with open("version.json", "w", encoding="utf-8") as f:
|
with open("version.json", "w", encoding="utf-8") as f:
|
||||||
@@ -70,7 +69,7 @@ print(f"Updated version.json with apkUrl: {direct_url}")
|
|||||||
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.0.8 - 시스템 권한 설정 토글 시 앱 자동 즉시 복귀, 달력 상단 근무 텍스트 컬러화 및 최신 버전 확인 아이콘 개편"
|
commit_msg = "v1.1.0 - 오늘의 근무 폰트 확대, 설정 드롭박스 텍스트 중앙 정렬 및 전체 알람 켜짐 타이포 크기 일원화"
|
||||||
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": 108,
|
"versionCode": 110,
|
||||||
"versionName": "1.0.8",
|
"versionName": "1.1.0",
|
||||||
"apkUrl": "https://git.webpluss.net/attachments/184d5d36-cd76-4505-af83-abe97534f62f",
|
"apkUrl": "https://git.webpluss.net/attachments/a7d302ab-914c-4152-9aa5-b6efaec7c0a6",
|
||||||
"changelog": "v1.0.8: 권한 설정 시 앱 자동 복귀, 달력 상단 근무 색상 적용, 최신 버전 확인 아이콘 개편",
|
"changelog": "v1.1.0: 오늘의 근무 폰트 확대, 설정 드롭박스 텍스트 중앙 정렬, 전체 알람 타이포 통일",
|
||||||
"forceUpdate": false
|
"forceUpdate": false
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user