Search in sources :

Example 1 with IAddonActivity

use of org.holoeverywhere.addon.IAddonActivity in project HoloEverywhere by Prototik.

the class _HoloActivity method requestDecorView.

private boolean requestDecorView(View view, LayoutParams params, int layoutRes) {
    if (mDecorView != null) {
        return true;
    }
    mDecorView = new ActivityDecorView();
    mDecorView.setId(android.R.id.content);
    mDecorView.setProvider(this);
    if (view != null) {
        mDecorView.addView(view, params);
    } else if (layoutRes > 0) {
        getThemedLayoutInflater().inflate(layoutRes, mDecorView, true);
    }
    final LayoutParams p = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    performAddonAction(new AddonCallback<IAddonActivity>() {

        @Override
        public boolean action(IAddonActivity addon) {
            return addon.installDecorView(mDecorView, p);
        }

        @Override
        public void justPost() {
            _HoloActivity.super.setContentView(mDecorView, p);
        }
    });
    return false;
}
Also used : LayoutParams(android.view.ViewGroup.LayoutParams) IAddonActivity(org.holoeverywhere.addon.IAddonActivity)

Example 2 with IAddonActivity

use of org.holoeverywhere.addon.IAddonActivity in project HoloEverywhere by Prototik.

the class Activity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    final Bundle state = instanceState(savedInstanceState);
    mCreatedByThemeManager = getIntent().getBooleanExtra(ThemeManager.KEY_CREATED_BY_THEME_MANAGER, false);
    mAttacher.inhert(getSupportApplication());
    forceInit(state);
    performAddonAction(new AddonCallback<IAddonActivity>() {

        @Override
        public void justAction(IAddonActivity addon) {
            addon.onPreCreate(state);
        }
    });
    super.onCreate(state);
    performAddonAction(new AddonCallback<IAddonActivity>() {

        @Override
        public void justAction(IAddonActivity addon) {
            addon.onCreate(state);
        }
    });
}
Also used : IAddonActivity(org.holoeverywhere.addon.IAddonActivity) Bundle(android.os.Bundle)

Example 3 with IAddonActivity

use of org.holoeverywhere.addon.IAddonActivity in project HoloEverywhere by Prototik.

the class Activity method onPostCreate.

@Override
protected void onPostCreate(Bundle sSavedInstanceState) {
    final Bundle savedInstanceState = instanceState(sSavedInstanceState);
    performAddonAction(new AddonCallback<IAddonActivity>() {

        @Override
        public void justAction(IAddonActivity addon) {
            addon.onPostCreate(savedInstanceState);
        }
    });
    super.onPostCreate(savedInstanceState);
}
Also used : IAddonActivity(org.holoeverywhere.addon.IAddonActivity) Bundle(android.os.Bundle)

Example 4 with IAddonActivity

use of org.holoeverywhere.addon.IAddonActivity in project HoloEverywhere by Prototik.

the class Activity method onConfigurationChanged.

@Override
public void onConfigurationChanged(final Configuration newConfig) {
    final Configuration oldConfig = getResources().getConfiguration();
    super.onConfigurationChanged(newConfig);
    performAddonAction(new AddonCallback<IAddonActivity>() {

        @Override
        public void justAction(IAddonActivity addon) {
            addon.onConfigurationChanged(oldConfig, newConfig);
        }
    });
}
Also used : Configuration(android.content.res.Configuration) IAddonActivity(org.holoeverywhere.addon.IAddonActivity)

Aggregations

IAddonActivity (org.holoeverywhere.addon.IAddonActivity)4 Bundle (android.os.Bundle)2 Configuration (android.content.res.Configuration)1 LayoutParams (android.view.ViewGroup.LayoutParams)1