Skip to content

Instantly share code, notes, and snippets.

View oianmol's full-sized avatar
🏠
Working from home

Anmol Verma oianmol

🏠
Working from home
View GitHub Profile
import android.content.Context;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.OnScrollListener;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.AbsListView;
public class CircularViewModifier extends ViewModifier {
private static final int CIRCLE_OFFSET = 500;
private static final float DEGTORAD = 1.0f / 180.0f * (float) Math.PI;
private static final float SCALING_RATIO = 0.001f;
private static final float TRANSLATION_RATIO = 0.09f;
@Override
void applyToView(final View v, final RecyclerView parent) {
final float halfHeight = v.getHeight() * 0.5f;
@oianmol
oianmol / UriAwareEditText.java
Created July 28, 2017 12:16
This EditText will support GBOARD for gifs and other attachments like "image/png", "image/gif", "image/jpeg","image/webp"
package com.sports.spornado.util.view;
import android.content.Context;
import android.os.Bundle;
import android.support.v13.view.inputmethod.EditorInfoCompat;
import android.support.v13.view.inputmethod.InputConnectionCompat;
import android.support.v13.view.inputmethod.InputContentInfoCompat;
import android.support.v4.os.BuildCompat;
import android.util.AttributeSet;
import android.view.inputmethod.EditorInfo;
@oianmol
oianmol / FileUtils.java
Created July 28, 2017 12:18
File Utils For Gboard edittext extension keyboard
class FileUtils{
@NotNull
public static File buildImageKeyboardSupportUri(@Nullable String extension) {
final long fileId = System.currentTimeMillis();
String filePath = Environment.getExternalStorageDirectory().toString() +
"/keyboardImage/.shared/iks" + String.valueOf(fileId) +
(android.text.TextUtils.isEmpty(extension) ? "" : ("." + extension));
checkAndCreateDir(filePath);
return new File(filePath);
@oianmol
oianmol / UriInfoLoader.kt
Last active July 28, 2017 12:23
Save Uri form gBoard keyboard with uri like gif/png/jpeg's
class UriInfoLoader {
fun loadUriInfo(inputContentInfo: InputContentInfoCompat, context: Context): Single<File>? {
return Single.create<File> { emitter ->
val likUri = inputContentInfo.linkUri
val count = inputContentInfo.description.mimeTypeCount
var ext: String? = null
for (i in 0..count - 1) {
val mimetype = inputContentInfo.description.getMimeType(i)
if (!TextUtils.isEmpty(mimetype)) {
@oianmol
oianmol / GirlWithHairPainted.dart
Created April 6, 2021 08:17
My Experiments with quadraticBezier and CustomPainter in Flutter.
import 'package:flutter/material.dart';
const HAIR_COLOR = Color.fromRGBO(22, 31, 56, 1);
const BG_COLOR = Color.fromRGBO(204, 217, 205, 1);
const LEAVES_COLOR = Color.fromRGBO(64, 144, 130, 1);
const HEART_COLOR = Color.fromRGBO(255, 102, 83, 1);
const GIRL_LIGHT_COLOR = Color.fromRGBO(255, 178, 149, 1);
const GIRL_DARK_COLOR = Color.fromRGBO(253, 157, 121, 1);
const GIRL_CHEEKS_COLOR = Color.fromRGBO(251, 127, 106, 1);
const GIRL_TSHIRT_COLOR = Color.fromRGBO(255, 236, 227, 1);
import 'package:flutter/material.dart';
class StreamLoadingMarchingAnts extends CustomPainter {
late double progress;
StreamLoadingMarchingAnts({required this.progress});
final antPaint = Paint()
..strokeWidth = 2
..strokeCap = StrokeCap.round
### Keybase proof
I hereby claim:
* I am anmol92verma on github.
* I am oianmol (https://keybase.io/oianmol) on keybase.
* I have a public key ASDhcXl6t0yT1V4YFp25xcZOApoQwg-dq_VEUeDlz4DIsQo
To claim this, I am signing this object:
import Some.MutableLiveData
class MyActivity {
private val button = Button()
val vm = MyViewModel()
fun onCreate(){
vm.liveData.observe{value->
///
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="abc_decor_view_status_guard">#ff000000</color>
<color name="abc_decor_view_status_guard_light">#ffffffff</color>
<color name="abc_search_url_text_normal">#7fa87f</color>
<color name="abc_search_url_text_pressed">@android:color/black</color>
<color name="abc_search_url_text_selected">@android:color/black</color>
<color name="accent_material_dark">@color/material_deep_teal_200</color>
<color name="accent_material_light">@color/material_deep_teal_500</color>
<color name="alert_default_error_background">#f44336</color>