use of org.wordpress.android.ui.ExpandableHeightGridView in project WordPress-Android by wordpress-mobile.
the class MediaGallerySettingsFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
mAllowCheckChanged = true;
mType = GalleryType.DEFAULT;
mNumColumns = DEFAULT_THUMBNAIL_COLUMN_COUNT;
mIsRandomOrder = false;
restoreState(savedInstanceState);
View view = inflater.inflate(R.layout.media_gallery_settings_fragment, container, false);
mHeader = view.findViewById(R.id.media_gallery_settings_header);
mScrollView = (ScrollView) view.findViewById(R.id.media_gallery_settings_content_container);
mTitleView = (TextView) view.findViewById(R.id.media_gallery_settings_title);
mNumColumnsContainer = view.findViewById(R.id.media_gallery_settings_num_columns_container);
int visible = (mType == GalleryType.DEFAULT) ? View.VISIBLE : View.GONE;
mNumColumnsContainer.setVisibility(visible);
ExpandableHeightGridView numColumnsGrid = (ExpandableHeightGridView) view.findViewById(R.id.media_gallery_num_columns_grid);
numColumnsGrid.setExpanded(true);
ArrayList<String> list = new ArrayList<String>(9);
for (int i = 1; i <= 9; i++) {
list.add(i + "");
}
mGridAdapter = new CustomGridAdapter(mNumColumns);
numColumnsGrid.setAdapter(mGridAdapter);
mThumbnailCheckbox = (CheckBox) view.findViewById(R.id.media_gallery_type_thumbnail_grid);
mTiledCheckbox = (CheckBox) view.findViewById(R.id.media_gallery_type_tiled);
mSquaresCheckbox = (CheckBox) view.findViewById(R.id.media_gallery_type_squares);
mCirclesCheckbox = (CheckBox) view.findViewById(R.id.media_gallery_type_circles);
mSlideshowCheckbox = (CheckBox) view.findViewById(R.id.media_gallery_type_slideshow);
setType(mType.getTag());
mThumbnailCheckbox.setOnCheckedChangeListener(this);
mTiledCheckbox.setOnCheckedChangeListener(this);
mSquaresCheckbox.setOnCheckedChangeListener(this);
mCirclesCheckbox.setOnCheckedChangeListener(this);
mSlideshowCheckbox.setOnCheckedChangeListener(this);
mRandomOrderCheckbox = (CheckBox) view.findViewById(R.id.media_gallery_random_checkbox);
mRandomOrderCheckbox.setChecked(mIsRandomOrder);
mRandomOrderCheckbox.setOnCheckedChangeListener(this);
Button reverseButton = (Button) view.findViewById(R.id.media_gallery_settings_reverse_button);
reverseButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mCallback.onReverseClicked();
}
});
return view;
}
Aggregations