Skip to content

Instantly share code, notes, and snippets.

View lawloretienne's full-sized avatar
💭
Check out the surf report app I'm working on https://pitted.app

Etienne Lawlor lawloretienne

💭
Check out the surf report app I'm working on https://pitted.app
View GitHub Profile
@jie-meng
jie-meng / values.xml
Created October 11, 2017 08:13
Android Multiline Snackbar To override the predefined value used for that in values.xml of the app
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="design_snackbar_text_max_lines">5</integer>
</resources>
@Bhavdip
Bhavdip / sketch-never-ending.md
Created October 6, 2016 15:53
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

package com.example.marcin.splitlayout;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Region;
@sromku
sromku / ImageScaleView.java
Created November 20, 2015 15:32
Image View Top Crop / Bottom Crop
/**
* Scale to center top or scale to center bottom
*
* @author sromku
*/
public class ImageScaleView extends ImageView {
private MatrixCropType mMatrixType = MatrixCropType.TOP_CENTER; // default
private enum MatrixCropType {
@kaushikgopal
kaushikgopal / RoundedBitmapDrawableUsage.java
Last active March 25, 2024 13:55
RoundedImageView - drop dead easy way to do this with RoundedBitmapDrawable
Bitmap batmapBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.batman);
RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(getResources(), batmapBitmap);
// option 1 h/t [Chris Banes](https://chris.banes.me/)
circularBitmapDrawable.setCornerRadius(batmapBitmap.getWidth());
// option 2 h/t @csorgod in the comments
circularBitmapDrawable.setCircular(true);
@lapastillaroja
lapastillaroja / DividerItemDecoration.java
Last active November 17, 2023 23:06 — forked from akmalxxx/DividerItemDecoration.java
DividerItemDecoration. RecyclerView.ItemDecoration simple implementation
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
@cdsap
cdsap / AndroidManifest.xml
Last active January 7, 2021 17:59
Example ManifestPlaceHolder
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapplication" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
@snadjafi
snadjafi / CancelableCallback.java
Created August 28, 2014 20:49
retrofit cancelableCallbacks for fragment use
public class CancelableCallback<T> implements Callback<T> {
private Callback<T> callback;
private boolean canceled;
public CancelableCallback(Callback<T> callback) {
this.callback = callback;
canceled = false;
}
@snadjafi
snadjafi / photoQuestionView.java
Created July 22, 2014 19:56
custom view with butterknife exmaple
public class PhotoQuestionAnswer extends FrameLayout {
@InjectView(R.id.photo) PicassoImageView photoIv;
public PhotoQuestionAnswer(Context context) {
this(context, null);
}
public PhotoQuestionAnswer(Context context, AttributeSet attrs) {
this(context, attrs, 0);
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 7, 2024 17:37
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\