• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Fragment类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getItem

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
@Override
public android.support.v4.app.Fragment getItem(int page) {
	switch (page) {
		case 0:
			if (activeSnaps == null)
				activeSnaps = new SnapViewerListFrag();
			return activeSnaps;
		case 1: 
			if (mainMenuFrag == null) {
				mainMenuFrag = new MainMenuFrag();
			}
			return mainMenuFrag;
		case 2:
			return new ContactViewerListFrag();
	}
	return null;
}
 
开发者ID:saltisgood,项目名称:opensnap,代码行数:18,代码来源:MainFrag.java


示例2: Logout

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
/**
 * Logout helper method. Sets the login state to false and swaps in the
 * {@link LaunchFrag} fragment with an animation.
 */
public void Logout() {
	new LogoutTask(this, GlobalVars.getUsername(this)).execute(new String[0]);
	
	GlobalVars.setLoggedIn(this, false);
	
	mDrawerNoLoginLayout.setVisibility(View.VISIBLE);
	mDrawerListView.setVisibility(View.GONE);
	
	LaunchFrag fragger = new LaunchFrag();
	getSupportFragmentManager().beginTransaction().setCustomAnimations(R.anim.push_up_in, R.anim.push_up_out)
	.replace(R.id.launch_container, fragger, LaunchFrag.FRAGTAG).commit();
	
	List<android.support.v4.app.Fragment> frags = this.getSupportFragmentManager().getFragments();
	for (android.support.v4.app.Fragment frag : frags) {
		if (frag instanceof MainFrag) {
			((MainFrag)frag).popFragment();
		}
	}
}
 
开发者ID:saltisgood,项目名称:opensnap,代码行数:24,代码来源:LaunchActivity.java


