@@ -0,0 +1,3492 @@
+package com.yinli.ylscrollview;%0A%0Aimport android.content.Context;%0Aimport android.graphics.Canvas;%0Aimport android.graphics.Color;%0Aimport android.util.AttributeSet;%0Aimport android.view.Gravity;%0Aimport android.view.View;%0Aimport android.widget.FrameLayout;%0Aimport android.widget.LinearLayout;%0Aimport android.widget.ScrollView;%0Aimport android.widget.TextView;%0A%0A/**%0A * Created by Yin Li on 16/03/15.%0A */%0Apublic class YLScrollView extends FrameLayout %7B%0A%0A    private ScrollView mScrollView;%0A    private TextView mTextView;%0A    private LinearLayout mContainer;%0A    private int indicatorVisibility;%0A%0A    public YLScrollView(Context context, AttributeSet attrs) %7B%0A        super(context, attrs);%0A        init(context);%0A    %7D%0A%0A    private void init(Context mContext) %7B%0A        mContainer = new LinearLayout(mContext);%0A        FrameLayout.LayoutParams params0 =%0A                new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);%0A        mContainer.setLayoutParams(params0);%0A%0A        mTextView = new TextView(mContext);%0A        LinearLayout.LayoutParams params2 =%0A                new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);%0A        params2.gravity = Gravity.CENTER_VERTICAL;%0A        mTextView.setRotation(270f);%0A        mTextView.setText(%22Scroll to view more%22);%0A        mTextView.setTextColor(Color.LTGRAY);%0A        mTextView.setLayoutParams(params2);%0A%0A        mScrollView = new ScrollView(mContext);%0A        LinearLayout.LayoutParams params1 =%0A                new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);%0A        mScrollView.setScrollBarStyle(SCROLLBARS_OUTSIDE_OVERLAY);%0A        mScrollView.setLayoutParams(params1);%0A    %7D%0A%0A    @Override%0A    protected void onFinishInflate() %7B%0A        super.onFinishInflate();%0A%0A        View subView = getChildAt(0);%0A        removeView(subView);%0A        mScrollView.addView(subView);%0A%0A        mContainer.addView(mScrollView);%0A        mContainer.addView(mTextView);%0A%0A        addView(mContainer);%0A    %7D%0A%0A    @Override%0A    protected void onDraw(Canvas canvas) %7B%0A        super.onDraw(canvas);%0A    %7D%0A%0A    @Override%0A    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) %7B%0A        super.onMeasure(widthMeasureSpec, heightMeasureSpec);%0A%0A        if (indicatorVisibility == VISIBLE) %7B%0A            /* Pivot is the geometric center of the text */%0A            int textWidth = mTextView.getWidth() / 2;%0A            int textSize = (int) mTextView.getTextSize();%0A%0A            int gap = textWidth - textSize;%0A            LinearLayout.LayoutParams params2 = (LinearLayout.LayoutParams) mTextView.getLayoutParams();%0A            params2.setMargins(0, 0, -gap, 0);%0A            mTextView.setLayoutParams(params2);%0A%0A            LinearLayout.LayoutParams params1 = (LinearLayout.LayoutParams) mScrollView.getLayoutParams();%0A            params1.weight = 1.0f;%0A            params1.setMargins(0, 0, -gap, 0);%0A            mScrollView.setLayoutParams(params1);%0A        %7D%0A    %7D%0A%0A    @Override%0A    protected void onLayout(boolean changed, int l, int t, int r, int b) %7B%0A        super.onLayout(changed, l, t, r, b);%0A%0A        int containerHeight = getHeight();%0A%0A        View view = mScrollView.getChildAt(0);%0A        int contentHeight = view.getHeight();%0A%0A        indicatorVisibility = contentHeight %3E containerHeight ? VISIBLE : GONE;%0A        mTextView.setVisibility(indicatorVisibility);%0A    %7D%0A%7D%0A

Version 1.0 text-indicator supported