• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RefactoredDefaultItemAnimator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator的典型用法代码示例。如果您正苦于以下问题:Java RefactoredDefaultItemAnimator类的具体用法?Java RefactoredDefaultItemAnimator怎么用?Java RefactoredDefaultItemAnimator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RefactoredDefaultItemAnimator类属于com.h6ah4i.android.widget.advrecyclerview.animator包,在下文中一共展示了RefactoredDefaultItemAnimator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setUpRecyclerView

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
private void setUpRecyclerView() {
    recyclerViewDragDropManager = new RecyclerViewDragDropManager();
    final GeneralItemAnimator animator = new RefactoredDefaultItemAnimator();

    playingQueueAdapter = new PlayingQueueAdapter(
            ((AppCompatActivity) getActivity()),
            MusicPlayerRemote.getPlayingQueue(),
            MusicPlayerRemote.getPosition(),
            R.layout.item_list,
            false,
            null);
    wrappedAdapter = recyclerViewDragDropManager.createWrappedAdapter(playingQueueAdapter);

    layoutManager = new LinearLayoutManager(getActivity());

    recyclerView.setLayoutManager(layoutManager);
    recyclerView.setAdapter(wrappedAdapter);
    recyclerView.setItemAnimator(animator);

    recyclerViewDragDropManager.attachRecyclerView(recyclerView);

    layoutManager.scrollToPositionWithOffset(MusicPlayerRemote.getPosition() + 1, 0);
}
 
开发者ID:aliumujib,项目名称:Orin,代码行数:24,代码来源:FlatPlayerFragment.java


示例2: initRecyclerView

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
private void initRecyclerView(Bundle savedInstanceState) {
    mLayoutManager = new LinearLayoutManager(getActivity());

    final Parcelable eimSavedState = (savedInstanceState != null) ?
            savedInstanceState.getParcelable(SAVED_STATE_EXPANDABLE_ITEM_MANAGER) : null;
    mRecyclerViewExpandableItemManager = new RecyclerViewExpandableItemManager(eimSavedState);

    mExpandableItemAdapter = new ExpandableItemAdapter(getActivity(), this, new ArrayList<Day>());
    mAdapter = mExpandableItemAdapter;
    mWrappedAdapter = mRecyclerViewExpandableItemManager.createWrappedAdapter(mExpandableItemAdapter);

    final GeneralItemAnimator animator = new RefactoredDefaultItemAnimator();

    animator.setSupportsChangeAnimations(false);

    mRecyclerView.setLayoutManager(mLayoutManager);
    mRecyclerView.setAdapter(mWrappedAdapter);
    mRecyclerView.setItemAnimator(animator);
    mRecyclerView.setHasFixedSize(false);

    mRecyclerViewExpandableItemManager.attachRecyclerView(mRecyclerView);
}
 
开发者ID:andreshj87,项目名称:CleanFit,代码行数:23,代码来源:DiaryFragment.java


示例3: setupBreakdown

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
private void setupBreakdown(@Nullable final Bundle savedState) {
    if (mBreakdownView != null) {
        mBreakdownView.setHasFixedSize(false);
        mBreakdownView.setLayoutManager(new LinearLayoutManager(getActivity()));

        // create and attach adapter
        mBreakdownExpandableItemManager = new RecyclerViewExpandableItemManager(
                savedState != null ? savedState.getParcelable(SAVED_STATE_EXPANDABLE_ITEM_MANAGER) : null);
        mBreakdownAdapter = new MeasurementBreakdownExpandableViewAdapter();
        mWrappedBreakdownAdapter = mBreakdownExpandableItemManager.createWrappedAdapter(mBreakdownAdapter);
        mBreakdownView.setAdapter(mWrappedBreakdownAdapter);

        // set custom animator
        mBreakdownView.setItemAnimator(new RefactoredDefaultItemAnimator());

        // attach the RecyclerView to the ExpandableItemManager
        mBreakdownExpandableItemManager.attachRecyclerView(mBreakdownView);

        // set some item decorators
        mBreakdownView.addItemDecoration(new DividerItemDecoration(getActivity(), VERTICAL));
    }
}
 
开发者ID:GlobalTechnology,项目名称:gma-android,代码行数:23,代码来源:MeasurementDetailsFragment.java


