Skip to content

Commit 5d49a11

Browse files
committed
Release v1.1.2
1 parent 659ae43 commit 5d49a11

37 files changed

Lines changed: 73 additions & 400 deletions

File tree

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ android {
1111
applicationId = "com.brittytino.patchwork"
1212
minSdk = 26
1313
targetSdk = 36
14-
versionCode = 32
15-
versionName = "1.1.1"
14+
versionCode = 33
15+
versionName = "1.1.2"
1616

1717
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
1818
}

app/src/main/java/com/brittytino/patchwork/AppUpdatesActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ class AppUpdatesActivity : FragmentActivity() {
190190
if (repoToShowReleaseNotesFullName != null) {
191191
val repo = trackedRepos.find { it.fullName == repoToShowReleaseNotesFullName }
192192
if (repo != null) {
193-
val isNotesLoading = repo.latestReleaseBody.isNullOrBlank()
193+
val isNotesLoading = repo.latestReleaseBody == null
194194
UpdateBottomSheet(
195195
updateInfo = com.brittytino.patchwork.domain.model.UpdateInfo(
196196
versionName = repo.latestTagName,

app/src/main/java/com/brittytino/patchwork/domain/DIYTabs.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import androidx.annotation.StringRes
44
import com.brittytino.patchwork.R
55

66
enum class DIYTabs(@StringRes val title: Int, val subtitle: Any, val iconRes: Int) {
7-
ESSENTIALS(R.string.tab_essentials, if (com.brittytino.patchwork.BuildConfig.DEBUG) "=^._.^= ∫ Debug" else "=^..^=", R.drawable.ic_stat_name),
7+
ESSENTIALS(R.string.tab_essentials, if (com.brittytino.patchwork.BuildConfig.DEBUG) "^._.^" else "=^..^=", R.drawable.ic_stat_name),
88
FREEZE(R.string.tab_freeze, R.string.tab_freeze_subtitle, R.drawable.rounded_mode_cool_24),
99
DIY(R.string.tab_diy, R.string.tab_diy_subtitle, R.drawable.rounded_experiment_24),
1010
APPS(R.string.tab_apps, R.string.tab_apps_subtitle, R.drawable.rounded_apps_24)

app/src/main/java/com/brittytino/patchwork/ui/components/dialogs/AboutSection.kt

Lines changed: 7 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import android.content.Intent
55
import android.util.Log
66
import android.widget.Toast
77
import androidx.compose.foundation.ExperimentalFoundationApi
8-
import androidx.compose.foundation.Image
9-
import androidx.compose.foundation.background
108
import androidx.compose.foundation.combinedClickable
119
import androidx.compose.foundation.layout.Arrangement
1210
import androidx.compose.foundation.layout.Column
@@ -16,7 +14,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
1614
import androidx.compose.foundation.layout.padding
1715
import androidx.compose.foundation.layout.size
1816
import androidx.compose.foundation.layout.width
19-
import androidx.compose.foundation.shape.RoundedCornerShape
2017
import androidx.compose.material3.Button
2118
import androidx.compose.material3.Icon
2219
import androidx.compose.material3.MaterialTheme
@@ -26,8 +23,6 @@ import androidx.compose.material3.Text
2623
import androidx.compose.runtime.Composable
2724
import androidx.compose.ui.Alignment
2825
import androidx.compose.ui.Modifier
29-
import androidx.compose.ui.draw.clip
30-
import androidx.compose.ui.layout.ContentScale
3126
import androidx.compose.ui.platform.LocalContext
3227
import androidx.compose.ui.res.painterResource
3328
import androidx.compose.ui.res.stringResource
@@ -41,7 +36,6 @@ import com.brittytino.patchwork.R
4136
fun AboutSection(
4237
modifier: Modifier = Modifier,
4338
appName: String = stringResource(R.string.app_name),
44-
developerName: String = stringResource(R.string.app_developer_name),
4539
description: String = stringResource(R.string.app_description),
4640
onAvatarLongClick: () -> Unit = {}
4741
) {
@@ -53,8 +47,7 @@ fun AboutSection(
5347
}
5448

5549
Surface(
56-
modifier = modifier
57-
.fillMaxWidth(),
50+
modifier = modifier.fillMaxWidth(),
5851
shape = MaterialTheme.shapes.medium,
5952
color = MaterialTheme.colorScheme.surfaceBright
6053
) {
@@ -70,26 +63,14 @@ fun AboutSection(
7063
textAlign = TextAlign.Center
7164
)
7265

73-
Image(
74-
painter = painterResource(id = R.drawable.avatar),
75-
contentDescription = "Developer Avatar",
76-
contentScale = ContentScale.Crop,
77-
modifier = Modifier
78-
.size(120.dp)
79-
.clip(RoundedCornerShape(16.dp))
80-
.background(MaterialTheme.colorScheme.primary)
81-
.combinedClickable(
82-
onClick = {},
83-
onLongClick = {
84-
onAvatarLongClick()
85-
}
86-
)
87-
)
88-
8966
Text(
90-
text = stringResource(R.string.developed_by_format, developerName),
67+
text = stringResource(R.string.developed_by_format),
9168
style = MaterialTheme.typography.titleMedium,
92-
textAlign = TextAlign.Center
69+
textAlign = TextAlign.Center,
70+
modifier = Modifier.combinedClickable(
71+
onClick = {},
72+
onLongClick = onAvatarLongClick
73+
)
9374
)
9475

9576
FlowRow(
@@ -134,7 +115,6 @@ fun AboutSection(
134115

135116
OutlinedButton(
136117
onClick = {
137-
// Use mailto: URI so the system opens an email client
138118
val mailUri = "mailto:mail@brittytino08@gmail.com".toUri()
139119
val emailIntent = Intent(Intent.ACTION_SENDTO, mailUri).apply {
140120
putExtra(Intent.EXTRA_SUBJECT, "Hello from Essentials")
@@ -179,123 +159,6 @@ fun AboutSection(
179159
Spacer(modifier = Modifier.width(8.dp))
180160
Text(stringResource(R.string.action_telegram))
181161
}
182-
183-
OutlinedButton(
184-
onClick = {
185-
val websiteUrl = "https://buymeacoffee.com/tinobritty"
186-
val intent = Intent(Intent.ACTION_VIEW, websiteUrl.toUri())
187-
context.startActivity(intent)
188-
},
189-
modifier = Modifier.padding(horizontal = 4.dp)
190-
) {
191-
Icon(
192-
painter = painterResource(id = R.drawable.rounded_heart_smile_24),
193-
contentDescription = null,
194-
modifier = Modifier.size(18.dp)
195-
)
196-
Spacer(modifier = Modifier.width(8.dp))
197-
Text(stringResource(R.string.action_support))
198-
}
199-
}
200-
201-
Text(
202-
text = stringResource(R.string.label_other_apps),
203-
style = MaterialTheme.typography.titleMedium,
204-
textAlign = TextAlign.Center
205-
)
206-
207-
FlowRow(
208-
modifier = Modifier.fillMaxWidth(),
209-
horizontalArrangement = Arrangement.Center,
210-
verticalArrangement = Arrangement.spacedBy(6.dp),
211-
maxItemsInEachRow = 3
212-
) {
213-
214-
OutlinedButton(
215-
onClick = {
216-
val websiteUrl =
217-
"https://play.google.com/store/apps/details?id=com.brittytino.airsync&hl=en"
218-
val intent = Intent(Intent.ACTION_VIEW, websiteUrl.toUri())
219-
context.startActivity(intent)
220-
},
221-
modifier = Modifier.padding(horizontal = 4.dp)
222-
) {
223-
Icon(
224-
painter = painterResource(id = R.drawable.rounded_devices_24),
225-
contentDescription = null,
226-
modifier = Modifier.size(18.dp)
227-
)
228-
Spacer(modifier = Modifier.width(8.dp))
229-
Text(stringResource(R.string.app_airsync))
230-
}
231-
232-
OutlinedButton(
233-
onClick = {
234-
val websiteUrl = "https://brittytino08@gmail.com/zen"
235-
val intent = Intent(Intent.ACTION_VIEW, websiteUrl.toUri())
236-
context.startActivity(intent)
237-
},
238-
modifier = Modifier.padding(horizontal = 4.dp)
239-
) {
240-
Icon(
241-
painter = painterResource(id = R.drawable.rounded_web_24),
242-
contentDescription = null,
243-
modifier = Modifier.size(18.dp)
244-
)
245-
Spacer(modifier = Modifier.width(8.dp))
246-
Text(stringResource(R.string.app_zenzero))
247-
}
248-
249-
OutlinedButton(
250-
onClick = {
251-
val websiteUrl = "https://github.com/brittytino/canvas"
252-
val intent = Intent(Intent.ACTION_VIEW, websiteUrl.toUri())
253-
context.startActivity(intent)
254-
},
255-
modifier = Modifier.padding(horizontal = 4.dp)
256-
) {
257-
Icon(
258-
painter = painterResource(id = R.drawable.rounded_draw_24),
259-
contentDescription = null,
260-
modifier = Modifier.size(18.dp)
261-
)
262-
Spacer(modifier = Modifier.width(8.dp))
263-
Text(stringResource(R.string.app_canvas))
264-
}
265-
266-
OutlinedButton(
267-
onClick = {
268-
val websiteUrl = "https://github.com/brittytino/tasks"
269-
val intent = Intent(Intent.ACTION_VIEW, websiteUrl.toUri())
270-
context.startActivity(intent)
271-
},
272-
modifier = Modifier.padding(horizontal = 4.dp)
273-
) {
274-
Icon(
275-
painter = painterResource(id = R.drawable.rounded_task_alt_24),
276-
contentDescription = null,
277-
modifier = Modifier.size(18.dp)
278-
)
279-
Spacer(modifier = Modifier.width(8.dp))
280-
Text(stringResource(R.string.app_tasks))
281-
}
282-
283-
OutlinedButton(
284-
onClick = {
285-
val websiteUrl = "https://github.com/brittytino/Browser"
286-
val intent = Intent(Intent.ACTION_VIEW, websiteUrl.toUri())
287-
context.startActivity(intent)
288-
},
289-
modifier = Modifier.padding(horizontal = 4.dp)
290-
) {
291-
Icon(
292-
painter = painterResource(id = R.drawable.outline_highlight_mouse_cursor_24),
293-
contentDescription = null,
294-
modifier = Modifier.size(18.dp)
295-
)
296-
Spacer(modifier = Modifier.width(8.dp))
297-
Text(stringResource(R.string.app_zero))
298-
}
299162
}
300163
}
301164
}

app/src/main/java/com/brittytino/patchwork/ui/components/sheets/AddRepoBottomSheet.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,20 @@ fun AddRepoBottomSheet(
105105
}
106106
}
107107

108+
val trackedRepoForEdit = remember(searchResult, viewModel.trackedRepos.value) {
109+
viewModel.trackedRepos.value.find { it.fullName == searchResult?.fullName }
110+
}
111+
112+
LaunchedEffect(searchResult?.fullName, latestRelease, trackedRepoForEdit?.selectedApkName) {
113+
val availableApkNames = latestRelease?.assets
114+
?.filter { it.name.endsWith(".apk") }
115+
?.map { it.name }
116+
.orEmpty()
117+
val preferred = trackedRepoForEdit?.selectedApkName ?: "Auto"
118+
selectedApkName =
119+
if (preferred == "Auto" || availableApkNames.contains(preferred)) preferred else "Auto"
120+
}
121+
108122
if (showReleaseNotes && latestRelease != null) {
109123
val updateInfo = UpdateInfo(
110124
versionName = latestRelease!!.tagName,

app/src/main/java/com/brittytino/patchwork/viewmodels/AppUpdatesViewModel.kt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,18 @@ class AppUpdatesViewModel : ViewModel() {
261261
val urlPattern = Regex("(?:https?://)?(?:www\\.)?github\\.com/([^/]+)/([^/\\s?#]+).*")
262262
val urlMatch = urlPattern.matchEntire(query)
263263
if (urlMatch != null) {
264-
return urlMatch.groupValues[1] to urlMatch.groupValues[2]
264+
val owner = urlMatch.groupValues[1]
265+
val repo = urlMatch.groupValues[2].removeSuffix(".git")
266+
return owner to repo
265267
}
266268

267269
// Handle owner/repo
268270
val simplePattern = Regex("([^/\\s]+)/([^/\\s]+)")
269271
val simpleMatch = simplePattern.matchEntire(query)
270272
if (simpleMatch != null) {
271-
return simpleMatch.groupValues[1] to simpleMatch.groupValues[2]
273+
val owner = simpleMatch.groupValues[1]
274+
val repo = simpleMatch.groupValues[2].removeSuffix(".git")
275+
return owner to repo
272276
}
273277

274278
return null
@@ -301,7 +305,8 @@ class AppUpdatesViewModel : ViewModel() {
301305
}
302306

303307
fun fetchReleaseNotesIfNeeded(context: Context, repo: TrackedRepo) {
304-
if (!repo.latestReleaseBody.isNullOrBlank()) return
308+
// Null means "not loaded yet". Empty string can be a valid "no notes" payload.
309+
if (repo.latestReleaseBody != null) return
305310

306311
viewModelScope.launch {
307312
try {
@@ -353,6 +358,7 @@ class AppUpdatesViewModel : ViewModel() {
353358

354359
val updatedRepos = reposToCheck.toMutableList()
355360
var changesMade = false
361+
var hitRateLimit = false
356362

357363
for (i in updatedRepos.indices) {
358364
val repo = updatedRepos[i]
@@ -400,6 +406,7 @@ class AppUpdatesViewModel : ViewModel() {
400406
if (e.message == "RATE_LIMIT") {
401407
_errorMessage.value =
402408
context.getString(R.string.error_rate_limited)
409+
hitRateLimit = true
403410
break
404411
}
405412
} finally {
@@ -409,6 +416,12 @@ class AppUpdatesViewModel : ViewModel() {
409416
}
410417
}
411418

419+
// Avoid leaving refresh UI in a stuck loading state after early exits.
420+
if (hitRateLimit) {
421+
_refreshingRepoIds.value = emptySet()
422+
_updateProgress.value = 0f
423+
}
424+
412425
if (changesMade) {
413426
settingsRepo.saveTrackedRepos(updatedRepos)
414427
_trackedRepos.value = updatedRepos

app/src/main/res/values-ach/strings.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -869,17 +869,10 @@
869869
<!-- QS / Activities -->
870870
<string name="error_unlock_network_settings">Unlock phone to change network settings</string>
871871
<!-- About Section -->
872-
<string name="developed_by_format">Developed by %1$s\nwith ❤\uFE0F from \uD83C\uDDF1\uD83C\uDDF0</string>
872+
<string name="developed_by_format">Developed by Tino Britty J</string>
873873
<string name="action_website">Website</string>
874874
<string name="action_contact">Contact</string>
875875
<string name="action_telegram">Telegram</string>
876-
<string name="action_support">Support</string>
877-
<string name="label_other_apps">Other Apps</string>
878-
<string name="app_airsync">AirSync</string>
879-
<string name="app_zenzero">ZenZero</string>
880-
<string name="app_canvas">Canvas</string>
881-
<string name="app_tasks">Tasks</string>
882-
<string name="app_zero">Zero</string>
883876
<!-- Help & Guides -->
884877
<string name="help_guides_title">Help &amp; Guides</string>
885878
<string name="need_more_support_reach_out">Need more support? Reach out,</string>

app/src/main/res/values-af/strings.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -869,17 +869,10 @@
869869
<!-- QS / Activities -->
870870
<string name="error_unlock_network_settings">Unlock phone to change network settings</string>
871871
<!-- About Section -->
872-
<string name="developed_by_format">Developed by %1$s\nwith ❤\uFE0F from \uD83C\uDDF1\uD83C\uDDF0</string>
872+
<string name="developed_by_format">Developed by Tino Britty J</string>
873873
<string name="action_website">Website</string>
874874
<string name="action_contact">Contact</string>
875875
<string name="action_telegram">Telegram</string>
876-
<string name="action_support">Support</string>
877-
<string name="label_other_apps">Other Apps</string>
878-
<string name="app_airsync">AirSync</string>
879-
<string name="app_zenzero">ZenZero</string>
880-
<string name="app_canvas">Canvas</string>
881-
<string name="app_tasks">Tasks</string>
882-
<string name="app_zero">Zero</string>
883876
<!-- Help & Guides -->
884877
<string name="help_guides_title">Help &amp; Guides</string>
885878
<string name="need_more_support_reach_out">Need more support? Reach out,</string>

app/src/main/res/values-ar/strings.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -869,17 +869,10 @@
869869
<!-- QS / Activities -->
870870
<string name="error_unlock_network_settings">Unlock phone to change network settings</string>
871871
<!-- About Section -->
872-
<string name="developed_by_format">Developed by %1$s\nwith ❤\uFE0F from \uD83C\uDDF1\uD83C\uDDF0</string>
872+
<string name="developed_by_format">Developed by Tino Britty J</string>
873873
<string name="action_website">Website</string>
874874
<string name="action_contact">Contact</string>
875875
<string name="action_telegram">Telegram</string>
876-
<string name="action_support">Support</string>
877-
<string name="label_other_apps">Other Apps</string>
878-
<string name="app_airsync">AirSync</string>
879-
<string name="app_zenzero">ZenZero</string>
880-
<string name="app_canvas">Canvas</string>
881-
<string name="app_tasks">Tasks</string>
882-
<string name="app_zero">Zero</string>
883876
<!-- Help & Guides -->
884877
<string name="help_guides_title">Help &amp; Guides</string>
885878
<string name="need_more_support_reach_out">Need more support? Reach out,</string>

app/src/main/res/values-ca/strings.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -869,17 +869,10 @@
869869
<!-- QS / Activities -->
870870
<string name="error_unlock_network_settings">Unlock phone to change network settings</string>
871871
<!-- About Section -->
872-
<string name="developed_by_format">Developed by %1$s\nwith ❤\uFE0F from \uD83C\uDDF1\uD83C\uDDF0</string>
872+
<string name="developed_by_format">Developed by Tino Britty J</string>
873873
<string name="action_website">Website</string>
874874
<string name="action_contact">Contact</string>
875875
<string name="action_telegram">Telegram</string>
876-
<string name="action_support">Support</string>
877-
<string name="label_other_apps">Other Apps</string>
878-
<string name="app_airsync">AirSync</string>
879-
<string name="app_zenzero">ZenZero</string>
880-
<string name="app_canvas">Canvas</string>
881-
<string name="app_tasks">Tasks</string>
882-
<string name="app_zero">Zero</string>
883876
<!-- Help & Guides -->
884877
<string name="help_guides_title">Help &amp; Guides</string>
885878
<string name="need_more_support_reach_out">Need more support? Reach out,</string>

0 commit comments

Comments
 (0)