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();
}
});
}
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);
}
}
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;
}
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);
}
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);
}
Aggregations