Skip to content

Instantly share code, notes, and snippets.

View Bhavdip's full-sized avatar
🎯
Focusing

bhavdip Bhavdip

🎯
Focusing
View GitHub Profile
@lucasr
lucasr / SimpleListLayout.java
Last active May 2, 2020 06:21
List layout built with the new TwoWayView API
public class SimpleListLayout extends TwoWayLayoutManager {
public SimpleListLayout(Context context, Orientation orientation) {
super(context, orientation);
}
@Override
protected void measureChild(View child, Direction direction) {
measureChildWithMargins(child, 0, 0);
}
@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() {
@staltz
staltz / introrx.md
Last active May 7, 2024 09:38
The introduction to Reactive Programming you've been missing
@lenamuit
lenamuit / google_now_card.xml
Created June 9, 2014 16:47
Google Now card background
<?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" />
@burntcookie90
burntcookie90 / card_bg.xml
Created June 6, 2014 18:08
Android Cards UI background
<?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="#dbdbdb" />
</shape>
</item>
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator" >
<alpha
android:fromAlpha="0"
android:toAlpha="1"
android:duration="2000" >
</alpha>
@matthew-carroll
matthew-carroll / HttpBoilerplate.java
Last active August 29, 2015 13:59
Intro to Retrofit by Square
// Compose a single request to send to the server:
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("http://www.myserver.com/apis/users/" + userId + "/profile");
List<NameValuePair> bodyParams = new ArrayList<NameValuePair>();
pairs.add(new NameValuePair("first_name", firstName));
pairs.add(new NameValuePair("last_name", firstName));
pairs.add(new NameValuePair("street1", firstName));
pairs.add(new NameValuePair("street2", firstName));
pairs.add(new NameValuePair("zip", firstName));
@scruffyfox
scruffyfox / Card UI
Last active August 29, 2015 13:57
Card drawable
Basic card layout with drawables and styles.
Missing icons: ic_action_remove, ic_action_accept and ic_action_cancel (all can be found in the standard android icon pack)
Example screenshot: https://pbs.twimg.com/media/BmTdvKhIYAAkrPa.png
@smanikandan14
smanikandan14 / gist:9777422
Last active April 19, 2018 10:41
Change action menu text item color actionbar compat.
Tried to follow the naming conventions as mentioned in
http://android-developers.blogspot.com/2013/08/actionbarcompat-and-io-2013-app-source.html
res/values/styles.xml
<resources>
<style name="Theme.Styled" parent="@style/Theme.AppCompat.Light">
<item name="actionBarStyle">@style/Widget.Styled.ActionBar</item>
</style>
@mdaisuke
mdaisuke / rxjava_sample.java
Created February 22, 2014 16:50
rxjava usage in android
package com.mdaisuke.sample;
import android.app.Activity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;