本文整理了Java中android.widget.GridView.setFocusableInTouchMode()
方法的一些代码示例,展示了GridView.setFocusableInTouchMode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GridView.setFocusableInTouchMode()
方法的具体详情如下:
包路径:android.widget.GridView
类名称:GridView
方法名:setFocusableInTouchMode
暂无
代码示例来源:origin: stackoverflow.com
private void showGridDialog() {
// Prepare grid view
final GridView bv = (GridView)
dialogueBill.findViewById(R.id.gridBillView);
ba = new BillAdapter(this, ParseData.BillList);
bv.findFocus();
bv.setAdapter(ba);
bv.setFocusableInTouchMode(true);
bv.requestFocus();
bv.setClickable(true);
bv.setFocusable(true);
bv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// do something here
}
});
// Set grid view to alertDialog
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setView(bv);
builder.setTitle("Goto");
builder.show();
}
代码示例来源:origin: MoMoWait/LeanbackLauncher
public void preformIconMoreClick(){
int itemCount = mList.getChildCount();
int selectedPosition = mList.getSelectedPosition();
ArrayList<HomeScreenRow> visibleRows = mHomeAdapter.getVisRowList();
for(int i = 0; i < itemCount; ++i){
View rowView = visibleRows.get(i).getRowView();
if(rowView instanceof ActiveFrame && i != selectedPosition){
rowView.setVisibility(View.GONE);
}
}
mAllAppGridView.setVisibility(View.VISIBLE);
mAllLaunchPoints = mLaunchPointListGenerator.getAllLaunchPoints();
mAllAppGridAdapter = new AllAppGridAdapter(this, R.layout.adapter_item_allapp, mAllLaunchPoints);
mAllAppGridView.setAdapter(mAllAppGridAdapter);
mAllAppGridView.setOnItemClickListener(this);
mAllAppGridView.setFocusable(true);
mAllAppGridView.setFocusableInTouchMode(true);
mAllAppGridView.requestFocus();
}
内容来源于网络,如有侵权,请联系作者删除!