Skip to content

Commit d71c3ac

Browse files
authored
Merge pull request #575 from namehillsoftware/feature/scrolling-browser-menus
[Feature] Scrolling Browser Menus
2 parents af4f298 + 4ee36ab commit d71c3ac

File tree

54 files changed

+2527
-1732
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2527
-1732
lines changed

projectBlueWater/build.gradle

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,16 @@ def getGeneratedVersionCode() {
167167
}
168168

169169
dependencies {
170-
def compose_version = '1.9.0'
170+
def compose_version = '1.9.1'
171171
def media3_version = '1.8.0'
172-
def lifecycle_version = '2.9.2'
172+
def lifecycle_version = '2.9.4'
173173
def junit5_version = '5.13.4'
174174

175175
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
176176

177177
implementation 'androidx.core:core-ktx:1.17.0'
178178
implementation 'androidx.annotation:annotation:1.9.1'
179-
implementation 'androidx.work:work-runtime:2.10.3'
179+
implementation 'androidx.work:work-runtime:2.10.4'
180180
implementation 'androidx.media:media:1.7.1'
181181
implementation 'androidx.palette:palette-ktx:1.0.0'
182182
implementation 'androidx.preference:preference-ktx:1.2.1'
@@ -185,16 +185,16 @@ dependencies {
185185
implementation "androidx.lifecycle:lifecycle-service:$lifecycle_version"
186186
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
187187
implementation "androidx.startup:startup-runtime:1.2.0"
188-
implementation 'com.google.android.material:material:1.12.0'
189-
implementation 'com.google.guava:guava:33.4.8-android'
188+
implementation 'com.google.android.material:material:1.13.0'
189+
implementation 'com.google.guava:guava:33.5.0-android'
190190
implementation 'joda-time:joda-time:2.14.0'
191191
implementation 'commons-io:commons-io:2.20.0'
192192
implementation 'org.slf4j:slf4j-api:2.0.17'
193193
implementation 'com.github.tony19:logback-android:3.0.0'
194194
implementation 'com.namehillsoftware:handoff:0.30.1'
195195
implementation 'io.reactivex.rxjava3:rxjava:3.1.11'
196196
implementation 'com.namehillsoftware:lazy-j:0.11.0'
197-
implementation 'org.jsoup:jsoup:1.21.1'
197+
implementation 'org.jsoup:jsoup:1.21.2'
198198
implementation "androidx.media3:media3-exoplayer:$media3_version"
199199
implementation "androidx.media3:media3-datasource-okhttp:$media3_version"
200200
implementation 'com.squareup.okio:okio:3.16.0'
@@ -204,17 +204,17 @@ dependencies {
204204
implementation "androidx.compose.material:material:$compose_version"
205205
implementation "androidx.compose.ui:ui-tooling:$compose_version"
206206
implementation "androidx.compose.runtime:runtime-rxjava3:$compose_version"
207-
implementation 'androidx.activity:activity-compose:1.10.1'
207+
implementation 'androidx.activity:activity-compose:1.11.0'
208208
implementation 'dev.olshevski.navigation:reimagined:1.5.0'
209-
implementation 'com.google.code.gson:gson:2.13.1'
209+
implementation 'com.google.code.gson:gson:2.13.2'
210210
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-rx3:1.10.2'
211211
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
212212
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
213213
testCompileOnly 'junit:junit:4.13.2'
214214
testImplementation 'commons-codec:commons-codec:1.19.0'
215215
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit5_version"
216-
testImplementation 'org.assertj:assertj-core:3.27.4'
217-
testImplementation 'org.robolectric:robolectric:4.15.1'
216+
testImplementation 'org.assertj:assertj-core:3.27.5'
217+
testImplementation 'org.robolectric:robolectric:4.16'
218218
testImplementation 'androidx.test.ext:junit-ktx:1.3.0'
219219
testImplementation 'androidx.test:core:1.7.0'
220220
testImplementation 'androidx.test:runner:1.7.0'

projectBlueWater/src/main/java/com/lasthopesoftware/bluewater/MessageReceiversInitializer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class MessageReceiversInitializer : Initializer<Unit> {
5050
notificationManager.notify(
5151
storageReadPermissionsConfiguration.notificationId,
5252
storageReadPermissionsRequestNotificationBuilder
53-
.buildReadPermissionsRequestNotification(readPermissionsNeeded.libraryId.id))
53+
.buildReadPermissionsRequestNotification(readPermissionsNeeded.libraryId))
5454
}
5555

5656
registerForApplicationMessages.registerReceiver(

projectBlueWater/src/main/java/com/lasthopesoftware/bluewater/android/ui/UiCalculations.kt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@ import androidx.compose.runtime.DisallowComposableCalls
55
import androidx.compose.runtime.DisposableEffect
66
import androidx.compose.ui.unit.Density
77
import androidx.compose.ui.unit.Dp
8+
import androidx.compose.ui.unit.coerceIn
9+
import com.lasthopesoftware.bluewater.client.playback.nowplaying.view.ScreenDimensionsScope
10+
import com.lasthopesoftware.bluewater.client.playback.nowplaying.view.minimumMenuWidth
811

912
fun linearInterpolation(initial: Dp, final: Dp, progress: Float): Dp =
1013
initial + (final - initial) * progress
1114

1215
fun linearInterpolation(initial: Float, final: Float, progress: Float): Float =
1316
initial + (final - initial) * progress
1417

18+
fun calculateProgress(initial: Dp, final: Dp, currentPosition: Dp): Float =
19+
((currentPosition - initial) / (final - initial)).coerceIn(0f, 1f)
20+
1521
fun calculateProgress(initial: Float, final: Float, currentPosition: Float): Float =
1622
((currentPosition - initial) / (final - initial)).coerceIn(0f, 1f)
1723

@@ -35,6 +41,17 @@ inline fun <T> Density.remember(key1: Any?, key2: Any?, key3: Any?, crossinline
3541
inline fun <T> Density.remember(key1: Any?, key2: Any?, key3: Any?, key4: Any?, crossinline calculation: Density.() -> T) =
3642
androidx.compose.runtime.remember(this, key1, key2, key3, key4) { this.calculation() }
3743

44+
@Composable
45+
inline fun <T : AutoCloseable> rememberAutoCloseable(key1: Any?, key2: Any?, crossinline calculation: () -> T): T {
46+
val result = androidx.compose.runtime.remember(key1, key2, calculation)
47+
48+
DisposableEffect(result) {
49+
onDispose { result.close() }
50+
}
51+
52+
return result
53+
}
54+
3855
@Composable
3956
inline fun <T : AutoCloseable> rememberAutoCloseable(key1: Any?, key2: Any?, key3: Any?, crossinline calculation: () -> T): T {
4057
val result = androidx.compose.runtime.remember(key1, key2, key3, calculation)
@@ -45,3 +62,16 @@ inline fun <T : AutoCloseable> rememberAutoCloseable(key1: Any?, key2: Any?, key
4562

4663
return result
4764
}
65+
66+
/**
67+
* Calculates the width of the summary column based on the screen height, ensuring it stays within
68+
* the defined minimum menu width and half of the maximum screen width.
69+
*
70+
* This is used to determine an appropriate width for a side panel or menu that adapts to screen size
71+
* while maintaining usability.
72+
*
73+
* @receiver ScreenDimensionsScope Provides access to screen dimensions like screenHeight and maxWidth.
74+
* @return The calculated Dp value for the summary column width.
75+
*/
76+
fun ScreenDimensionsScope.calculateSummaryColumnWidth() =
77+
screenHeight.coerceIn(minimumMenuWidth, maxWidth / 2)

0 commit comments

Comments
 (0)