use of android.support.annotation.CallSuper in project Shuttle by timusus.
the class BaseActivity method onCreate.
@CallSuper
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Permiso.getInstance().setActivity(this);
Permiso.getInstance().requestPermissions(new Permiso.IOnPermissionResult() {
@Override
public void onPermissionResult(Permiso.ResultSet resultSet) {
if (resultSet.areAllPermissionsGranted()) {
bindService();
} else {
Toast.makeText(BaseActivity.this, "Permission check failed", Toast.LENGTH_LONG).show();
finish();
}
}
@Override
public void onRationaleRequested(Permiso.IOnRationaleProvided callback, String... permissions) {
callback.onRationaleProvided();
}
}, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.WAKE_LOCK);
billingManager = new BillingManager(this, new BillingManager.BillingUpdatesListener() {
@Override
public void onPurchasesUpdated(List<Purchase> purchases) {
for (Purchase purchase : purchases) {
if (purchase.getSku().equals(Config.SKU_PREMIUM)) {
ShuttleApplication.getInstance().setIsUpgraded(true);
}
}
}
@Override
public void onPremiumPurchaseCompleted() {
ShuttleApplication.getInstance().setIsUpgraded(true);
UpgradeDialog.getUpgradeSuccessDialog(BaseActivity.this).show();
}
@Override
public void onPremiumPurchaseRestored() {
ShuttleApplication.getInstance().setIsUpgraded(true);
Toast.makeText(BaseActivity.this, R.string.iab_purchase_restored, Toast.LENGTH_SHORT).show();
}
});
setVolumeControlStream(AudioManager.STREAM_MUSIC);
}
use of android.support.annotation.CallSuper in project BottomNavigation by Ashok-Varma.
the class BottomNavigationTab method initialise.
@CallSuper
public void initialise(boolean setActiveColor) {
iconView.setSelected(false);
if (isInActiveIconSet) {
StateListDrawable states = new StateListDrawable();
states.addState(new int[] { android.R.attr.state_selected }, mCompactIcon);
states.addState(new int[] { -android.R.attr.state_selected }, mCompactInActiveIcon);
states.addState(new int[] {}, mCompactInActiveIcon);
iconView.setImageDrawable(states);
} else {
if (setActiveColor) {
DrawableCompat.setTintList(mCompactIcon, new ColorStateList(new int[][] { // 1
new int[] { android.R.attr.state_selected }, // 2
new int[] { -android.R.attr.state_selected }, new int[] {} }, new int[] { // 1
mActiveColor, // 2
mInActiveColor, // 3
mInActiveColor }));
} else {
DrawableCompat.setTintList(mCompactIcon, new ColorStateList(new int[][] { // 1
new int[] { android.R.attr.state_selected }, // 2
new int[] { -android.R.attr.state_selected }, new int[] {} }, new int[] { // 1
mBackgroundColor, // 2
mInActiveColor, // 3
mInActiveColor }));
}
iconView.setImageDrawable(mCompactIcon);
}
if (isNoTitleMode) {
labelView.setVisibility(GONE);
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) iconContainerView.getLayoutParams();
layoutParams.gravity = Gravity.CENTER;
setNoTitleIconContainerParams(layoutParams);
iconContainerView.setLayoutParams(layoutParams);
FrameLayout.LayoutParams iconLayoutParams = (FrameLayout.LayoutParams) iconView.getLayoutParams();
setNoTitleIconParams(iconLayoutParams);
iconView.setLayoutParams(iconLayoutParams);
}
}
use of android.support.annotation.CallSuper in project android-oss by kickstarter.
the class KSApplication method onCreate.
@Override
@CallSuper
public void onCreate() {
super.onCreate();
// Send crash reports in release builds
if (!BuildConfig.DEBUG && !isInUnitTests()) {
checkForCrashes();
}
MultiDex.install(this);
// Only log for internal builds
if (BuildConfig.FLAVOR_AUDIENCE.equals("internal")) {
Timber.plant(new Timber.DebugTree());
}
if (!isInUnitTests() && ApiCapabilities.canDetectMemoryLeaks()) {
refWatcher = LeakCanary.install(this);
}
JodaTimeAndroid.init(this);
component = DaggerApplicationComponent.builder().applicationModule(new ApplicationModule(this)).build();
component().inject(this);
CookieHandler.setDefault(cookieManager);
FacebookSdk.sdkInitialize(this);
pushNotifications.initialize();
final ApplicationLifecycleUtil appUtil = new ApplicationLifecycleUtil(this);
registerActivityLifecycleCallbacks(appUtil);
registerComponentCallbacks(appUtil);
}
use of android.support.annotation.CallSuper in project android-oss by kickstarter.
the class BaseActivity method onSaveInstanceState.
@CallSuper
@Override
protected void onSaveInstanceState(@NonNull final Bundle outState) {
super.onSaveInstanceState(outState);
Timber.d("onSaveInstanceState %s", this.toString());
final Bundle viewModelEnvelope = new Bundle();
if (viewModel != null) {
ActivityViewModelManager.getInstance().save(viewModel, viewModelEnvelope);
}
outState.putBundle(VIEW_MODEL_KEY, viewModelEnvelope);
}
use of android.support.annotation.CallSuper in project nucleus by konmik.
the class RxPresenter method onSave.
/**
* {@inheritDoc}
*/
@CallSuper
@Override
protected void onSave(Bundle state) {
for (int i = requested.size() - 1; i >= 0; i--) {
int restartableId = requested.get(i);
Subscription subscription = restartableSubscriptions.get(restartableId);
if (subscription != null && subscription.isUnsubscribed())
requested.remove(i);
}
state.putIntegerArrayList(REQUESTED_KEY, requested);
}
Aggregations