示例3: finishPreferencePanel

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
public void finishPreferencePanel(Fragment caller, int resultCode,
                                  Intent resultData) {
    if (mSinglePane) {
        setResult(resultCode, resultData);
        finish();
    } else {
        onBackPressed();
        if (caller != null) {
            if (caller.getTargetFragment() != null) {
                caller.getTargetFragment().onActivityResult(
                        caller.getTargetRequestCode(), resultCode,
                        resultData);
            }
        }
    }
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:17,代码来源:PreferenceActivity.java


示例4: startPreferencePanel

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
public void startPreferencePanel(String fragmentClass, Bundle args,
                                 int titleRes, CharSequence titleText, Fragment resultTo,
                                 int resultRequestCode) {
    if (mSinglePane) {
        startWithFragment(fragmentClass, args, resultTo, resultRequestCode,
                titleRes, 0);
    } else {
        @SuppressWarnings("deprecation")
        Fragment f = Fragment.instantiate(this, fragmentClass, args);
        if (resultTo != null) {
            f.setTargetFragment(resultTo, resultRequestCode);
        }
        FragmentTransaction transaction = getSupportFragmentManager()
                .beginTransaction();
        transaction.replace(R.id.prefs, f);
        if (titleRes != 0) {
            transaction.setBreadCrumbTitle(titleRes);
        } else if (titleText != null) {
            transaction.setBreadCrumbTitle(titleText);
        }
        transaction
                .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
        transaction.addToBackStack(PreferenceActivity.BACK_STACK_PREFS);
        transaction.commitAllowingStateLoss();
    }
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:27,代码来源:PreferenceActivity.java


示例5: TabListener

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
public TabListener(Activity activity, String tag, Class<T> clz, Bundle args) {
    mActivity = activity;
    mTag = tag;
    mClass = clz;
    mArgs = args;

    // Check to see if we already have a fragment for this tab, probably
    // from a previously saved state.  If so, deactivate it, because our
    // initial state is that a tab isn't shown.
    mFragment = (Fragment) activity.getSupportFragmentManager().findFragmentByTag(mTag);
    if (mFragment != null && !mFragment.isDetached()) {
        FragmentTransaction ft = activity.getSupportFragmentManager().beginTransaction();
        ft.detach(mFragment);
        ft.commit();
    }
}
 
开发者ID:abeluck,项目名称:radioplayer,代码行数:17,代码来源:TabListener.java


示例6: finishPreferencePanel

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
public void finishPreferencePanel(Fragment caller, int resultCode,
        Intent resultData) {
    if (mSinglePane) {
        setResult(resultCode, resultData);
        finish();
    } else {
        onBackPressed();
        if (caller != null) {
            if (caller.getTargetFragment() != null) {
                caller.getTargetFragment().onActivityResult(
                        caller.getTargetRequestCode(), resultCode,
                        resultData);
            }
        }
    }
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:17,代码来源:PreferenceActivity.java


示例7: startPreferencePanel

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
public void startPreferencePanel(String fragmentClass, Bundle args,
        int titleRes, CharSequence titleText, Fragment resultTo,
        int resultRequestCode) {
    if (mSinglePane) {
        startWithFragment(fragmentClass, args, resultTo, resultRequestCode,
                titleRes, 0);
    } else {
        @SuppressWarnings("deprecation")
        Fragment f = Fragment.instantiate(this, fragmentClass, args);
        if (resultTo != null) {
            f.setTargetFragment(resultTo, resultRequestCode);
        }
        FragmentTransaction transaction = getSupportFragmentManager()
                .beginTransaction();
        transaction.replace(R.id.prefs, f);
        if (titleRes != 0) {
            transaction.setBreadCrumbTitle(titleRes);
        } else if (titleText != null) {
            transaction.setBreadCrumbTitle(titleText);
        }
        transaction
                .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
        transaction.addToBackStack(PreferenceActivity.BACK_STACK_PREFS);
        transaction.commitAllowingStateLoss();
    }
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:27,代码来源:PreferenceActivity.java


示例8: startPreferenceFragment

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
public void startPreferenceFragment(Fragment fragment, boolean push) {
    FragmentTransaction transaction = getSupportFragmentManager()
            .beginTransaction();
    transaction.replace(R.id.prefs, fragment);
    if (push) {
        transaction
                .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
        transaction.addToBackStack(PreferenceActivity.BACK_STACK_PREFS);
    } else {
        transaction
                .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
    }
    transaction.commitAllowingStateLoss();
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:15,代码来源:PreferenceActivity.java


示例9: startWithFragment

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
public void startWithFragment(String fragmentName, Bundle args,
                              Fragment resultTo, int resultRequestCode, int titleRes,
                              int shortTitleRes) {
    Intent intent = onBuildStartFragmentIntent(fragmentName, args,
            titleRes, shortTitleRes);
    if (resultTo == null) {
        startActivity(intent);
    } else {
        resultTo.startActivityForResult(intent, resultRequestCode);
    }
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:12,代码来源:PreferenceActivity.java


示例10: switchToHeaderInner

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
private void switchToHeaderInner(String fragmentName, Bundle args,
                                 int direction) {
    getSupportFragmentManager().popBackStack(
            PreferenceActivity.BACK_STACK_PREFS,
            FragmentManager.POP_BACK_STACK_INCLUSIVE);
    @SuppressWarnings("deprecation")
    Fragment f = Fragment.instantiate(this, fragmentName, args);
    FragmentTransaction transaction = getSupportFragmentManager()
            .beginTransaction();
    transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
    transaction.replace(R.id.prefs, f);
    transaction.commitAllowingStateLoss();
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:14,代码来源:PreferenceActivity.java


示例11: onAttach

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
@Override
protected void onAttach(Fragment object) {
    super.onAttach(object);
    if (object instanceof AddonTabberCallback) {
        mTabberCallback = (AddonTabberCallback) object;
    }
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:8,代码来源:AddonTabber.java


示例12: LayoutInflater

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
protected LayoutInflater(Context context, Fragment childFragment) {
    super(context);
    if (context == null) {
        throw new IllegalArgumentException("Context cannot be null");
    }
    mChildFragment = childFragment;
    mContext = context;
    if (LayoutInflater.sListener != null) {
        LayoutInflater.sListener.onInitInflater(this);
    }
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:12,代码来源:LayoutInflater.java


示例13: onTabSelected

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
public void onTabSelected(Tab tab, FragmentTransaction ft) {
    if (mFragment == null) {
        mFragment = Fragment.instantiate(mActivity, mClass.getName(), mArgs);
        ft.add(R.id.pager, mFragment, mTag);
    } else {
    	Log.d(mTag, "ATTACHED");
        ft.attach(mFragment);
    }
}
 
开发者ID:abeluck,项目名称:radioplayer,代码行数:10,代码来源:TabListener.java


示例14: getItem

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
@Override
public Fragment getItem(int i) {

	switch (i) {
    case 0:
    	return new RadioFragment();
	case 1:
		return new NewsFragment();
    }
	return null;
}
 
开发者ID:abeluck,项目名称:radioplayer,代码行数:12,代码来源:MainActivity.java


示例15: startWithFragment

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
public void startWithFragment(String fragmentName, Bundle args,
        Fragment resultTo, int resultRequestCode, int titleRes,
        int shortTitleRes) {
    Intent intent = onBuildStartFragmentIntent(fragmentName, args,
            titleRes, shortTitleRes);
    if (resultTo == null) {
        startActivity(intent);
    } else {
        resultTo.startActivityForResult(intent, resultRequestCode);
    }
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:12,代码来源:PreferenceActivity.java


示例16: switchToHeaderInner

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
private void switchToHeaderInner(String fragmentName, Bundle args,
        int direction) {
    getSupportFragmentManager().popBackStack(
            PreferenceActivity.BACK_STACK_PREFS,
            FragmentManager.POP_BACK_STACK_INCLUSIVE);
    @SuppressWarnings("deprecation")
    Fragment f = Fragment.instantiate(this, fragmentName, args);
    FragmentTransaction transaction = getSupportFragmentManager()
            .beginTransaction();
    transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
    transaction.replace(R.id.prefs, f);
    transaction.commitAllowingStateLoss();
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:14,代码来源:PreferenceActivity.java


示例17: obtainFragmentChildInflater

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
public LayoutInflater obtainFragmentChildInflater(Fragment fragment) {
    if (mParentInflater != null) {
        return mParentInflater.obtainFragmentChildInflater(fragment);
    }
    if (mFragmentChildInstances == null) {
        mFragmentChildInstances = new WeaklyMap<Fragment, LayoutInflater>();
    }
    LayoutInflater inflater = mFragmentChildInstances.get(fragment);
    if (inflater == null) {
        mFragmentChildInstances.put(fragment,
                inflater = new LayoutInflater(this, mContext, fragment));
    }
    return inflater;
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:15,代码来源:LayoutInflater.java


示例18: LayoutInflater

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
protected LayoutInflater(Context context, Fragment childFragment) {
    super(context);
    mChildFragment = childFragment;
    mContext = context;
    if (LayoutInflater.sListener != null) {
        LayoutInflater.sListener.onInitInflater(this);
    }
}
 
开发者ID:antonyt,项目名称:TflTravelAlerts,代码行数:9,代码来源:LayoutInflater.java


示例19: buildFragment

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
@Override
protected Fragment buildFragment() {
    Bundle args = getIntent().getExtras();
    if (!args.containsKey(LINE_ID_ARGS_KEY)) {
        throw new IllegalArgumentException("Line id is required!");
    }

    Fragment fragment = new LineStatusViewerDetailFragment();
    fragment.setArguments(args);
    return fragment;
}
 
开发者ID:antonyt,项目名称:TflTravelAlerts,代码行数:12,代码来源:LineStatusViewerDetailActivity.java


示例20: buildFragment

import org.holoeverywhere.app.Fragment; //导入依赖的package包/类
@Override
protected Fragment buildFragment() {
    Fragment fragment = new EditAlertFragment();
    Bundle args = getIntent().getExtras();
    fragment.setArguments(args);
    return fragment;
}
 
开发者ID:antonyt,项目名称:TflTravelAlerts,代码行数:8,代码来源:EditAlertActivity.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JavaStringCompiler类代码示例发布时间:2022-05-22
下一篇:
Java EqualsHelper类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap