Skip to content

Instantly share code, notes, and snippets.

View amalChandran's full-sized avatar
💭
I may be slow to respond.

Amal Chandran amalChandran

💭
I may be slow to respond.
View GitHub Profile
When Edison had been an unknown inventor who specialized in the
telegraphic equipment business, reporters had not sought him out and begged
him for an opportunity to become his friend. Now, however, in early May 1878,
sycophantic journalists led him to believe that he was wise in all manner of
subjects, far afield of the electrical business. If they wished to listen to his
opinions, and they did indeed, he was glad to hold forth on any topic, such as the
relationship of diet to national destiny, a lecture delivered over lunch while
digging into strawberry shortcake, strawberries and cream, and an apple
dumpling.
@amalChandran
amalChandran / Map.java
Created January 13, 2017 04:51
How to Set Polyline fit to screen
public void onMapReady(GoogleMap googleMap) {
map.clear();
map = googleMap;
LatLng hcmus = new LatLng(Double.parseDouble(latitude1), Double.parseDouble(longitude1));
map.moveCamera(CameraUpdateFactory.newLatLngZoom(hcmus, 10));
originMarkers.add(map.addMarker(new MarkerOptions()
.title(mStudentObject.getAddress())
.position(hcmus)));
LatLng startMarker=new LatLng(Double.parseDouble(latitude1),Double.parseDouble(longitude1));
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/content_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
@amalChandran
amalChandran / BezInterpolator.java
Last active November 1, 2019 13:11
Easy custom interpolators for android.
public class BezInterpolator {
private static BezInterpolator bezInterpolator;
//Control points to create the cubic bezier curve.
private float[] PRINCIPLE_DEFAULT_EASE = {(float)0.25, (float)0.1, (float)0.25, (float)1.0};
private float[] EASE_OUT = {(float)0, (float)0, (float)0.58, (float)1.0};
private float[] EASE_IN = {(float)0.42, (float)0, (float)1.0, (float)1.0};
public static BezInterpolator getInstance(){
@amalChandran
amalChandran / 1_drawable_ic_hash_io16.xml
Created March 19, 2016 16:21 — forked from nickbutcher/1_drawable_ic_hash_io16.xml
Animated Stroke. The google I/O website this year (https://google.com/io) has some funky animated lettering. I especially liked the animated stroke around the letters and wondered how you might implement that on Android. Turns out that AnimatedVectorDrawable makes this very easy! Here's how it looks: https://twitter.com/crafty/status/71077957997…
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016 Google Inc.
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
@amalChandran
amalChandran / gist:51f6a0e32379d93263de
Last active September 15, 2015 15:37 — forked from ec84b4/gist:d56c00fb5fd2dfaf279b
recycler view header adapter
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
/**
* Created by khaled bakhtiari on 10/26/2014.
* <a href="http://about.me/kh.bakhtiari">
*/