Represent a square matrix using only List. Access to the matrix must use one-based indices.
interface Cell {
val i: Int
val j: Int
val job = GlobalScope.async(Dispatchers.Default, CoroutineStart.DEFAULT, { MyApi.execute() }) | |
GlobalScope.launch(Dispatchers.Main, CoroutineStart.DEFAULT, { updateUi(job.await()) }) |
/** | |
* Copyright (C) 2018 Fernando Cejas Open Source Project | |
* Modifications Copyright (C) 2018 Al Warren | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
package com.ntxdroid.forecastv3.ui.base | |
import android.annotation.SuppressLint | |
import android.os.Bundle | |
import android.os.PersistableBundle | |
import android.util.Log | |
import androidx.appcompat.app.AppCompatActivity | |
@SuppressLint("Registered") | |
open class LoggingActivity : AppCompatActivity() { |
object Mock { | |
val currentWeatherEntry by lazy { currentWeatherEntryMock() } | |
val condition by lazy { conditionMock() } | |
val weatherLocation by lazy { weatherLocationMock() } | |
val currentWeatherResponse by lazy { currentWeatherResponseMock(currentWeatherEntry, weatherLocation) } | |
const val string: String = "string" | |
const val int:Int = 1 | |
const val long: Long = 1L | |
const val double:Double = 1.0 |
class MyAdapter : RecyclerView.Adapter<ViewHolder>() { | |
var data: List<MyClass> by Delegates.observable(emptyList()) { | |
_, _, _ -> notifyDataSetChanged() | |
} | |
internal var clickListener: (MyClass) -> Unit = { } | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = | |
ViewHolder(parent.inflate(R.layout.data_row)) |
abstract class AbstractListRecycler<T> : RecyclerView.Adapter<RecyclerView.ViewHolder>() { | |
abstract fun layoutId(): Int | |
var collection: List<T> by Delegates.observable(emptyList()) { | |
_, _, _ -> notifyDataSetChanged() | |
} | |
internal var clickListener: (T) -> Unit = { } | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder = |
Android things I just can't seem to keep straight.
Theme Variants
Colors
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
/* //device/apps/common/assets/res/any/colors.xml | |
** | |
** Copyright 2006, The Android Open Source Project | |
** | |
** Licensed under the Apache License, Version 2.0 (the "License"); | |
** you may not use this file except in compliance with the License. | |
** You may obtain a copy of the License at | |
** |
import java.text.DateFormat | |
import java.text.SimpleDateFormat | |
// Top-level build file where you can add configuration options common to all sub-projects/modules. | |
buildscript { | |
apply from: 'buildsystem/dependencies.gradle' | |
addRepos(repositories) | |
dependencies { | |
classpath deps.android_gradle_plugin | |
classpath deps.kotlin.kotlin_gradle_plugin |