Skip to content

Instantly share code, notes, and snippets.

@HRankit
HRankit / BackgroundColorAndTextColor.json
Last active May 3, 2019 09:01
While working on a project I found out that setting white as text color on an light background caused the text to be unreadable. So made a json file which has 'b' as background color and 't' as text color. Hope this will help someone. All colors have been taken from Google Material Design.
[
{
"b": "5e35b1",
"t": "FFFFFF"
},
{
"b": "512da8",
"t": "FFFFFF"
},
{
@HRankit
HRankit / StackWidgetProvider.java
Last active August 4, 2018 06:04
This is gist for creating a widget. Let me know if something is missing. The Widget has a gridview which shows an image and text below it. It is set to show only one item per column.
package com.udacity.baketime.baketime.widget;
import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@HRankit
HRankit / MainActivity.java
Last active February 27, 2018 05:47
Service to Activity Data Transfer
// In onCreate
LocalBroadcastManager.getInstance(getActivity()).registerReceiver(
MyMsgReceiver, new IntentFilter("GPSLocation"));
// End onCreate
private BroadcastReceiver MyMsgReceiver = new BroadcastReceiver() {
@Override