FragmentTransaction hide - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for FragmentTransaction hide method.

This code example shows how to use the following methods:hide
    protected static void showFragment(FragmentTransaction ft, Fragment f) {
        if ((f != null) && f.isHidden()) ft.show(f);
    } 
 
    protected static void hideFragment(FragmentTransaction ft, Fragment f) {
        if ((f != null) && !f.isHidden()) ft.hide(f);
    } 
} 
6
CodeRank
This code example shows how to use the following methods:hide
		 
	} 
 
	@Override 
	public void onTabUnselected(Tab tab, FragmentTransaction ft) {
		ft.hide(this);
		 
	} 
	 
	/////////////////////////////////////////////////////////////////////////////// 
	// Implementation of SetData 
	/////////////////////////////////////////////////////////////////////////////// 
 
	@Override 
	public void setData(Bundle data) {
		// Display the string spelling out the number 
		EditText t = (EditText) getActivity().findViewById(R.id.detail_text);
		String s = data.getString("placeName");
		t.setText(s);		
	} 
6
CodeRank
This code example shows how to use the following methods:hide
		 
	} 
 
	@Override 
	public void onTabUnselected(Tab tab, FragmentTransaction ft) {
		ft.hide(this);
		 
	} 
	 
	/////////////////////////////////////////////////////////////////////////////// 
	// Implementation of SetData 
	/////////////////////////////////////////////////////////////////////////////// 
 
	@Override 
	public void setData(Bundle data) {
		// Display the number 
		EditText t = (EditText) getActivity().findViewById(R.id.editText1);
		int i = data.getInt("place");
		t.setText(Integer.toString(i));
	} 
6
CodeRank
This code example shows how to use the following methods:addToBackStack, commit, hide, show
 
		final FragmentManager manager = getSupportFragmentManager();
		final FragmentTransaction transaction = manager.beginTransaction();
 
		// replace hide current fragment and show selected fragment 
		transaction.hide(fragments[currentFragment]);
		transaction.show(fragments[nextFragment]);
		transaction.addToBackStack(null);
		transaction.commit();
	} 
 
	private void initializeFragments(final FragmentManager fm) {
 
		fragments[MenuButtonsFragment.FragmentIds.MENU_BUTTONS_FRAGMENT] = fm
				.findFragmentById(R.id.menu_buttons_fragment);
		// fragments[MenuButtonsFragment.FragmentIds.MENU_OPTIONS_FRAGMENT] = fm 
		// .findFragmentById(R.id.menu_options_fragment); 
		fragments[MenuButtonsFragment.FragmentIds.MENU_HIGHSCORES_FRAGMENT] = fm
				.findFragmentById(R.id.menu_highscores_fragment);
 
6
CodeRank
This code example shows how to use the following methods:commit, hide, show
		if(companyDetailFragment.isVisible())
		{ 
			//Returning to the main view 
			FragmentManager fragmentManager = getFragmentManager();
			FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
			fragmentTransaction.show(getCompanyFragment());
			fragmentTransaction.hide(getCompanyDetailFragment());
			fragmentTransaction.commit();
		} 
		else 
		{ 
			super.onBackPressed(); 
		} 
	}	 
} 
5
CodeRank
This code example shows how to use the following methods:addToBackStack, commit, hide, show
		FragmentManager fm = getSupportFragmentManager();
		FragmentTransaction ft = fm.beginTransaction();
		 
		if (!mIsDualPane)
		{ 
			ft.hide(subscriptionsFragment);
	        ft.show(articlesFragment);
	        ft.addToBackStack(null);
		} 
		 
		ft.commit();
	} 
	 
	private User getUser(Account account)
	{ 
		AccountManager accountManager = AccountManager.get(this);
		ContentResolver cr = getContentResolver();
		 
		Cursor cursor = cr.query(Users.CONTENT_URI, 
				new String[] 
5
CodeRank
This code example shows how to use the following methods:addListener, playTogether, setDuration, start
        // Post this on the UI thread's message queue. It's needed for the items to be already measured 
        new Handler().post(new Runnable() {
 
            @Override 
            public void run() { 
                mSetAnim = new AnimatorSet();
                mTopImage.setLayerType(View.LAYER_TYPE_HARDWARE, null);
                mBottomImage.setLayerType(View.LAYER_TYPE_HARDWARE, null);
                mSetAnim.addListener(new Animator.AnimatorListener() {
                    @Override 
                    public void onAnimationStart(Animator animation) {
                    } 
 
                    @Override 
                    public void onAnimationEnd(Animator animation) {
                        clean(destActivity);
                    } 
 
                    @Override 
                    public void onAnimationCancel(Animator animation) {

7
CodeRank
This code example shows how to use the following methods:end, isRunning, setTarget, start
            container.start(view, closing);
        } 
    } 
 
    private void start(View view, boolean closing) {
        if (mEnterAnimation.isRunning()) {
            mEnterAnimation.end();
        } 
        if (mExitAnimation.isRunning()) {
            mExitAnimation.end();
        } 
        if (view.getVisibility() != View.VISIBLE) {
            if (!closing) {
                mEnterAnimation.setTarget(view);
                mEnterAnimation.start();
            } 
        } else if (closing) {
            mExitAnimation.setTarget(view);
            mExitAnimation.start();
        } else { 

7
CodeRank
This code example shows how to use the following methods:addListener, cancel
6
CodeRank
This code example shows how to use the following methods:addListener, play, start
        } else { 
            final long duration = getResources().getInteger(android.R.integer.config_shortAnimTime);
 
            // Animate if we have Honeycomb APIs, don't animate otherwise 
            mIsAnimating = true;
            AnimatorSet animatorSet = new AnimatorSet();
            mMasterView.setLayerType(LAYER_TYPE_HARDWARE, null);
            mDetailView.setLayerType(LAYER_TYPE_HARDWARE, null);
            animatorSet
                    .play(ObjectAnimator
                            .ofFloat(mMasterView, "translationX", translationX)
                            .setDuration(duration))
                    .with(ObjectAnimator
                            .ofFloat(mDetailView, "translationX", translationX)
                            .setDuration(duration));
            animatorSet.addListener(this);
            animatorSet.start();
 
            // For API level 12+, use this instead: 
            // mMasterView.animate().translationX().setDuration(duration); 

6
CodeRank

Related FragmentTransaction hide Questions & Answers:

hide Method Overview
Hides an existing fragment.
See Code Examples for other Android FragmentTransaction Methods: