-
-
Save dbarks1024/7a65943294bd302780660700486f5ea8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onBindSlice(sliceUri: Uri): Slice? { | |
context ?: return null | |
return when (sliceUri.path) { | |
"/range" -> { | |
// Display range slice | |
val primarySliceAction = createPrimarySliceAction() | |
val nerdLevelIntent = Intent(context, NerdLevelReceiver::class.java).let { | |
PendingIntent.getBroadcast(context, 0, it, 0) | |
} | |
val nerdLevelTitle = context.getString(R.string.nerd_level_title) | |
list(context, sliceUri, ListBuilder.INFINITY) { | |
inputRange { | |
title = nerdLevelTitle | |
inputAction = nerdLevelIntent | |
max = 100 | |
value = 50 | |
primaryAction = primarySliceAction | |
} | |
} | |
} | |
else -> { | |
... | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment