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 android.os.SystemClock; | |
import android.view.View; | |
import java.util.Map; | |
import java.util.WeakHashMap; | |
/** | |
* A Debounced OnClickListener | |
* Rejects clicks that are too close together in time. | |
* This class is safe to use as an OnClickListener for multiple views, and will debounce each one separately. |
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
// No Security | |
{ | |
"rules": { | |
".read": true, | |
".write": 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
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', |
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
1. To enable TLS 1.2 in Android 4.4 | |
Copy TLSSocketFactory.java | |
If using HttpsURLConnection: | |
=> conn.setSSLSocketFactory(new TLSSocketFactory()); | |
Else if using OkHttp: | |
=> new OkHttpClient.Builder().setSocketFactory(new TLSSocketFactory()). ... .build(); | |
Else if using HttpClient: | |
sample for legacy apache http library: https://github.com/Kane-Shih/TestApacheHttpClient | |
=> see: https://stackoverflow.com/questions/2603691/android-httpclient-and-https |
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
/* | |
* Copyright 2016 Alireza Eskandarpour Shoferi | |
* | |
* 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 |
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 void startFacebook(String facebookUrl) { | |
try { | |
Uri uri = null; | |
int versionCode = getPackageManager() | |
.getPackageInfo("com.facebook.katana", 0) | |
.versionCode; |
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 class ToolbarAlphaScrollBehavior extends CoordinatorLayout.Behavior<android.support.v7.widget.Toolbar> { | |
private ColorDrawable mStatusBarColorDrawable; | |
private int mStatusBarColor; | |
private TextView mTitleView; | |
private boolean searchedForTitleView = false; | |
public ToolbarAlphaScrollBehavior(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
mStatusBarColor = ContextCompat.getColor(context, R.color.primary_dark); | |
mStatusBarColor = getColorWithAlpha(0, mStatusBarColor); |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |