Skip to content

Instantly share code, notes, and snippets.

Andy Dennie adennie

Block or report user

Report or block adennie

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@adennie
adennie / BaseApplication.java
Created Oct 22, 2013
detect first run after install/upgrade
View BaseApplication.java
protected void handleNewInstallsAndUpgrades() {
int savedVersion = readVersionCodeFromPref(PREF_TAG_CURRENT_APP_VERSION);
if (savedVersion == -1)
processNewInstall(getVersionCode());
else if (savedVersion != getVersionCode())
processUpgrade(getVersionCode(), readVersionCodeFromPref(PREF_TAG_PREVIOUS_APP_VERSION));
}
protected void processNewInstall(final int newVersionCode) {
updateSavedVersionCodes();
View EllipsizingTextView.java
/*
* Copyright (C) 2011 Micah Hainline
* Copyright (C) 2012 Triposo
* 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.
@adennie
adennie / ContextHoldingModules2.java
Created Mar 19, 2013
inherited qualified provider not found when checking for completeness of bindings
View ContextHoldingModules2.java
package com.fizzbuzz.daggerexperiments;
import dagger.Module;
import dagger.Provides;
import javax.inject.Inject;
import javax.inject.Qualifier;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
You can’t perform that action at this time.