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


Java GridView.setVisibility方法代码示例

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


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

示例1: onCreateView

import android.widget.GridView; //导入方法依赖的package包/类
@Override
    public View onCreateView(final LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment_project, container, false);
        // Inflate the layout for this fragment
        mDemoSlider = (SliderLayout) view.findViewById(R.id.slider);
        simpleList = (GridView) view.findViewById(R.id.simpleGridView);

        mHandler = new Handler(Looper.getMainLooper()); // udaan hurdanii shalgax davtalt

        HashMap<String,String> url_maps = new HashMap<String, String>();
        url_maps.put("Өсвөр үеийн эрүүл ирээдүйн төлөө", "https://www.colourbox.com/preview/1282705-colorful-child-hand-prints-on-white-background.jpg");
        url_maps.put("Өсвөр үеийн эрүүл ирээдүйн төлөө", "https://image.freepik.com/free-vector/fantastic-background-of-children-playing-together_23-2147608068.jpg");
        url_maps.put("Өсвөр үеийн эрүүл ирээдүйн төлөө", "https://ak2.picdn.net/shutterstock/videos/14967505/thumb/1.jpg");

        for(String name : url_maps.keySet()){

            TextSliderView textSliderView = new TextSliderView(getActivity());
            // initialize a SliderLayout
            textSliderView
                    .description(name)
                    .image(url_maps.get(name))
                    .setScaleType(BaseSliderView.ScaleType.Fit);
//                    .setOnSliderClickListener(getContext());

            //add your extra information
            textSliderView.bundle(new Bundle());
            textSliderView.getBundle()
                    .putString("extra",name);

            mDemoSlider.addSlider(textSliderView);

        }
        mDemoSlider.setPresetTransformer(SliderLayout.Transformer.Accordion);
        mDemoSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
        mDemoSlider.setCustomAnimation(new DescriptionAnimation());
        mDemoSlider.setDuration(4000);

        simpleList.setNumColumns(2);
        simpleList.setVisibility(View.VISIBLE);

        getProject();

        return view;

    }
 
开发者ID:doljko,项目名称:youth-health,代码行数:47,代码来源:ProjectFragment.java

示例2: onCreateView

import android.widget.GridView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.fragment_category, container, false);

    prgLoading = (TSProgressBar) rootView.findViewById(R.id.prgLoading);
    listCategory = (GridView) rootView.findViewById(R.id.listCategory);
    txtAlert = (TextView) rootView.findViewById(R.id.txtAlert);

    swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipeRefreshCat);
    swipeRefreshLayout.setColorSchemeResources(R.color.bg_screen1, R.color.bg_screen2, R.color.bg_screen3);

    mHandler = new Handler(Looper.getMainLooper());
    listCategory.setVisibility(View.VISIBLE);

    getCategoryList();
    listCategory.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        public void onItemClick(AdapterView<?> arg0, View arg1, int position,
                                long arg3) {
            Intent iMenuList = new Intent(getActivity(), ActivityCompanyProduct.class);
            startActivity(iMenuList);
        }
    });

    swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    swipeRefreshLayout.setRefreshing(false);
                    IOConnect = 0;
                    listCategory.invalidateViews();
                }
            }, 3000);
        }
    });
    return  rootView;
}
 
开发者ID:techstar-cloud,项目名称:techstar-shop,代码行数:41,代码来源:CategoryFragment.java

示例3: setPhotoList

import android.widget.GridView; //导入方法依赖的package包/类
/**
 * @param photoList 图片地址的集合
 */
public void setPhotoList(List<String> photoList, GridView view) {
    this.photoList = photoList;
    if (photoList.size() == 0) {
        view.setVisibility(View.GONE);
    } else if (photoList.size() <= 3) {
        view.setNumColumns(photoList.size());
    }else{
        view.setNumColumns(3);
    }
}
 
开发者ID:haoxiongqin,项目名称:One_NineGrid,代码行数:14,代码来源:DisplayPhotoAdapter.java

示例4: onCreateView

import android.widget.GridView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.fragment_organization, container, false);
    prgLoading = (ProgressBar) rootView.findViewById(R.id.newsLoading);
    homeItemList = (GridView) rootView.findViewById(R.id.newsItemList);
    txtAlert = (TextView) rootView.findViewById(R.id.newsTxtAlert);

    mHandler = new Handler(Looper.getMainLooper());

    homeItemList.setNumColumns(2);

    homeItemList.setVisibility(View.VISIBLE);

    getNews();

    return rootView;

}
 
开发者ID:doljko,项目名称:youth-health,代码行数:20,代码来源:OrgFragment.java


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