Skip to content

Instantly share code, notes, and snippets.

http://www.unicode.org/Public/UNIDATA/SpecialCasing.txt
00DF ß
FB03 ffi
03C3 σ
03C2 ς FINAL
00CC I WITH GRAVE
i
java.text.Collator.getInstance().compare("ch","cw")
@koral--
koral-- / MainActivity.java
Last active August 29, 2015 14:11
Test for #95
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GifImageView gifImageView=new GifImageView(this);
//https://github.com/koral--/android-gif-drawable-sample/blob/master/sample/src/main/res/drawable-nodpi/anim_flag_england.gif
gifImageView.setImageResource(R.drawable.anim_flag_england);
setContentView(gifImageView);
}
}
@koral--
koral-- / gist:844fae1940dd2c692e7c
Created April 17, 2015 19:24
Getting GifDrawable or default one from resources
public static Drawable getDrawable(@NonNull Resources resources, @DrawableRes @RawRes int resId, @Nullable Resources.Theme theme) {
try {
return new GifDrawable(resources, resId);
} catch (IOException ignored) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
return resources.getDrawable(resId, theme);
else
return resources.getDrawable(resId);
}
}
Drawable.Callback gifCallback;
private SpannableStringBuilder handleEmotion(final TextView gifTextView, String content) {
SpannableStringBuilder sb = new SpannableStringBuilder(content);
String regex = "\\[(.+?)\\]";
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(content);
if (m.groupCount() > 0) {
gifCallback = new Drawable.Callback() {
@koral--
koral-- / VersionCodes.java
Created November 24, 2016 15:30
VersionCodes
public static void foo() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
long x = JobInfo.getMinPeriodMillis(); //available on N+, no lint error
} else {
long x = JobInfo.getMinPeriodMillis(); //available on M-, lint error
}
if (isNougatOrAbove()) {
long x = JobInfo.getMinPeriodMillis(); //available on N+, no lint error
} else {
long x = JobInfo.getMinPeriodMillis(); //available on M-, lint check does not work!
@koral--
koral-- / README.md
Last active January 19, 2017 20:33
change-merged gerrit hook pushing branches according to ${GERRIT_SITE}/etc/client_replication_remotes

Requirements

  • bash
  • git

Usage

  • create client_replication_remotes file in ${GERRIT_SITE}/etc/ (syntax in example below)
  • create change-merged file in ${GERRIT_SITE}/hooks
  • make change-merged executable (chmod +x change-merged)
import com.android.ddmlib.AndroidDebugBridge
import com.android.ddmlib.IDevice
import com.android.ddmlib.NullOutputReceiver
import java.util.concurrent.TimeUnit
buildscript {
repositories {
jcenter()
}
@koral--
koral-- / SinglePagerTitleStrip.java
Last active April 10, 2017 10:43
Modification of android.support.v4.view.PagerTitleStrip preserving only primary page indicator, see http://www.thedroidsonroids.com/blog/android/pagertitlestrip-with-current-page-indicator-only/ for more info.
/*
* Copyright (C) 2011 The Android Open Source Project
*
* 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
@koral--
koral-- / bitrise.yml
Last active July 23, 2017 23:22
Bitrise workflow with Open STF
---
format_version: '2'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: android
workflows:
stf_test:
steps:
- activate-ssh-key:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- cache-pull: {}
@koral--
koral-- / app_build.gradle
Last active September 19, 2017 18:52
app
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion versions.compileSdk
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "pl.droidsonroids.bootcamp.rxbootcamp"
minSdkVersion 21