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

Java FlexboxLayoutManager类代码示例

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

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



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

示例1: onBindViewHolder

import com.google.android.flexbox.FlexboxLayoutManager; //导入依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    MediaItem mediaItem = mImages.get(position);
    Boolean selected = mSelection.get(position);

    GalleryViewHolder itemViewHolder = (GalleryViewHolder) holder;
    itemViewHolder.mBinding.getRoot().setTag(position);

    View item = itemViewHolder.mBinding.getRoot();
    item.getLayoutParams().width = mImageWidth;
    item.getLayoutParams().height = mImageHeight;
    ImageView image = itemViewHolder.mBinding.image;
    ViewGroup.LayoutParams lp = image.getLayoutParams();
    if (lp instanceof FlexboxLayoutManager.LayoutParams) {
        FlexboxLayoutManager.LayoutParams params = (FlexboxLayoutManager.LayoutParams) lp;
        params.setFlexGrow(1.0f);
    }

    itemViewHolder.mBinding.setIsSelected(selected);
    itemViewHolder.mBinding.setIsVideo(
            mediaItem.mMediaType == MediaStore.Files.FileColumns.MEDIA_TYPE_VIDEO);
    itemViewHolder.mBinding.setHandlers(mHandlers);
    PicassoHelper.bindImage(mPicasso, image, null, mediaItem.mUri,
            new Rect(0, 0, mImageWidth, mImageHeight));
}
 
开发者ID:jruesga,项目名称:rview,代码行数:26,代码来源:GalleryChooserFragment.java


示例2: onCreate

import com.google.android.flexbox.FlexboxLayoutManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_observation_form_picker);

    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.forms);

    FlexboxLayoutManager layoutManager = new FlexboxLayoutManager(this);
    layoutManager.setFlexDirection(FlexDirection.ROW);
    layoutManager.setJustifyContent(JustifyContent.CENTER);
    recyclerView.setLayoutManager(layoutManager);

    JsonArray formDefinitions = EventHelper.getInstance(getApplicationContext()).getCurrentEvent().getForms();
    Adapter adapter = new Adapter(this, formDefinitions);
    recyclerView.setAdapter(adapter);

    findViewById(R.id.close).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            cancel(v);
        }
    });

    MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
 
开发者ID:ngageoint,项目名称:mage-android,代码行数:27,代码来源:ObservationFormPickerActivity.java


示例3: setUp

import com.google.android.flexbox.FlexboxLayoutManager; //导入依赖的package包/类
private void setUp(Context context, AttributeSet attrs, int defStyleAttr) {
    mBinding = DataBindingUtil.inflate(LayoutInflater.from(context), R.layout.layout_flex_search_1, this, true);
    mBinding.setPresenter(new Presenter());
    initAttr(context, attrs, defStyleAttr);
    allNames = SearchManger.getInstance(getContext()).getAllSearchModels();
    mBinding.svSearch.setOnQueryTextListener(this);
    mBinding.svSearch.setOnQueryTextFocusChangeListener(this);
    flexboxLayoutManager = new FlexboxLayoutManager(getContext());
    flexboxLayoutManager.setFlexDirection(FlexDirection.COLUMN);
    flexboxLayoutManager.setAlignContent(AlignContent.FLEX_START);
    initHistoryData(allNames);
    initNetTags(allNames);
    initSuggestion();
    initSearchView();
}
 
开发者ID:xieyangxuejun,项目名称:SearchLayout,代码行数:16,代码来源:FlexSearchLayout.java


示例4: onCreate

import com.google.android.flexbox.FlexboxLayoutManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_select_product);

    textViewSearchIntro = (TextView) findViewById(R.id.textView_search_intro);
    recyclerViewProducts = (RecyclerView) findViewById(R.id.product_recycler_view);
    selectProductContainer = (LinearLayout) findViewById(R.id.activity_select_product);

    FlexboxLayoutManager layoutManager = new FlexboxLayoutManager();
    setUpFlexboxLayoutManager(layoutManager);

    brandsLayoutManager = new FlexboxLayoutManager();
    setUpFlexboxLayoutManager(brandsLayoutManager);

    List<String> productsList = getItemList(R.array.products_array);
    List<String> brandsList = getItemList(R.array.brands_array);

    productsAdapter = new ProductsAdapter(productsList);
    recyclerViewProducts.setLayoutManager(layoutManager);
    recyclerViewProducts.setAdapter(productsAdapter);

    brandsAdapter = new BrandsAdapter(brandsList);

    selectProductPresenter = new SelectProductPresenter(selectProductContainer, productName);
    selectProductPresenter.attachView(this);
}
 
