AppCompat Android KTX Multidex Test Animations & Transitions Auto TV & Wear Emoji Fragment Layout Palette Download Manager Media & Playback Permissions Notifications Sharing Slices
navigate to it exitAnim: the animation for the source fragment/activity when we navigate away from it popEnterAnim: the animation for the target fragment/activity when we press back popExitAnim: the animation for the source fragment/activity when we press back
implementation "android.arch.lifecycle:runtime:1.1.1" implementation "android.arch.lifecycle:extensions:1.1.1" annotationProcessor "android.arch.lifecycle:compiler:1.1.1" Room //Movie.kt @Entity(tableName = TABLE_MOVIE) data class Movie(@PrimaryKey val id: Long, val title: String, val popularity: Int, val voteAverage: Int, val posterUrl: String, val description: String)
to use it WorkRequest request = new OneTimeWorkRequest.Builder(FooWorker.class).build(); workManager.enqueue(request); LiveData<WorkStatus> status = workManager.getStatusByIdLiveData(request.getId()); status.observe(...); //How to cancel workManager.cancelWorkById(request.getId()); // Can also add chain WorkRequest request1 = new OneTimeWorkRequest.Builder(FooWorker.class).build(); WorkRequest request2 = new OneTimeWorkRequest.Builder(BarWorker.class).build(); WorkRequest request3 = new OneTimeWorkRequest.Builder(BazWorker.class).build(); workManager.beginWith(request1, request2).then(request3).enqueue();
palette synchronously and return it fun createPaletteSync(bitmap: Bitmap): Palette = Palette.from(bitmap).generate() // Generate palette asynchronously and use it on a different // thread using onGenerated() fun createPaletteAsync(bitmap: Bitmap) { Palette.from(bitmap).generate { palette -> // Use generated instance } }
parent builder ListBuilder listBuilder = new ListBuilder(getContext(), sliceUri, ListBuilder.INFINITY); // Construct the builder for the row ListBuilder.RowBuilder temperatureRow = new ListBuilder.RowBuilder(listBuilder); // Set title temperatureRow.setTitle(MainActivity.getTemperatureString(getContext())); // TODO: add actions to row; in later step // Add the row to the parent builder listBuilder.addRow(temperatureRow); // Build the slice return listBuilder.build(); }