button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
doSomethingAmazing();
}
});
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Tiles · CodePen</title> | |
<!-- | |
Copyright (c) 2012 jacobmoncur, http://codepen.io/jacobmoncur | |
Permission is hereby granted, free of charge, to any person obtaining |
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
repositories { | |
mavenCentral() | |
maven { | |
url = 'https://github.com/github-username/github-project/raw/master' | |
credentials { | |
username 'my-username' | |
password 'my-password' | |
} | |
} | |
} |
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
let string = "This is how you say GIF." | |
let utterance = AVSpeechUtterance(string: string) | |
utterance.voice = AVSpeechSynthesisVoice(language: "en-US") | |
utterance.rate = 0.15 | |
utterance.pitchMultiplier = 1.2 | |
utterance.preUtteranceDelay = 0.2 | |
utterance.postUtteranceDelay = 0.2 | |
let synthesizer = AVSpeechSynthesizer() | |
synthesizer.speakUtterance(utterance) |
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
self.tableView.beginUpdates() | |
self.tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation:.Fade) | |
self.tableView.endUpdates() |
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
apply plugin: 'com.android.application' | |
apply plugin: 'kotlin-android' | |
android { | |
compileSdkVersion 22 | |
buildToolsVersion "22.0.1" | |
defaultConfig { | |
applicationId "com.****.*****" | |
minSdkVersion 16 |
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
import org.junit.Assert | |
import org.junit.Test as test | |
public class AuthenticationTest { | |
test public fun login() { | |
Assert.assertTrue(1 == 1) | |
} |
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
val snapshot = try { | |
cache[key] ?: return null | |
} catch (e: IOException) { | |
// Give up because the cache cannot be read. | |
return null | |
} |
Animator anim = ObjectAnimator.ofFloat(mainView, "translationY", 500.f);
anim.setInterpolator(new AccelerateDecelerateInterpolator());
anim.setDuration(300);
anim.setStartDelay(100);
Animator anim1 = ObjectAnimator.ofFloat(otherView, "translationY", 200.f);
anim1.setInterpolator(new AccelerateDecelerateInterpolator());
OlderNewer