FIFA Worldcup 2014 Brazil mySQL and JSON dumps, includes data for all participating teams, venues and matches.
Note that match
contains a parameter stage
:
0 => Group games
8 => Round of 16
4 => Quarter-Finals
package com.peirra.tint; | |
import android.graphics.Color; | |
import android.support.v4.graphics.drawable.DrawableCompat; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.ImageView; | |
import java.util.Random; |
FIFA Worldcup 2014 Brazil mySQL and JSON dumps, includes data for all participating teams, venues and matches.
Note that match
contains a parameter stage
:
0 => Group games
8 => Round of 16
4 => Quarter-Finals
public class MyFragment { | |
boolean loaded; | |
private void maybeLoad() { | |
if (!loaded && getUserVisibleHint()) { | |
loaded = true; | |
loadMyData(); | |
} | |
} | |
@Override |
#!/bin/bash | |
# License for any modification to the original (linked below): | |
# ---------------------------------------------------------------------------- | |
# "THE BEER-WARE LICENSE" (Revision 42): | |
# Sebastiano Poggi wrote this file. As long as you retain this notice you | |
# can do whatever you want with this stuff. If we meet some day, and you think | |
# this stuff is worth it, you can buy me a beer in return. | |
# ---------------------------------------------------------------------------- | |
prefix=${1-"drawable"} | |
buckets=( mdpi hdpi xhdpi xxhdpi xxxhdpi ) |
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > | |
<!-- Drop Shadow Stack --> | |
<item> | |
<shape> | |
<padding | |
android:bottom="1dp" | |
android:left="1dp" | |
android:right="1dp" |
// From http://stackoverflow.com/questions/25628258/align-text-around-imagespan-center-vertical | |
public class CenteredImageSpan extends ImageSpan { | |
// Extra variables used to redefine the Font Metrics when an ImageSpan is added | |
private int initialDescent = 0; | |
private int extraSpace = 0; | |
public CenteredImageSpan(final Drawable drawable) { | |
this(drawable, entry, DynamicDrawableSpan.ALIGN_BOTTOM); |
import android.content.Context; | |
import android.support.annotation.NonNull; | |
import android.support.design.widget.BottomSheetBehavior; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import java.util.ArrayList; | |
/** | |
* Wrapper around {@link BottomSheetBehavior} with support for multiple callbacks. |
String frequencyToChannel(String frequency) { | |
switch(frequency) { | |
case "2412" : | |
return "ch 1 - 2.4ghz"; | |
case "2417" : | |
return "ch 2 - 2.4ghz"; | |
case "2422" : | |
return "ch 3 - 2.4ghz"; | |
case "2427" : | |
return "ch 4 - 2.4ghz"; |
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
open class BaseRepository{ | |
suspend fun <T : Any> safeApiCall(call: suspend () -> Response<T>, errorMessage: String): T? { | |
val result : Result<T> = safeApiResult(call,errorMessage) | |
var data : T? = null | |
when(result) { | |
is Result.Success -> | |
data = result.data |