Java Code Examples for android.view.View#setVerticalScrollBarEnabled()

The following examples show how to use android.view.View#setVerticalScrollBarEnabled() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
@Override
protected void onFinishInflate() {
    super.onFinishInflate();

    int count = getChildCount();
    for (int i = 0; i < count; i++) {
        View child = getChildAt(i);
        child.setVerticalScrollBarEnabled(false);
        child.setHorizontalScrollBarEnabled(false);
        if (!(child instanceof ILinkageScroll)) {
            throw new RuntimeException("Child in LinkageScrollLayout must implement ILinkageScroll");
        }
        ((ILinkageScroll) child).setChildLinkageEvent(mChildLinkageEvent);
        child.setOverScrollMode(OVER_SCROLL_NEVER);
    }
}
 
Example 2
private void startPartialSelectMode() {

        boolean hideHelp = PreferenceHelper.getHidePartialSelectHelpPreference(this);

        if (hideHelp) {
            partialSelectMode = true;
            partiallySelectedLogLines.clear();
            Toast.makeText(this, R.string.toast_started_select_partial, Toast.LENGTH_SHORT).show();
        } else {

            LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            @SuppressLint("InflateParams") View helpView = inflater.inflate(R.layout.dialog_partial_save_help, null);
            // don't show the scroll bar
            helpView.setVerticalScrollBarEnabled(false);
            helpView.setHorizontalScrollBarEnabled(false);
            final CheckBox checkBox = (CheckBox) helpView.findViewById(android.R.id.checkbox);

            new MaterialDialog.Builder(this)
                    .title(R.string.menu_title_partial_select)
                    .customView(helpView, true)
                    .negativeText(android.R.string.cancel)
                    .positiveText(android.R.string.ok)
                    .onPositive(new MaterialDialog.SingleButtonCallback() {
                        @Override
                        public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
                            partialSelectMode = true;
                            partiallySelectedLogLines.clear();
                            Toast.makeText(LogcatActivity.this, R.string.toast_started_select_partial, Toast.LENGTH_SHORT).show();

                            if (checkBox.isChecked()) {
                                // hide this help dialog in the future
                                PreferenceHelper.setHidePartialSelectHelpPreference(LogcatActivity.this, true);
                            }
                        }
                    })
                    .show();
        }
    }
 
Example 3
/**
 * 设置纵向滚动条
 *
 * @param enabled
 * @return
 */
public UDView setVerticalScrollBarEnabled(boolean enabled) {
    View view = getView();
    if (view != null) {
        view.setVerticalScrollBarEnabled(enabled);
    }
    return this;
}
 
Example 4
private void startPartialSelectMode() {

        boolean hideHelp = PreferenceHelper.getHidePartialSelectHelpPreference(this);

        if (hideHelp) {
            partialSelectMode = true;
            partiallySelectedLogLines.clear();
            Toast.makeText(this, R.string.toast_started_select_partial, Toast.LENGTH_SHORT).show();
        } else {

            LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            @SuppressLint("InflateParams") View helpView = inflater.inflate(R.layout.dialog_partial_save_help, null);
            // don't show the scroll bar
            helpView.setVerticalScrollBarEnabled(false);
            helpView.setHorizontalScrollBarEnabled(false);
            final CheckBox checkBox = (CheckBox) helpView.findViewById(android.R.id.checkbox);

            new MaterialDialog.Builder(this)
                    .title(R.string.menu_title_partial_select)
                    .customView(helpView, true)
                    .negativeText(android.R.string.cancel)
                    .positiveText(android.R.string.ok)
                    .onPositive(new MaterialDialog.SingleButtonCallback() {
                        @Override
                        public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
                            partialSelectMode = true;
                            partiallySelectedLogLines.clear();
                            Toast.makeText(LogcatActivity.this, R.string.toast_started_select_partial, Toast.LENGTH_SHORT).show();

                            if (checkBox.isChecked()) {
                                // hide this help dialog in the future
                                PreferenceHelper.setHidePartialSelectHelpPreference(LogcatActivity.this, true);
                            }
                        }
                    })
                    .show();
        }
    }
 
Example 5
private void startPartialSelectMode() {

        boolean hideHelp = PreferenceHelper.getHidePartialSelectHelpPreference(this);

        if (hideHelp) {
            partialSelectMode = true;
            partiallySelectedLogLines.clear();
            Toast.makeText(this, R.string.toast_started_select_partial, Toast.LENGTH_SHORT).show();
        } else {

            LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            @SuppressLint("InflateParams") View helpView = inflater.inflate(R.layout.dialog_partial_save_help, null);
            // don't show the scroll bar
            helpView.setVerticalScrollBarEnabled(false);
            helpView.setHorizontalScrollBarEnabled(false);
            final CheckBox checkBox = helpView.findViewById(android.R.id.checkbox);

            new MaterialDialog.Builder(this)
                    .title(R.string.menu_title_partial_select)
                    .customView(helpView, true)
                    .negativeText(android.R.string.cancel)
                    .positiveText(android.R.string.ok)
                    .onPositive((dialog, which) -> {
                        partialSelectMode = true;
                        partiallySelectedLogLines.clear();
                        Toast.makeText(LogcatActivity.this, R.string.toast_started_select_partial, Toast.LENGTH_SHORT).show();

                        if (checkBox.isChecked()) {
                            // hide this help dialog in the future
                            PreferenceHelper.setHidePartialSelectHelpPreference(LogcatActivity.this, true);
                        }
                    })
                    .show();
        }
    }
 
Example 6
@Override
public View onCreateView(final LayoutInflater inflater,
                         final ViewGroup container, final Bundle savedInstanceState) {
    init(container, savedInstanceState);
    setActionBarTitle(R.string.Book_Detail_fragment_title);

    final View view = inflater
            .inflate(R.layout.fragment_book_detail, container, false);
    view.setVerticalScrollBarEnabled(false);
    initViews(view);

    getActivity().getWindow()
            .setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE
                    | WindowManager.LayoutParams
                    .SOFT_INPUT_STATE_HIDDEN);
    mDeleteBookDialogFragment = (AlertDialogFragment) getFragmentManager()
            .findFragmentByTag(FragmentTags.DIALOG_DELETE_BOOK);

    final AbstractBarterLiFragment fragment = ((AbstractBarterLiActivity) getActivity())
            .getCurrentMasterFragment();

    if (fragment != null && fragment instanceof BooksPagerFragment) {
        mLoadedIndividually = false;
    } else {
        mLoadedIndividually = true;
    }

    if (savedInstanceState == null) {
        mBookDetails = getArguments();
    } else {
        mBookDetails = savedInstanceState.getBundle(Keys.BOOK_DETAILS);
    }
    setHasOptionsMenu(mLoadedIndividually);
    loadBookDetails();
    return view;
}
 
Example 7
Source Project: DevUtils   File: ViewUtils.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * 设置是否绘制垂直滚动条
 * @param view                     {@link View}
 * @param verticalScrollBarEnabled {@code true} yes, {@code false} no
 * @return {@link View}
 */
public static View setVerticalScrollBarEnabled(final View view, final boolean verticalScrollBarEnabled) {
    if (view != null) view.setVerticalScrollBarEnabled(verticalScrollBarEnabled);
    return view;
}