This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Base fragment to ensure the parent activity implements a contract interface. */ | |
public abstract class ContractFragment<T> extends Fragment { | |
private T mContract; | |
@Override | |
public void onAttach(Activity activity) { | |
try { | |
mContract = (T)activity; | |
} catch (ClassCastException e) { | |
throw new IllegalStateException(activity.getClass().getSimpleName() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.v4.content.AsyncTaskLoader; | |
import android.content.Context; | |
import android.os.Handler; | |
import android.text.format.DateUtils; | |
public abstract class BetterAsyncLoader<T> extends AsyncTaskLoader<T> { | |
private T mData; | |
private long mPollInterval; | |
private Handler mRepeatHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.*; | |
import android.database.Cursor; | |
import android.database.sqlite.SQLiteDatabase; | |
import android.database.sqlite.SQLiteOpenHelper; | |
import android.database.sqlite.SQLiteQueryBuilder; | |
import android.net.Uri; | |
import android.provider.BaseColumns; | |
import android.text.TextUtils; | |
public abstract class BetterContentProvider extends ContentProvider { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2012 Square, Inc. | |
package com.squareup.widgets; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.util.AttributeSet; | |
import android.widget.ImageView; | |
/** Maintains an aspect ratio based on either width or height. Disabled by default. */ | |
public class AspectRatioImageView extends ImageView { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Moved to | |
https://github.com/romannurik/android-swipetodismiss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
import android.content.Context; | |
import android.database.Cursor; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentManager; | |
import android.support.v4.app.FragmentPagerAdapter; | |
import android.util.SparseIntArray; | |
import android.view.ViewGroup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
* Copyright (c) 2012 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 | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.actionbarsherlock.app; | |
import android.app.Activity; | |
import android.support.v4.app.Watson.OnCreateOptionsMenuListener; | |
import android.support.v4.app.Watson.OnOptionsItemSelectedListener; | |
import android.support.v4.app.Watson.OnPrepareOptionsMenuListener; | |
import com.actionbarsherlock.app.SherlockFragmentActivity; | |
import com.actionbarsherlock.internal.view.menu.MenuItemWrapper; | |
import com.actionbarsherlock.internal.view.menu.MenuWrapper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomUncaughtExceptionHandlerProxy implements Thread.UncaughtExceptionHandler { | |
private static CustomUncaughtExceptionHandlerProxy proxy; | |
private final boolean enabled; | |
private Thread.UncaughtExceptionHandler customUncaughtExceptionHandler; | |
private CustomUncaughtExceptionHandlerProxy(CustomApplication application) { | |
enabled = !application.inDevMode(); |
OlderNewer