Search in sources :

Example 56 with GridView

use of android.widget.GridView in project SeeSik by GHHM.

the class Calendar_main method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    context = getActivity().getApplicationContext();
    // 월별 캘린더 뷰 객체 참조
    monthView = (GridView) view.findViewById(R.id.monthView);
    monthViewAdapter = new MonthAdapter(context);
    monthView.setAdapter(monthViewAdapter);
    monthText = (TextView) view.findViewById(R.id.monthText);
    setMonthText();
    // 이전 월로 넘어가는 이벤트 처리
    ImageButton monthPrevious = (ImageButton) view.findViewById(R.id.monthPrevious);
    monthPrevious.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            monthViewAdapter.setPreviousMonth();
            monthViewAdapter.notifyDataSetChanged();
            setMonthText();
        }
    });
    // 다음 월로 넘어가는 이벤트 처리
    ImageButton monthNext = (ImageButton) view.findViewById(R.id.monthNext);
    monthNext.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            monthViewAdapter.setNextMonth();
            monthViewAdapter.notifyDataSetChanged();
            setMonthText();
        }
    });
}
Also used : ImageButton(android.widget.ImageButton) GridView(android.widget.GridView) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 57 with GridView

use of android.widget.GridView in project android_frameworks_base by crdroidandroid.

the class GridDelete method onKeyDown.

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_DEL) {
        GridView g = getGridView();
        ((DeleteAdapter) g.getAdapter()).deletePosition(g.getSelectedItemPosition());
        return true;
    } else {
        return super.onKeyDown(keyCode, event);
    }
}
Also used : GridView(android.widget.GridView)

Example 58 with GridView

use of android.widget.GridView in project apps-android-commons by commons-app.

the class MultipleUploadListFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_multiple_uploads_list, null);
    photosGrid = (GridView) view.findViewById(R.id.multipleShareBackground);
    baseTitle = (EditText) view.findViewById(R.id.multipleBaseTitle);
    photosAdapter = new PhotoDisplayAdapter();
    photosGrid.setAdapter(photosAdapter);
    photosGrid.setOnItemClickListener((AdapterView.OnItemClickListener) getActivity());
    photoSize = calculatePicDimension(detailProvider.getTotalMediaCount());
    photosGrid.setColumnWidth(photoSize.x);
    baseTitle.addTextChangedListener(textWatcher);
    return view;
}
Also used : AdapterView(android.widget.AdapterView) GridView(android.widget.GridView) SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView)

Example 59 with GridView

use of android.widget.GridView in project LiveLessons by douglascraigschmidt.

the class ResultsActivity method addResultButton.

/**
     * Add a button with the given filterName as its text.  This
     * button will load the results of the given filter into the
     * GridView
     */
@SuppressLint("InflateParams")
private void addResultButton(String filterName) {
    // Create a new button with the layout of "result_button".
    Button resultButton = (Button) LayoutInflater.from(this).inflate(R.layout.result_button, null);
    // Set the new button's text and tag to the filter name.
    resultButton.setText(filterName);
    resultButton.setTag(filterName);
    // When the button is clicked, change the imageAdapter source
    // to the appropriate filter directory.
    resultButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View view) {
            Button button = (Button) view;
            // Find the filter directory and load the
            // directory as the source of the imageAdapter.
            imageAdapter.setBitmaps(new File(PlatformStrategy.instance().getDirectoryPath(), button.getText().toString()).getAbsolutePath());
        }
    });
    // Add the button to the layout.
    mLayout.addView(resultButton);
}
Also used : Button(android.widget.Button) OnClickListener(android.view.View.OnClickListener) GridView(android.widget.GridView) ImageView(android.widget.ImageView) View(android.view.View) File(java.io.File) SuppressLint(android.annotation.SuppressLint)

Example 60 with GridView

use of android.widget.GridView in project LiveLessons by douglascraigschmidt.

the class ResultsActivity method onCreate.

/**
     * Creates the activity and generates a button for each filter
     * applied to the images. These buttons load change the
     * imageAdapter's source to a new directory, from which it will
     * load images into the GridView.
     */
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.results_activity);
    // Retrieve the Layout that buttons will be added to.
    mLayout = (LinearLayout) findViewById(R.id.buttonList);
    // Configure the GridView adapter and dimensions.
    imageAdapter = new ImageAdapter(this);
    GridView imageGrid = (GridView) findViewById(R.id.imageGrid);
    imageGrid.setAdapter(imageAdapter);
    configureGridView(imageGrid);
    // Retrieves the names of the filters applied to this set of
    // downloads.
    mFilterNames = getIntent().getStringArrayExtra(MainActivity.FILTER_EXTRA);
    // each filter.
    for (String filterName : mFilterNames) addResultButton(filterName);
}
Also used : GridView(android.widget.GridView)

Aggregations

GridView (android.widget.GridView)142 View (android.view.View)86 AdapterView (android.widget.AdapterView)64 TextView (android.widget.TextView)42 ImageView (android.widget.ImageView)30 AbsListView (android.widget.AbsListView)20 Intent (android.content.Intent)15 ViewGroup (android.view.ViewGroup)14 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)11 SuppressLint (android.annotation.SuppressLint)10 ArrayList (java.util.ArrayList)9 LayoutInflater (android.view.LayoutInflater)8 WindowManager (android.view.WindowManager)7 Button (android.widget.Button)7 ColorDrawable (android.graphics.drawable.ColorDrawable)6 ListView (android.widget.ListView)6 LinearLayout (android.widget.LinearLayout)5 Bundle (android.os.Bundle)4 ViewTreeObserver (android.view.ViewTreeObserver)4 ArrayAdapter (android.widget.ArrayAdapter)4