Skip to content

Instantly share code, notes, and snippets.

View TimCastelijns's full-sized avatar

Tim Castelijns TimCastelijns

  • Coolblue
View GitHub Profile
@TimCastelijns
TimCastelijns / foo.kt
Created November 9, 2018 15:07
onSizeChanged with linear gradient set up
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
super.onSizeChanged(w, h, oldw, oldh)
val colors = intArrayOf(
typedArray.getColor(R.styleable.SlickGraph_gradColorStart, defaultColor),
typedArray.getColor(R.styleable.SlickGraph_gradColorEnd, defaultColor)
)
val gradient = LinearGradient(
0f,
val input = "738576468625144447399791512378297253634373265751783467175946279546121378242834293189618169557899627432131741924235953478395737293295377433633811848896717272765186249883819531765428979755868345851112699621795332281722937237345586217784447844339183548459152523565186346489117792724495492582778679943653659256137426929947473832129357538589943844655856924123627877977998358791243139547524479653888837328718692164742686623775673734273197676395949914999631559158471612219918329527743987291137131392459448676647943854441741652974349511481982598452443736722523418477261794252595496113697687532518272575476837268453197261445513452359633835537444427352211536223873438316477812937662862149766296545676163179617835359962988766593952189244736121947964648397879839271611979328271773952489738595827372677631815497767554628778987426533968875397718512933492971548638187528627852824769646416229769169815471277558954194526357489726657599645554762553794792797249797933393211516515146274221632732111629137239658561866447571532129812
val input = "738576468625144447399791512378297253634373265751783467175946279546121378242834293189618169557899627432131741924235953478395737293295377433633811848896717272765186249883819531765428979755868345851112699621795332281722937237345586217784447844339183548459152523565186346489117792724495492582778679943653659256137426929947473832129357538589943844655856924123627877977998358791243139547524479653888837328718692164742686623775673734273197676395949914999631559158471612219918329527743987291137131392459448676647943854441741652974349511481982598452443736722523418477261794252595496113697687532518272575476837268453197261445513452359633835537444427352211536223873438316477812937662862149766296545676163179617835359962988766593952189244736121947964648397879839271611979328271773952489738595827372677631815497767554628778987426533968875397718512933492971548638187528627852824769646416229769169815471277558954194526357489726657599645554762553794792797249797933393211516515146274221632732111629137239658561866447571532129812
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.resource.bitmap.BitmapTransitionOptions;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.bumptech.glide.request.RequestOptions;
saBusiness.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() {
@Override
public void onProgressChanged(SeekArc seekArc, int i, boolean b) {
int text = R.string.week_overview_clear;
int color = R.color.week_overview_clear;
if (i > 75) {
text = R.string.week_overview_swamped;
color = R.color.week_overview_swamped;
} else if (i > 50) {
text = R.string.week_overview_busy;
version: '3'
services:
thumbnail:
build: .
ports:
- "8080:8080"
volumes:
- .:/code
extra_hosts:
- "gae.com:172.18.0.1"
# -*- coding: utf-8 -*-
"""
Example of how to use Poster.encode on AppEngine.
http://atlee.ca/software/poster/
The only variation needed versus the example from Poster is that
GAE's UrlFetch cannot use the generator returned by multipart_encode()
for payload, so simply create a payload string first.
"""
public class SearchablesListAdapter extends BaseAdapter {
private interface Searchable {
String getSearchableName();
}
private class Country implements Searchable {
@Override
public String getSearchableName() {
<div class="navbar-fixed">
<nav>
<div class="nav-wrapper">
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="#" class="dropdown-button" data-beloworigin="true" data-activates="dropdown_account"
data-constrainwidth="false" data-alignment="right"><i class="material-icons">account_circle</i></a></li>
</ul>
</div>
</nav>
</div>
@TimCastelijns
TimCastelijns / LocationUpdateService.java
Created February 17, 2017 15:17
requesting location updates using IntentService
public class LocationUpdateService extends IntentService {
private Realm realm;
public LocationUpdateService() {
super("LocationUpdateService");
}
@Override
protected void onHandleIntent(Intent intent) {