Skip to content

Commit c022c60

Browse files
Merge pull request #8 from meticha/fix/readme
Docs: Enhance Alarm UI example and update README
2 parents 5c44645 + 7f9a873 commit c022c60

File tree

3 files changed

+56
-24
lines changed

3 files changed

+56
-24
lines changed

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99

1010
env:
11-
VERSION_NAME: 0.0.1 # Update this value for each release
11+
VERSION_NAME: 0.0.2 # Update this value for each release
1212

1313
jobs:
1414
release:

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 54 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ It simplifies scheduling exact alarms and showing user-facing UIs at a specific
1010
your app has been killed or without you managing foreground-service boilerplate, wake-locks, or
1111
lock-screen flags.
1212

13-
1413
## Example
14+
1515
<p>
1616
<img src="triggerx_example.gif" alt="TriggerX Example" height="500">
1717
</p>
@@ -147,27 +147,52 @@ TriggerXAlarmScheduler().scheduleAlarm(
147147
## 🧩 Create your Alarm UI
148148

149149
```kotlin
150-
class MyAlarmActivity : TriggerXAlarmActivity() {
150+
class AppAlarmActivity : TriggerXActivity() {
151151

152152
@Composable
153153
override fun AlarmContent() {
154-
val data = intent.getBundleExtra("ALARM_DATA")
155-
val title = data?.getString("title") ?: "No Title"
156-
val location = data?.getString("location") ?: "No Location"
157-
158-
Column(
159-
modifier = Modifier
160-
.fillMaxSize()
161-
.padding(16.dp),
162-
verticalArrangement = Arrangement.Center,
163-
horizontalAlignment = Alignment.CenterHorizontally
154+
val bundle = remember { intent?.getBundleExtra("ALARM_DATA") }
155+
val title = bundle?.getString("title") ?: "empty title"
156+
val location = bundle?.getString("location")
157+
Box(
158+
modifier = Modifier.fillMaxSize()
164159
) {
165-
Text(title, fontSize = 28.sp, fontWeight = FontWeight.Bold)
166-
Text(location, fontSize = 18.sp)
167-
Spacer(Modifier.height(32.dp))
168-
Row(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
169-
Button(onClick = ::finish) { Text("Dismiss") }
170-
Button(onClick = { /* Snooze */ }) { Text("Snooze") }
160+
Column(
161+
modifier = Modifier
162+
.fillMaxSize()
163+
.background(
164+
color = Color.White,
165+
shape = RoundedCornerShape(32.dp)
166+
)
167+
.padding(32.dp),
168+
verticalArrangement = Arrangement.Center,
169+
horizontalAlignment = Alignment.CenterHorizontally
170+
) {
171+
Icon(
172+
imageVector = Icons.Default.Notifications,
173+
contentDescription = "Trigger Icon",
174+
tint = Color(0xFF111111),
175+
modifier = Modifier.size(80.dp)
176+
)
177+
178+
Spacer(modifier = Modifier.height(24.dp))
179+
180+
Text(
181+
text = title,
182+
fontSize = 42.sp,
183+
fontWeight = FontWeight.Bold,
184+
color = Color(0xFF111111)
185+
)
186+
187+
Spacer(modifier = Modifier.height(12.dp))
188+
189+
Text(
190+
text = location ?: "empty location",
191+
fontSize = 20.sp,
192+
fontWeight = FontWeight.Medium,
193+
color = Color(0xFF333333),
194+
textAlign = TextAlign.Center
195+
)
171196
}
172197
}
173198
}
@@ -359,14 +384,20 @@ TriggerXAlarmScheduler().cancelAlarm(this, alarmId = 1)
359384

360385
## 📄 License
361386

362-
```xml
363-
Designed and developed by 2025 Meticha
387+
```
388+
Copyright 2025 Meticha
364389
365-
Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at
390+
Licensed under the Apache License, Version 2.0 (the "License");
391+
you may not use this file except in compliance with the License.
392+
You may obtain a copy of the License at
366393
367-
http://www.apache.org/licenses/LICENSE-2.0
394+
http://www.apache.org/licenses/LICENSE-2.0
368395
369-
Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
396+
Unless required by applicable law or agreed to in writing, software
397+
distributed under the License is distributed on an "AS IS" BASIS,
398+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
399+
See the License for the specific language governing permissions and
400+
limitations under the License.
370401
```
371402

372403
If TriggerX saves you time, consider giving the repo a ⭐ on GitHub.

0 commit comments

Comments
 (0)