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


Java LayoutAnimationController类代码示例

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


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

示例1: solveData

import android.view.animation.LayoutAnimationController; //导入依赖的package包/类
private void solveData() {
    mButler.clear();

    final boolean ready = isDataSetReady();

    if (ready) {
        final LayoutAnimationController controller =
                AnimationUtils.loadLayoutAnimation(this, R.anim.layout_animation_from_bottom);

        mRecyclerView.setLayoutAnimation(controller);
        mRecyclerView.scheduleLayoutAnimation();

        dataSetReady();
    } else {
        dataSetUnready();
    }
}
 
开发者ID:huazhouwang,项目名称:Synapse,代码行数:18,代码来源:MainActivity.java

示例2: loadFolder

import android.view.animation.LayoutAnimationController; //导入依赖的package包/类
public void loadFolder(String folder) {
    clear();

    mProjectFolder = folder;

    mListProjects = PhonkScriptHelper.listProjects(mProjectFolder, mOrderByName);
    mProjectAdapter.setArray(mListProjects);
    mGrid.setAdapter(mProjectAdapter);
    // mGrid.clearAnimation();
    // mGrid.startAnimation(mAnim);

    notifyAddedProject();

    final Context context = mGrid.getContext();
    final LayoutAnimationController controller = AnimationUtils.loadLayoutAnimation(context, R.anim.fav_grid_anim);

    mGrid.setLayoutAnimation(controller);
    mGrid.getAdapter().notifyDataSetChanged();
    mGrid.scheduleLayoutAnimation();

    MLog.d(TAG, "loading " + mProjectFolder);
}
 
开发者ID:victordiaz,项目名称:phonk,代码行数:23,代码来源:ProjectListFragment.java

示例3: onCreate

import android.view.animation.LayoutAnimationController; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main_grid);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    mRecyclerView = (StaggeredGridRecyclerView) findViewById(R.id.recycler_view);
    mRecyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
    mStaggeredGridAdapter = new StaggeredGridAdapter();
    mStaggeredGridAdapter.setDataSet(mockData());
    mRecyclerView.setAdapter(mStaggeredGridAdapter);
    LayoutAnimationController controller = MyLayoutAnimationHelper.makeLayoutAnimationController();
    ViewGroup viewGroup = (ViewGroup) findViewById(R.id.root_view);
    viewGroup.setLayoutAnimation(controller);
    viewGroup.scheduleLayoutAnimation();
}
 
开发者ID:nuptboyzhb,项目名称:RecyclerViewAnimation,代码行数:18,代码来源:StaggeredGridActivity.java

示例4: onPostExecute

import android.view.animation.LayoutAnimationController; //导入依赖的package包/类
@Override
protected void onPostExecute(Void aVoid) {
    super.onPostExecute(aVoid);
    if (itemList.size() == 0) Toast.makeText(MyRank.this, "发生未知错误",Toast.LENGTH_SHORT).show();
    RecyclerView rankList = findViewById(R.id.rank_list);
    ReleaseRankItemAdapter adapter = new ReleaseRankItemAdapter(itemList);
    GridLayoutManager layoutManager = new GridLayoutManager(MyRank.this, 1);
    rankList.setLayoutManager(layoutManager);
    rankList.setAdapter(adapter);

    TranslateAnimation animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 2f, Animation.RELATIVE_TO_SELF,
            0f, Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0);
    animation.setInterpolator(new DecelerateInterpolator());
    animation.setDuration(550);

    lac = new LayoutAnimationController(animation, 0.12f);
    lac.setInterpolator(new DecelerateInterpolator());
    rankList.setLayoutAnimation(lac);

    RecyclerView ranklist1 = findViewById(R.id.rank_list1);
    ReleaseRankItemAdapter adapter1 = new ReleaseRankItemAdapter(itemListOthers);
    GridLayoutManager layoutManager1 = new GridLayoutManager(MyRank.this,1);
    ranklist1.setLayoutManager(layoutManager1);
    ranklist1.setAdapter(adapter1);
    ranklist1.setLayoutAnimation(lac);
}
 
