本文整理汇总了Java中android.view.View.setVerticalScrollBarEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java View.setVerticalScrollBarEnabled方法的具体用法?Java View.setVerticalScrollBarEnabled怎么用?Java View.setVerticalScrollBarEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.setVerticalScrollBarEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setVerticalScrollBarEnabled
import android.view.View; //导入方法依赖的package包/类
/**
* 设置纵向滚动条
*
* @param enabled
* @return
*/
public UDView setVerticalScrollBarEnabled(boolean enabled) {
final View view = getView();
if (view != null) {
view.setVerticalScrollBarEnabled(enabled);
}
return this;
}
示例2: startPartialSelectMode
import android.view.View; //导入方法依赖的package包/类
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();
}
}