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
package com.steadfastinnovation.recyclerissue; | |
import android.graphics.Color; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.support.v7.widget.GridLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.Menu; | |
import android.view.MenuItem; |
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
fun test(context: Context) { | |
val backupWorker = OneTimeWorkRequestBuilder<BackupWorker>() | |
.setConstraints( | |
Constraints.Builder() | |
.setRequiresBatteryNotLow(true) | |
.setRequiresStorageNotLow(true) | |
.build() | |
) | |
.setInputData(workDataOf(BackupWorker.KEY_BACKUP_NAME to "backupName")) | |
.build() |
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
inline fun Data.requireBoolean(key: String): Boolean = keyValueMap[key] as? Boolean ?: throw IllegalArgumentException("Missing boolean value for key: $key") | |
inline fun Data.requireBooleanArray(key: String): BooleanArray = getBooleanArray(key) ?: throw IllegalArgumentException("Missing boolean array value for key: $key") | |
inline fun Data.requireByte(key: String): Byte = keyValueMap[key] as? Byte ?: throw IllegalArgumentException("Missing byte value for key: $key") | |
inline fun Data.requireByteArray(key: String): ByteArray = getByteArray(key) ?: throw IllegalArgumentException("Missing byte array value for key: $key") | |
inline fun Data.requireInt(key: String): Int = keyValueMap[key] as? Int ?: throw IllegalArgumentException("Missing int value for key: $key") | |
inline fun Data.requireIntArray(key: String): IntArray = getIntArray(key) ?: throw IllegalArgumentException("Missing int array value for key: $key") | |
inline fun Data.requireLong(key: String): Long = keyValueMap[key] as? Long ?: throw IllegalArgumentException("M |