开发者ID:Luodian,项目名称:Shared-Route,代码行数:27,代码来源:MyRank.java

示例5: onInitView

import android.view.animation.LayoutAnimationController; //导入依赖的package包/类
@Override
protected void onInitView() {
    mSwipeRefreshLayout.setColorSchemeResources(
            R.color.username1,
            R.color.username2,
            R.color.username3,
            R.color.username4,
            R.color.username5,
            R.color.username6);
    mSwipeRefreshLayout.setOnRefreshListener(this);

    mAdapter = new CategoryAdapter(getContext(),R.layout.category_item,mDatas);

    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    mRecyclerView.addItemDecoration(new RecycleViewDivider(getActivity(), LinearLayoutManager.HORIZONTAL));
    mRecyclerView.setAdapter(mAdapter);
    mRecyclerView.setOnLoadMoreListener(this);
    mRecyclerView.setEmpty();
    LayoutAnimationController lac = new LayoutAnimationController(AnimationUtils.loadAnimation(getContext(),R.anim.fade_in));
    lac.setOrder(LayoutAnimationController.ORDER_NORMAL);
    mRecyclerView.setLayoutAnimation(lac);
    mRecyclerView.startLayoutAnimation();

    getData(true);

}
 
开发者ID:Alex-Jerry,项目名称:LLApp,代码行数:27,代码来源:MyArticleTypeFragment.java

示例6: getAnimationController

import android.view.animation.LayoutAnimationController; //导入依赖的package包/类
/**
 * ListView节点出现动画
 *
 * @return
 */
protected LayoutAnimationController getAnimationController() {
    int duration = 300;
    AnimationSet set = new AnimationSet(true);

    Animation animation = new AlphaAnimation(0.0f, 1.0f);
    animation.setDuration(duration);
    set.addAnimation(animation);

    animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
            Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
            -1.0f, Animation.RELATIVE_TO_SELF, 0.0f);
    animation.setDuration(duration);
    set.addAnimation(animation);

    LayoutAnimationController controller = new LayoutAnimationController(set, 0.5f);
    controller.setOrder(LayoutAnimationController.ORDER_NORMAL);
    return controller;
}
 
开发者ID:paifeng,项目名称:Mobile-guards,代码行数:24,代码来源:AppLockFragment2.java

示例7: loadAnimation

import android.view.animation.LayoutAnimationController; //导入依赖的package包/类
/**
   * 加载动画.
   */
  @SuppressWarnings("ResourceType")
  public static LayoutAnimationController loadAnimation(Context context) {
/*
 * 创建动画的集合
 */
      AnimationSet set = new AnimationSet(false);
      Animation animation;
/*
 * 创建旋转动画
 */
      animation = new RotateAnimation(180, 10);
      animation.setDuration(1000);
      set.addAnimation(animation);

      LayoutAnimationController controller = new LayoutAnimationController(set, 1);
      controller.setInterpolator(context, android.R.anim.accelerate_interpolator);
      controller.setAnimation(set);
      return controller;
  }
 
开发者ID:JasonFengIce,项目名称:AndroidTVWidget,代码行数:23,代码来源:MenuAnimationUtils.java

示例8: loadAnimation2

import android.view.animation.LayoutAnimationController; //导入依赖的package包/类
/**
 * 加载动画2.
 */
public static LayoutAnimationController loadAnimation2() {
    int duration = 300;
    AnimationSet set = new AnimationSet(true);

    Animation animation = new AlphaAnimation(0.0f, 1.0f);
    animation.setDuration(duration);
    set.addAnimation(animation);

    animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
            Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f);
    animation.setDuration(duration);
    set.addAnimation(animation);

    LayoutAnimationController controller = new LayoutAnimationController(set, 0.5f);
    controller.setOrder(LayoutAnimationController.ORDER_NORMAL);
    return controller;
}
 
开发者ID:JasonFengIce,项目名称:AndroidTVWidget,代码行数:21,代码来源:MenuAnimationUtils.java

