Search in sources :

Example 1 with HorizontalScrollView

use of android.widget.HorizontalScrollView in project Android-PullToRefresh by chrisbanes.

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 2 with HorizontalScrollView

use of android.widget.HorizontalScrollView in project Android-Terminal-Emulator by jackpal.

the class FSNavigator method fileView.

////////////////////////////////////////////////////////////
private LinearLayout fileView(boolean entryWindow) {
    LinearLayout ll = new LinearLayout(context);
    ll.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1));
    ll.setOrientation(LinearLayout.HORIZONTAL);
    ll.setGravity(android.view.Gravity.FILL);
    final TextView tv;
    if (entryWindow) {
        tv = new EditText(context);
        tv.setHint(getString(R.string.fsnavigator_optional_enter_path));
        tv.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT, 2));
        tv.setOnKeyListener(new EditText.OnKeyListener() {

            public boolean onKey(View v, int keyCode, KeyEvent event) {
                if (keyCode == KeyEvent.KEYCODE_ENTER) {
                    String path = tv.getText().toString();
                    File file = new File(getCanonicalPath(path));
                    chdir(file.getParentFile() == null ? file : file.getParentFile());
                    if (file.isFile()) {
                        setResult(RESULT_OK, getIntent().setData(Uri.fromFile(file)));
                        finish();
                    } else {
                        chdir(file);
                        makeView();
                    }
                    return (true);
                }
                return (false);
            }
        });
        ll.addView(tv);
    } else {
        tv = new TextView(context);
        tv.setClickable(true);
        tv.setLongClickable(true);
        tv.setOnClickListener(fileListener);
        tv.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT, 1));
        HorizontalScrollView hv = new HorizontalScrollView(context);
        hv.setFillViewport(true);
        hv.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, BUTTON_SIZE, 7));
        hv.addView(tv);
        ll.addView(hv);
    }
    tv.setFocusable(true);
    tv.setSingleLine();
    tv.setTextSize(textLg);
    tv.setTypeface(Typeface.SERIF, Typeface.BOLD);
    tv.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
    tv.setPadding(10, 5, 10, 5);
    //1);
    tv.setId(R.id.textview);
    return (ll);
}
Also used : EditText(android.widget.EditText) KeyEvent(android.view.KeyEvent) TextView(android.widget.TextView) ImageView(android.widget.ImageView) HorizontalScrollView(android.widget.HorizontalScrollView) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) View(android.view.View) File(java.io.File) HorizontalScrollView(android.widget.HorizontalScrollView) LinearLayout(android.widget.LinearLayout)

Example 3 with HorizontalScrollView

use of android.widget.HorizontalScrollView in project Android-Terminal-Emulator by jackpal.

the class FSNavigator method directoryView.

////////////////////////////////////////////////////////////
private LinearLayout directoryView(boolean up) {
    ImageView b1 = imageViewFolder(up);
    TextView tv = new TextView(context);
    if (//Gravity.CENTER);
    up)
        //Gravity.CENTER);
        tv.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
    else
        tv.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
    tv.setClickable(true);
    tv.setLongClickable(true);
    tv.setFocusable(true);
    tv.setOnClickListener(directoryListener);
    tv.setMaxLines(1);
    tv.setTextSize(textLg);
    tv.setPadding(10, 5, 10, 5);
    tv.setId(R.id.textview);
    tv.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, BUTTON_SIZE, 1));
    HorizontalScrollView hv = new HorizontalScrollView(context);
    hv.addView(tv);
    hv.setFillViewport(true);
    hv.setFocusable(true);
    hv.setOnClickListener(directoryListener);
    hv.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, BUTTON_SIZE, 7));
    LinearLayout ll = new LinearLayout(context);
    ll.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, BUTTON_SIZE, 2));
    ll.setOrientation(LinearLayout.HORIZONTAL);
    ll.setGravity(android.view.Gravity.FILL);
    ll.setOnClickListener(directoryListener);
    ll.addView(b1);
    ll.addView(hv);
    return (ll);
}
Also used : TextView(android.widget.TextView) ImageView(android.widget.ImageView) HorizontalScrollView(android.widget.HorizontalScrollView) LinearLayout(android.widget.LinearLayout)

Example 4 with HorizontalScrollView

use of android.widget.HorizontalScrollView in project nmid-headline by miao1007.

the class EditPage method initImageListView.

private void initImageListView() {
    final HorizontalScrollView hScrollView = (HorizontalScrollView) findViewByResName("hScrollView");
    ImageListResultsCallback callback = new ImageListResultsCallback() {

        @Override
        public void onFinish(ArrayList<ImageInfo> results) {
            if (results == null)
                return;
            LinearLayout layout = (LinearLayout) findViewByResName("imagesLinearLayout");
            for (ImageInfo imageInfo : results) {
                if (imageInfo.bitmap == null)
                    continue;
                layout.addView(makeImageItemView(imageInfo));
            }
        }
    };
    if (!initImageList(callback)) {
        hScrollView.setVisibility(View.GONE);
    }
}
Also used : ArrayList(java.util.ArrayList) HorizontalScrollView(android.widget.HorizontalScrollView) LinearLayout(android.widget.LinearLayout)

Example 5 with HorizontalScrollView

use of android.widget.HorizontalScrollView in project XposedInstaller by rovo89.

the class LogsFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.tab_logs, container, false);
    mTxtLog = (TextView) v.findViewById(R.id.txtLog);
    mTxtLog.setTextIsSelectable(true);
    mSVLog = (ScrollView) v.findViewById(R.id.svLog);
    mHSVLog = (HorizontalScrollView) v.findViewById(R.id.hsvLog);
    reloadErrorLog();
    /*
        View scrollTop = v.findViewById(R.id.scroll_top);
        View scrollDown = v.findViewById(R.id.scroll_down);

        scrollTop.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                scrollTop();
            }
        });
        scrollDown.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                scrollDown();
            }
        });
*/
    return v;
}
Also used : HorizontalScrollView(android.widget.HorizontalScrollView) View(android.view.View) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView)

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