开发者ID:moyheen,项目名称:MakeUpSearch,代码行数:28,代码来源:SelectProductActivity.java


示例5: createLoadersWithValidContext

import com.google.android.flexbox.FlexboxLayoutManager; //导入依赖的package包/类
private void createLoadersWithValidContext() {
    if (getActivity() == null) {
        return;
    }

    if (mAdapter == null) {
        mAdapter = new GalleryAdapter(this, mImageWidth, mPrevSelection);
        FlexboxLayoutManager layoutManager = new FlexboxLayoutManager(getContext());
        layoutManager.setFlexWrap(FlexWrap.WRAP);
        layoutManager.setFlexDirection(FlexDirection.ROW);
        layoutManager.setAlignItems(AlignItems.STRETCH);
        mBinding.list.setLayoutManager(layoutManager);
        mBinding.list.setAdapter(mAdapter);

        // Fetch or join current loader
        RxLoaderManager loaderManager = RxLoaderManagerCompat.get(this);
        mMediaLoader = loaderManager.create(fetchMedia(), mMediaObserver);

        mHandler.postDelayed(() -> {
            synchronized (mSync) {
                if (getActivity() != null && !mLoaded) {
                    mLoading = true;
                    updateState();
                }
            }
        }, 750);
    }
}
 
开发者ID:jruesga,项目名称:rview,代码行数:29,代码来源:GalleryChooserFragment.java


示例6: onCreateView

import com.google.android.flexbox.FlexboxLayoutManager; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View view = inflater.inflate(R.layout.fragment_library, container, false);
    SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(getActivity());
    path = SP.getString("path", path);
    Log.e("PathFromPref", SP.getString("path", path));
    path = path.replaceAll(":", "");
    Log.e("AfterProcessing", path);
    RecyclerView rv = (RecyclerView) view.findViewById(R.id.rv);
    /*RecyclerView.LayoutManager mLayoutManager = new GridLayoutManager(getActivity(),3);
    rv.setLayoutManager(mLayoutManager);
    initializeData();
    MangaListADA list_ada = new MangaListADA(getContext(), mangaList);
    rv.addItemDecoration(new GridSpacingItemDecoration(3, dpToPx(5), true));
    rv.setItemAnimator(new DefaultItemAnimator());
    rv.setAdapter(list_ada);*/
    initializeData();
    MangaListADA list_ada = new MangaListADA(getContext(), mangaList);
    rv.setAdapter(list_ada);
    FlexboxLayoutManager layoutManager = new FlexboxLayoutManager(getContext());
    layoutManager.setFlexDirection(FlexDirection.ROW);
    layoutManager.setFlexWrap(FlexWrap.WRAP);
    //layoutManager.setJustifyContent(JustifyContent.SPACE_AROUND);
    rv.setLayoutManager(layoutManager);
   return view;
}
 
开发者ID:FR0ST1N,项目名称:Mataku,代码行数:29,代码来源:LibraryFragment.java


示例7: onBindViewHolder

import com.google.android.flexbox.FlexboxLayoutManager; //导入依赖的package包/类
@Override
public void onBindViewHolder(ViewHolderBase viewHolder, Cursor cursor) {
    ((TextView) viewHolder.itemView).setText(cursor.getString(1));
    ViewGroup.LayoutParams lp = viewHolder.itemView.getLayoutParams();
    if (lp instanceof FlexboxLayoutManager.LayoutParams) {
        FlexboxLayoutManager.LayoutParams flexboxLp = (FlexboxLayoutManager.LayoutParams) viewHolder.itemView.getLayoutParams();
        flexboxLp.setFlexGrow(1.0f);
        flexboxLp.setAlignSelf(AlignSelf.STRETCH);
    }
}
 
开发者ID:SelvinPL,项目名称:SyncFrameworkAndroid,代码行数:11,代码来源:ItemDetailsFragment.java


示例8: setupRecyclerView

import com.google.android.flexbox.FlexboxLayoutManager; //导入依赖的package包/类
private void setupRecyclerView() {
    FlexboxLayoutManager layoutManager = new FlexboxLayoutManager(getContext());
    layoutManager.setJustifyContent(JustifyContent.FLEX_START);
    rvGenreList.setLayoutManager(layoutManager);
}
 
