Search in sources :

Example 1 with ExpandableHeightGridView

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;
}
Also used : CompoundButton(android.widget.CompoundButton) Button(android.widget.Button) ExpandableHeightGridView(org.wordpress.android.ui.ExpandableHeightGridView) ArrayList(java.util.ArrayList) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) View(android.view.View) ExpandableHeightGridView(org.wordpress.android.ui.ExpandableHeightGridView)

Aggregations

View (android.view.View)1 OnClickListener (android.view.View.OnClickListener)1 Button (android.widget.Button)1 CompoundButton (android.widget.CompoundButton)1 ScrollView (android.widget.ScrollView)1 TextView (android.widget.TextView)1 ArrayList (java.util.ArrayList)1 ExpandableHeightGridView (org.wordpress.android.ui.ExpandableHeightGridView)1