本文整理汇总了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();
}
});
}
示例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;
}
示例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());
}
示例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() );
}
}
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}