本文整理汇总了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();
}
示例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();
}
示例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);
}
示例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;
}
}
}
}
示例5: setOrientation
@Override
public void setOrientation(int orientation) {
if (LinearLayout.HORIZONTAL == orientation) {
throw new IllegalArgumentException("ExpandableTextView only supports Vertical Orientation.");
}
super.setOrientation(orientation);
}
示例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);
}
示例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();
}
示例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);
}
}
示例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);
}
}
示例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);
}
});
}
示例11: initListAdapterH
private void initListAdapterH(){
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayout.HORIZONTAL, false);
mRv.setLayoutManager(layoutManager);
mRv.setAdapter(mListAdapter);
}