Use rowSpan and columnSpan attributes for GridLayout contents

This commit is contained in:
Phillip Hsu
2016-07-17 16:40:48 -07:00
parent bc2446d586
commit 081dd76545
6 changed files with 56 additions and 23 deletions
@@ -317,8 +317,7 @@ public class EditAlarmActivity extends BaseActivity implements
// If we keep a reference to the dialog, we keep its previous state as well.
// So the next time we call show() on it, the input field will show the
// last inputted time.
/*NumpadTimePickerDialog.newInstance(EditAlarmActivity.this)
.show(getSupportFragmentManager(), TAG_TIME_PICKER);*/
//NumpadTimePickerDialog.newInstance(this).show(getSupportFragmentManager(), TAG_TIME_PICKER);
ScrollingGridTimePickerDialog.newInstance(this, true).show(getSupportFragmentManager(), "tag");
}
@@ -22,7 +22,8 @@ public class ScrollingGridTimePickerDialog extends BaseTimePickerDialog {
private String[] mValues;
private boolean mIs24HourMode;
@Bind(R.id.grid) RecyclerView mGrid;
@Nullable
@Bind(R.id.main_content) RecyclerView mGrid;
public static ScrollingGridTimePickerDialog newInstance(TimePicker.OnTimeSetListener callback, boolean is24HourMode) {
ScrollingGridTimePickerDialog ret = new ScrollingGridTimePickerDialog();
@@ -50,15 +51,17 @@ public class ScrollingGridTimePickerDialog extends BaseTimePickerDialog {
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = super.onCreateView(inflater, container, savedInstanceState);
mGrid.setLayoutManager(new GridLayoutManager(view.getContext(), COLUMNS));
mAdapter = new ScrollingGridAdapter(mValues, new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO: If on hours, switch dataset to minutes values. Else, do nothing.
mAdapter.notifyDataSetChanged();
}
});
mGrid.setAdapter(mAdapter);
if (mGrid != null) {
mGrid.setLayoutManager(new GridLayoutManager(view.getContext(), COLUMNS));
mAdapter = new ScrollingGridAdapter(mValues, new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO: If on hours, switch dataset to minutes values. Else, do nothing.
mAdapter.notifyDataSetChanged();
}
});
mGrid.setAdapter(mAdapter);
}
return view;
}