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


Java ObservableRecyclerView.setHasFixedSize方法代码示例

本文整理汇总了Java中com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView.setHasFixedSize方法的典型用法代码示例。如果您正苦于以下问题:Java ObservableRecyclerView.setHasFixedSize方法的具体用法?Java ObservableRecyclerView.setHasFixedSize怎么用?Java ObservableRecyclerView.setHasFixedSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView的用法示例。


在下文中一共展示了ObservableRecyclerView.setHasFixedSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreateView

import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_recyclerview, container, false);

    final ObservableRecyclerView recyclerView = (ObservableRecyclerView) view.findViewById(R.id.scroll);
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.setHasFixedSize(false);
    setDummyData(recyclerView);

    Fragment parentFragment = getParentFragment();
    ViewGroup viewGroup = (ViewGroup) parentFragment.getView();
    if (viewGroup != null) {
        recyclerView.setTouchInterceptionViewGroup((ViewGroup) viewGroup.findViewById(R.id.container));
        if (parentFragment instanceof ObservableScrollViewCallbacks) {
            recyclerView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentFragment);
        }
    }
    return view;
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:20,代码来源:ViewPagerTabFragmentRecyclerViewFragment.java

示例2: onCreateView

import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_recyclerview, container, false);

    Activity parentActivity = getActivity();
    final ObservableRecyclerView recyclerView = (ObservableRecyclerView) view.findViewById(R.id.scroll);
    recyclerView.setLayoutManager(new LinearLayoutManager(parentActivity));
    recyclerView.setHasFixedSize(false);
    setDummyData(recyclerView);
    recyclerView.setTouchInterceptionViewGroup((ViewGroup) parentActivity.findViewById(R.id.container));

    if (parentActivity instanceof ObservableScrollViewCallbacks) {
        recyclerView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
    }
    return view;
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:17,代码来源:ViewPagerTab2RecyclerViewFragment.java

示例3: onCreate

import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_stickyheaderrecyclerview);

    setSupportActionBar((Toolbar) findViewById(R.id.toolbar));

    mHeaderView = findViewById(R.id.header);
    ViewCompat.setElevation(mHeaderView, getResources().getDimension(R.dimen.toolbar_elevation));
    mToolbarView = findViewById(R.id.toolbar);

    mRecyclerView = (ObservableRecyclerView) findViewById(R.id.recycler);
    mRecyclerView.setScrollViewCallbacks(this);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    mRecyclerView.setHasFixedSize(false);
    View headerView = LayoutInflater.from(this).inflate(R.layout.recycler_header, null);
    setDummyDataWithHeader(mRecyclerView, headerView);
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:19,代码来源:StickyHeaderRecyclerViewActivity.java

示例4: onCreateView

import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_recyclerview, container, false);

    Activity parentActivity = getActivity();
    final ObservableRecyclerView recyclerView = (ObservableRecyclerView) view.findViewById(R.id.scroll);
    recyclerView.setLayoutManager(new LinearLayoutManager(parentActivity));
    recyclerView.setHasFixedSize(false);
    UiTestUtils.setDummyData(getActivity(), recyclerView);
    recyclerView.setTouchInterceptionViewGroup((ViewGroup) parentActivity.findViewById(R.id.container));

    if (parentActivity instanceof ObservableScrollViewCallbacks) {
        recyclerView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
    }
    return view;
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:17,代码来源:ViewPagerTab2RecyclerViewFragment.java

示例5: onCreate

import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_touchinterception_recyclerview);
    ((TextView) findViewById(R.id.title)).setText(getClass().getSimpleName());
    mScrollable = (Scrollable) findViewById(R.id.scrollable);
    mScrollable.setScrollViewCallbacks(this);
    ObservableRecyclerView recyclerView = (ObservableRecyclerView) mScrollable;
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setHasFixedSize(true);
    recyclerView.setScrollViewCallbacks(this);
    UiTestUtils.setDummyData(this, recyclerView);

    mIntersectionHeight = getResources().getDimensionPixelSize(R.dimen.intersection_height);
    mHeaderBarHeight = getResources().getDimensionPixelSize(R.dimen.header_bar_height);

    mInterceptionLayout = (TouchInterceptionFrameLayout) findViewById(R.id.scroll_wrapper);
    mInterceptionLayout.setScrollInterceptionListener(mInterceptionListener);
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:20,代码来源:TouchInterceptionRecyclerViewActivity.java

示例6: onCreateView

import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater,
                         @Nullable ViewGroup container,
                         @Nullable Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_photos, container, false);

    layoutManager = new GridLayoutManager(activity, getSpanCount());
    layoutManager.setSpanSizeLookup(new HeaderSpanSizeLookup(layoutManager));

    photos = (ObservableRecyclerView) rootView.findViewById(R.id.photos);
    photos.setHasFixedSize(true);
    photos.setLayoutManager(layoutManager);
    photos.setAdapter(adapter);
    photos.setScrollViewCallbacks(this);

    albumId = getArguments().getString("id");

    return rootView;
}
 
开发者ID:xingrz,项目名称:meizhi,代码行数:20,代码来源:AlbumFragment.java

示例7: onCreate

import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.observable_scroll_view_activity_toolbarcontrolrecyclerview);

    setSupportActionBar((Toolbar) findViewById(R.id.toolbar));

    mHeaderView = findViewById(R.id.header);
    ViewCompat.setElevation(mHeaderView, getResources().getDimension(R.dimen.toolbar_elevation));
    mToolbarView = findViewById(R.id.toolbar);

    mRecyclerView = (ObservableRecyclerView) findViewById(R.id.recycler);
    mRecyclerView.setScrollViewCallbacks(this);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    mRecyclerView.setHasFixedSize(false);

    ArrayList<String> items = new ArrayList<String>();
    for (int i = 1; i <= 100; i++) {
        items.add("Item " + i);
    }
    View headerView = LayoutInflater.from(this).inflate(R.layout.observable_scroll_view_recycler_header, null);
    mRecyclerView.setAdapter(new SimpleHeaderRecyclerAdapter(this, items, headerView));
}
 
