Skip to content

Instantly share code, notes, and snippets.

View dalwadi2's full-sized avatar

Harsh Dalwadi dalwadi2

View GitHub Profile
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = false
max_line_length = 200
tab_width = 4
ij_continuation_indent_size = 8
ij_formatter_off_tag = @formatter:off

<JIRA-TICKET(S)-HERE> (replace me with just JIRA number plz)

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Type of change

  • Bug fix
  • New feature
@dalwadi2
dalwadi2 / RecursiveAlarmHelper.java
Created December 31, 2019 09:49
RecursiveAlarmHelper Working by Mehul Joisar
import android.annotation.SuppressLint;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.util.Log;
import java.util.Date;
@dalwadi2
dalwadi2 / RatingBarColorChange.java
Created September 26, 2018 07:18
Ratingbar that can change colors on every rating.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mBinding = getViewDataBinding();
sessionSummaryVM.setNavigator(this);
setSupportActionBar(mBinding.toolbar);
mBinding.contentSessionSummary.rating.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {
@Override
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.text.DecimalFormat;
import java.util.Enumeration;
import java.util.List;
import java.util.Locale;
@dalwadi2
dalwadi2 / 1 search_bar.xml
Created March 10, 2017 13:36 — forked from nickbutcher/1 search_bar.xml
Demonstrating morphing a search icon into a search field. To do this we use an AnimatedVectorDrawable (https://developer.android.com/reference/android/graphics/drawable/AnimatedVectorDrawable.html) made up of two paths. The first is the search icon (as a single line) the second is the horizontal bar. We then animate the 'trimPathStart' property …
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 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
@dalwadi2
dalwadi2 / ClearTextView.java
Created January 31, 2017 09:29 — forked from togramago/ClearTextView.java
TextView with background and transparent (carved through background) text
package com.runup.myapplication2.app;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.drawable.BitmapDrawable;
@dalwadi2
dalwadi2 / gist:ef7ef1e6d67e9777437aca1904846b6e
Created January 18, 2017 10:24 — forked from pocmo/gist:bc95238e890a185003c4
Android M-Preview 1 - Permissions + Groups + Protection Level
(android.permission-group.CONTACTS) android.permission.READ_CONTACTS dangerous
(android.permission-group.CONTACTS) android.permission.WRITE_CONTACTS dangerous
(android.permission-group.CONTACTS) android.permission.READ_PROFILE dangerous
(android.permission-group.CONTACTS) android.permission.WRITE_PROFILE dangerous
(android.permission-group.CALENDAR) android.permission.READ_CALENDAR dangerous
(android.permission-group.CALENDAR) android.permission.WRITE_CALENDAR dangerous
(android.permission-group.SMS) android.permission.SEND_SMS dangerous
(android.permission-group.SMS) android.permission.RECEIVE_SMS dangerous
(android.permission-group.SMS) android.permission.READ_SMS dangerous
(android.permission-group.SMS) android.permission.RECEIVE_WAP_PUSH dangerous
@dalwadi2
dalwadi2 / ValidationUtils.java
Created January 11, 2017 06:04
Validation Utils
package io.github.dalwadi2.vaidationutils;
import android.content.Context;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ValidationUtils {
private final Context mContext;
@dalwadi2
dalwadi2 / CustomTextView.java
Last active January 20, 2017 18:31
CustomTextView that have functionality to change TextViewDrawable size.
package com.samcomtechnologies.chumchatclient.utils;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.TextView;