示例9: applyAnimationToListView

import android.view.animation.LayoutAnimationController; //导入依赖的package包/类
private void applyAnimationToListView() {
    AnimationSet set = new AnimationSet(true);

    Animation animation = new AlphaAnimation(0.0f, 1.0f);
    animation.setDuration(50);
    set.addAnimation(animation);

    animation = new TranslateAnimation(
        Animation.RELATIVE_TO_SELF, 0.0f,Animation.RELATIVE_TO_SELF, 0.0f,
        Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f
    );
    animation.setDuration(100);
    set.addAnimation(animation);

    LayoutAnimationController controller = new LayoutAnimationController(set, 0.5f);
    ListView listView = getListView();
    listView.setLayoutAnimation(controller);
}
 
开发者ID:emmanuel-florent,项目名称:flowzr-android-black,代码行数:19,代码来源:ReportFragment.java

示例10: setAnimation

import android.view.animation.LayoutAnimationController; //导入依赖的package包/类
/**
 * Set the list loading animation.
 */
private void setAnimation() {
	AnimationSet set = new AnimationSet(true);

	Animation animation = new AlphaAnimation(0.0f, 1.0f);
	animation.setDuration(75);
	set.addAnimation(animation);

	animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
			Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
			-1.0f, Animation.RELATIVE_TO_SELF, 0.0f);
	animation.setDuration(50);
	set.addAnimation(animation);

	LayoutAnimationController controller = new LayoutAnimationController(
			set, 0.5f);

	mListView.setLayoutAnimation(controller);
}
 
开发者ID:tommy4711,项目名称:gaeproxy,代码行数:22,代码来源:WeaveBookmarksListActivity.java

示例11: setAnimation

import android.view.animation.LayoutAnimationController; //导入依赖的package包/类
/**
 * Set the list loading animation.
 */
private void setAnimation() {
	AnimationSet set = new AnimationSet(true);

	Animation animation = new AlphaAnimation(0.0f, 1.0f);
	animation.setDuration(100);
	set.addAnimation(animation);

	animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
			Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -1.0f,
			Animation.RELATIVE_TO_SELF, 0.0f);
	animation.setDuration(100);
	set.addAnimation(animation);

	LayoutAnimationController controller = new LayoutAnimationController(set, 0.5f);

	mList.setLayoutAnimation(controller);
}
 
开发者ID:tommy4711,项目名称:gaeproxy,代码行数:21,代码来源:BookmarksListActivity.java

示例12: setAnimation

import android.view.animation.LayoutAnimationController; //导入依赖的package包/类
/**
 * Set the view loading animation.
 */
private void setAnimation() {
	AnimationSet set = new AnimationSet(true);

	Animation animation = new AlphaAnimation(0.0f, 1.0f);
	animation.setDuration(100);
	set.addAnimation(animation);

	animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
			Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
			-1.0f, Animation.RELATIVE_TO_SELF, 0.0f);
	animation.setDuration(100);
	set.addAnimation(animation);

	LayoutAnimationController controller = new LayoutAnimationController(
			set, 0.5f);
	ListView listView = getListView();
	listView.setLayoutAnimation(controller);
}
 
开发者ID:tommy4711,项目名称:gaeproxy,代码行数:22,代码来源:AdBlockerWhiteListActivity.java

示例13: getLayoutAnimation

import android.view.animation.LayoutAnimationController; //导入依赖的package包/类
public LayoutAnimationController getLayoutAnimation(ResourceDesc resourceDesc, XMLInflaterContext xmlInflaterContext)
{
    if (resourceDesc instanceof ResourceDescDynamic)
    {
        ResourceDescDynamic resourceDescDyn = (ResourceDescDynamic)resourceDesc;
        if (resourceDescDyn.getValuesResourceName() != null)
        {
            ElementValuesResources elementResources = getElementValuesResources(resourceDescDyn, xmlInflaterContext);
            return elementResources.getLayoutAnimation(resourceDescDyn.getValuesResourceName(), xmlInflaterContext);
        }
        else
        {
            return getLayoutAnimationDynamicFromXML(resourceDescDyn,xmlInflaterContext);
        }
    }
    else if (resourceDesc instanceof ResourceDescCompiled)
    {
        Context ctx = xmlInflaterContext.getContext();
        String resourceDescValue = resourceDesc.getResourceDescValue();
        return getLayoutAnimationCompiled(resourceDescValue, ctx);
    }
    else throw MiscUtil.internalError();
}
 
