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


Java AnimationUtils.loadLayoutAnimation方法代码示例

本文整理汇总了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));
}
 
开发者ID:MLSDev,项目名称:AnimatedRecyclerView,代码行数:25,代码来源:AnimatedRecyclerView.java

示例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();
    }
}
 
开发者ID:huazhouwang,项目名称:Synapse,代码行数:18,代码来源:MainActivity.java

示例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();
    }
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:28,代码来源:Home.java

示例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);
}
 
开发者ID:victordiaz,项目名称:phonk,代码行数:23,代码来源:ProjectListFragment.java

示例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();
}
 
开发者ID:AlexeyZatsepin,项目名称:CP-Tester,代码行数:8,代码来源:MainActivity.java

示例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();
}
 
开发者ID:afiqiqmal,项目名称:MVP-Android,代码行数:9,代码来源:RecyclerViewUtils.java

示例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);
    }
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:36,代码来源:Home.java

示例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();
}
 
开发者ID:tpakis,项目名称:Charities,代码行数:10,代码来源:CharitiesResultsActivity.java

示例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();
}
 
开发者ID:domgeorg,项目名称:INFOotball,代码行数:6,代码来源:BaseFragment.java

示例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);

}
 
开发者ID:rumaan,项目名称:file.io-app,代码行数:46,代码来源:UploadHistoryActivity.java


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