Erwan Gereec

Founder of Cup of News app. Fascinated by new technologies. Android Developer.

Read this first

Rounded ImageView with thin border #Android

Here is a little trick to create a rounded ImageView with a thin border.
We use this class :

I spent a lot of time to search on the web a class which allows to create a rotation effect on each item of an Android listview.

Here is a good implementation which works fine :

package com.frisbeeeapp.frisbeee.utilities;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Shader;
import android.graphics.drawable.BitmapDrawable;
import android.util.AttributeSet;
import android.widget.ImageView;

public class CircularImageView extends ImageView {

    private int borderWidth = 2;
    private int viewWidth;
    private int viewHeight;
    private Bitmap image;
    private Paint paint;
...

Continue reading →


Some web and mobile design for inspiration (Week 19)

Here is some great design found on the web for inspiration purpose.

Profile Card :

Profile Card

Source :

https://dribbble.com/shots/1542116-Profile-Card?list=searches&tag=web&offset=87

Weather app :

Profile Card

Source :

https://dribbble.com/shots/1092631-Weather

Bank app:

Profile Card

Source :

https://dribbble.com/shots/1540166-Banking-timeline

Secret app:

Profile Card

Source :

https://dribbble.com/shots/1541298-Secret-App?list=shots&sort=popular&timeframe=now&offset=12

Flooz app

Profile Card

Source :

https://dribbble.com/shots/1541056-Update-Flooz-App?list=shots&sort=popular&timeframe=now&offset=0

Android popup UI example

Profile Card

Source :

https://dribbble.com/shots/1534453-Android-Popup-UIlist=shots&sort=popular&timeframe=now&offset=0

News app

Profile Card

Source :

https://dribbble.com/shots/1523599-News-iOS?list=users&offset=1

TV show app

Profile Card

Source :

https://dribbble.com/shots/1531620-Misc-Screens-2-TV-Shows-App

Other app

Profile Card

Source...

Continue reading →


Android listview: Create 3D rotation effect for listview item

I spent a lot of time to search on the web a class which allows to create a rotation effect on each item of an Android listview.

Here is a good implementation which works fine :

import android.view.View;
import android.view.animation.Animation;
import android.view.animation.Transformation;
import android.graphics.Camera;
import android.graphics.Matrix;

/**
 * An animation that rotates the view on the Y axis between two specified angles.
 * This animation also adds a translation on the Z axis (depth) to improve the effect.
 */
public class Rotate3dAnimation extends Animation {
    private final float mFromDegrees;
    private final float mToDegrees;
    private final float mDepthZ;
    private final View mView;
    private final boolean mReverse;
    private Camera mCamera;

    /**
     * Creates a new 3D rotation on the Y axis. The rotation is defined by its
     * start angle and
...

Continue reading →


Android listview: Animate listview item like Google plus effect

There a few weeks ago when I was working on Android “Cup of News” application, I wanted to replicate the effect “Google Plus” on the various items contained in a listview.

From my point of view, the use of such effects must do this sparingly. Everything depends on the content in each item that makes up your listview.

I have long sought a solution that is adequate but after some research on the web, I came to a rather acceptable solution.

Create a global variable which will be used to store the last item position the listview :

private int lastPosition = -1 ;

Create the first animation file: up_from_bottom.xml :

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
     android:shareInterpolator="@android:anim/decelerate_interpolator">
    <translate
        android:fromXDelta="0%" android:toXDelta="0%"
...

Continue reading →