示例4: setUpRecyclerView

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
private void setUpRecyclerView() {
    ViewUtil.setUpFastScrollRecyclerViewColor(this, ((FastScrollRecyclerView) recyclerView), ThemeStore.accentColor(this));
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    if (playlist instanceof AbsCustomPlaylist) {
        adapter = new CustomPlaylistSongAdapter(this, new ArrayList<Song>(), R.layout.item_list, false, this);
        recyclerView.setAdapter(adapter);
    } else {
        recyclerViewDragDropManager = new RecyclerViewDragDropManager();
        final GeneralItemAnimator animator = new RefactoredDefaultItemAnimator();
        adapter = new PlaylistSongAdapter(this, new ArrayList<PlaylistSong>(), R.layout.item_list, false, this, new PlaylistSongAdapter.OnMoveItemListener() {
            @Override
            public void onMoveItem(int fromPosition, int toPosition) {
                if (PlaylistsUtil.moveItem(PlaylistDetailActivity.this, playlist.id, fromPosition, toPosition)) {
                    Song song = adapter.getDataSet().remove(fromPosition);
                    adapter.getDataSet().add(toPosition, song);
                    adapter.notifyItemMoved(fromPosition, toPosition);
                }
            }
        });
        wrappedAdapter = recyclerViewDragDropManager.createWrappedAdapter(adapter);

        recyclerView.setAdapter(wrappedAdapter);
        recyclerView.setItemAnimator(animator);

        recyclerViewDragDropManager.attachRecyclerView(recyclerView);
    }

    adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
        @Override
        public void onChanged() {
            super.onChanged();
            checkIsEmpty();
        }
    });
}
 
开发者ID:aliumujib,项目名称:Orin,代码行数:36,代码来源:PlaylistDetailActivity.java


示例5: setUpRecyclerView

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
private void setUpRecyclerView() {
    mRecyclerViewDragDropManager = new RecyclerViewDragDropManager();
    final GeneralItemAnimator animator = new RefactoredDefaultItemAnimator();

    mPlayingQueueAdapter = new PlayingQueueAdapter(
            (AppCompatActivity) getActivity(),
            MusicPlayerRemote.getPlayingQueue(),
            MusicPlayerRemote.getPosition(),
            R.layout.item_list,
            false,
            null);
    mWrappedAdapter = mRecyclerViewDragDropManager.createWrappedAdapter(mPlayingQueueAdapter);

    mLayoutManager = new LinearLayoutManager(getContext());

    mRecyclerView.setLayoutManager(mLayoutManager);
    mRecyclerView.setAdapter(mWrappedAdapter);
    mRecyclerView.setItemAnimator(animator);

    mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
        @Override
        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
            super.onScrolled(recyclerView, dx, dy);
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
               /* if (recyclerView.canScrollVertically(RecyclerView.NO_POSITION)) {
                    mAppBarLayout.setElevation(5f);
                } else {
                    mAppBarLayout.setElevation(0f);
                }*/
            }
        }
    });

    mRecyclerViewDragDropManager.attachRecyclerView(mRecyclerView);
    mLayoutManager.scrollToPositionWithOffset(MusicPlayerRemote.getPosition() + 1, 0);
}
 
开发者ID:h4h13,项目名称:RetroMusicPlayer,代码行数:37,代码来源:PlayingQueueFragment.java


示例6: setUpRecyclerView

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
private void setUpRecyclerView() {
    ViewUtil.setUpFastScrollRecyclerViewColor(this,
            ((FastScrollRecyclerView) recyclerView),
            ThemeStore.accentColor(this));
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    if (playlist instanceof AbsCustomPlaylist) {
        adapter = new PlaylistSongAdapter(this, new ArrayList<Song>(), R.layout.item_list, false, this);
        recyclerView.setAdapter(adapter);
    } else {
        recyclerViewDragDropManager = new RecyclerViewDragDropManager();
        final GeneralItemAnimator animator = new RefactoredDefaultItemAnimator();
        adapter = new OrderablePlaylistSongAdapter(this, new ArrayList<PlaylistSong>(), R.layout.item_list, false, this, (fromPosition, toPosition) -> {
            if (PlaylistsUtil.moveItem(PlaylistDetailActivity.this, playlist.id, fromPosition, toPosition)) {
                Song song = adapter.getDataSet().remove(fromPosition);
                adapter.getDataSet().add(toPosition, song);
                adapter.notifyItemMoved(fromPosition, toPosition);
            }
        });
        wrappedAdapter = recyclerViewDragDropManager.createWrappedAdapter(adapter);

        recyclerView.setAdapter(wrappedAdapter);
        recyclerView.setItemAnimator(animator);

        recyclerViewDragDropManager.attachRecyclerView(recyclerView);
    }
    adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
        @Override
        public void onChanged() {
            super.onChanged();
            checkIsEmpty();
        }
    });
}
 
