当前位置: 首页>>代码示例>>Java>>正文


Java IBaseFragment类代码示例

本文整理汇总了Java中com.odoo.core.support.addons.fragment.IBaseFragment的典型用法代码示例。如果您正苦于以下问题:Java IBaseFragment类的具体用法?Java IBaseFragment怎么用?Java IBaseFragment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IBaseFragment类属于com.odoo.core.support.addons.fragment包,在下文中一共展示了IBaseFragment类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getModels

import com.odoo.core.support.addons.fragment.IBaseFragment; //导入依赖的package包/类
private List<OModel> getModels() {
    List<OModel> models = new ArrayList<>();
    models.addAll(BaseModels.baseModels(mContext, mUser));
    for (OAddon addon : mAddons.getAddons()) {
        IBaseFragment fragment = (IBaseFragment) addon.get();
        try {
            Class<Object> model = fragment.database();
            if (model != null) {
                OModel dbModel = (OModel) model.getConstructor(Context.class)
                        .newInstance(mContext);
                models.add(dbModel);
            }
        } catch (Exception e) {
            Log.e(TAG, e.getMessage());
        }
    }
    return models;
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:19,代码来源:OSQLite.java

示例2: onPostCreate

import com.odoo.core.support.addons.fragment.IBaseFragment; //导入依赖的package包/类
@Override
protected void onPostCreate(Bundle savedInstanceState) {
    super.onPostCreate(savedInstanceState);
    mSavedInstanceState = savedInstanceState;
    if (mDrawerItemContainer != null) {
        if (savedInstanceState == null) {
            // Loading Default Fragment (if any)
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    IBaseFragment fragment = DrawerUtils.getDefaultDrawerFragment();
                    if (fragment != null) {
                        loadDrawerItemInstance(new HomeScreen(), null, false);
                    }
                }
            }, DRAWER_ITEM_LAUNCH_DELAY);
        } else {
            mHasActionBarSpinner = savedInstanceState.getBoolean(KEY_HAS_ACTIONBAR_SPINNER);
            mDrawerSelectedIndex = savedInstanceState.getInt(KEY_CURRENT_DRAWER_ITEM);
            setTitle(savedInstanceState.getString(KEY_APP_TITLE));
            focusOnDrawerItem(mDrawerSelectedIndex);
        }
    }
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:25,代码来源:OdooActivity.java

示例3: getModels

import com.odoo.core.support.addons.fragment.IBaseFragment; //导入依赖的package包/类
private List<OModel> getModels() {
    List<OModel> models = new ArrayList<>();
    models.addAll(BaseModels.baseModels(mContext, mUser));
    for (OAddon addon : mAddons.getAddons()) {
        IBaseFragment fragment = (IBaseFragment) addon.get();
        try {
            Class<Object> model = fragment.database();
            if (model != null) {
                OModel dbModel = (OModel) model.getConstructor(Context.class, OUser.class)
                        .newInstance(mContext, mUser);
                models.add(dbModel);
            }
        } catch (Exception e) {
            Log.e(TAG, e.getMessage());
        }
    }
    return models;
}
 
开发者ID:Odoo-mobile,项目名称:hr,代码行数:19,代码来源:OSQLite.java

示例4: getDrawerItems

import com.odoo.core.support.addons.fragment.IBaseFragment; //导入依赖的package包/类
public static List<ODrawerItem> getDrawerItems(Context context) {
    List<ODrawerItem> items = new ArrayList<>();
    for (OAddon addon : new Addons().getAddons()) {
        IBaseFragment frag = (IBaseFragment) addon.get();
        if (frag != null) {
            List<ODrawerItem> menus = frag.drawerMenus(context);
            if (menus != null) {
                items.addAll(menus);
            }
        }
    }
    items.addAll(DrawerUtils.baseSettingsItems(context));
    return items;
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:15,代码来源:DrawerUtils.java

示例5: getDefaultDrawerFragment

import com.odoo.core.support.addons.fragment.IBaseFragment; //导入依赖的package包/类
public static IBaseFragment getDefaultDrawerFragment() {
    OAddon addon = new Addons().getDefaultAddon();
    if (addon != null) {
        return (IBaseFragment) addon.get();
    }
    return null;
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:8,代码来源:DrawerUtils.java

示例6: getStartableObject

import com.odoo.core.support.addons.fragment.IBaseFragment; //导入依赖的package包/类
public static ODrawerItem getStartableObject(Context context, IBaseFragment fragment) {
    List<ODrawerItem> items = fragment.drawerMenus(context);
    if (items != null) {
        for (ODrawerItem item : items) {
            if (!item.isGroupTitle() && item.getInstance() != null) {
                return item;
            }
        }
    }
    return null;
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:12,代码来源:DrawerUtils.java

示例7: onPostCreate

import com.odoo.core.support.addons.fragment.IBaseFragment; //导入依赖的package包/类
@Override
protected void onPostCreate(Bundle savedInstanceState) {
    super.onPostCreate(savedInstanceState);
    mSavedInstanceState = savedInstanceState;
    if (savedInstanceState == null) {
        // Loading Default Fragment (if any)
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                IBaseFragment fragment = DrawerUtils.getDefaultDrawerFragment();
                if (fragment != null) {
                    ODrawerItem item = DrawerUtils.getStartableObject(OdooActivity.this, fragment);
                    setTitle(item.getTitle());
                    loadDrawerItemInstance(item.getInstance(), item.getExtra());
                    int selected_item = DrawerUtils.findItemIndex(item, mDrawerItemContainer);
                    if (selected_item > -1) {
                        focusOnDrawerItem(selected_item);
                    }
                }
            }
        }, DRAWER_ITEM_LAUNCH_DELAY);
    } else {
        mHasActionBarSpinner = savedInstanceState.getBoolean(KEY_HAS_ACTIONBAR_SPINNER);
        mDrawerSelectedIndex = savedInstanceState.getInt(KEY_CURRENT_DRAWER_ITEM);
        setTitle(savedInstanceState.getString(KEY_APP_TITLE));
        focusOnDrawerItem(mDrawerSelectedIndex);
    }
}
 
开发者ID:Odoo-mobile,项目名称:hr,代码行数:29,代码来源:OdooActivity.java


注:本文中的com.odoo.core.support.addons.fragment.IBaseFragment类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。