Skip to content

Instantly share code, notes, and snippets.

View sharish's full-sized avatar

Harish Sridharan sharish

View GitHub Profile
public String getFormattedPrice(Resources resources) {
final String LAKH = "L";
final String CRORE = "C";
double value = getPrice();
String rupees = resources.getString(R.string.rupee);
if (value >= 100) {
public String getFormattedPrice(Resources resources) {
final String LAKH = "L";
final String CRORE = "C";
double value = getPrice();
String rupees = resources.getString(R.string.rupee);
if (value >= 100) {
final PieChart pie = (PieChart) this.findViewById(R.id.pie_chart);
float[] marks = {0.35f, 0.3f, 0.2f,0.15f};
String[] subjects = { "Physics", "Maths", "Chemistry", "CS"};
int[] colors = {Color.RED, Color.GREEN, Color.BLUE, Color.YELLOW};
for (int i = 0; i < marks.length; i++) {
<com.cooltechworks.chartexample.PieChart
android:layout_marginTop="@dimen/margin_medium"
android:id="@+id/pie_chart"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_gravity="center"
/>
<!-- Rating bar drawable -->
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background"
android:drawable="@drawable/apptheme_rate_star_small_off_holo_light" />
<item android:id="@android:id/secondaryProgress"
android:drawable="@drawable/apptheme_rate_star_small_half_holo_light" />
<item android:id="@android:id/progress"
android:drawable="@drawable/apptheme_rate_star_small_on_holo_light" />
</layer-list>
/**
* Copyright 2016 Harish Sridharan
* <p/>
* 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
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless required by applicable law or agreed to in writing, software
package com.cooltechworks.semicircletest;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.text.TextPaint;
import android.util.AttributeSet;
import android.view.MotionEvent;
@sharish
sharish / MainActivity.java
Last active March 9, 2016 07:26
Send Email Animation Along with sending of mail.
package com.cooltechworks.envelopeanimation;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Handler;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Menu;

###Sending the email over mailgun.com

For automatically sending the email after this animation is done, You can use mailgun.com services to autosend the email.

####STEPS:

  • Goto www.mailgun.com and create a new account.
  • Confirm your email address and verify the OTP over mobile SMS
@sharish
sharish / harish.exolist.json
Last active January 24, 2024 02:02
Sample Exo Playlist for Widevine Dash with HDCP v2.0
[
{
"name": "Widevine DASH: MP4,H264",
"samples": [
{
"name": "Sample Demo Video",
"drm_scheme": "widevine",
"uri": "https://drvideotest.streaming.mediaservices.windows.net/b56d4515-6604-4bbb-8465-87ce54759ca7/SampleVideo_1280x720_30mb.ism/manifest(format=mpd-time-csf)",
"drm_license_url": "https://drvideotest.keydelivery.southindia.media.azure.net/Widevine/?kid=604dbd46-3b6f-4cf8-84da-9ddb2a76a7b7",