Skip to content

Instantly share code, notes, and snippets.

View milaptank's full-sized avatar
💭
a lazy android developer

milap tank milaptank

💭
a lazy android developer
View GitHub Profile
@guillermomuntaner
guillermomuntaner / CutCopyPaste.java
Last active May 13, 2024 05:44
EditText which notifies of Cut, Copy and Paste events via an attachable listener
import android.content.Context;
import android.util.AttributeSet;
import android.widget.EditText;
/**
* Original:
* An EditText, which notifies when something was cut/copied/pasted inside it.
* @author Lukas Knuth
* @version 1.0
*
@nocturnalgeek
nocturnalgeek / MailinatorAliases
Last active April 8, 2024 20:45
A list of alternate domains that point to @mailinator.com
@binkmail.com
@bobmail.info
@chammy.info
@devnullmail.com
@letthemeatspam.com
@mailinater.com
@mailinator.net
@mailinator2.com
@notmailinator.com
@reallymymail.com
@lopspower
lopspower / README.md
Last active January 20, 2024 09:18
Publish AAR to jCenter and Maven Central

Publish AAR to jCenter and Maven Central

Twitter

EDIT: You can find this same updated tutorial here -> Medium

Now I'm going to list how to publish an Android libray to jCenter and then syncronize it with Maven Central:

  1. I use "Android Studio" and I have this simple android lib that I would like to be available on maven: CircularImageView
@julianshen
julianshen / CircleTransform.java
Last active November 6, 2023 12:47
CircleTransform for Picasso
/*
* Copyright 2014 Julian Shen
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
@orcchg
orcchg / ExpiryDateTextWatcher.java
Created April 19, 2018 17:29
TextWatcher for expiry date MM/YY automatically adding slash. For Android
import android.graphics.Canvas;
import android.graphics.Paint;
import android.support.annotation.NonNull;
import android.text.Editable;
import android.text.Spannable;
import android.text.TextWatcher;
import android.text.style.ReplacementSpan;
public class ExpiryDateTextWatcher implements TextWatcher {
private int maxLength = 5;
@JakeWharton
JakeWharton / Truss.java
Last active June 9, 2023 07:35
Extremely simple wrapper around SpannableStringBuilder to make the API more logical and less awful. Apache 2 licensed.
import android.text.SpannableStringBuilder;
import java.util.ArrayDeque;
import java.util.Deque;
import static android.text.Spanned.SPAN_INCLUSIVE_EXCLUSIVE;
/** A {@link SpannableStringBuilder} wrapper whose API doesn't make me want to stab my eyes out. */
public class Truss {
private final SpannableStringBuilder builder;
private final Deque<Span> stack;
@milaptank
milaptank / build.gradle
Created April 15, 2016 13:26 — forked from ok3141/build.gradle
Gradle obfuscate string
apply from: "$rootDir/utils.gradle"
android {
defaultConfig {
buildConfigField 'String', 'SECRET_KEY', toJavaCodeString(SECRET_KEY)
}
}
@artem-zinnatullin
artem-zinnatullin / MyApp.java
Last active January 15, 2023 13:04
If you need to set one font for all TextViews in android application you can use this solution. It will override ALL TextView's typefaces, includes action bar and other standard components, but EditText's password font won't be overriden.
public class MyApp extends Application {
@Override
public void onCreate() {
TypefaceUtil.overrideFont(getApplicationContext(), "SERIF", "fonts/Roboto-Regular.ttf"); // font from assets: "assets/fonts/Roboto-Regular.ttf
}
}
@HugoGresse
HugoGresse / MainActivity.java
Created March 2, 2016 11:06
changeFragment
/**
* Change the current displayed fragment by a new one.
* - if the fragment is in backstack, it will pop it
* - if the fragment is already displayed (trying to change the fragment with the same), it will not do anything
*
* @param frag the new fragment to display
* @param saveInBackstack if we want the fragment to be in backstack
* @param animate if we want a nice animation or not
*/
@ok3141
ok3141 / build.gradle
Last active August 9, 2021 11:36
Gradle obfuscate string
apply from: "$rootDir/utils.gradle"
android {
defaultConfig {
buildConfigField 'String', 'SECRET_KEY', toJavaCodeString(SECRET_KEY)
}
}