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
func tmpl(w io.Writer, text string, data interface{}) { | |
t := template.New("top") | |
t.Funcs(template.FuncMap{ | |
"trim": strings.TrimSpace, | |
// deref allows to use pointer in templates | |
"deref": func(data interface{}) string { | |
if reflect.ValueOf(data).IsNil() { | |
return "" | |
} | |
switch vv := data.(type) { |
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
public static Map<String, String> getHashMapResource(Context c, int hashMapResId) { | |
Map<String, String> map = null; | |
XmlResourceParser parser = c.getResources().getXml(hashMapResId); | |
String key = null, value = null; | |
try { | |
int eventType = parser.getEventType(); | |
while (eventType != XmlPullParser.END_DOCUMENT) { |
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 (C) 2014 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 |
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
<View | |
android:id="@+id/divider" | |
android:layout_width="match_parent" | |
android:layout_height="1px" | |
android:layout_gravity="bottom" | |
android:layout_marginLeft="72dp" | |
android:background="#9e9e9e" | |
android:src="@android:drawable/divider_horizontal_dim_dark" | |
/> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<TextView | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="48dp" | |
android:gravity="center_vertical" | |
android:paddingLeft="72dp" | |
android:paddingRight="16dp" | |
android:textColor="?android:attr/textColorSecondary" |
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
public class Fetcher { | |
public Observable<String> fetch() { | |
return Observable.just("1","2","3").compose(composer()); | |
// Compiler error: Incompatible type: required Observable<String>, found Observable<Object> | |
} | |
private <T> Observable.Transformer<T,T> composer() { | |
return new Observable.Transformer<T, T>() { | |
@Override |
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 (C) 2008 Google Inc. | |
* | |
* 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
package com.comalia.gesicamobile.manager.net; | |
import com.android.volley.toolbox.HurlStack; | |
import com.comalia.gesicamobile.manager.util.NukeSSLCerts; | |
import com.squareup.okhttp.OkHttpClient; | |
import com.squareup.okhttp.OkUrlFactory; | |
import java.io.IOException; | |
import java.net.HttpURLConnection; | |
import java.net.URL; |
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 com.tweetping.util; | |
import android.os.SystemClock; | |
import android.view.View; | |
import android.widget.AdapterView; | |
public abstract class SingleClickListener | |
implements AdapterView.OnItemClickListener, View.OnClickListener { | |
private static final long MIN_CLICK_INTERVAL = 600; |
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 com.comalia.gesicamobile.manager.widget; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import com.comalia.gesicamobile.manager.R; |