Skip to content

Instantly share code, notes, and snippets.

View abunayem's full-sized avatar
🎯
Focusing

Abu Nayem abunayem

🎯
Focusing
View GitHub Profile
@romsalva
romsalva / niceColors.txt
Created November 5, 2013 19:01
Named colors in rgb-hex, rgb-0-255, and rgb-0.0f-1.0f formats.
Black #000000 0-0-0 0.0f, 0.0f, 0.0f
White #FFFFFF 255-255-255 1.0f, 1.0f, 1.0f
10% Gray #EBEBEB 235-235-235 0.92f, 0.92f, 0.92f
15% Gray #E1E1E1 225-225-225 0.88f, 0.88f, 0.88f
20% Gray #D7D7D7 215-215-215 0.84f, 0.84f, 0.84f
25% Gray #D7D7D7 204-204-204 0.8f, 0.8f, 0.8f
30% Gray #C2C2C2 194-194-194 0.76f, 0.76f, 0.76f
35% Gray #B7B7B7 183-183-183 0.71f, 0.71f, 0.71f
40% Gray #ACACAC 172-172-172 0.67f, 0.67f, 0.67f
45% Gray #A0A0A0 161-161-161 0.63f, 0.63f, 0.63f
@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
}
}
@tadast
tadast / countries_codes_and_coordinates.csv
Last active November 19, 2024 05:25
Countries with their (ISO 3166-1) Alpha-2 code, Alpha-3 code, UN M49, average latitude and longitude coordinates
Country Alpha-2 code Alpha-3 code Numeric code Latitude (average) Longitude (average)
Afghanistan AF AFG 4 33 65
Åland Islands AX ALA 248 60.116667 19.9
Albania AL ALB 8 41 20
Algeria DZ DZA 12 28 3
American Samoa AS ASM 16 -14.3333 -170
Andorra AD AND 20 42.5 1.6
Angola AO AGO 24 -12.5 18.5
Anguilla AI AIA 660 18.25 -63.1667
Antarctica AQ ATA 10 -90 0
@AvatarQing
AvatarQing / AudioPlayer.java
Last active December 3, 2020 17:01
MediaPlayer播放音频封装类
package com.hk.agg.im.utils;
import android.content.Context;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
import android.media.MediaPlayer.OnPreparedListener;
import android.os.PowerManager;
import android.text.TextUtils;
@gabrielemariotti
gabrielemariotti / Readme.md
Last active March 2, 2024 23:10
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@neonankiti
neonankiti / FileCreateActivity.java
Created April 9, 2016 14:06
How to create text file.
package com.finc.strageframewok;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
@nesquena
nesquena / PatternEditableBuilder.java
Last active October 21, 2022 10:20
PatternEditableBuilder - Easy way to create colored clickable spans within a TextView!
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.regex.Matcher;
@cbeyls
cbeyls / RecyclerViewCursorAdapter.java
Last active April 19, 2018 20:24
Simplified CursorAdapter designed for RecyclerView
package be.digitalia.common.adapters;
import android.database.Cursor;
import android.support.v7.widget.RecyclerView;
/**
* Simplified CursorAdapter designed for RecyclerView.
*
* @author Christophe Beyls
*/
@florina-muntenescu
florina-muntenescu / Data.kt
Last active October 16, 2024 21:39
Using RoomDatabase#Callback to pre-populate the database - https://medium.com/google-developers/7-pro-tips-for-room-fbadea4bfbd1
/*
* Copyright (C) 2017 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
*
* Unless required by applicable law or agreed to in writing, software
@florina-muntenescu
florina-muntenescu / CustomTypefaceSpan.kt
Last active July 2, 2024 09:28
Style internationalized text using Annotations
/*
* Copyright (C) 2018 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
*
* Unless required by applicable law or agreed to in writing, software