This is a quick guide to Kotlin programming language. The previous part of this guide is here
#Object Oriented
fun main(args : Array<String>) {
class local (val x : Int)
val y = local(10)
println("${y.x}")| // Copyright 2012 Square, Inc. | |
| package com.squareup.widgets; | |
| import android.content.Context; | |
| import android.content.res.TypedArray; | |
| import android.util.AttributeSet; | |
| import android.widget.ImageView; | |
| /** Maintains an aspect ratio based on either width or height. Disabled by default. */ | |
| public class AspectRatioImageView extends ImageView { |
| package com.squareup.example; | |
| public abstract BaseActivity extends SherlockActivity { | |
| private final ScopedBus scopedBus = new ScopedBus(); | |
| protected ScopedBus getBus() { | |
| return scopedBus; | |
| } | |
| @Override public void onPause() { |
| #!/bin/bash | |
| # Script adb+ | |
| # Usage | |
| # You can run any command adb provides on all your currently connected devices | |
| # ./adb+ <command> is the equivalent of ./adb -s <serial number> <command> | |
| # | |
| # Examples | |
| # ./adb+ version | |
| # ./adb+ install apidemo.apk | |
| # ./adb+ uninstall com.example.android.apis |
| /** | |
| * Copyright (c) 2013 Xcellent Creations, Inc. | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining | |
| * a copy of this software and associated documentation files (the | |
| * "Software"), to deal in the Software without restriction, including | |
| * without limitation the rights to use, copy, modify, merge, publish, | |
| * distribute, sublicense, and/or sell copies of the Software, and to | |
| * permit persons to whom the Software is furnished to do so, subject to | |
| * the following conditions: |
| import java.util.concurrent.Callable; | |
| import java.util.concurrent.ExecutorService; | |
| import java.util.concurrent.Future; | |
| import java.util.concurrent.LinkedBlockingQueue; | |
| import java.util.concurrent.ThreadPoolExecutor; | |
| import java.util.concurrent.TimeUnit; | |
| public class FuturesA { | |
| public static void run() throws Exception { |
| import java.util.ArrayList; | |
| import java.util.Iterator; | |
| import java.util.List; | |
| import java.util.concurrent.Callable; | |
| import java.util.concurrent.ExecutorService; | |
| import java.util.concurrent.Future; | |
| import java.util.concurrent.LinkedBlockingQueue; | |
| import java.util.concurrent.ThreadPoolExecutor; | |
| import java.util.concurrent.TimeUnit; |
| import java.util.concurrent.CountDownLatch; | |
| import java.util.concurrent.ExecutorService; | |
| import java.util.concurrent.LinkedBlockingQueue; | |
| import java.util.concurrent.ThreadPoolExecutor; | |
| import java.util.concurrent.TimeUnit; | |
| import java.util.concurrent.atomic.AtomicReference; | |
| public class CallbackB { | |
| /** |
| import android.support.v4.app.Fragment; | |
| public class FragmentUtils { | |
| /** | |
| * @param fragment | |
| * The Fragment whose parent is to be found | |
| * @param parentClass | |
| * The interface that the parent should implement | |
| * @return The parent of fragment that implements parentClass, |
This is a quick guide to Kotlin programming language. The previous part of this guide is here
#Object Oriented
fun main(args : Array<String>) {
class local (val x : Int)
val y = local(10)
println("${y.x}")