本文整理汇总了Java中android.view.animation.AnimationUtils.loadLayoutAnimation方法的典型用法代码示例。如果您正苦于以下问题:Java AnimationUtils.loadLayoutAnimation方法的具体用法?Java AnimationUtils.loadLayoutAnimation怎么用?Java AnimationUtils.loadLayoutAnimation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.animation.AnimationUtils
的用法示例。
在下文中一共展示了AnimationUtils.loadLayoutAnimation方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import android.view.animation.AnimationUtils; //导入方法依赖的package包/类
@SuppressLint("Recycle")
private void init(Context context, @Nullable AttributeSet attrs) {
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.AnimatedRecyclerView, 0, 0);
orientation = typedArray.getInt(R.styleable.AnimatedRecyclerView_layoutManagerOrientation, orientation);
reverse = typedArray.getBoolean(R.styleable.AnimatedRecyclerView_layoutManagerReverse, reverse);
animationDuration = typedArray.getInt(R.styleable.AnimatedRecyclerView_animationDuration, animationDuration);
layoutManagerType = typedArray.getInt(R.styleable.AnimatedRecyclerView_layoutManagerType, layoutManagerType);
columns = typedArray.getInt(R.styleable.AnimatedRecyclerView_gridLayoutManagerColumns, columns);
animation = typedArray.getResourceId(R.styleable.AnimatedRecyclerView_layoutAnimation, -1);
if (animationController == null)
animationController = animation != -1
? AnimationUtils.loadLayoutAnimation(getContext(), animation)
: AnimationUtils.loadLayoutAnimation(getContext(), R.anim.layout_animation_from_bottom);
animationController.getAnimation().setDuration(animationDuration);
setLayoutAnimation(animationController);
if (layoutManagerType == LayoutManagerType.LINEAR)
setLayoutManager(new LinearLayoutManager(context, orientation, reverse));
else if (layoutManagerType == LayoutManagerType.GRID)
setLayoutManager(new GridLayoutManager(context, columns, orientation, reverse));
}
示例2: solveData
import android.view.animation.AnimationUtils; //导入方法依赖的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();
}
}
示例3: hideApplications
import android.view.animation.AnimationUtils; //导入方法依赖的package包/类
/**
* Hides all of the applications by playing an animation on the grid.
*/
private void hideApplications() {
if (mBlockAnimation) {
return;
}
mBlockAnimation = true;
mShowApplicationsCheck.toggle();
if (mHideLayoutAnimation == null) {
mHideLayoutAnimation = AnimationUtils.loadLayoutAnimation(
this, R.anim.hide_applications);
}
mGridExit.setAnimationListener(new HideGrid());
mGrid.startAnimation(mGridExit);
mGrid.setVisibility(View.INVISIBLE);
mShowApplications.requestFocus();
// This enables a layout animation; if you uncomment this code, you need to
// comment the line mGrid.startAnimation() above
// mGrid.setLayoutAnimationListener(new HideGrid());
// mGrid.setLayoutAnimation(mHideLayoutAnimation);
// mGrid.startLayoutAnimation();
}
示例4: loadFolder
import android.view.animation.AnimationUtils; //导入方法依赖的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);
}
示例5: runLayoutAnimation
import android.view.animation.AnimationUtils; //导入方法依赖的package包/类
private void runLayoutAnimation() {
final LayoutAnimationController controller =
AnimationUtils.loadLayoutAnimation(getApplicationContext(), R.anim.layout_animation_fall_down);
mRecyclerView.setLayoutAnimation(controller);
mRecyclerView.getAdapter().notifyDataSetChanged();
mRecyclerView.scheduleLayoutAnimation();
}
示例6: runLayoutAnimation
import android.view.animation.AnimationUtils; //导入方法依赖的package包/类
public static void runLayoutAnimation(final RecyclerView recyclerView) {
final Context context = recyclerView.getContext();
final LayoutAnimationController controller = AnimationUtils.loadLayoutAnimation(context, R.anim.layout_animation_fall_up);
recyclerView.setLayoutAnimation(controller);
recyclerView.getAdapter().notifyDataSetChanged();
recyclerView.scheduleLayoutAnimation();
}
示例7: showApplications
import android.view.animation.AnimationUtils; //导入方法依赖的package包/类
/**
* Shows all of the applications by playing an animation on the grid.
*/
private void showApplications(boolean animate) {
if (mBlockAnimation) {
return;
}
mBlockAnimation = true;
mShowApplicationsCheck.toggle();
if (mShowLayoutAnimation == null) {
mShowLayoutAnimation = AnimationUtils.loadLayoutAnimation(
this, R.anim.show_applications);
}
// This enables a layout animation; if you uncomment this code, you need to
// comment the line mGrid.startAnimation() below
// mGrid.setLayoutAnimationListener(new ShowGrid());
// mGrid.setLayoutAnimation(mShowLayoutAnimation);
// mGrid.startLayoutAnimation();
if (animate) {
mGridEntry.setAnimationListener(new ShowGrid());
mGrid.startAnimation(mGridEntry);
}
mGrid.setVisibility(View.VISIBLE);
if (!animate) {
mBlockAnimation = false;
}
// ViewDebug.startHierarchyTracing("Home", mGrid);
}
示例8: runLayoutAnimation
import android.view.animation.AnimationUtils; //导入方法依赖的package包/类
private void runLayoutAnimation(final RecyclerView recyclerView) {
final Context context = recyclerView.getContext();
final LayoutAnimationController controller =
AnimationUtils.loadLayoutAnimation(context, R.anim.rv_layout_animation);
recyclerView.setLayoutAnimation(controller);
recyclerView.getAdapter().notifyDataSetChanged();
recyclerView.scheduleLayoutAnimation();
}
示例9: runLayoutAnimation
import android.view.animation.AnimationUtils; //导入方法依赖的package包/类
private final void runLayoutAnimation(int animation){
final LayoutAnimationController controller = AnimationUtils.loadLayoutAnimation(getActivity(),animation);
recyclerViewContent.setLayoutAnimation(controller);
recyclerViewContent.scheduleLayoutAnimation();
}
示例10: onCreate
import android.view.animation.AnimationUtils; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_upload_history);
ButterKnife.bind(this);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setTitle(getString(R.string.upload_history_title));
actionBar.setDisplayHomeAsUpEnabled(true);
}
final RecyclerView recyclerView = findViewById(R.id.list);
final UploadHistoryListAdapter uploadHistoryListAdapter = new UploadHistoryListAdapter(this);
uploadItemViewModel = ViewModelProviders.of(this).get(UploadItemViewModel.class);
uploadItemViewModel
.getUploadHistoryList()
.observe(this, new Observer<List<UploadItem>>() {
@Override
public void onChanged(@Nullable List<UploadItem> uploadItems) {
if ((uploadItems == null) || uploadItems.isEmpty()) {
noUploadsView.setVisibility(View.VISIBLE);
recyclerView.setVisibility(View.INVISIBLE);
MaterialIn.animate(noUploadsView);
} else {
noUploadsView.setVisibility(View.INVISIBLE);
recyclerView.setVisibility(View.VISIBLE);
uploadHistoryListAdapter.setUploadItemList(uploadItems);
}
}
});
recyclerView.setAdapter(uploadHistoryListAdapter);
uploadHistoryListAdapter.setOnUploadItemLongClickListener(this);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(linearLayoutManager);
LayoutAnimationController layoutAnimationController = AnimationUtils.loadLayoutAnimation(this, R.anim.layout_anim_fall_down);
recyclerView.setLayoutAnimation(layoutAnimationController);
}