Search in sources :

Example 11 with HorizontalScrollView

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();
}
Also used : IMeasurablePagerTitleView(net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IMeasurablePagerTitleView) IPagerTitleView(net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerTitleView) HorizontalScrollView(android.widget.HorizontalScrollView) View(android.view.View)

Example 12 with HorizontalScrollView

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;
}
Also used : HorizontalScrollView(android.widget.HorizontalScrollView)

Example 13 with HorizontalScrollView

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;
}
Also used : HorizontalScrollView(android.widget.HorizontalScrollView)

Example 14 with HorizontalScrollView

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;
}
Also used : LayoutParams(android.widget.LinearLayout.LayoutParams) TextView(android.widget.TextView) HorizontalScrollView(android.widget.HorizontalScrollView) LinearLayout(android.widget.LinearLayout)

Example 15 with HorizontalScrollView

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;
        }
    });
}
Also used : LayoutParams(android.widget.LinearLayout.LayoutParams) Callback(android.os.Handler.Callback) Platform(cn.sharesdk.framework.Platform) CustomPlatform(cn.sharesdk.framework.CustomPlatform) Message(android.os.Message) FrameLayout(android.widget.FrameLayout) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) HorizontalScrollView(android.widget.HorizontalScrollView) View(android.view.View) TextView(android.widget.TextView) BitmapHelper.captureView(com.mob.tools.utils.BitmapHelper.captureView) HorizontalScrollView(android.widget.HorizontalScrollView)

Aggregations

HorizontalScrollView (android.widget.HorizontalScrollView)17 View (android.view.View)6 LinearLayout (android.widget.LinearLayout)6 TextView (android.widget.TextView)6 ImageView (android.widget.ImageView)3 ScrollView (android.widget.ScrollView)3 LayoutParams (android.widget.LinearLayout.LayoutParams)2 SuppressLint (android.annotation.SuppressLint)1 Paint (android.graphics.Paint)1 Callback (android.os.Handler.Callback)1 Message (android.os.Message)1 KeyEvent (android.view.KeyEvent)1 ViewGroup (android.view.ViewGroup)1 ViewTreeObserver (android.view.ViewTreeObserver)1 OnGlobalLayoutListener (android.view.ViewTreeObserver.OnGlobalLayoutListener)1 AdapterView (android.widget.AdapterView)1 EditText (android.widget.EditText)1 FrameLayout (android.widget.FrameLayout)1 Spinner (android.widget.Spinner)1 CustomPlatform (cn.sharesdk.framework.CustomPlatform)1