Skip to content

Instantly share code, notes, and snippets.

Avatar
🐈
...

Miguel Ángel Moreno nitrico

🐈
...
View GitHub Profile
@AlexBlokh
AlexBlokh / RatioViewPager.java
Last active Mar 31, 2017
ViewPager with custom aspect ratio
View RatioViewPager.java
public class RatioViewPager extends ViewPager {
private float mRatio = 1f;
public RatioViewPager(Context context) {
super(context);
}
public RatioViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
View CollapsingTitleLayout.java
/*
* Copyright 2014 Chris Banes
*
* 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
@pgloaguen
pgloaguen / gist:10b69882a6f721ce98f6
Last active Jun 25, 2019
PhotographicPrintAnimator realize a beautiful photographic print animation as described in the Material design spec (http://www.google.com/design/spec/patterns/loading-images.html#loading-images-loading-images)
View gist:10b69882a6f721ce98f6
import android.animation.ValueAnimator;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator;
import android.widget.ImageView;
import java.lang.ref.SoftReference;
public class PhotographicPrintAnimator {
@gabrielemariotti
gabrielemariotti / Readme.md
Last active Mar 3, 2021
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.
View Readme.md

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

View FloatLabelLayout.java
/*
* Copyright 2014 Chris Banes
*
* 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
@Frikish
Frikish / SwipeRefreshLayout and StickyListHeaders.md
Last active Feb 23, 2017
SwipeRefreshLayout with StickyListHeaders
View SwipeRefreshLayout and StickyListHeaders.md

Trying to find a solution

StickyListHeaders

SwipeRefreshLayout

I had a problem getting the new fancy SwipeRefreshLayout from the appcompat lib to work with a custom listview, in this case the StickyListHeaders. Since the First child of the SwipeRefreshLayout should be either a ScrollView or a pure List, some workaround had to be done.

View gist:9762847
/*
Combine tab into actionbar,
i'm using pager sliding tab strinb (https://github.com/astuetz/PagerSlidingTabStrip)
*/
package com.srin.flores;
import android.app.ActionBar;
import android.content.Context;
import android.os.Bundle;
@PrashamTrivedi
PrashamTrivedi / android embed tabs
Created Dec 3, 2013
android : Embed tabs as a part of actionbar.... as done in shazaam apps
View android embed tabs
//In onCreate after initializing actionbar
int currentapiVersion = android.os.Build.VERSION.SDK_INT;
if (currentapiVersion >= VERSION_CODES.ICE_CREAM_SANDWICH) {
// Do something for froyo and above versions
try {
Field actionBarField = actionBar.getClass().getDeclaredField("mActionBar");
actionBarField.setAccessible(true);
enableEmbeddedTabs(actionBarField.get(actionBar));
} catch (Exception e) {
Log.e(TAG, "Error enabling embedded tabs", e);
@itsalif
itsalif / SimpleXmlRequest.java
Last active Feb 25, 2019 — forked from ficusk/GsonRequest.java
Volley adapter for making XML Requests. It uses Simple-XML for serializing XML to Objects (http://simple.sourceforge.net/). Code is based of GsonRequest. Hope someone finds it useful.
View SimpleXmlRequest.java
import java.io.UnsupportedEncodingException;
import java.util.Map;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;