Skip to content

Instantly share code, notes, and snippets.

Avatar

Carlo Marinangeli carlonzo

View GitHub Profile
@carlonzo
carlonzo / CacheFragmentStatePagerAdapter.java
Created Aug 2, 2015
FragmentStatePagerAdapter that caches each pages.
View CacheFragmentStatePagerAdapter.java
/*
* Copyright 2014 Soichiro Kashima
*
* 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
@carlonzo
carlonzo / ParallaxScrollingImages.java
Created Mar 3, 2017
ParallaxScrollingImages yahoo weather like
View ParallaxScrollingImages.java
package it.carlom.bubutranslater;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
View PopupHighlightItems.java
public class PopupHighlightItems {
private WindowManager windowManager;
private final View contentView;
private WeakReference<View> anchor;
private int direction = Gravity.TOP;
private boolean isShowing = false;
private WindowManager.LayoutParams layoutParams;
@carlonzo
carlonzo / PopupHighlightItems.java
Last active Nov 2, 2018
Centered Window Android. It will align the contentView at the center of the anchor. It has a addOnGlobalLayoutListener to refresh the position when the size of the contentview changes
View PopupHighlightItems.java
public class PopupHighlightItems {
private WindowManager windowManager;
private final View contentView;
private WeakReference<View> anchor;
private int direction = Gravity.TOP;
private boolean isShowing = false;
private WindowManager.LayoutParams layoutParams;