@Override
public void onClick(View view) {
//Extract values from children
LinearLayout rowsView = (LinearLayout) rootView.findViewById(R.id.repeatable_items);
ArrayList<String> row = new ArrayList<>();
for (int i = 0; i < rowsView.getChildCount(); ++i) {
EditText et = (EditText) rowsView.getChildAt(i).findViewById(R.id.input_row);
row.add(et.getText().toString());
}
fq.addRow(row);
TextView tvCount = (TextView) rootView.findViewById(R.id.question_items_count);
tvCount.setText(fq.getRows().size() + " items");
Toast.makeText(FormSolverActivity.this, "SAVED", Toast.LENGTH_SHORT).show();
Animation animation = new ScaleAnimation(1,1.1f,1,1.1f);
animation.setDuration(300);
animation.setRepeatMode(Animation.REVERSE);
animation.setRepeatCount(1);
tvCount.startAnimation(animation);
//Remove any child from view
((LinearLayout) rootView.findViewById(R.id.repeatable_items)).removeAllViews();
((Button) rootView.findViewById(R.id.question_add_response_instance)).setText(getString(R.string.action_new_row));
rootView.findViewById(R.id.question_add_response_instance).setOnClickListener(new onRowAddedListener(rootView, fq));
fab.show();
}
FormSolverActivity.java 文件源码
java
阅读 21
收藏 0
点赞 0
评论 0
项目:labtablet
作者:
评论列表
文章目录