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


Java ViewAnimator.addView方法代码示例

本文整理汇总了Java中android.widget.ViewAnimator.addView方法的典型用法代码示例。如果您正苦于以下问题:Java ViewAnimator.addView方法的具体用法?Java ViewAnimator.addView怎么用?Java ViewAnimator.addView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.ViewAnimator的用法示例。


在下文中一共展示了ViewAnimator.addView方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initFlipCard

import android.widget.ViewAnimator; //导入方法依赖的package包/类
private void initFlipCard() {
  viewAnimator = (ViewAnimator) this.findViewById(R.id.viewFlipper);
  cardFront = LayoutInflater.from(this).inflate(R.layout.card, null);
  cardBack = LayoutInflater.from(this).inflate(R.layout.card, null);
  viewAnimator.addView(cardFront);
  viewAnimator.addView(cardBack);
  currentCard = cardFront;

  viewAnimator.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View v) {
      flipCard();
      updateNavBar();
    }
  });
}
 
开发者ID:Vosie,项目名称:WikiCards,代码行数:17,代码来源:CardActivity.java

示例2: buildView

import android.widget.ViewAnimator; //导入方法依赖的package包/类
protected ViewAnimator buildView() {
    LayoutInflater li = getLayoutInflater();
    ViewAnimator va = (ViewAnimator) li.inflate(R.layout.base, null);
    View v = li.inflate(R.layout.main, null);
    if (app.isLite()) {
        ((ImageView) v.findViewById(R.id.logo)).setImageResource(R.drawable.logo_lite);
    }
    View touch = v.findViewById(R.id.touch_screen);
    touch.setOnTouchListener(simpleTouchHandler);
    LockSlider ls = (LockSlider) v.findViewById(R.id.drawer);
    if (sharedPreferences.getBoolean(MkRemotePreferences.cs(R.string.c_lock_on), false)) {
        ls.lock();
    } else {
        ls.unlock();
    }
    va.addView(v, MAIN_VIEW);
    va.addView(li.inflate(R.layout.keyboard, null), KEYBOARD_VIEW);
    va.addView(new View(this), BLANK_VIEW);
    va.setDisplayedChild(currentView);
    return va;
}
 
开发者ID:devbury,项目名称:mkRemote,代码行数:22,代码来源:Main.java

示例3: testSetDisplayedChild

import android.widget.ViewAnimator; //导入方法依赖的package包/类
@Test
public void testSetDisplayedChild() {
    final Context context = InstrumentationRegistry.getContext();

    final ViewAnimator va = new ViewAnimator(context);
    va.addView(new View(context));
    va.addView(new View(context));
    va.addView(new View(context));

    BindingAdapters.setDisplayedChild(va, 1);
    assertEquals(1, va.getDisplayedChild());
}
 
开发者ID:Doctoror,项目名称:PainlessMusicPlayer,代码行数:13,代码来源:BindingAdaptersTest.java

示例4: onCreate

import android.widget.ViewAnimator; //导入方法依赖的package包/类
public void onCreate( Bundle savedInstanceState )
{
    super.onCreate( savedInstanceState );
    setContentView( R.layout.activity_loading );
    setTitle( getString( getLoginTitleResId() ) );
    sitesLoginHandler = initSitesLoginHandler();
    vaLoadingView = ( ViewAnimator ) findViewById( R.id.va_loading_view );
    webView = initMainView( savedInstanceState );
    loadingView = initLoadingView( savedInstanceState );
    vaLoadingView.addView( webView, MAIN_VIEW );
    vaLoadingView.addView( loadingView, LOADING_VIEW );
    if ( null != savedInstanceState )
    {
        activeView = savedInstanceState.getInt( ACTIVE_VIEW_KEY );
        showView( activeView );
        if ( savedInstanceState.containsKey( REQUEST_TOKEN_KEY ) )
        {
            this.requestToken = ( Token ) savedInstanceState.getSerializable( REQUEST_TOKEN_KEY );
        }
        webView.restoreState( savedInstanceState );
    }
    else
    {
        switch ( getOAuthVersion() )
        {
            case 1:
                sitesLoginHandler.fetchRequestToken();
                break;
            case 2:
                webView.loadUrl( getAuthorizationUrl() );
        }
    }
}
 
开发者ID:iTwenty,项目名称:Hashtagger,代码行数:34,代码来源:SitesLoginActivity.java

示例5: onCreateView

import android.widget.ViewAnimator; //导入方法依赖的package包/类
@Override
public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState )
{
    View v = inflater.inflate( R.layout.fragment_sites, container, false );
    vaSitesView = ( ViewAnimator ) v.findViewById( R.id.va_sites_view );
    vaSitesView.addView( initViewReady( inflater ), READY );
    vaSitesView.addView( initViewLoading( inflater ), LOADING );
    vaSitesView.addView( initViewLogin( inflater ), LOGIN );
    return v;
}
 
