Skip to content

Instantly share code, notes, and snippets.

Sudhanshu sud007

Block or report user

Report or block sud007

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
alexjlockwood / RingOfCirclesView.kt
Last active Aug 27, 2019
Kotlin implementation of a Ring of Circles animation, inspired by
View RingOfCirclesView.kt
import android.content.Context
import android.util.AttributeSet
import android.view.View
private const val N = 16
private const val PERIOD1 = -10000.0
private const val PERIOD2 = -500.0
rylexr / YourFragment.kt
Created Feb 26, 2019
Android navigation bar style with animation
View YourFragment.kt
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
binding = DataBindingUtil.inflate(inflater, R.layout.your_fragment, container, false)
binding.homeAction.setOnClickListener { select( }
binding.likesAction.setOnClickListener { select( }
binding.searchAction.setOnClickListener { select( }
binding.profileAction.setOnClickListener { select( }
return binding.root
fun select(id: Int) {
paulocaldeira17 /
Last active Aug 27, 2019
Android AppBarLayout collapsed/expanded state listener
* App bar collapsing state
* @author Paulo Caldeira <>.
public abstract class AppBarStateChangeListener implements AppBarLayout.OnOffsetChangedListener {
// State
public enum State {
iPaulPro / include_list_viewpager.xml
Last active Aug 24, 2019
CollapsingToolbarLayout with TabLayout
View include_list_viewpager.xml
<?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
~ Unless required by applicable law or agreed to in writing, software
grantland /
Last active Aug 15, 2019
RecyclerView item onClick

RecyclerView item onClick

RecyclerView does not have an OnItemClickListener like it's predecessor, ListView. However, detecting item clicks is pretty simple.

Set an OnClickListener in your ViewHolder creation:

private class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder>  {

    public static class ViewHolder extends RecyclerView.ViewHolder
jackmahoney / Static typeface
Created Feb 24, 2014
Set custom font on an android custom textview. Untested code, be sure to test.
View Static typeface
public class TextHelper{
private static TypeFace typeface = null;
public static void setTypeface(Context context, TextView textview){
if(this.typeface == null){
this.typeface = Typeface.createFromAsset(context.getAssets(), "Helvetica_Neue.ttf");
artem-zinnatullin /
Last active Aug 27, 2019
If you need to set one font for all TextViews in android application you can use this solution. It will override ALL TextView's typefaces, includes action bar and other standard components, but EditText's password font won't be overriden.
public class MyApp extends Application {
public void onCreate() {
TypefaceUtil.overrideFont(getApplicationContext(), "SERIF", "fonts/Roboto-Regular.ttf"); // font from assets: "assets/fonts/Roboto-Regular.ttf
package com.jwo.example.sampleform;
import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
/* Copyright 2013 Google Inc.
Licensed under Apache 2.0: */
package com.example.latlnginterpolation;
import android.animation.ObjectAnimator;
import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.os.Build;
jamiechapman /
Last active Mar 14, 2019
A Serializable ParseObject Proxy
// By Jamie Chapman, @chappers57
// License: open, do as you wish, just don't blame me if stuff breaks ;-)
public class ParseProxyObject implements Serializable {
private static final long serialVersionUID = 1L;
private HashMap<String, Object> values = new HashMap<String, Object>();
public HashMap<String, Object> getValues() {
return values;
You can’t perform that action at this time.