Skip to content

Instantly share code, notes, and snippets.

Avatar
🎧
Focusing

Mert Şimşek iammert

🎧
Focusing
View GitHub Profile
@gokhanbarisaker
gokhanbarisaker / PicassoDecoder.java
Last active Sep 1, 2016
Picasso decoder for subsampling-scale-image-view
View PicassoDecoder.java
/**
* Created by gokhanbarisaker on 8/30/15.
*/
public class PicassoDecoder implements ImageDecoder
{
private String tag;
private Picasso picasso;
public PicassoDecoder(String tag, Picasso picasso) {
this.tag = tag;
@sohamtriveous
sohamtriveous / build.gradle
Last active Feb 1, 2017
A sample RxJava-Android and retrolambda gradle configuration for Android Studio on Mac OS.
View build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.example.databaseexample"
minSdkVersion 14
targetSdkVersion 22
@iammert
iammert / gist:faa6cd996c752dcfb10a
Created Sep 16, 2015
update gitignore already commited
View gist:faa6cd996c752dcfb10a
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
git push origin master
@jeffdgr8
jeffdgr8 / TimePickerDialogFixedNougatSpinner.java
Last active Jan 21, 2021
TimePickerDialog with fixed android:timePickerMode spinner in Nougat
View TimePickerDialogFixedNougatSpinner.java
package my.packagename;
import android.app.TimePickerDialog;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.TimePicker;
import java.lang.reflect.Constructor;
View PresenterLoader.java
import android.content.Context;
import android.support.v4.content.Loader;
public final class PresenterLoader<T extends Presenter> extends Loader<T>{
private final PresenterFactory<T> factory;
private T presenter;
public PresenterLoader(Context context, PresenterFactory<T> factory) {
super(context);
@JakeWharton
JakeWharton / AutoGson.java
Last active Nov 28, 2021
A Gson TypeAdapterFactory which allows serialization of @autovalue types. Apache 2 licensed.
View AutoGson.java
import com.google.auto.value.AutoValue;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Marks an {@link AutoValue @AutoValue}-annotated type for proper Gson serialization.
* <p>
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8"/>
<uses-permission android:name="android.permission.READ_CONTACTS" />
<application android:label="@string/app_name">
anonymous
anonymous / gist:3b25e358e87334292ce5
Created Jun 18, 2015
Swipe Dismiss
View gist:3b25e358e87334292ce5
import android.animation.ObjectAnimator;
import android.graphics.Rect;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.MotionEvent;
import android.view.View;
public class MainActivity extends AppCompatActivity {
@iPaulPro
iPaulPro / include_list_viewpager.xml
Last active Apr 9, 2022
CollapsingToolbarLayout with TabLayout
View include_list_viewpager.xml
<?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
~
~ Unless required by applicable law or agreed to in writing, software
@granoeste
granoeste / EachDirectoryPath.md
Last active Apr 26, 2022
[Android] How to get the each directory path.
View EachDirectoryPath.md

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories