android.widget.TableLayout.indexOfChild()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中android.widget.TableLayout.indexOfChild()方法的一些代码示例,展示了TableLayout.indexOfChild()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableLayout.indexOfChild()方法的具体详情如下:
包路径:android.widget.TableLayout
类名称:TableLayout
方法名:indexOfChild

TableLayout.indexOfChild介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

TableLayout contact_table = (TableLayout)findViewById(R.id.contact_table);
final View row=contact_table.getChildAt(i);
row.setOnClickListener(new OnClickListener(){

  @Override
  public void onClick(View v){
    // TODO Auto-generated method stub
    row_id=contact_table.indexOfChild(row);
  }
});

代码示例来源:origin: TobiasBielefeld/Simple-Solitaire

@Override
public void onClick(View v) {
  //get index of the button as seen from the container
  TableRow row = (TableRow) v.getParent();
  TableLayout table = (TableLayout) row.getParent();
  int index = table.indexOfChild(row)*COLUMNS + row.indexOfChild(v);
  loadGameText(index);
}

代码示例来源:origin: shrikanth7698/Collapsible-Calendar-View-Android

private int getSuitableRowIndex() {
  if (getSelectedItemPosition() != -1) {
    View view = mAdapter.getView(getSelectedItemPosition());
    TableRow row = (TableRow) view.getParent();
    return mTableBody.indexOfChild(row);
  } else if (getTodayItemPosition() != -1) {
    View view = mAdapter.getView(getTodayItemPosition());
    TableRow row = (TableRow) view.getParent();
    return mTableBody.indexOfChild(row);
  } else {
    return 0;
  }
}

代码示例来源:origin: TobiasBielefeld/Simple-Solitaire

/**
 * Starts the clicked game. This uses the total index position of the clicked view to get the
 * game.
 *
 * @param view The clicked view.
 */
private void startGame(View view) {
  TableRow row = (TableRow) view.getParent();
  TableLayout table = (TableLayout) row.getParent();
  ArrayList<Integer> orderedList = lg.getOrderedGameList();
  int index = indexes.get(table.indexOfChild(row)*menuColumns + row.indexOfChild(view));
  index = orderedList.indexOf(index);
  //avoid loading two games at once when pressing two buttons at once
  if (prefs.getSavedCurrentGame() != DEFAULT_CURRENT_GAME) {
    return;
  }
  prefs.saveCurrentGame(index);
  Intent intent = new Intent(getApplicationContext(), GameManager.class);
  intent.putExtra(GAME, index);
  startActivityForResult(intent, 0);
}

代码示例来源:origin: stackoverflow.com

int currentRowIndex = table.indexOfChild(currentRow);
if (currentRowIndex < 1) {
  return false;

相关文章