Skip to content

Instantly share code, notes, and snippets.

View AravinthVelusamy's full-sized avatar
🎯
Focusing

Aravinth Velusamy AravinthVelusamy

🎯
Focusing
View GitHub Profile
class SearchActivity : AppCompatActivity() {
lateinit var dataBinding: ActivitySearchBinding
lateinit var viewModel: SearchSharedViewModel
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
dataBinding = DataBindingUtil.setContentView(this, R.layout.activity_search)
viewModel = ViewModelProviders.of(this).get(SearchSharedViewModel::class.java)
createFragments()
@AravinthVelusamy
AravinthVelusamy / MyVideoRecyclerViewAdapter.java
Created January 6, 2019 15:38 — forked from shubhubhosale/MyVideoRecyclerViewAdapter.java
Android AutoPlay Videos in RecyclerView like Instagram using SimpleVideoView and
package pune.university.engineering.gifutilstest;
import android.content.Context;
import android.net.Uri;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
@AravinthVelusamy
AravinthVelusamy / QRCode.java
Created December 19, 2018 14:50 — forked from harshildarji/QRCode.java
Generating QR code in Android.
...
String QRcode = "...";
new generateQrcode(qrcodeImageview).execute(QRcode);
...
private class generateQrcode extends AsyncTask<String, Void, Bitmap> {
public final static int WIDTH = 400;
ImageView bmImage;
public generateQrcode(ImageView bmImage) {
this.bmImage = bmImage;
@AravinthVelusamy
AravinthVelusamy / activity_main.xml
Created December 1, 2018 16:48 — forked from udacityandroid/activity_main.xml
Android for Beginners : Quantity Picker Button Style Solution
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
@AravinthVelusamy
AravinthVelusamy / ScrollingActivity.java
Created October 3, 2018 09:07 — forked from iChintanSoni/ScrollingActivity.java
CollapsingToolbarLayout with TabLayout
public class ScrollingActivity extends AppCompatActivity {
private SectionsPagerAdapter mSectionsPagerAdapter;
private ViewPager mViewPager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_scrolling);
@AravinthVelusamy
AravinthVelusamy / CustomItemClickListener.java
Created September 15, 2018 05:35 — forked from riyazMuhammad/CustomItemClickListener.java
Easy Implementation of RecyclerView custom onItemClickListener
public interface CustomItemClickListener {
public void onItemClick(View v, int position);
}
@AravinthVelusamy
AravinthVelusamy / styles.xml
Created September 9, 2018 07:15 — forked from mustafasevgi/styles.xml
Android appcompat full screen and hide status bar
<resources>
<style name="AppTheme" parent="@style/Theme.AppCompat.Light">
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
</resources>
@AravinthVelusamy
AravinthVelusamy / SpacesItemDecoration.java
Created September 2, 2018 16:57 — forked from yrom/SpacesItemDecoration.java
SpacesItemDecoration for RecyclerView.
import android.graphics.Rect;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
public class SpacesItemDecoration extends RecyclerView.ItemDecoration {
private int space;
private int spanCount;
private int lastItemInFirstLane = -1;
public SpacesItemDecoration(int space) {
@AravinthVelusamy
AravinthVelusamy / DividerItemDecoration.java
Created September 2, 2018 16:56 — forked from alexfu/DividerItemDecoration.java
An ItemDecoration that draws dividers between items. Pulled from Android support demos.
/*
* Copyright (C) 2014 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
@AravinthVelusamy
AravinthVelusamy / ArcUtils.java
Created September 2, 2018 02:17 — forked from sheerazam/ArcUtils.java
Fresco Circular Progress Drawable
public final class ArcUtils {
private static final double FULL_CIRCLE_RADIANS = toRadians(360d);
private ArcUtils() { }
/**
* Draws a circular arc on the given {@code Canvas}.
*
* @param canvas The canvas to draw into.
* @param circleCenter The center of the circle on which to draw the arc.