本文整理匯總了Java中android.support.v7.widget.RecyclerView.scheduleLayoutAnimation方法的典型用法代碼示例。如果您正苦於以下問題:Java RecyclerView.scheduleLayoutAnimation方法的具體用法?Java RecyclerView.scheduleLayoutAnimation怎麽用?Java RecyclerView.scheduleLayoutAnimation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v7.widget.RecyclerView
的用法示例。
在下文中一共展示了RecyclerView.scheduleLayoutAnimation方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreateView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
Bundle args = getArguments();
String title = "Sample";
int layout = R.layout.fragment_list_from_bottom;
if (args != null) {
title = args.getString(SampleActivity.TITLE_KEY);
layout = args.getInt(SampleActivity.LAYOUT_KEY);
}
((SampleActivity) getActivity()).getSupportActionBar().setTitle(title);
View view = inflater.inflate(layout, container, false);
RecyclerView recyclerView = (AnimatedRecyclerView) view.findViewById(R.id.recycler_view);
recyclerView.setAdapter(adapter);
adapter.notifyDataSetChanged();
recyclerView.scheduleLayoutAnimation();
return view;
}
示例2: runLayoutAnimation
import android.support.v7.widget.RecyclerView; //導入方法依賴的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();
}
示例3: applyAnimation
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public static void applyAnimation(RecyclerView recyclerView) {
LayoutAnimationController controller = new LayoutAnimationController(getAnimationSetFromLeft());
controller.setDelay(0.1f);
controller.setOrder(LayoutAnimationController.ORDER_NORMAL);
recyclerView.setLayoutAnimation(controller);
recyclerView.getAdapter().notifyDataSetChanged();
recyclerView.scheduleLayoutAnimation();
}
示例4: runLayoutAnimation
import android.support.v7.widget.RecyclerView; //導入方法依賴的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();
}