开发者ID:h4h13,项目名称:RetroMusicPlayer,代码行数:34,代码来源:PlaylistDetailActivity.java


示例7: initView

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
void initView(View container) {
  this.recyclerView = (RecyclerView) container.findViewById(R.id.search_result_recyclerView);
  recyclerView.setLayoutManager(new LinearLayoutManager(recyclerView.getContext()));
  recyclerView.addItemDecoration(new CommonDivderDecorator(recyclerView.getContext()));
  recyclerView.setItemAnimator(new RefactoredDefaultItemAnimator());
  mAdapter = new SearchResultAdapter();
  recyclerView.setAdapter(mAdapter);
}
 
开发者ID:8enet,项目名称:AppOpsX,代码行数:9,代码来源:SearchHandler.java


示例8: onCreate

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);

  Log.e(TAG, "onCreate --> ");
  mSearchHandler = new SearchHandler();

  mProgressBar = (ProgressBar) findViewById(R.id.progressBar);

  containerApp = findViewById(R.id.container_app);
  containerSearch = findViewById(R.id.container_search);

  mSearchHandler.initView(containerSearch);

  recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
  mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swiperefreshlayout);
  mSwipeRefreshLayout.setRefreshing(false);
  mSwipeRefreshLayout.setColorSchemeResources(R.color.colorAccent);
  mSwipeRefreshLayout.setEnabled(false);

  recyclerView.setLayoutManager(new LinearLayoutManager(this));
  recyclerView.addItemDecoration(new CommonDivderDecorator(getApplicationContext()));
  recyclerView.setItemAnimator(new RefactoredDefaultItemAnimator());

  adapter = new MainListAdapter();
  recyclerView.setAdapter(adapter);

  loadData(true);
  mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
    @Override
    public void onRefresh() {
      loadData(false);
    }
  });
}
 
开发者ID:8enet,项目名称:AppOpsX,代码行数:37,代码来源:MainActivity.java


示例9: onViewCreated

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
  super.onViewCreated(view, savedInstanceState);

  recyclerView = (RecyclerView) view.findViewById(R.id.recyclerView);
  if (recyclerView != null) {
    recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    recyclerView.addItemDecoration(new CommonDivderDecorator(getContext()));
    recyclerView.setItemAnimator(new RefactoredDefaultItemAnimator());
  }
}
 
开发者ID:8enet,项目名称:AppOpsX,代码行数:12,代码来源:BaseConfigFragment.java


示例10: onCreate

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_usage_stats);

  getSupportActionBar().setDisplayHomeAsUpEnabled(true);

  setTitle(R.string.menu_stats);

  mProgressBar = (ProgressBar) findViewById(R.id.progressBar);

  containerApp = findViewById(R.id.container_app);

  recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
  mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swiperefreshlayout);
  mSwipeRefreshLayout.setRefreshing(false);
  mSwipeRefreshLayout.setColorSchemeResources(R.color.colorAccent);
  mSwipeRefreshLayout.setEnabled(false);

  recyclerView.setLayoutManager(new LinearLayoutManager(this));
  recyclerView.addItemDecoration(new CommonDivderDecorator(getApplicationContext()));
  recyclerView.setItemAnimator(new RefactoredDefaultItemAnimator());

  adapter = new UsageStatsAdapter();
  recyclerView.setAdapter(adapter);


  loadData(true);
  mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
    @Override
    public void onRefresh() {
      loadData(false);
    }
  });


}
 
开发者ID:8enet,项目名称:AppOpsX,代码行数:38,代码来源:PermsUsageStatsActivity.java


示例11: onCreateView

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    recyclerView = (RecyclerView) inflater.inflate(R.layout.vertical_recycler_view, null);

    dController = DatabaseController.getInstance(getActivity());
    ilias = IliasController.getInstance(getActivity());

    List<FileObject> list = new ArrayList<>();
    list = Session.getSynchronisationFiles();

    final Parcelable expandableItemManagerSavedState = (savedInstanceState != null) ? savedInstanceState.getParcelable(SAVED_STATE_EXPANDABLE_ITEM_MANAGER) : null;
    mRecyclerViewExpandableItemManager = new RecyclerViewExpandableItemManager(expandableItemManagerSavedState);

    adapter = new CourseRecyclerAdapter(getActivity()/*, ExpandableCourse.createCourses(list)*/, this, mRecyclerViewExpandableItemManager);

    mWrappedAdapter = mRecyclerViewExpandableItemManager.createWrappedAdapter(adapter);

    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.setAdapter(mWrappedAdapter);
    recyclerView.addItemDecoration(new SimpleListDividerDecorator(getResources().getDrawable(R.drawable.list_divider), true));
    recyclerView.setItemAnimator(new RefactoredDefaultItemAnimator());
    recyclerView.setHasFixedSize(false);

    mRecyclerViewExpandableItemManager.attachRecyclerView(recyclerView);

    connector = new DataProviderAdapterConnector(StaticSortedCourseDataProvider.getInstance(), mRecyclerViewExpandableItemManager, adapter);

    return recyclerView;
}
 
开发者ID:fi3te,项目名称:ILIASDownloaderAndroid,代码行数:30,代码来源:CurrentSyncFragment.java


示例12: setUpRecyclerView

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
private void setUpRecyclerView() {
    ViewUtil.setUpFastScrollRecyclerViewColor(this, ((FastScrollRecyclerView) recyclerView), ThemeStore.accentColor(this));
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    if (playlist instanceof AbsCustomPlaylist) {
        adapter = new PlaylistSongAdapter(this, new ArrayList<Song>(), R.layout.item_list, false, this);
        recyclerView.setAdapter(adapter);
    } else {
        recyclerViewDragDropManager = new RecyclerViewDragDropManager();
        final GeneralItemAnimator animator = new RefactoredDefaultItemAnimator();
        adapter = new OrderablePlaylistSongAdapter(this, new ArrayList<PlaylistSong>(), R.layout.item_list, false, this, (fromPosition, toPosition) -> {
            if (PlaylistsUtil.moveItem(PlaylistDetailActivity.this, playlist.id, fromPosition, toPosition)) {
                Song song = adapter.getDataSet().remove(fromPosition);
                adapter.getDataSet().add(toPosition, song);
                adapter.notifyItemMoved(fromPosition, toPosition);
            }
        });
        wrappedAdapter = recyclerViewDragDropManager.createWrappedAdapter(adapter);

        recyclerView.setAdapter(wrappedAdapter);
        recyclerView.setItemAnimator(animator);

        recyclerViewDragDropManager.attachRecyclerView(recyclerView);
    }

    adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
        @Override
        public void onChanged() {
            super.onChanged();
            checkIsEmpty();
        }
    });
}
 
开发者ID:kabouzeid,项目名称:Phonograph,代码行数:33,代码来源:PlaylistDetailActivity.java


示例13: initRecyclerView

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
/**
 * Initialize the recycler view and set the adapter.
 */
private void initRecyclerView(Bundle savedInstanceState) {
            // restore state if necessary
    final Parcelable eimSavedState = (savedInstanceState != null) ? savedInstanceState.getParcelable(SAVED_STATE_EXPANDABLE_ITEM_MANAGER) : null;
    recyclerViewExpandableItemManager = new RecyclerViewExpandableItemManager(eimSavedState);

    // create data provider
    dataProvider = new UniversitiesDataProvider();

    // create adapter
    universitiesAdapter = new UniversitiesAdapter(this, dataProvider, recyclerViewExpandableItemManager);
    wrappedAdapter = recyclerViewExpandableItemManager.createWrappedAdapter(universitiesAdapter);

    // set animation stuff
    final GeneralItemAnimator animator = new RefactoredDefaultItemAnimator();
    animator.setSupportsChangeAnimations(false);

    // init recycler view
    layoutManager = new LinearLayoutManager(this);
    rvUniversities = (RecyclerView) findViewById(R.id.rv_universities);
    rvUniversities.setLayoutManager(layoutManager);
    rvUniversities.setAdapter(wrappedAdapter);
    rvUniversities.setItemAnimator(animator);
    rvUniversities.setHasFixedSize(false);

    // attach recycler view to item manager, necessary for touch listeners
    recyclerViewExpandableItemManager.attachRecyclerView(rvUniversities);
}
 
开发者ID:MyGrades,项目名称:mygrades-app,代码行数:31,代码来源:SelectUniversityActivity.java


示例14: onViewCreated

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
@Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        //noinspection ConstantConditions
        mRecyclerView = (RecyclerView) getView().findViewById(R.id.recycler_view);
        mLayoutManager = new LinearLayoutManager(getActivity());

        // drag & drop manager
        mRecyclerViewDragDropManager = new RecyclerViewDragDropManager();
        mRecyclerViewDragDropManager.setDraggingItemShadowDrawable(
                (NinePatchDrawable) getResources().getDrawable(R.drawable.material_shadow_z3));

        //adapter
        final MyDraggableItemAdapter myItemAdapter = new MyDraggableItemAdapter(getDataProvider());
        mAdapter = myItemAdapter;

        mWrappedAdapter = mRecyclerViewDragDropManager.createWrappedAdapter(myItemAdapter);      // wrap for dragging

        final GeneralItemAnimator animator = new RefactoredDefaultItemAnimator();

        mRecyclerView.setLayoutManager(mLayoutManager);
        mRecyclerView.setAdapter(mWrappedAdapter);  // requires *wrapped* adapter
        mRecyclerView.setItemAnimator(animator);

        // additional decorations
        //noinspection StatementWithEmptyBody
        if (supportsViewElevation()) {
            // Lollipop or later has native drop shadow feature. ItemShadowDecorator is not required.
        } else {
            mRecyclerView.addItemDecoration(new ItemShadowDecorator((NinePatchDrawable) getResources().getDrawable(R.drawable.material_shadow_z1)));
        }
        mRecyclerView.addItemDecoration(new SimpleListDividerDecorator(getResources().getDrawable(R.drawable.list_divider), true));

        mRecyclerViewDragDropManager.attachRecyclerView(mRecyclerView);

        // for debugging
//        animator.setDebug(true);
//        animator.setMoveDuration(2000);
    }
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:41,代码来源:RecyclerListViewFragment.java


示例15: onViewCreated

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
@Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        //noinspection ConstantConditions
        mRecyclerView = (RecyclerView) getView().findViewById(R.id.recycler_view);
        mLayoutManager = new LinearLayoutManager(getActivity());

        // drag & drop manager
        mRecyclerViewDragDropManager = new RecyclerViewDragDropManager();
        mRecyclerViewDragDropManager.setDraggingItemShadowDrawable(
                (NinePatchDrawable) getResources().getDrawable(R.drawable.material_shadow_z3));

        //adapter
        final MyDraggableWithSectionItemAdapter myItemAdapter = new MyDraggableWithSectionItemAdapter(getDataProvider());
        mAdapter = myItemAdapter;

        mWrappedAdapter = mRecyclerViewDragDropManager.createWrappedAdapter(myItemAdapter);      // wrap for dragging

        final GeneralItemAnimator animator = new RefactoredDefaultItemAnimator();

        mRecyclerView.setLayoutManager(mLayoutManager);
        mRecyclerView.setAdapter(mWrappedAdapter);  // requires *wrapped* adapter
        mRecyclerView.setItemAnimator(animator);

        // additional decorations
        //noinspection StatementWithEmptyBody
        if (supportsViewElevation()) {
            // Lollipop or later has native drop shadow feature. ItemShadowDecorator is not required.
        } else {
            mRecyclerView.addItemDecoration(new ItemShadowDecorator((NinePatchDrawable) getResources().getDrawable(R.drawable.material_shadow_z1)));
        }
        mRecyclerView.addItemDecoration(new SimpleListDividerDecorator(getResources().getDrawable(R.drawable.list_divider), true));

        mRecyclerViewDragDropManager.attachRecyclerView(mRecyclerView);

        // for debugging
