Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Shaban Kamel ShabanKamell

🏠
Working from home
  • Egypt
View GitHub Profile
@ShabanKamell
ShabanKamell / DottedLine.java
Created Sep 20, 2017 — forked from mlagerberg/DottedLine.java
[Vertical dotted line view] #android
View DottedLine.java
package com.pixplicity.gist.ui.views;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathDashPathEffect;
import android.util.AttributeSet;
@ShabanKamell
ShabanKamell / gist:01eb00a8a16b4f1702f2ea03e1252fd4
Created Aug 11, 2017 — forked from yqritc/gist:ccca77dc42f2364777e1
Equal column spacing for Android RecyclerView GridLayoutManager by using custom ItemDecoration
View gist:01eb00a8a16b4f1702f2ea03e1252fd4

ItemOffsetDecoration

public class ItemOffsetDecoration extends RecyclerView.ItemDecoration {

    private int mItemOffset;

    public ItemOffsetDecoration(int itemOffset) {
        mItemOffset = itemOffset;
    }
@ShabanKamell
ShabanKamell / gist:a9bf165cf4e2aee47b7cb39dab1b4a75
Created Aug 11, 2017 — forked from yqritc/gist:ccca77dc42f2364777e1
Equal column spacing for Android RecyclerView GridLayoutManager by using custom ItemDecoration
View gist:a9bf165cf4e2aee47b7cb39dab1b4a75

ItemOffsetDecoration

public class ItemOffsetDecoration extends RecyclerView.ItemDecoration {

    private int mItemOffset;

    public ItemOffsetDecoration(int itemOffset) {
        mItemOffset = itemOffset;
    }
@ShabanKamell
ShabanKamell / AndroidManifest.xml
Created Jun 20, 2017 — forked from bjoernQ/AndroidManifest.xml
Creating a System Overlay (Always on Top over all Apps) in Android
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.mobilej.overlay"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="14" />
<application android:label="SystemOverlay" >
<activity
@ShabanKamell
ShabanKamell / ApiService.java
Created Jun 1, 2017 — forked from dustin-graham/ApiService.java
Infinite Scrolling Android RecyclerView with RxJava
View ApiService.java
public static Observable<List<String>> paginatedThings(final Observable<Void> onNextObservable) {
return Observable.create(new Observable.OnSubscribe<List<String>>() {
@Override
public void call(final Subscriber<? super List<String>> subscriber) {
onNextObservable.subscribe(new Observer<Void>() {
int latestPage = -1;
@Override
public void onCompleted() {
subscriber.onCompleted();
@ShabanKamell
ShabanKamell / Example.java
Created Jun 1, 2017 — forked from nightscape/Example.java
Simple RxJava-based adapter for an Android RecyclerView
View Example.java
public class ReactiveTextViewHolder<T> extends ReactiveViewHolder<T> {
private TextView label;
private T currentItem;
public ReactiveTextViewHolder(View itemView) {
super(itemView);
label = (TextView) itemView.findViewById(android.R.id.text1);
}