Skip to content

Commit 5abc69f

Browse files
Merge branch 'android:main' into loading-progress-for-image
2 parents 8aa0457 + e03294b commit 5abc69f

File tree

5 files changed

+15
-13
lines changed
  • core
    • designsystem/src/main/java/com/google/samples/apps/nowinandroid/core/designsystem/component
    • network/src/main/java/com/google/samples/apps/nowinandroid/core/network/retrofit
  • feature/interests/src/main/java/com/google/samples/apps/nowinandroid/feature/interests/navigation
  • sync/work/src/main/java/com/google/samples/apps/nowinandroid/sync/initializers

5 files changed

+15
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ follows Android design and development best practices and is intended to be a us
1515
for developers. As a running app, it's intended to help developers keep up-to-date with the world
1616
of Android development by providing regular news updates.
1717

18-
The app is currently in development. The `demoRelease` variant is [available on the Play Store in open beta](https://play.google.com/store/apps/details?id=com.google.samples.apps.nowinandroid).
18+
The app is currently in development. The `prodRelease` variant is [available on the Play Store](https://play.google.com/store/apps/details?id=com.google.samples.apps.nowinandroid).
1919

2020
# Features
2121

core/designsystem/src/main/java/com/google/samples/apps/nowinandroid/core/designsystem/component/LoadingWheel.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fun NiaLoadingWheel(
5555
contentDesc: String,
5656
modifier: Modifier = Modifier,
5757
) {
58-
val infiniteTransition = rememberInfiniteTransition()
58+
val infiniteTransition = rememberInfiniteTransition(label = "wheel transition")
5959

6060
// Specifies the float animation for slowly drawing out the lines on entering
6161
val startValue = if (LocalInspectionMode.current) 0F else 1F
@@ -82,6 +82,7 @@ fun NiaLoadingWheel(
8282
animationSpec = infiniteRepeatable(
8383
animation = tween(durationMillis = ROTATION_TIME, easing = LinearEasing),
8484
),
85+
label = "wheel rotation animation",
8586
)
8687

8788
// Specifies the color animation for the base-to-progress line color change
@@ -100,6 +101,7 @@ fun NiaLoadingWheel(
100101
repeatMode = RepeatMode.Restart,
101102
initialStartOffset = StartOffset(ROTATION_TIME / NUM_OF_LINES / 2 * index),
102103
),
104+
label = "wheel color animation",
103105
)
104106
}
105107

core/network/src/main/java/com/google/samples/apps/nowinandroid/core/network/retrofit/RetrofitNiaNetwork.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ private interface RetrofitNiaNetworkApi {
5757
): List<NetworkChangeList>
5858
}
5959

60-
private const val NiaBaseUrl = BuildConfig.BACKEND_URL
60+
private const val NIA_BASE_URL = BuildConfig.BACKEND_URL
6161

6262
/**
63-
* Wrapper for data provided from the [NiaBaseUrl]
63+
* Wrapper for data provided from the [NIA_BASE_URL]
6464
*/
6565
@Serializable
6666
private data class NetworkResponse<T>(
@@ -77,7 +77,7 @@ class RetrofitNiaNetwork @Inject constructor(
7777
) : NiaNetworkDataSource {
7878

7979
private val networkApi = Retrofit.Builder()
80-
.baseUrl(NiaBaseUrl)
80+
.baseUrl(NIA_BASE_URL)
8181
.callFactory(okhttpCallFactory)
8282
.addConverterFactory(
8383
networkJson.asConverterFactory("application/json".toMediaType()),

feature/interests/src/main/java/com/google/samples/apps/nowinandroid/feature/interests/navigation/InterestsNavigation.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ import androidx.navigation.compose.composable
2323
import androidx.navigation.navigation
2424
import com.google.samples.apps.nowinandroid.feature.interests.InterestsRoute
2525

26-
private const val interestsGraphRoutePattern = "interests_graph"
26+
private const val INTERESTS_GRAPH_ROUTE_PATTERN = "interests_graph"
2727
const val interestsRoute = "interests_route"
2828

2929
fun NavController.navigateToInterestsGraph(navOptions: NavOptions? = null) {
30-
this.navigate(interestsGraphRoutePattern, navOptions)
30+
this.navigate(INTERESTS_GRAPH_ROUTE_PATTERN, navOptions)
3131
}
3232

3333
fun NavGraphBuilder.interestsGraph(
3434
onTopicClick: (String) -> Unit,
3535
nestedGraphs: NavGraphBuilder.() -> Unit,
3636
) {
3737
navigation(
38-
route = interestsGraphRoutePattern,
38+
route = INTERESTS_GRAPH_ROUTE_PATTERN,
3939
startDestination = interestsRoute,
4040
) {
4141
composable(route = interestsRoute) {

sync/work/src/main/java/com/google/samples/apps/nowinandroid/sync/initializers/SyncWorkHelpers.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import androidx.work.NetworkType
2828
import com.google.samples.apps.nowinandroid.sync.R
2929

3030
const val SYNC_TOPIC = "sync"
31-
private const val SyncNotificationId = 0
32-
private const val SyncNotificationChannelID = "SyncNotificationChannel"
31+
private const val SYNC_NOTIFICATION_ID = 0
32+
private const val SYNC_NOTIFICATION_CHANNEL_ID = "SyncNotificationChannel"
3333

3434
// All sync work needs an internet connectionS
3535
val SyncConstraints
@@ -42,7 +42,7 @@ val SyncConstraints
4242
* run with a foreground service
4343
*/
4444
fun Context.syncForegroundInfo() = ForegroundInfo(
45-
SyncNotificationId,
45+
SYNC_NOTIFICATION_ID,
4646
syncWorkNotification(),
4747
)
4848

@@ -53,7 +53,7 @@ fun Context.syncForegroundInfo() = ForegroundInfo(
5353
private fun Context.syncWorkNotification(): Notification {
5454
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
5555
val channel = NotificationChannel(
56-
SyncNotificationChannelID,
56+
SYNC_NOTIFICATION_CHANNEL_ID,
5757
getString(R.string.sync_notification_channel_name),
5858
NotificationManager.IMPORTANCE_DEFAULT,
5959
).apply {
@@ -68,7 +68,7 @@ private fun Context.syncWorkNotification(): Notification {
6868

6969
return NotificationCompat.Builder(
7070
this,
71-
SyncNotificationChannelID,
71+
SYNC_NOTIFICATION_CHANNEL_ID,
7272
)
7373
.setSmallIcon(
7474
com.google.samples.apps.nowinandroid.core.common.R.drawable.ic_nia_notification,

0 commit comments

Comments
 (0)