This file contains hidden or 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
plugins { | |
id("com.android.application") | |
} | |
android { | |
defaultConfig { | |
applicationId = "com.example.task" | |
versionCode = 1 | |
versionName = "1.0" | |
} |
This file contains hidden or 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.meier.marina.magiccoroutines | |
import android.util.Log | |
import kotlinx.coroutines.experimental.* | |
import kotlinx.coroutines.experimental.android.UI | |
import kotlinx.coroutines.experimental.channels.* | |
import kotlin.coroutines.experimental.CoroutineContext | |
class ViewModel { | |
private var count = 0 |
This file contains hidden or 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
@Database(entities = arrayOf(Note::class, User::class), version = 1) | |
@TypeConverters(Converters::class) | |
abstract class AppDatabse : RoomDatabase() { | |
abstract fun userDAO(): UserDAO | |
abstract fun noteDAO(): NoteDAO | |
} |
This file contains hidden or 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.ninetyseconds.auckland.core.databindings | |
import android.databinding.* | |
import android.databinding.Observable.OnPropertyChangedCallback | |
import android.os.Parcelable | |
import io.reactivex.Observable | |
import io.reactivex.Observable.create | |
import org.funktionale.option.toOption | |
import java.lang.Math.max | |
import java.lang.Math.min |
#####Logcat Colors for IntelliJ Darcula Theme (original post)
- Preferences -> Editor -> Android Logcat
- "Save As" scheme
- Uncheck "Use inherited attributes" option
- Edit foreground color with the following
Debug : #6897BB
Info : #6A8759
This file contains hidden or 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
long date = 1407869895000L; // August 12, 2014, 8:58PM | |
// August 12, 2014 (default) | |
DateUtils.formatDateTime(this, date, 0); | |
// Aug 12, 2014 (default with abbreviated month) | |
DateUtils.formatDateTime(this, date, DateUtils.FORMAT_ABBREV_MONTH); | |
// August 12 (date without year) | |
DateUtils.formatDateTime(this, date, DateUtils.FORMAT_NO_YEAR); |
Centralize the support libraries dependencies in gradle
Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.
A very good way is to separate gradle build files, defining something like:
root
--gradleScript
----dependencies.gradle
This file contains hidden or 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
var mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
This file contains hidden or 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
// Copyright 2014 Robert Carr | |
// | |
// 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 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
NewerOlder