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 2019 Louis Cognault Ayeva Derman. Use of this source code is governed by the Apache 2.0 license. | |
*/ | |
package nl.nl2312.core.ext | |
import kotlinx.coroutines.* | |
import kotlin.coroutines.CoroutineContext | |
import kotlin.coroutines.EmptyCoroutineContext | |
fun <T> suspendBlockingLazy( |
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
package nl.nl2312.example; | |
import android.os.Bundle; | |
import androidx.annotation.XmlRes; | |
import androidx.appcompat.app.AppCompatActivity; | |
import androidx.appcompat.app.AppCompatCallback; | |
import androidx.preference.Preference; | |
import androidx.preference.PreferenceFragmentCompat; | |
import androidx.preference.PreferenceManager; |
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 Maxim Tuev. | |
* | |
* 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
if (BuildConfig.DEBUG) { | |
httpclient.interceptors().add(new LoggingInterceptor()); | |
} | |
public class LoggingInterceptor implements Interceptor { | |
@Override | |
public Response intercept(Chain chain) throws IOException { | |
Request request = chain.request(); | |
long t1 = System.nanoTime(); |
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
// Usage example... | |
HttpsURLConnection connection = (HttpsURLConnection) new URL("https://someurl.com").openConnection(); | |
connection.setSSLSocketFactory(buildSslSocketFactory()); | |
private static SSLSocketFactory buildSslSocketFactory(Context context) { | |
// Add support for self-signed (local) SSL certificates | |
// Based on http://developer.android.com/training/articles/security-ssl.html#UnknownCa | |
try { | |
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
echo 'Get remote translation files from the server.' | |
rm -rf res | |
ncftpget -u myusername -R -F mydomain.org . www/translate/res | |
rm -rf res/values | |
php diff-online-translations.php | |
echo 'Copy new translation files to our local working copy.' | |
cp -rf res /home/myusername/dev/myapp/myandroidapp/ |
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
package nl.nl2312.android.components; | |
import nl.nl2312.android.R; | |
import android.content.Context; | |
import android.content.res.Resources; | |
import android.graphics.drawable.Drawable; | |
import android.support.v4.view.ViewPager; | |
import android.util.AttributeSet; | |
import android.view.ViewGroup; | |
import android.widget.ImageView; |