//        animator.setDebug(true);
//        animator.setMoveDuration(2000);
    }
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:41,代码来源:RecyclerListViewFragment.java


示例16: onViewCreated

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    //noinspection ConstantConditions
    mRecyclerView = (RecyclerView) getView().findViewById(R.id.recycler_view);
    mLayoutManager = new LinearLayoutManager(getActivity());

    final Parcelable eimSavedState = (savedInstanceState != null) ? savedInstanceState.getParcelable(SAVED_STATE_EXPANDABLE_ITEM_MANAGER) : null;
    mRecyclerViewExpandableItemManager = new RecyclerViewExpandableItemManager(eimSavedState);

    //adapter
    final MyAddRemoveExpandableItemAdapter myItemAdapter = new MyAddRemoveExpandableItemAdapter(mRecyclerViewExpandableItemManager, getDataProvider());

    mAdapter = myItemAdapter;

    mWrappedAdapter = mRecyclerViewExpandableItemManager.createWrappedAdapter(myItemAdapter);       // wrap for expanding

    final GeneralItemAnimator animator = new RefactoredDefaultItemAnimator();

    // Change animations are enabled by default since support-v7-recyclerview v22.
    // Need to disable them when using animation indicator.
    animator.setSupportsChangeAnimations(false);

    mRecyclerView.setLayoutManager(mLayoutManager);
    mRecyclerView.setAdapter(mWrappedAdapter);  // requires *wrapped* adapter
    mRecyclerView.setItemAnimator(animator);
    mRecyclerView.setHasFixedSize(false);

    // additional decorations
    //noinspection StatementWithEmptyBody
    if (supportsViewElevation()) {
        // Lollipop or later has native drop shadow feature. ItemShadowDecorator is not required.
    } else {
        mRecyclerView.addItemDecoration(new ItemShadowDecorator((NinePatchDrawable) getResources().getDrawable(R.drawable.material_shadow_z1)));
    }
    mRecyclerView.addItemDecoration(new SimpleListDividerDecorator(getResources().getDrawable(R.drawable.list_divider), true));

    mRecyclerViewExpandableItemManager.attachRecyclerView(mRecyclerView);
}
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:41,代码来源:RecyclerListViewFragment.java


示例17: onCreateView

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View layout = inflater.inflate(R.layout.properties_fragment, container, false);

    final RecyclerView recyclerView = (RecyclerView) layout.findViewById(R.id.properties_list);

    final Parcelable savedState = (savedInstanceState != null) ?
            savedInstanceState.getParcelable(SAVED_STATE_EXPANDABLE_ITEM_MANAGER) : null;
    mRecyclerViewExpandableItemManager = new RecyclerViewExpandableItemManager(savedState);

    ElementProperties properties = (ElementProperties) getArguments().get(
            PropertiesActivity.ARGUMENT_PROPERTIES);

    IsotopesAdapter adapter = new IsotopesAdapter(getActivity(), properties.getIsotopes());

    mWrappedAdapter = mRecyclerViewExpandableItemManager.createWrappedAdapter(adapter);

    GeneralItemAnimator animator = new RefactoredDefaultItemAnimator();
    animator.setSupportsChangeAnimations(false);

    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.setAdapter(mWrappedAdapter);
    recyclerView.addItemDecoration(new DividerDecoration(getActivity()));
    recyclerView.setItemAnimator(animator);

    mRecyclerViewExpandableItemManager.attachRecyclerView(recyclerView);

    getActivity().registerForContextMenu(recyclerView);

    return layout;
}
 
开发者ID:Frozen-Developers,项目名称:android-periodic-table,代码行数:33,代码来源:IsotopesFragment.java


示例18: onCreateTestTargetItemAnimator

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
@Override
protected GeneralItemAnimator onCreateTestTargetItemAnimator() {
    return new RefactoredDefaultItemAnimator();
}
 
开发者ID:fabricethilaw,项目名称:expandable-recyclerview-with-gridlayout,代码行数:5,代码来源:RefactoredDefaultItemAnimatorTest.java