开发者ID:hsm59,项目名称:WatchIt,代码行数:6,代码来源:DetailsFragment.java


示例9: setupRecyclerView

import com.google.android.flexbox.FlexboxLayoutManager; //导入依赖的package包/类
private void setupRecyclerView() {
    FlexboxLayoutManager tvLayoutManager = new FlexboxLayoutManager(getContext());
    tvLayoutManager.setJustifyContent(JustifyContent.SPACE_AROUND);
    rvGenreTv.setLayoutManager(tvLayoutManager);
}
 
开发者ID:hsm59,项目名称:WatchIt,代码行数:6,代码来源:IntroTvSeriesFragment.java


示例10: setupRecyclerView

import com.google.android.flexbox.FlexboxLayoutManager; //导入依赖的package包/类
private void setupRecyclerView(){
    FlexboxLayoutManager layoutManager = new FlexboxLayoutManager(getContext());
    layoutManager.setJustifyContent(JustifyContent.SPACE_AROUND);
    rvGenreMovies.setLayoutManager(layoutManager);
}
 
开发者ID:hsm59,项目名称:WatchIt,代码行数:6,代码来源:IntroMoviesFragment.java


示例11: setUpFlexboxLayoutManager

import com.google.android.flexbox.FlexboxLayoutManager; //导入依赖的package包/类
private void setUpFlexboxLayoutManager(FlexboxLayoutManager layoutManager) {
    layoutManager.setFlexWrap(FlexWrap.WRAP);
    layoutManager.setAlignItems(AlignItems.BASELINE);
    layoutManager.setJustifyContent(JustifyContent.CENTER);
}
 
开发者ID:moyheen,项目名称:MakeUpSearch,代码行数:6,代码来源:SelectProductActivity.java


示例12: onCreateView

import com.google.android.flexbox.FlexboxLayoutManager; //导入依赖的package包/类
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    final View root = inflater.inflate(R.layout.item_fragment, container, false);
    mName = Ui.getView(root, R.id.name);
    mDescription = Ui.getView(root, R.id.description);
    mPriority = new SpinnerHelper(Ui.<Spinner>getView(root, R.id.priority), PRIORITIES_LOADER_ID,
            new SimpleCursorAdapter(getActivity(), spinnerRowResource, null, new String[]{Priority.NAME},
                    new int[]{android.R.id.text1}, 1), spinnerRowResource) {
        @Override
        public Loader<Cursor> getCursorLoader() {
            return new CursorLoader(getActivity(), ListProvider.getHelper().getDirUri(Priority.TABLE_NAME, false),
                    new String[]{BaseColumns._ID, Priority.ID, Priority.NAME}, null, null, Priority.ID + " ASC");
        }
    };

    mStatus = new SpinnerHelper(Ui.<Spinner>getView(root, R.id.status), STATUSES_LOADER_ID,
            new SimpleCursorAdapter(getActivity(), spinnerRowResource, null, new String[]{Status.NAME},
                    new int[]{android.R.id.text1}, 1), spinnerRowResource) {
        @Override
        public Loader<Cursor> getCursorLoader() {
            return new CursorLoader(getActivity(), ListProvider.getHelper().getDirUri(Status.TABLE_NAME, false),
                    new String[]{BaseColumns._ID, Status.ID, Status.NAME}, null, null, Status.ID + " ASC");
        }
    };

    final RecyclerView recyclerView = Ui.getView(root, R.id.tags);
    final FlexboxLayoutManager layoutManager = new FlexboxLayoutManager(getContext());
    layoutManager.setFlexDirection(FlexDirection.ROW);
    recyclerView.setLayoutManager(layoutManager);
    mTagsAdapter = new TagsAdapter(getActivity(), getChildFragmentManager(), SyncService.getUserId(getContext()));
    recyclerView.setAdapter(mTagsAdapter);
    mStartDate = Ui.getView(root, R.id.start_date);
    mStartTime = Ui.getView(root, R.id.start_time);
    mEndDate = Ui.getView(root, R.id.end_date);
    mEndTime = Ui.getView(root, R.id.end_time);

    mStartDate.setOnClickListener(this);
    mStartTime.setOnClickListener(this);
    mEndDate.setOnClickListener(this);
    mEndTime.setOnClickListener(this);
    return root;
}
 
开发者ID:SelvinPL,项目名称:SyncFrameworkAndroid,代码行数:42,代码来源:ItemDetailsFragment.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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