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