Skip to content

Instantly share code, notes, and snippets.

@icastell
icastell / NetworkServiceDiscovery.java
Last active March 17, 2021 17:25
Using Network Service Discovery (Bonjour) in Android
package com.solarfighter.activities;
import java.io.IOException;
import java.net.InetAddress;
import javax.jmdns.JmDNS;
import javax.jmdns.ServiceEvent;
import javax.jmdns.ServiceListener;
import android.content.Context;
@icastell
icastell / emoji_impl.java
Created April 26, 2012 11:23
Emoji implementation
package com.mrm.emoji;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map.Entry;
import android.content.Context;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.ImageSpan;
import com.mrm.emoji.R;
public class EmoticonUtils {
@icastell
icastell / activity_home.xml
Created May 26, 2013 10:27
Pushing the ActionBar to the next level
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:src="@drawable/daft_punk"/>
@icastell
icastell / activity_home.xml
Created May 26, 2013 10:12
Pushing the ActionBar to the next level
<?xml version="1.0" encoding="utf-8"?>
<com.cyrilmottier.android.translucentactionbar.NotifyingScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@icastell
icastell / NotifyingScrollView.java
Created May 26, 2013 10:11
Pushing the ActionBar to the next level
package com.cyrilmottier.android.translucentactionbar;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ScrollView;
/**
* @author Cyril Mottier
*/
public class NotifyingScrollView extends ScrollView {
@icastell
icastell / AndroidManifest.xml
Created May 26, 2013 10:07
Pushing the ActionBar to the next level
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cyrilmottier.android.translucentactionbar"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
@icastell
icastell / styles.xml
Created May 26, 2013 10:06
Pushing the ActionBar to the next level
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Widget.ActionBar" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:background">@drawable/ab_background</item>
</style>
<style name="Widget.ActionBar.Transparent">
<item name="android:background">@android:color/transparent</item>
</style>
</resources>
@icastell
icastell / themes.xml
Created May 26, 2013 10:01
Pushing the ActionBar to the Next Level
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.TranslucentActionBar" parent="@android:style/Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/Widget.ActionBar</item>
</style>
<style name="Theme.TranslucentActionBar.ActionBar" />
<style name="Theme.TranslucentActionBar.ActionBar.Overlay">
<item name="android:actionBarStyle">@style/Widget.ActionBar.Transparent</item>
@icastell
icastell / AndroidManifest.xml
Created May 26, 2013 09:55
Pushing the ActionBar to the Next Level
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cyrilmottier.android.translucentactionbar"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
@icastell
icastell / NotifyingScrollView.java
Created May 26, 2013 10:29
Pushing the ActionBar to the next level
private boolean mIsOverScrollEnabled = true;
public void setOverScrollEnabled(boolean enabled) {
mIsOverScrollEnabled = enabled;
}
public boolean isOverScrollEnabled() {
return mIsOverScrollEnabled;
}