當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。