开发者ID:cymcsg,项目名称:UltimateAndroid,代码行数:24,代码来源:ToolbarControlRecyclerViewActivity.java

示例8: onCreate

import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_stickyheaderrecyclerview);

    setSupportActionBar((Toolbar) findViewById(R.id.toolbar));

    mHeaderView = findViewById(R.id.header);
    ViewCompat.setElevation(mHeaderView, getResources().getDimension(R.dimen.toolbar_elevation));
    mToolbarView = findViewById(R.id.toolbar);

    mRecyclerView = (ObservableRecyclerView) findViewById(R.id.recycler);
    mRecyclerView.setScrollViewCallbacks(this);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    mRecyclerView.setHasFixedSize(false);
    View headerView = LayoutInflater.from(this).inflate(R.layout.recycler_header, null);
    setDummyDataWithHeader(mRecyclerView, headerView);

    ScrollUtils.addOnGlobalLayoutListener(mRecyclerView, new Runnable() {
        @Override
        public void run() {
            int count = mRecyclerView.getAdapter().getItemCount() - 1;
            int position = count == 0 ? 1 : count > 0 ? count : 0;
            mRecyclerView.scrollToPosition(position);
        }
    });
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:28,代码来源:ScrollFromBottomRecyclerViewActivity.java

示例9: createScrollable

import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; //导入方法依赖的package包/类
@Override
protected ObservableRecyclerView createScrollable() {
    ObservableRecyclerView recyclerView = (ObservableRecyclerView) findViewById(R.id.scroll);
    recyclerView.setScrollViewCallbacks(this);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setHasFixedSize(true);
    recyclerView.setAdapter(new CustomAdapter(this, getDummyData()));
    return recyclerView;
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:10,代码来源:SlidingUpRecyclerViewActivity.java

示例10: createScrollable

import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; //导入方法依赖的package包/类
@Override
protected ObservableRecyclerView createScrollable() {
    ObservableRecyclerView recyclerView = (ObservableRecyclerView) findViewById(R.id.scroll);
    recyclerView.setScrollViewCallbacks(this);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setHasFixedSize(false);
    setDummyDataWithHeader(recyclerView, mFlexibleSpaceImageHeight);
    return recyclerView;
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:10,代码来源:FillGap2RecyclerViewActivity.java

示例11: createScrollable

import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; //导入方法依赖的package包/类
@Override
protected ObservableRecyclerView createScrollable() {
    ObservableRecyclerView recyclerView = (ObservableRecyclerView) findViewById(R.id.scrollable);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setHasFixedSize(true);
    setDummyData(recyclerView);
    return recyclerView;
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:9,代码来源:ToolbarControlRecyclerViewActivity.java

示例12: createScrollable

import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; //导入方法依赖的package包/类
@Override
protected ObservableRecyclerView createScrollable() {
    ObservableRecyclerView recyclerView = (ObservableRecyclerView) findViewById(R.id.scroll);
    recyclerView.setScrollViewCallbacks(this);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setHasFixedSize(true);
    setDummyDataFew(recyclerView);
    return recyclerView;
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:10,代码来源:FillGap3RecyclerViewActivity.java

示例13: onCreateView

import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_recyclerview, container, false);

    Activity parentActivity = getActivity();
    final ObservableRecyclerView recyclerView = (ObservableRecyclerView) view.findViewById(R.id.scroll);
    recyclerView.setLayoutManager(new LinearLayoutManager(parentActivity));
    recyclerView.setHasFixedSize(false);
    View headerView = LayoutInflater.from(parentActivity).inflate(R.layout.padding, null);
    setDummyDataWithHeader(recyclerView, headerView);

    if (parentActivity instanceof ObservableScrollViewCallbacks) {
        // Scroll to the specified offset after layout
        Bundle args = getArguments();
        if (args != null && args.containsKey(ARG_INITIAL_POSITION)) {
            final int initialPosition = args.getInt(ARG_INITIAL_POSITION, 0);
            ScrollUtils.addOnGlobalLayoutListener(recyclerView, new Runnable() {
                @Override
                public void run() {
                    recyclerView.scrollVerticallyToPosition(initialPosition);
                }
            });
        }

        // TouchInterceptionViewGroup should be a parent view other than ViewPager.
        // This is a workaround for the issue #117:
        // https://github.com/ksoichiro/Android-ObservableScrollView/issues/117
        recyclerView.setTouchInterceptionViewGroup((ViewGroup) parentActivity.findViewById(R.id.root));

        recyclerView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
    }
    return view;
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:34,代码来源:ViewPagerTabRecyclerViewFragment.java

示例14: onCreate

import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_handletouchrecyclerview);

    ObservableRecyclerView recyclerView = (ObservableRecyclerView) findViewById(R.id.scroll);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setHasFixedSize(true);
    recyclerView.setScrollViewCallbacks(this);
    recyclerView.setAdapter(new CustomAdapter(this, getDummyData()));
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:12,代码来源:HandleTouchRecyclerViewActivity.java

示例15: onCreate

import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_actionbarcontrolrecyclerview);

    ObservableRecyclerView recyclerView = (ObservableRecyclerView) findViewById(R.id.recycler);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setHasFixedSize(true);
    recyclerView.setScrollViewCallbacks(this);
    setDummyData(recyclerView);
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:12,代码来源:ActionBarControlRecyclerViewActivity.java


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