use of android.widget.AdapterView.OnItemClickListener in project android-app-common-tasks by multidots.
the class CodeSnippestHomeActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mContext = CodeSnippestHomeActivity.this;
//Activity mActivity = CodeSnippestHomeActivity.this;
String[] sdkFunctionalityListValue = new String[] { "Executing a HTTP Get Request", /* 0 */
"Executing a HTTP Post Request", /* 1 */
"Executing a HTTP post Request for Send Audio,Video and Image" };
ListView sdkFunctionalityList = (ListView) findViewById(R.id.Md_list_company);
ArrayAdapter<String> stringArrayAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, sdkFunctionalityListValue);
sdkFunctionalityList.setAdapter(stringArrayAdapter);
sdkFunctionalityList.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
selectedListItem(position);
}
});
}
use of android.widget.AdapterView.OnItemClickListener in project Android-Universal-Image-Loader by nostra13.
the class ImageGridFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fr_image_grid, container, false);
listView = (GridView) rootView.findViewById(R.id.grid);
((GridView) listView).setAdapter(new ImageAdapter(getActivity()));
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
startImagePagerActivity(position);
}
});
return rootView;
}
use of android.widget.AdapterView.OnItemClickListener in project android-viewflow by pakerfeldt.
the class ViewFlowExample method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
listView = (ListView) findViewById(R.id.menu);
String[] listeStrings = { "Circle indicator...", "Title indicator...", "Different Views...", "Async Data Loading..." };
listView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, listeStrings));
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long arg3) {
switch(position) {
case 0:
startActivity(new Intent(ViewFlowExample.this, CircleViewFlowExample.class));
break;
case 1:
startActivity(new Intent(ViewFlowExample.this, TitleViewFlowExample.class));
break;
case 2:
startActivity(new Intent(ViewFlowExample.this, DiffViewFlowExample.class));
break;
case 3:
startActivity(new Intent(ViewFlowExample.this, AsyncDataFlowExample.class));
break;
}
}
});
}
use of android.widget.AdapterView.OnItemClickListener in project PocketHub by pockethub.
the class ItemListFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
swipeLayout = (SwipeRefreshLayout) view.findViewById(R.id.swipe_item);
swipeLayout.setOnRefreshListener(this);
swipeLayout.setColorSchemeResources(R.color.pager_title_background_top_start, R.color.pager_title_background_end, R.color.text_link, R.color.pager_title_background_end);
listView = (ListView) view.findViewById(android.R.id.list);
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
onListItemClick((ListView) parent, view, position, id);
}
});
listView.setOnItemLongClickListener(new OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
return onListItemLongClick((ListView) parent, view, position, id);
}
});
progressBar = (ProgressBar) view.findViewById(R.id.pb_loading);
emptyView = (TextView) view.findViewById(android.R.id.empty);
configureList(getActivity(), getListView());
}
use of android.widget.AdapterView.OnItemClickListener in project JamsMusicPlayer by psaravan.
the class BlacklistedArtistsPickerFragment method onCreateView.
@SuppressLint("NewApi")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
mApp = (Common) getActivity().getApplicationContext();
View rootView = inflater.inflate(R.layout.fragment_artists_music_library_editor, null);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
rootView.setBackground(UIElementsHelper.getBackgroundGradientDrawable(getActivity()));
} else {
rootView.setBackgroundDrawable(UIElementsHelper.getBackgroundGradientDrawable(getActivity()));
}
cursor = mApp.getDBAccessHelper().getAllUniqueArtistsNoBlacklist("");
listView = (ListView) rootView.findViewById(R.id.musicLibraryEditorArtistsListView);
listView.setFastScrollEnabled(true);
listView.setAdapter(new BlacklistedArtistsMultiselectAdapter(getActivity(), cursor));
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View view, int which, long dbID) {
CheckBox checkbox = (CheckBox) view.findViewById(R.id.artistCheckboxMusicLibraryEditor);
checkbox.performClick();
/* Since we've performed a software-click (checkbox.performClick()), all we have
* to do now is determine the *new* state of the checkbox. If the checkbox is checked,
* that means that the user tapped on it when it was unchecked, and we should add
* the artist's songs to the HashSet. If the checkbox is unchecked, that means the user
* tapped on it when it was checked, so we should remove the artist's songs from the
* HashSet.
*/
if (checkbox.isChecked()) {
view.setBackgroundColor(0xCCFF4444);
AsyncBlacklistArtistTask task = new AsyncBlacklistArtistTask((String) view.getTag(R.string.artist));
task.execute(new String[] { "ADD" });
} else {
view.setBackgroundColor(0x00000000);
AsyncBlacklistArtistTask task = new AsyncBlacklistArtistTask((String) view.getTag(R.string.artist));
task.execute(new String[] { "REMOVE" });
}
}
});
instructions = (TextView) rootView.findViewById(R.id.artists_music_library_editor_instructions);
instructions.setTypeface(TypefaceHelper.getTypeface(getActivity(), "RobotoCondensed-Light"));
instructions.setPaintFlags(instructions.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG);
instructions.setText(R.string.blacklist_manager_artists_instructions);
//KitKat translucent navigation/status bar.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
//Calculate navigation bar height.
int navigationBarHeight = 0;
int resourceId = getResources().getIdentifier("navigation_bar_height", "dimen", "android");
if (resourceId > 0) {
navigationBarHeight = getResources().getDimensionPixelSize(resourceId);
}
listView.setClipToPadding(false);
listView.setPadding(0, 0, 0, navigationBarHeight);
}
return rootView;
}
Aggregations