A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
| // MIT http://rem.mit-license.org | |
| function trim(c) { | |
| var ctx = c.getContext('2d'), | |
| copy = document.createElement('canvas').getContext('2d'), | |
| pixels = ctx.getImageData(0, 0, c.width, c.height), | |
| l = pixels.data.length, | |
| i, | |
| bound = { | |
| top: null, |
| /** | |
| * @project | |
| * @author chris.jenkins | |
| * @created Dec 28, 2011 | |
| */ | |
| package com.application.android.ui.fragments; | |
| import android.os.Bundle; | |
| import android.os.Handler; | |
| import android.support.v4.app.FragmentStatePagerAdapter; |
| import android.support.v4.app.Fragment; | |
| public class FragmentUtils { | |
| /** | |
| * @param fragment | |
| * The Fragment whose parent is to be found | |
| * @param parentClass | |
| * The interface that the parent should implement | |
| * @return The parent of fragment that implements parentClass, |
| /* | |
| * Copyright (C) 2013 readyState Software Ltd | |
| * | |
| * 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 |
| public class MLRoundedImageView extends ImageView { | |
| public MLRoundedImageView(Context context) { | |
| super(context); | |
| } | |
| public MLRoundedImageView(Context context, AttributeSet attrs) { | |
| super(context, attrs); | |
| } |
| /* | |
| * Copyright (C) 2006 The Android Open Source Project | |
| * | |
| * 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 |
| /* | |
| * Author: Felipe Herranz ([email protected]) | |
| * Contributors:Francesco Verheye ([email protected]) | |
| * Israel Dominguez ([email protected]) | |
| */ | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.concurrent.atomic.AtomicBoolean; | |
| import android.os.Handler; |
| public class AccountAuthenticator extends AbstractAccountAuthenticator { | |
| private final Context context; | |
| @Inject @ClientId String clientId; | |
| @Inject @ClientSecret String clientSecret; | |
| @Inject ApiService apiService; | |
| public AccountAuthenticator(Context context) { | |
| super(context); |
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
Example: