Skip to content

Instantly share code, notes, and snippets.

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.*;
import android.util.AttributeSet;
import com.android.volley.toolbox.NetworkImageView;
public class FadeInNetworkImageView extends NetworkImageView {
private static final int FADE_IN_TIME_MS = 250;
@wingoku
wingoku / gist:eee1e95bea313f8a0206
Last active September 25, 2015 07:21
CardView shadow rendering issue
/**
* Created by wingoku on 2/4/15.
*/
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Color;
import android.os.Build;
import android.support.v7.widget.CardView;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
Add this class to your project, sample: https://github.com/tajchert/ShapeWear/blob/master/wear/src/main/java/pl/tajchert/shapewearsample/MainActivity.java
To start call `ShapeWear.initShapeWear(this);` and in most basic case use `ShapeWear.isRound()` to check if device screen is round.
Source: https://github.com/tajchert/ShapeWear
```java
package pl.tajchert.shapewear;
/*
package com.wingoku.myTests;
import android.app.Activity;
import android.app.Instrumentation;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.Looper;
import android.support.test.InstrumentationRegistry;
import android.support.test.espresso.Espresso;
/*
* Copyright (C) 2016 Umer Farooq (wingoku)
*
* 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
/*
* Copyright (C) 2016 Umer Farooq (wingoku)
*
* 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
/*
* Copyright (C) 2016 Umer Farooq (wingoku)
*
* 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
/*
* Copyright (C) 2016 Umer Farooq (wingoku)
*
* 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
/*
* Copyright (C) 2016 Umer Farooq (wingoku)
*
* 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
/*
* Copyright (C) 2016 Umer Farooq (wingoku)
*
* 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