开发者ID:iTwenty,项目名称:Hashtagger,代码行数:11,代码来源:SitesFragment.java

示例6: createView

import android.widget.ViewAnimator; //导入方法依赖的package包/类
private View createView(Context c) {
    viewAnimator = new ViewAnimator(c);
    //viewAnimator.setInAnimation(AnimationUtils.loadAnimation(c,R.anim.slide_from_right));
    //viewAnimator.setOutAnimation(AnimationUtils.loadAnimation(c,R.anim.slide_to_left));

    for(ProcedurePage page : pages) {
        viewAnimator.addView(page.toView(c));
    }

    return viewAnimator;
}
 
开发者ID:SahilArora92,项目名称:vit-04,代码行数:12,代码来源:Procedure.java

示例7: createView

import android.widget.ViewAnimator; //导入方法依赖的package包/类
/**
 * Creates the base view of this object.
 */
public void createView() {
	if (p == null)
		return;	
	setTitle(p.getTitle());
	View procedureView = wrapViewWithInterface(p.toView(this));

	// Now that the view is active, go to the correct page.
	if(p.getCurrentIndex() != startPage) {
		p.jumpToPage(startPage);
		updateNextPrev();            
	}

	baseViews = new ViewAnimator(this);
	baseViews.setBackgroundResource(android.R.drawable.alert_dark_frame);
	baseViews.setInAnimation(AnimationUtils.loadAnimation(this,
			R.anim.slide_from_right));
	baseViews.setOutAnimation(AnimationUtils.loadAnimation(this,
			R.anim.slide_to_left));
	baseViews.addView(procedureView);

	// This should add it to baseViews, so don't add it manually.
	View procedureDonePage = getLayoutInflater().inflate(
			R.layout.procedure_runner_done, baseViews);
	((TextView)procedureDonePage.findViewById(R.id.procedure_done_text))
		.setTextAppearance(this, android.R.style.TextAppearance_Large);
	procedureDonePage.findViewById(R.id.procedure_done_back)
		.setOnClickListener(this);
	procedureDonePage.findViewById(R.id.procedure_done_upload)
		.setOnClickListener(this);

	if(onDonePage) {
		baseViews.setInAnimation(null);
		baseViews.setOutAnimation(null);
		baseViews.showNext();
		baseViews.setInAnimation(AnimationUtils.loadAnimation(this,
				R.anim.slide_from_right));
		baseViews.setOutAnimation(AnimationUtils.loadAnimation(this,
				R.anim.slide_to_left));
	}

	setContentView(baseViews);
	setProgressBarVisibility(true);
	setProgress(0);
}
 
开发者ID:SahilArora92,项目名称:vit-04,代码行数:48,代码来源:ProcedureRunner.java

示例8: createView

import android.widget.ViewAnimator; //导入方法依赖的package包/类
/** Creates the base view of this object. */
public void createView() {
    Log.i(TAG, "createView()");
    if (mProcedure == null)
        return;
    getActivity().setTitle(mProcedure.getTitle());
    View procedureView = wrapViewWithInterface(mProcedure.toView(getActivity()));

    // Now that the view is active, go to the correct page.
    if (mProcedure.getCurrentIndex() != startPage) {
        mProcedure.jumpToPage(startPage);
        updateNextPrev();
    }

    baseViews = new ViewAnimator(getActivity());
    baseViews.setBackgroundResource(android.R.drawable.alert_dark_frame);
    baseViews.setInAnimation(AnimationUtils.loadAnimation(getActivity(),
            R.anim.slide_from_right));
    baseViews
            .setOutAnimation(AnimationUtils.loadAnimation(getActivity(), R.anim.slide_to_left));
    baseViews.addView(procedureView);

    // This should add it to baseViews, so don't add it manually.
    if(isShowCompleteConfirmation()) {
        View procedureDonePage = getActivity().getLayoutInflater().inflate(
                R.layout.procedure_runner_done, baseViews);
        ((TextView) procedureDonePage.findViewById(R.id.procedure_done_text)).setTextAppearance(
                getActivity(), android.R.style.TextAppearance_Large);
        procedureDonePage.findViewById(R.id.procedure_done_back).setOnClickListener(this);
        procedureDonePage.findViewById(R.id.procedure_done_upload).setOnClickListener(this);
    }
    if (onDonePage) {
        baseViews.setInAnimation(null);
        baseViews.setOutAnimation(null);
        baseViews.showNext();
        baseViews.setInAnimation(AnimationUtils.loadAnimation(getActivity(),
                R.anim.slide_from_right));
        baseViews.setOutAnimation(AnimationUtils.loadAnimation(getActivity(),
                R.anim.slide_to_left));
    }

    setContentView(baseViews);
    getActivity().setProgressBarVisibility(true);
    getActivity().setProgress(0);
}
 
开发者ID:SanaMobile,项目名称:sana.mobile,代码行数:46,代码来源:BaseRunnerFragment.java


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