Skip to content

Commit 4d0efef

Browse files
authored
Merge pull request #879 from tatsuyafujisaki/rename-constants
Rename constants
2 parents d685f46 + f6d62f9 commit 4d0efef

File tree

3 files changed

+11
-11
lines changed
  • core/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

3 files changed

+11
-11
lines changed

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)