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


Java LinearLayout.HORIZONTAL属性代码示例

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


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

示例1: setCalendarOrientation

@Override
public void setCalendarOrientation(int calendarOrientation) {
    clearSelections();
    settingsManager.setCalendarOrientation(calendarOrientation);
    setDaysOfWeekTitles();
    recreateInitialMonth();

    rvMonths.setLayoutManager(new GridLayoutManager(getContext(), 1, getCalendarOrientation(), false));

    changeSnapHelper();

    if (getCalendarOrientation() == LinearLayout.HORIZONTAL) {
        if (flNavigationButtons != null) {
            flNavigationButtons.setVisibility(VISIBLE);
        } else {
            createNavigationButtons();
        }
    } else {
        if (flNavigationButtons != null) {
            flNavigationButtons.setVisibility(GONE);
        }
    }

    setSelectionBarVisibility();
    update();
}
 
开发者ID:ApplikeySolutions,项目名称:CosmoCalendar,代码行数:26,代码来源:CalendarView.java

示例2: initRecycleView

private void initRecycleView() {
    for(int a=0 ; a<20 ; a++){
        YCBean bean;
        if(a==3||a==8||a==14||a==16){
            bean = new YCBean("",2,"修改","","杨充"+a,"2000","美元","北京","你好");
        }else {
            bean = new YCBean("",2,"完成","","杨充"+a,"2000","美元","北京","你好");
        }
        list.add(bean);
    }
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setHasFixedSize(true);                             // 如果Item够简单,高度是确定的,打开FixSize将提高性能。
    recyclerView.setItemAnimator(new DefaultItemAnimator());        // 设置Item默认动画,加也行,不加也行。
    final RecycleViewItemLine line = new RecycleViewItemLine(this, LinearLayout.HORIZONTAL,
            20, Color.parseColor("#f5f5f7"));
    recyclerView.addItemDecoration(line);// 添加分割线。
    adapter = new ItemSlideAdapter(this, mDeleteListener);
    recyclerView.setAdapter(adapter);
    adapter.setData(list);
    statusLayoutManager.showContent();
}
 
开发者ID:yangchong211,项目名称:YCSlideView,代码行数:21,代码来源:FirstActivity.java

示例3: init

private void init() {
    LayoutInflater inflater = LayoutInflater.from(mContext);
    inflater.inflate(R.layout.episodelist_layout, this, true);

    mChildrenView = (RecyclerView) findViewById(R.id.episodes);
    mParentView = (RecyclerView) findViewById(R.id.groups);

    mEpisodesLayoutManager = new LinearLayoutManager(mContext, LinearLayout.HORIZONTAL, false);
    mGroupLayoutManager = new LinearLayoutManager(mContext, LinearLayout.HORIZONTAL, false);

    mChildrenView.setLayoutManager(mEpisodesLayoutManager);
    mParentView.setLayoutManager(mGroupLayoutManager);

    mChildrenView.setItemAnimator(new DefaultItemAnimator());
    mParentView.setItemAnimator(new DefaultItemAnimator());

    mChildrenView.setOnFocusChangeListener(this);
    mParentView.setOnFocusChangeListener(this);
    this.setOnFocusChangeListener(this);
}
 
开发者ID:hejunlin2013,项目名称:EpisodeListView,代码行数:20,代码来源:EpisodeListView.java

示例4: compatibleWithLayoutManager

/**
 * compatible with recyclerview layoutmanager
 *
 * @param parent
 */
private void compatibleWithLayoutManager(RecyclerView parent) {

    if (parent.getLayoutManager() != null) {
        if (parent.getLayoutManager() instanceof GridLayoutManager) {
            mMode = MODE_GRID;
        } else if (parent.getLayoutManager() instanceof LinearLayoutManager) {
            if (((LinearLayoutManager) parent.getLayoutManager()).getOrientation() == LinearLayout.HORIZONTAL) {
                mMode = MODE_VERTICAL;
            } else {
                mMode = MODE_HORIZONTAL;
            }
        }
    }
}
 
开发者ID:z-chu,项目名称:FriendBook,代码行数:19,代码来源:RecyclerViewItemDecoration.java

示例5: setOrientation