开发者ID:jmarranz,项目名称:itsnat_droid,代码行数:24,代码来源:XMLInflaterRegistry.java

示例14: getLayoutAnimationDynamicFromXML

import android.view.animation.LayoutAnimationController; //导入依赖的package包/类
private LayoutAnimationController getLayoutAnimationDynamicFromXML(ResourceDescDynamic resourceDescDyn, XMLInflaterContext xmlInflaterContext)
{
    if (resourceDescDyn.getValuesResourceName() != null) throw MiscUtil.internalError();

    Context ctx = xmlInflaterContext.getContext();

    int bitmapDensityReference = xmlInflaterContext.getBitmapDensityReference();

    AttrResourceInflaterListener attrResourceInflaterListener = xmlInflaterContext.getAttrResourceInflaterListener();

    // Esperamos un LayoutAnimationController
    PageImpl page = xmlInflaterContext.getPageImpl(); // Puede ser null

    if (resourceDescDyn instanceof ResourceDescRemote && page == null) throw MiscUtil.internalError(); // Si es remote hay page por medio

    ParsedResourceXMLDOM resource = (ParsedResourceXMLDOM) resourceDescDyn.getParsedResource();
    if (resource == null)
        throw new ItsNatDroidException("Resource is still not loaded, if remote resource maybe you should use an attribute with namespace " + NamespaceUtil.XMLNS_ITSNATDROID_RESOURCE + " for manual load declaration");
    XMLDOMLayoutAnimation xmlDOMLayoutAnimation = (XMLDOMLayoutAnimation) resource.getXMLDOM();
    InflatedXMLLayoutAnimation inflatedLayoutAnimation = InflatedXMLLayoutAnimation.createInflatedLayoutAnimation(itsNatDroid, xmlDOMLayoutAnimation, ctx, page);

    XMLInflaterLayoutAnimation xmlInflaterLayoutAnimation = XMLInflaterLayoutAnimation.createXMLInflaterLayoutAnimation(inflatedLayoutAnimation, bitmapDensityReference, attrResourceInflaterListener);
    return xmlInflaterLayoutAnimation.inflateLayoutAnimation();
}
 
开发者ID:jmarranz,项目名称:itsnat_droid,代码行数:25,代码来源:XMLInflaterRegistry.java

示例15: onViewCreated

import android.view.animation.LayoutAnimationController; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    AnimationSet set = new AnimationSet(true);
    Animation fadeIn = new AlphaAnimation(0.0f, 1.0f);
    fadeIn.setDuration(350);
    set.addAnimation(fadeIn);
    Animation dropDown = new TranslateAnimation(
            Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f,
            Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f
    );
    dropDown.setDuration(400);
    set.addAnimation(dropDown);
    LayoutAnimationController controller = new LayoutAnimationController(set, 0.2f);
    mRecyclerView.setLayoutAnimation(controller);

    mFab.attachToRecyclerView(mRecyclerView);
    mFab.setVisibility(View.INVISIBLE);
    mEmptyStartView.setVisibility(View.GONE);
    mEmptyWorkingView.setVisibility(View.GONE);
    mListContainer.addView(mEmptyStartView);
    mListContainer.addView(mEmptyWorkingView);
    mRecyclerView.setEmptyView(mEmptyStartView);
    mRecyclerView.setItemAnimator(new DefaultItemAnimator());
}
 
开发者ID:d4rken,项目名称:rootvalidator,代码行数:27,代码来源:ValidatorFragment.java


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