Skip to content

Instantly share code, notes, and snippets.

View raghunandankavi2010's full-sized avatar
🤵‍♂️
Android dev looking to learn new technologies and always open for a new job.

Raghunandan Kavi raghunandankavi2010

🤵‍♂️
Android dev looking to learn new technologies and always open for a new job.
View GitHub Profile
@raghunandankavi2010
raghunandankavi2010 / ProgressDrawable.java
Created September 25, 2015 03:37 — forked from adneal/ProgressDrawable.java
A custom ColorDrawable that can easily be implemented as a progress bar.
/*
* Copyright 2013 Andrew Neal
*
* 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
@raghunandankavi2010
raghunandankavi2010 / GifDecoder.java
Created February 19, 2016 17:03 — forked from devunwired/GifDecoder.java
An optimized implementation of GifDecoder for Android devices.
/**
* Copyright (c) 2013 Xcellent Creations, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@raghunandankavi2010
raghunandankavi2010 / Readme.md
Created February 24, 2016 04:56 — forked from gabrielemariotti/Readme.md
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

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

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@raghunandankavi2010
raghunandankavi2010 / CrystalSeekbar.java
Created February 18, 2017 18:35
Seekbar with touch move only on circle touch and not the highlight bar
package com.example.raghu.myapplication;
/**
* Created by Raghu on 18-02-2017.
*/
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
public class RoundImageview extends NetworkImageView {
Context mContext;
public RoundImageview(Context context) {
super(context);
mContext = context;
}
public RoundImageview(Context context, AttributeSet attrs) {
this(context, attrs, 0);
@raghunandankavi2010
raghunandankavi2010 / LoadImage.java
Created March 11, 2017 09:56
Glide loading image code
Glide.with(activity).load(feedItems.get(position).getUser_details().getUser_profile_image())
.asBitmap().centerCrop()
.placeholder(R.drawable.pod_h)
.into(new BitmapImageViewTarget(viewHolder.profilePic) {
@Override
protected void setResource(Bitmap resource) {
RoundedBitmapDrawable circularBitmapDrawable =
RoundedBitmapDrawableFactory.create(activity.getResources(), resource);
circularBitmapDrawable.setCircular(true);
viewHolder.profilePic.setImageDrawable(circularBitmapDrawable);
@raghunandankavi2010
raghunandankavi2010 / FinalLoad.java
Created March 11, 2017 10:04
Glide loding circular image with transformations
if(feedItems.get(position).getUser_details()!=null) {
Glide.with(activity).load(feedItems.get(position).getUser_details().getUser_profile_image())
.bitmapTransform(new CropCircleTransformation(activity))
.placeholder(R.drawable.pod_h)
.into(viewHolder.profilePic);
}else
{
// make sure Glide doesn't load anything into this view until told otherwise
Glide.clear(viewHolder.profilePic);
@raghunandankavi2010
raghunandankavi2010 / GlideImageLoad.java
Created March 12, 2017 04:23
Loading image via glide
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
final ViewHolder viewHolder;
if (convertView == null) {
viewHolder = new ViewHolder();
convertView = mLayoutInflater.inflate(R.layout.all_noti_item, parent, false);
viewHolder.profilePic = (ImageView) convertView.findViewById(R.id.profilePic);
convertView.setTag(viewHolder);
@raghunandankavi2010
raghunandankavi2010 / GridItemDecoration
Created June 15, 2017 08:23
RecyclerView grid item decoration
import android.graphics.Rect;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.TypedValue;
import android.view.View;
/**
* Created by Raghunandan on 17-11-2015.
*/
public class GridItemDecoration extends RecyclerView.ItemDecoration {
@raghunandankavi2010
raghunandankavi2010 / GridItemDecoration
Created June 27, 2017 05:56
GridItemDecoration for recyclerview
import android.graphics.Rect;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.TypedValue;
import android.view.View;
/**
* Created by Raghunandan on 17-11-2015.
*/
public class GridItemDecoration extends RecyclerView.ItemDecoration {