@Override
public void setOrientation(int orientation) {
    if (LinearLayout.HORIZONTAL == orientation) {
        throw new IllegalArgumentException("ExpandableTextView only supports Vertical Orientation.");
    }
    super.setOrientation(orientation);
}
 
开发者ID:wp521,项目名称:MyFire,代码行数:7,代码来源:ExpandableTextView.java

示例6: setOrientation

@Override
    public void setOrientation(int orientation) {
        if (LinearLayout.HORIZONTAL == orientation) {
//            throw new IllegalArgumentException("ExpandTextView only supports Vertical Orientation.");
            //强制使用垂直布局
            super.setOrientation(LinearLayout.VERTICAL);
        }
        super.setOrientation(orientation);
    }
 
开发者ID:yhyzgn,项目名称:Widgets,代码行数:9,代码来源:ExpandTextView.java

示例7: ResHelper

ResHelper(@ColorInt int colorSelected, @ColorInt int colorUnselected, float roundRadius,
                 int strokeWidth, @ColorInt int colorPressed) {
    setColorSelected(colorSelected);
    setColorUnselected(colorUnselected);
    this.roundRadius = roundRadius;
    this.strokeWidth = strokeWidth;
    this.orientation = LinearLayout.HORIZONTAL;

    setColorPressed(colorPressed);
    setRoundRadius(roundRadius);
    updateCornerStateDrawable();
}
 
开发者ID:ImDobyDad,项目名称:SingleSelectBar,代码行数:12,代码来源:ResHelper.java

示例8: setStartRoundRadius

private void setStartRoundRadius(float[] cornetRadii, float roundRadius) {
    if (orientation == LinearLayout.HORIZONTAL) {
        Arrays.fill(cornetRadii, 0, 2, roundRadius);
        Arrays.fill(cornetRadii, 2, 6, 0F);
        Arrays.fill(cornetRadii, 6, 8, roundRadius);
    } else {
        Arrays.fill(cornetRadii, 0, 4, roundRadius);
        Arrays.fill(cornetRadii, 4, 8, 0F);
    }
}
 
开发者ID:ImDobyDad,项目名称:SingleSelectBar,代码行数:10,代码来源:ResHelper.java

示例9: setEndRoundRadius

private void setEndRoundRadius(float[] cornetRadii, float roundRadius) {
    if (orientation == LinearLayout.HORIZONTAL) {
        Arrays.fill(cornetRadii, 0, 2, 0F);
        Arrays.fill(cornetRadii, 2, 6, roundRadius);
        Arrays.fill(cornetRadii, 6, 8, 0F);
    } else {
        Arrays.fill(cornetRadii, 0, 4, 0F);
        Arrays.fill(cornetRadii, 4, 8, roundRadius);
    }
}
 
开发者ID:ImDobyDad,项目名称:SingleSelectBar,代码行数:10,代码来源:ResHelper.java

示例10: RViewPager

public RViewPager(Context context, AttributeSet attrs) {
    super(context, attrs);
    if (mOrientation == LinearLayout.HORIZONTAL) {
        setPageTransformer(true, new FadeInOutPageTransformer());
    } else {
        setPageTransformer(true, new DefaultVerticalTransformer());
    }
    mGestureDetectorCompat = new GestureDetectorCompat(context, new GestureDetector.SimpleOnGestureListener() {

        @Override
        public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
            if (mOnPagerEndListener != null &&
                    getAdapter() != null &&
                    getCurrentItem() == getAdapter().getCount() - 1) {
                if (mOrientation == LinearLayout.VERTICAL) {
                    if (velocityY < -1000) {
                        mOnPagerEndListener.onPagerEnd();
                    }
                } else {
                    if (velocityX < -1000) {
                        mOnPagerEndListener.onPagerEnd();
                    }
                }
            }
            return super.onFling(e1, e2, velocityX, velocityY);
        }
    });
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:28,代码来源:RViewPager.java

示例11: initListAdapterH

private void initListAdapterH(){
    LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayout.HORIZONTAL, false);
    mRv.setLayoutManager(layoutManager);
    mRv.setAdapter(mListAdapter);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:RecyclerViewActivity1.java


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