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
object NetworkUtilities { | |
fun isInternetConnected(context: Context): Boolean { | |
val connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { | |
val networkCapabilities = | |
connectivityManager.getNetworkCapabilities(connectivityManager.activeNetwork) | |
if (networkCapabilities != null && | |
networkCapabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) && | |
networkCapabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED) | |
) { |
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
def getProperty(String filename, String propName) { | |
def propsFile = rootProject.file(filename) | |
if (propsFile.exists()) { | |
def props = new Properties() | |
props.load(new FileInputStream(propsFile)) | |
if (props[propName] != null) { | |
return props[propName] | |
} else { | |
print("No such property " + propName + " in file " + filename) | |
} |
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
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
theme: ThemeData( |
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
"editor.tokenColorCustomizations": { | |
"textMateRules": [ | |
{ | |
"scope": [ | |
//following will be in italics (=Pacifico) | |
"comment", | |
"entity.name.type.class", //class names | |
"keyword", //import, export, return… | |
//"support.class.builtin.js", //String, Number, Boolean…, this, super | |
"storage.modifier", //static keyword |
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.momentpin.ui.listeners; | |
import android.support.v7.widget.GridLayoutManager; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.support.v7.widget.StaggeredGridLayoutManager; | |
/** | |
* Custom implementation for OnScrollListener to know more items are needed to load when the list reaches at its end. | |
* <p> |
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
/[Ll]ibrary/ | |
/[Tt]emp/ | |
/[Oo]bj/ | |
/[Bb]uild/ | |
/[Bb]uilds/ | |
/Assets/AssetStoreTools* | |
# Visual Studio 2015 cache directory | |
/.vs/ |
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
## Ignore Visual Studio temporary files, build results, and | |
## files generated by popular Visual Studio add-ons. | |
# User-specific files | |
*.suo | |
*.user | |
*.sln.docstates | |
*.userprefs | |
# ignore Xamarin.Android Resource.Designer.cs files |
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
HostnameVerifier hostnameVerifier = new HostnameVerifier() { | |
@Override | |
public boolean verify(String hostname, SSLSession session) { | |
return true; | |
} | |
}; | |
X509TrustManager trustManager = new X509TrustManager() { | |
@Override | |
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { |
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.android.popularmovies.http; | |
import android.util.Log; | |
import com.franmontiel.persistentcookiejar.ClearableCookieJar; | |
import com.franmontiel.persistentcookiejar.PersistentCookieJar; | |
import com.franmontiel.persistentcookiejar.cache.SetCookieCache; | |
import com.franmontiel.persistentcookiejar.persistence.SharedPrefsCookiePersistor; | |
import com.github.aurae.retrofit2.LoganSquareConverterFactory; |
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.got2goto.android.components; | |
import android.content.Context; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ProgressBar; | |
import com.got2goto.android.BaseApplication; |
NewerOlder