Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare release 129 #4880

Merged
merged 4 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@

### Significant bug fixes

## v27.2

### Significant bug fixes

- The title of a hashtag tab now shows the actual hashtags again (instead of just "Hashtags") https://github.com/tuskyapp/Tusky/pull/4868
- Makes sure the background color of a dialogs is correct https://github.com/tuskyapp/Tusky/pull/4864
- Fixes an issue where Tusky would freeze while loading a timeline gap https://github.com/tuskyapp/Tusky/pull/4865

## v27.1

### New features and other improvements
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ android {
namespace "com.keylesspalace.tusky"
minSdk 24
targetSdk 34
versionCode 128
versionName "27.1"
versionCode 129
versionName "27.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class AccountsInListFragment : DialogFragment() {
viewModel.load(listId)
}

override fun getTheme() = R.style.TuskyDialogOverlay
override fun getTheme() = R.style.TuskyDialogFragment

override fun onStart() {
super.onStart()
Expand Down
5 changes: 1 addition & 4 deletions app/src/main/java/com/keylesspalace/tusky/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -886,10 +886,7 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, MenuProvider {
tabLayoutMediator = TabLayoutMediator(activeTabLayout, binding.viewPager, true) {
tab: TabLayout.Tab, position: Int ->
tab.icon = AppCompatResources.getDrawable(this@MainActivity, tabs[position].icon)
tab.contentDescription = when (tabs[position].id) {
LIST -> tabs[position].arguments[1]
else -> getString(tabs[position].text)
}
tab.contentDescription = tabs[position].title(this)
if (tabs[position].id == DIRECT) {
val badge = tab.orCreateBadge
badge.isVisible = activeAccount.hasDirectMessageBadge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,27 +308,27 @@ class NotificationsViewModel @Inject constructor(
)
)

val response = db.withTransaction {
val idAbovePlaceholder = notificationsDao.getIdAbove(account.id, placeholderId)
val idBelowPlaceholder = notificationsDao.getIdBelow(account.id, placeholderId)
when (readingOrder) {
// Using minId, loads up to LOAD_AT_ONCE statuses with IDs immediately
// after minId and no larger than maxId
ReadingOrder.OLDEST_FIRST -> api.notifications(
maxId = idAbovePlaceholder,
minId = idBelowPlaceholder,
limit = TimelineViewModel.LOAD_AT_ONCE,
excludes = excludes.value
)
// Using sinceId, loads up to LOAD_AT_ONCE statuses immediately before
// maxId, and no smaller than minId.
ReadingOrder.NEWEST_FIRST -> api.notifications(
maxId = idAbovePlaceholder,
sinceId = idBelowPlaceholder,
limit = TimelineViewModel.LOAD_AT_ONCE,
excludes = excludes.value
)
}
val (idAbovePlaceholder, idBelowPlaceholder) = db.withTransaction {
notificationsDao.getIdAbove(account.id, placeholderId) to
notificationsDao.getIdBelow(account.id, placeholderId)
}
val response = when (readingOrder) {
// Using minId, loads up to LOAD_AT_ONCE statuses with IDs immediately
// after minId and no larger than maxId
ReadingOrder.OLDEST_FIRST -> api.notifications(
maxId = idAbovePlaceholder,
minId = idBelowPlaceholder,
limit = TimelineViewModel.LOAD_AT_ONCE,
excludes = excludes.value
)
// Using sinceId, loads up to LOAD_AT_ONCE statuses immediately before
// maxId, and no smaller than minId.
ReadingOrder.NEWEST_FIRST -> api.notifications(
maxId = idAbovePlaceholder,
sinceId = idBelowPlaceholder,
limit = TimelineViewModel.LOAD_AT_ONCE,
excludes = excludes.value
)
}

val notifications = response.body()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,25 +157,25 @@ class CachedTimelineViewModel @Inject constructor(
Placeholder(placeholderId, loading = true).toEntity(tuskyAccountId = account.id)
)

val response = db.withTransaction {
val idAbovePlaceholder = timelineDao.getIdAbove(account.id, placeholderId)
val idBelowPlaceholder = timelineDao.getIdBelow(account.id, placeholderId)
when (readingOrder) {
// Using minId, loads up to LOAD_AT_ONCE statuses with IDs immediately
// after minId and no larger than maxId
OLDEST_FIRST -> api.homeTimeline(
maxId = idAbovePlaceholder,
minId = idBelowPlaceholder,
limit = LOAD_AT_ONCE
)
// Using sinceId, loads up to LOAD_AT_ONCE statuses immediately before
// maxId, and no smaller than minId.
NEWEST_FIRST -> api.homeTimeline(
maxId = idAbovePlaceholder,
sinceId = idBelowPlaceholder,
limit = LOAD_AT_ONCE
)
}
val (idAbovePlaceholder, idBelowPlaceholder) = db.withTransaction {
timelineDao.getIdAbove(account.id, placeholderId) to
timelineDao.getIdBelow(account.id, placeholderId)
}
val response = when (readingOrder) {
// Using minId, loads up to LOAD_AT_ONCE statuses with IDs immediately
// after minId and no larger than maxId
OLDEST_FIRST -> api.homeTimeline(
maxId = idAbovePlaceholder,
minId = idBelowPlaceholder,
limit = LOAD_AT_ONCE
)
// Using sinceId, loads up to LOAD_AT_ONCE statuses immediately before
// maxId, and no smaller than minId.
NEWEST_FIRST -> api.homeTimeline(
maxId = idAbovePlaceholder,
sinceId = idBelowPlaceholder,
limit = LOAD_AT_ONCE
)
}

val statuses = response.body()
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/res/drawable/dialog_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:insetLeft="16dp"
android:insetTop="16dp"
android:insetRight="16dp"
android:insetBottom="16dp">
<shape android:shape="rectangle">
<corners android:radius="?attr/dialogCornerRadius" />
<solid android:color="@color/colorBackground" />
</shape>
</inset>
20 changes: 15 additions & 5 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@
<item name="snackbarButtonStyle">@style/TuskyButton.TextButton</item>

<!-- for dialogs created with MaterialALertDialogBuilder -->
<item name="materialAlertDialogTheme">@style/TuskyDialogOverlay</item>
<item name="materialAlertDialogTheme">@style/TuskyMaterialDialogOverlay</item>
<!-- for dialogs opened from preferences -->
<item name="alertDialogTheme">@style/TuskyDialogOverlay</item>
<item name="alertDialogTheme">@style/TuskyAlertDialog</item>
<item name="dialogCornerRadius">16dp</item>

<item name="materialTimePickerTheme">@style/TuskyTimePickerOverlay</item>
Expand Down Expand Up @@ -146,12 +146,22 @@
<item name="android:colorControlNormal">@color/white</item>
</style>

<style name="TuskyDialogOverlay" parent="@style/ThemeOverlay.Material3.MaterialAlertDialog">
<item name="alertDialogStyle">@style/TuskyDialog</item>
<style name="TuskyDialogFragment" parent="@style/ThemeOverlay.Material3.Dialog">
<item name="android:windowBackground">@drawable/dialog_background</item>
<item name="android:backgroundDimAmount">0.5</item>
</style>

<style name="TuskyDialog" parent="@style/MaterialAlertDialog.Material3">
<style name="TuskyAlertDialog" parent="@style/ThemeOverlay.Material3.Dialog.Alert">
<item name="android:windowBackground">@drawable/dialog_background</item>
<item name="android:backgroundDimAmount">0.5</item>
</style>

<style name="TuskyMaterialDialogOverlay" parent="@style/ThemeOverlay.Material3.MaterialAlertDialog">
<item name="alertDialogStyle">@style/TuskyMaterialDialog</item>
<item name="android:backgroundDimAmount">0.5</item>
</style>

<style name="TuskyMaterialDialog" parent="@style/MaterialAlertDialog.Material3">
<item name="shapeAppearance">@style/ShapeAppearance.Material3.Corner.Large</item>
<item name="backgroundTint">@color/colorBackground</item>
</style>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading