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
public static void Fade (this UIView view, bool isIn, double duration = 0.3, Action onFinished = null) | |
{ | |
var minAlpha = (nfloat)0.0f; | |
var maxAlpha = (nfloat)1.0f; | |
view.Alpha = isIn ? minAlpha : maxAlpha; | |
view.Transform = CGAffineTransform.MakeIdentity (); | |
UIView.Animate (duration, 0, UIViewAnimationOptions.CurveEaseInOut, | |
() => { | |
view.Alpha = isIn ? maxAlpha : minAlpha; |
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
module.exports = { | |
"parser": "babel-eslint", | |
"extends": "airbnb", | |
"rules": { | |
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], | |
}, | |
"env": { | |
"browser": true | |
} | |
}; |
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
var auth2; | |
var loggedInPara = document.getElementById('login-status'); | |
gapi.load('auth2', function(){ | |
auth2 = gapi.auth2.init({ | |
client_id: 'app-id.apps.googleusercontent.com' | |
}); | |
loggedInPara.textContent = (auth2.isSignedIn.get()) ? 'User is logged in' : 'User is logged out'; | |
auth2.attachClickHandler('signin-button', {}, onSuccess, onFailure); | |
}); |
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
class StringDemo { | |
public static void main (String[] args) { | |
//The String data type is used to hold a sequence of characters | |
//We use double quotes to enclose the value of the String | |
String username = "joseph"; | |
String email = "john.doe@example.com"; | |
System.out.println("username " + username); | |
String firstName = "Joseph"; | |
String lastName = "Kandi"; |
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
class DoubleDemo { | |
public static void main (String[] args) { | |
//A double type holds a floating point number | |
//A double is a 64-bit precision floating point number | |
//Use double type for high precesion floating point types | |
double averageScore = 550.50; | |
System.out.println("averageScore " + averageScore); | |
//We can also prefix it with a D or d but a floating point literal is automatically a double value | |
double totalScore = 975.05D; |
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
class FloatDemo { | |
public static void main (String[] args) { | |
//A float type holds a floating point number | |
//A float is a 32-bit precision floating point number | |
//The float value should be prefixed with an F or f | |
//If you need very high precision you should use a double data type instead | |
float averageScore = 550.50F; | |
float totalScore = 975.05f; | |
System.out.println("averageScore " + averageScore); | |
System.out.println("totalScore " + totalScore); |
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
class BooleanDemo { | |
public static void main (String[] args) { | |
//boolean type hold the value of either true or false | |
boolean loggedIn = true; | |
System.out.println("loggedIn " + loggedIn); | |
//when using boolean types, the convention is to use is before the variable name | |
boolean isAuthenticated = false; | |
System.out.println("isAuthenticated " + isAuthenticated); | |
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
class CharDemo { | |
public static void main (String[] args) { | |
//The char data type is represented internally as a number | |
//It holds a single unicode character | |
char correctAnserOption = 'A'; | |
//The unicode value for the @ sign is 64. | |
char atSign = 64; | |
System.out.println(atSign); | |
//You can also use it to display non-printable characters |
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
class LongDemo { | |
public static void main (String[] args) { | |
//Use the long type for storing numbers greater than the int type maximum value | |
//It can store values in the range -9.22337203685478E18 to 9.22337203685478E18 | |
//This is a huge number, use this if you really need to, otherwise use int type | |
//For values within the int type range, you don't need anything special | |
long maximumCharacters = 140; | |
System.out.println("maximumCharacters " + maximumCharacters); | |
//You will need to add the L suffix for any numbers less than or greater the int min or max range |
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
class IntDemo { | |
public static void main (String[] args) { | |
////The int type stores values in the range -2147483648 to 2147483647 | |
//The Java compiler is optimized to use the int type | |
//Choose int type when you need a number without a decimal place as your default | |
int currentUsersOnline = 2147483647; | |
System.out.println("currentUsersOnline " + currentUsersOnline); | |
//TODO | |
//Try changing the value of currentUsersOnline to 2147483648 |
NewerOlder