use of android.widget.HorizontalScrollView in project MagicIndicator by hackware1993.
the class CommonNavigator method init.
private void init() {
removeAllViews();
View root;
if (mAdjustMode) {
root = LayoutInflater.from(getContext()).inflate(R.layout.pager_navigator_layout_no_scroll, this);
} else {
root = LayoutInflater.from(getContext()).inflate(R.layout.pager_navigator_layout, this);
}
// mAdjustMode为true时,mScrollView为null
mScrollView = (HorizontalScrollView) root.findViewById(R.id.scroll_view);
mTitleContainer = (LinearLayout) root.findViewById(R.id.title_container);
mTitleContainer.setPadding(mLeftPadding, 0, mRightPadding, 0);
mIndicatorContainer = (LinearLayout) root.findViewById(R.id.indicator_container);
if (mIndicatorOnTop) {
mIndicatorContainer.getParent().bringChildToFront(mIndicatorContainer);
}
initTitlesAndIndicator();
}
use of android.widget.HorizontalScrollView in project PullToRefreshLibrary by harichen.
the class PullToRefreshHorizontalScrollView method createRefreshableView.
@Override
protected HorizontalScrollView createRefreshableView(Context context, AttributeSet attrs) {
HorizontalScrollView scrollView;
if (VERSION.SDK_INT >= VERSION_CODES.GINGERBREAD) {
scrollView = new InternalHorizontalScrollViewSDK9(context, attrs);
} else {
scrollView = new HorizontalScrollView(context, attrs);
}
scrollView.setId(R.id.scrollview);
return scrollView;
}
use of android.widget.HorizontalScrollView in project SmartAndroidSource by jaychou2012.
the class PullToRefreshHorizontalScrollView method createRefreshableView.
@Override
protected HorizontalScrollView createRefreshableView(Context context, AttributeSet attrs) {
HorizontalScrollView scrollView;
if (VERSION.SDK_INT >= VERSION_CODES.GINGERBREAD) {
scrollView = new InternalHorizontalScrollViewSDK9(context, attrs);
} else {
scrollView = new HorizontalScrollView(context, attrs);
}
scrollView.setId(getResources().getIdentifier("scrollview", "id", context.getPackageName()));
// scrollView.setId(R.id.scrollview);
return scrollView;
}
use of android.widget.HorizontalScrollView in project nmid-headline by miao1007.
the class EditPage method getPlatformList.
// platform logos
private LinearLayout getPlatformList() {
LinearLayout llToolBar = new LinearLayout(getContext());
LayoutParams lpTb = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
llToolBar.setLayoutParams(lpTb);
TextView tvShareTo = new TextView(getContext());
int resId = getStringRes(activity, "share_to");
if (resId > 0) {
tvShareTo.setText(resId);
}
tvShareTo.setTextColor(0xffcfcfcf);
tvShareTo.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);
int dp_9 = dipToPx(getContext(), 9);
LayoutParams lpShareTo = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lpShareTo.gravity = Gravity.CENTER_VERTICAL;
lpShareTo.setMargins(dp_9, 0, 0, 0);
tvShareTo.setLayoutParams(lpShareTo);
llToolBar.addView(tvShareTo);
HorizontalScrollView sv = new HorizontalScrollView(getContext());
sv.setHorizontalScrollBarEnabled(false);
sv.setHorizontalFadingEdgeEnabled(false);
LayoutParams lpSv = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lpSv.setMargins(dp_9, dp_9, dp_9, dp_9);
sv.setLayoutParams(lpSv);
llToolBar.addView(sv);
llPlat = new LinearLayout(getContext());
llPlat.setLayoutParams(new HorizontalScrollView.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
sv.addView(llPlat);
return llToolBar;
}
use of android.widget.HorizontalScrollView in project nmid-headline by miao1007.
the class EditPage method afterPlatformListGot.
/** display platform list */
public void afterPlatformListGot() {
int size = platformList == null ? 0 : platformList.length;
views = new View[size];
final int dp_24 = dipToPx(getContext(), 24);
LayoutParams lpItem = new LayoutParams(dp_24, dp_24);
final int dp_9 = dipToPx(getContext(), 9);
lpItem.setMargins(0, 0, dp_9, 0);
FrameLayout.LayoutParams lpMask = new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
lpMask.gravity = Gravity.LEFT | Gravity.TOP;
int selection = 0;
for (int i = 0; i < size; i++) {
FrameLayout fl = new FrameLayout(getContext());
fl.setLayoutParams(lpItem);
if (i >= size - 1) {
fl.setLayoutParams(new LayoutParams(dp_24, dp_24));
}
llPlat.addView(fl);
fl.setOnClickListener(this);
ImageView iv = new ImageView(getContext());
iv.setScaleType(ScaleType.CENTER_INSIDE);
iv.setImageBitmap(getPlatLogo(platformList[i]));
iv.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
fl.addView(iv);
views[i] = new View(getContext());
views[i].setBackgroundColor(0xcfffffff);
views[i].setOnClickListener(this);
String platformName = platformList[i].getName();
for (Platform plat : platforms) {
if (platformName.equals(plat.getName())) {
views[i].setVisibility(View.INVISIBLE);
selection = i;
}
}
views[i].setLayoutParams(lpMask);
fl.addView(views[i]);
}
final int postSel = selection;
UIHandler.sendEmptyMessageDelayed(0, 333, new Callback() {
public boolean handleMessage(Message msg) {
HorizontalScrollView hsv = (HorizontalScrollView) llPlat.getParent();
hsv.scrollTo(postSel * (dp_24 + dp_9), 0);
return false;
}
});
}
Aggregations