Skip to content

Instantly share code, notes, and snippets.

View Anthonyeef's full-sized avatar
🎯
🐈

Yifen Wu Anthonyeef

🎯
🐈
View GitHub Profile
@cesarferreira
cesarferreira / api.java
Last active February 1, 2022 16:32
RxJava and Retrofit sample
public interface API {
@GET("/user/{username}/dogs")
Observable<Dog> getAllDogsOf(@Path("username") String username);
@GET("/dog/{id}")
Observable<Dog> getDogInfoById(@Path("id") int dogId);
}
@cesarferreira
cesarferreira / RxJava.md
Last active February 2, 2022 07:28
Party tricks with RxJava, RxAndroid & Retrolambda

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

Observable
    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
@serj-lotutovici
serj-lotutovici / Oauth1SigningInterceptor.java
Last active March 1, 2024 15:46 — forked from JakeWharton/Oauth1SigningInterceptor.java
An OkHttp interceptor which does OAuth1 signing. Requires Java 7 (but can easily be ported to Java 6).
/*
* Copyright (C) 2015 Jake Wharton
*
* 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
@riyazMuhammad
riyazMuhammad / CustomItemClickListener.java
Last active December 30, 2020 15:10
Easy Implementation of RecyclerView custom onItemClickListener
public interface CustomItemClickListener {
public void onItemClick(View v, int position);
}
@iPaulPro
iPaulPro / include_list_viewpager.xml
Last active March 7, 2024 11:13
CollapsingToolbarLayout with TabLayout
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (C) 2015 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
@gelldur
gelldur / HideNavigationBarComponent.java
Last active June 17, 2022 17:56
HideNavigationBarComponent.java
package com.dexode.core.view;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnSystemUiVisibilityChangeListener;
@waylife
waylife / LauncherUtil
Created March 14, 2015 09:42
ShortcutUtil
import java.util.List;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
import android.text.TextUtils;
/**
# =======================================
# OS X — ONE CLICK — EJECT ALL DISKS
# =======================================
# Open Script Editor on OS X
# Copy and paste this file in
# Pre-High Sierra: Save As > Application
# High Sierra: Export > File Format > Application
# Name it "Eject All Disks"
# Drag created application to Dock
# Now you can eject all external disks with one click from Dock
@gabrielemariotti
gabrielemariotti / README.md
Last active March 9, 2023 06:02
A SectionedGridRecyclerViewAdapter: use this class to realize a simple sectioned grid `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned grid RecyclerView.Adapter without changing your code.

Screen

The RecyclerView has to use a GridLayoutManager.

This is a porting of the class SimpleSectionedListAdapter provided by Google

If you are looking for a sectioned list RecyclerView.Adapter you can take a look here

@InsanityOnABun
InsanityOnABun / MarqueeToolbar.java
Created January 4, 2015 03:35
A Marquee-able Android Toolbar.
import android.content.Context;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.widget.TextView;
import java.lang.reflect.Field;
public class MarqueeToolbar extends Toolbar {