Skip to content
This repository has been archived by the owner on Sep 13, 2019. It is now read-only.

Commit

Permalink
Update AGP to 3.2-beta02 and update slice builders.
Browse files Browse the repository at this point in the history
API changes in slice builders allow you to use property accessors.
  • Loading branch information
Douglas Sigelbaum committed Jul 3, 2018
1 parent 9b43ed4 commit fd6c591
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
16 changes: 8 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ repositories {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "androidx.lifecycle:lifecycle-runtime:2.0.0-alpha1"
implementation "androidx.lifecycle:lifecycle-extensions:2.0.0-alpha1"
implementation "androidx.lifecycle:lifecycle-common:2.0.0-alpha1"
implementation "androidx.slice:slice-view:1.0.0-alpha3"
implementation "androidx.slice:slice-builders-ktx:1.0.0-alpha3"
implementation "androidx.appcompat:appcompat:1.0.0-alpha3"
implementation "androidx.cardview:cardview:1.0.0-alpha3"
implementation "androidx.core:core-ktx:1.0.0-alpha3"
implementation "androidx.lifecycle:lifecycle-runtime:2.0.0-beta01"
implementation "androidx.lifecycle:lifecycle-extensions:2.0.0-beta01"
implementation "androidx.lifecycle:lifecycle-common:2.0.0-beta01"
implementation "androidx.slice:slice-view:1.0.0-beta01"
implementation "androidx.slice:slice-builders-ktx:1.0.0-alpha4"
implementation "androidx.appcompat:appcompat:1.0.0-beta01"
implementation "androidx.cardview:cardview:1.0.0-beta01"
implementation "androidx.core:core-ktx:1.0.0-beta01"
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ class SampleSliceProvider : SliceProvider() {
private fun createHelloWorldSlice(sliceUri: Uri): Slice {
return list(context, sliceUri, ListBuilder.INFINITY) {
header {
setTitle("Hello World")
title = "Hello World"
}
}
}

private fun createTestSlice(sliceUri: Uri): Slice {
val activityAction = SliceAction(
val activityAction = SliceAction.create(
PendingIntent.getActivity(
context, 0,
MainActivity.getIntent(context), 0
Expand All @@ -73,18 +73,19 @@ class SampleSliceProvider : SliceProvider() {
context,
R.drawable.ic_arrow_forward_black_24dp
),
ListBuilder.ICON_IMAGE,
"Go to app."
)
return list(context, sliceUri, SliceHints.INFINITY) {
setAccentColor(0x7f040047)
header {
setTitle("Test Slice")
setSubtitle("Slice for testing purposes")
setSummary("Welcome to the basic Slice presenter.")
title = "Test Slice"
subtitle = "Slice for testing purposes"
summary = "Welcome to the basic Slice presenter."
}
row {
setTitle("Example Row")
setSubtitle("Row Subtitle")
title = "Example Row"
subtitle = "Row Subtitle"
addEndItem(
IconCompat.createWithResource(
context, R.drawable.ic_arrow_forward_black_24dp
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha18'
classpath 'com.android.tools.build:gradle:3.2.0-beta02'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down

0 comments on commit fd6c591

Please sign in to comment.