Skip to content

Instantly share code, notes, and snippets.

View Bhavdip's full-sized avatar
🎯
Focusing

bhavdip Bhavdip

🎯
Focusing
View GitHub Profile
@venkatesh05
venkatesh05 / customurl.xml
Created June 6, 2012 05:18
Custom Url schema android
<activity android:name=".SampleActivity"
android:label="sample" android:theme="@style/Theme.Titanium"
android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.LAUNCHER" />
<data android:scheme="mobileapp" />
</intent-filter>
@Leandros
Leandros / HockeySender.java
Last active December 11, 2015 17:29 — forked from ashtom/HockeySender.java
Improved Gist
package net.hockeyapp.android.demo;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.acra.ACRA;
import org.acra.collector.CrashReportData;
import org.acra.ReportField;
import org.acra.sender.ReportSender;
@Antarix
Antarix / round_background.xml
Created February 7, 2013 03:39
Round background image drawable for android
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<stroke android:width="1dp" android:color="#FFFFFF" />
<gradient
android:startColor="#679031"
android:centerColor="#679031"
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="#000"
android:background="?android:attr/activatedBackgroundIndicator"
//OnClickListener stub
public class ButtonListener implements OnClickListener {
private UpdateUIListener mUIListener;
public ButtonListener(UpdateUIListener uiListener){
mUIListener = uiListener;
}
@Override
@SebastianEngel
SebastianEngel / TimberLogger.java
Created October 15, 2013 12:12
Wrapper class for Timber logging offering static method calls, e.g. TimberLogger.d("Hello %s", user.name). Evaluates BuildConfig.DEBUG to decide if an instance of Timber.DEBUG or Timber.PROD will be used.
package de.bsr.android.util;
import com.example.app.BuildConfig;
import timber.log.Timber;
/**
* Wrapper class for Timber that evaluates <code>BuildConfig.DEBUG</code> on construction
* and uses Timber.DEBUG or Timber.PROD appropriately. In PROD mode, no logging is done at all.
*
* @author Sebastian Engel <engel.sebastian@gmail.com>
@kitek
kitek / list_selector.xml
Last active January 3, 2016 15:31
Custom ListView selector drawable/list_selector.xml android:listSelector="@drawable/selector"
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:constantSize="true">
<item android:state_focused="false" android:state_pressed="false">
<shape android:shape="rectangle">
<solid android:color="@android:color/transparent" />
<stroke android:width="0dp" android:color="@android:color/transparent" />
<padding android:bottom="1dp" android:left="1dp" android:right="1dp" android:top="1dp" />
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle"
android:dither="true">
<corners android:radius="2dp"/>
<solid android:color="#ccc" />
@lucasr
lucasr / sample.java
Last active March 5, 2016 03:41
Using ItemClickSupport from TwoWayView
ItemClickSupport itemClick = ItemClickSupport.addTo(recyclerView);
itemclick.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(RecyclerView p, View c, int pos, long id) {
...
}
});
itemClick.setOnItemLongClickListener(new OnItemLongClickListener() {
@ashtom
ashtom / HockeySender.java
Created March 1, 2012 09:26
Custom ReportSender for HockeyApp and ACRA
package net.hockeyapp.android.demo;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.acra.ACRA;
import org.acra.collector.CrashReportData;
import org.acra.ReportField;
import org.acra.sender.ReportSender;