Skip to content

Instantly share code, notes, and snippets.

View mgrabarski's full-sized avatar
😀

Mateusz Grabarski mgrabarski

😀
View GitHub Profile
@mgrabarski
mgrabarski / libs.versions.toml
Created June 28, 2023 12:13 — forked from BobbyESP/libs.versions.toml
A very complete TOML file for Android Development mainly thought for the new Jetpack Compose framework
[versions]
accompanist = "0.29.2-rc"
androidGradlePlugin = "7.4.2"
androidxComposeBom = "2023.01.00"
androidxComposeCompiler = "1.4.6"
androidxCore = "1.10.0-rc01"
androidMaterial = "1.9.0-alpha02"
androidxAppCompat = "1.7.0-alpha02"
androidxActivity = "1.7.1"
markdownDependency = "0.3.2"
@mgrabarski
mgrabarski / gist-example
Last active July 13, 2021 12:32
Blog: Dodanie ładnie wyglądającego kodu z GitHub gist do wpisu na blog
fun main() {
println("Hi!")
}
@mgrabarski
mgrabarski / gist:26cc9c14e37dc2b7cad38794a92562c5
Last active July 9, 2021 11:09
Android Room - wstęp do baz danych
def room_version = "2.3.0"
implementation 'androidx.room:room-runtime:$room_verion'
implementation 'androidx.room:room-ktx:$room_version'
kapt 'androidx.room:room-compiler:$room_verion'
@mgrabarski
mgrabarski / README.md
Created March 18, 2020 12:05 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@mgrabarski
mgrabarski / .gitlab-ci.yml
Created February 18, 2019 08:45 — forked from kytta/.gitlab-ci.yml
GitLab CI config for an Android project
image: jangrewe/gitlab-ci-android
variables:
ANDROID_COMPILE_SDK: "27"
APP_NAME: "NameOfYourApp"
cache:
key: ${CI_PROJECT_ID}
paths:
- .m2/
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.util.Log;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
public final class BitmapUtils {
private BitmapUtils(){}
private void hideEditText(final LinearLayout revealView) {
int cx = revealView.getRight() - 30;
int cy = revealView.getBottom() - 60;
int initalRadius = revealView.getWidth();
Animator anim = ViewAnimationUtils.createCircularReveal(revealView,
cx, cy, initalRadius, 0f);
anim.addListener(new AnimatorListenerAdapter() {
@Override
public class AppPreferences {
// shared preferences keys
private static final String KEY_USER_NAME = "KEY_USER_NAME";
private static final String PREFERENCES_NAME = "PREFERENCES_FILE_NAME";
private SharedPreferences sharedPreferences;
public AppPreferences(Context context) {
// Dependencies for local unit tests
testCompile "junit:junit:4.12"
testCompile "org.mockito:mockito-all:1.10.19"
testCompile "org.hamcrest:hamcrest-all:1.3"
testCompile "org.powermock:powermock-module-junit4:1.6.2"
testCompile "org.powermock:powermock-api-mockito:1.6.2"
// Android Testing Support Library's runner and rules
androidTestCompile "com.android.support.test:runner:1.0.1"
androidTestCompile "com.android.support.test:rules:1.0.1"