示例19: onViewCreated

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    // restore state if necessary
    final Parcelable eimSavedState = (savedInstanceState != null) ? savedInstanceState.getParcelable(SAVED_STATE_EXPANDABLE_ITEM_MANAGER) : null;
    recyclerViewExpandableItemManager = new RecyclerViewExpandableItemManager(eimSavedState);

    // create data
    FaqDataProvider faqDataProvider = new FaqDataProvider();
    faqDataProvider.populateData(getContext());

    // create adapter
    FaqExpandableItemAdapter itemAdapter = new FaqExpandableItemAdapter(faqDataProvider);
    wrappedAdapter = recyclerViewExpandableItemManager.createWrappedAdapter(itemAdapter);

    // set animation stuff
    final GeneralItemAnimator animator = new RefactoredDefaultItemAnimator();
    animator.setSupportsChangeAnimations(false);

    // init recycler view
    layoutManager = new LinearLayoutManager(getContext());
    recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.setAdapter(wrappedAdapter);  // requires *wrapped* adapter
    recyclerView.setItemAnimator(animator);
    recyclerView.setHasFixedSize(false);

    // set divider
    // recyclerView.addItemDecoration(new SimpleListDividerDecorator(ContextCompat.getDrawable(getContext(), R.drawable.grade_divider), true));

    // attach recycler view to item manager, necessary for touch listeners
    recyclerViewExpandableItemManager.attachRecyclerView(recyclerView);

    // jump to specific question if ARGUMENT_GO_TO_QUESTION is provided
    if (getArguments() != null) {
        int argumentQuestionId = getArguments().getInt(ARGUMENT_GO_TO_QUESTION);
        int groupId = faqDataProvider.getGroupId(argumentQuestionId);

        recyclerViewExpandableItemManager.expandGroup(groupId);
        recyclerView.scrollToPosition(groupId);
    }
}
 
开发者ID:MyGrades,项目名称:mygrades-app,代码行数:44,代码来源:FragmentFaq.java


示例20: onViewCreated

import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator; //导入依赖的package包/类
@Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        //noinspection ConstantConditions
        mRecyclerView = (RecyclerView) getView().findViewById(R.id.recycler_view);
        mLayoutManager = new LinearLayoutManager(getActivity());

        // drag & drop manager
        mRecyclerViewDragDropManager = new RecyclerViewDragDropManager();
        mRecyclerViewDragDropManager.setDraggingItemShadowDrawable(
                (NinePatchDrawable) getResources().getDrawable(R.drawable.material_shadow_z3));
        // Start dragging after long press
        mRecyclerViewDragDropManager.setInitiateOnLongPress(true);
        mRecyclerViewDragDropManager.setInitiateOnMove(false);

        //adapter
        final MyDraggableItemAdapter myItemAdapter = new MyDraggableItemAdapter(getDataProvider());
        mAdapter = myItemAdapter;

        mWrappedAdapter = mRecyclerViewDragDropManager.createWrappedAdapter(myItemAdapter);      // wrap for dragging

        final GeneralItemAnimator animator = new RefactoredDefaultItemAnimator();

        mRecyclerView.setLayoutManager(mLayoutManager);
        mRecyclerView.setAdapter(mWrappedAdapter);  // requires *wrapped* adapter
        mRecyclerView.setItemAnimator(animator);

        // additional decorations
        //noinspection StatementWithEmptyBody
        if (supportsViewElevation()) {
            // Lollipop or later has native drop shadow feature. ItemShadowDecorator is not required.
        } else {
            mRecyclerView.addItemDecoration(new ItemShadowDecorator((NinePatchDrawable) getResources().getDrawable(R.drawable.material_shadow_z1)));
        }
        mRecyclerView.addItemDecoration(new SimpleListDividerDecorator(getResources().getDrawable(R.drawable.list_divider), true));

        mRecyclerViewDragDropManager.attachRecyclerView(mRecyclerView);

        // for debugging
//        animator.setDebug(true);
//        animator.setMoveDuration(2000);
    }
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:44,代码来源:RecyclerListViewFragment.java



注:本文中的com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MinguoDate类代码示例发布时间:2022-05-22
下一篇:
Java ICompletableFuture类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap