use of android.view.View.OnClickListener in project glitch-hq-android by tinyspeck.
the class ActivityDetailFragment method setLikeButton.
private void setLikeButton(boolean bLiked) {
if (!m_bNotes || ((HomeScreen) getActivity()).getPlayerID().equalsIgnoreCase(m_playerId))
return;
Button btn = (Button) m_root.findViewById(R.id.btnLike);
btn.setVisibility(View.VISIBLE);
if (bLiked) {
btn.setText("Liked");
btn.setEnabled(false);
}
btn.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
setStatusLike(m_playerId, m_actId);
}
});
}
use of android.view.View.OnClickListener in project glitch-hq-android by tinyspeck.
the class EncyclopediaGiantsListListViewAdapter method getView.
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if (convertView != null) {
holder = (ViewHolder) convertView.getTag();
}
if (holder == null) {
convertView = m_inflater.inflate(R.layout.encyclopedia_giants_list_list_item, null);
holder = new ViewHolder();
holder.name = (TextView) convertView.findViewById(R.id.encyclopedia_giants_list_name);
holder.name.setTypeface(m_application.m_vagFont);
holder.whole = (View) convertView.findViewById(R.id.encyclopedia_giants_list_item);
convertView.setTag(holder);
}
holder = (ViewHolder) convertView.getTag();
if (position < getCount()) {
glitchGiant giant = m_giantsList.get(position);
holder.name.setText(giant.name);
holder.whole.setTag(position);
holder.whole.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
glitchGiant giant = m_giantsList.get((Integer) v.getTag());
EncyclopediaGiantDetailFragment f = new EncyclopediaGiantDetailFragment(m_bf, giant);
((HomeScreen) m_act).setCurrentFragment(f, true);
}
});
}
return convertView;
}
use of android.view.View.OnClickListener in project glitch-hq-android by tinyspeck.
the class EncyclopediaItemsInCategoryFragment method init.
private void init(View root) {
boolean bUpdateData = m_itemList == null;
m_btnBack = (Button) m_root.findViewById(R.id.btnBack);
m_btnBack.setText("Items");
m_btnBack.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
FragmentManager fm = getFragmentManager();
fm.popBackStack();
}
});
m_btnBack.setVisibility(View.VISIBLE);
m_btnSidebar = (Button) m_root.findViewById(R.id.btnSidebar);
m_btnSidebar.setVisibility(View.GONE);
if (bUpdateData) {
m_itemList = new Vector<glitchItem>();
}
m_adapter = new EncyclopediaItemsInCategoryListViewAdapter(this, m_itemList);
m_listView = (LinearListView) root.findViewById(R.id.encyclopedia_items_in_category_list);
m_listView.setAdapter(m_adapter);
TextView tv = (TextView) m_root.findViewById(R.id.encyclopedia_items_in_category_title);
tv.setTypeface(m_application.m_vagFont);
tv.setText(m_category.name);
if (bUpdateData) {
getItemsInCategory();
} else {
showItemsInCategoryPage();
}
}
use of android.view.View.OnClickListener in project IconicDroid by atermenji.
the class SimpleSampleActivity method initSimpleSample.
private void initSimpleSample() {
mIconicFontDrawable = new IconicFontDrawable(this);
mIconicFontDrawableButton = new IconicFontDrawable(this);
mIconicFontDrawableButton.setIntrinsicWidth(BUTTON_ICON_INTRINSIC_WIDTH);
mIconicFontDrawableButton.setIntrinsicHeight(BUTTON_ICON_INTRINSIC_HEIGHT);
if (SDK_INT < JELLY_BEAN) {
mIconView.setBackgroundDrawable(mIconicFontDrawable);
} else {
mIconView.setBackground(mIconicFontDrawable);
}
mChangeColorButton.setCompoundDrawablesWithIntrinsicBounds(mIconicFontDrawableButton, null, null, null);
List<Icon> icons = new ArrayList<Icon>();
icons.addAll(Arrays.asList(EntypoIcon.values()));
icons.addAll(Arrays.asList(EntypoSocialIcon.values()));
icons.addAll(Arrays.asList(FontAwesomeIcon.values()));
icons.addAll(Arrays.asList(IconicIcon.values()));
final ArrayAdapter<Icon> adapter = new ArrayAdapter<Icon>(this, android.R.layout.simple_spinner_item, icons);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
mIconsSpinner.setAdapter(adapter);
if (mIcon != null) {
mIconicFontDrawable.setIcon(mIcon);
mIconicFontDrawableButton.setIcon(mIcon);
mIconsSpinner.setSelection(adapter.getPosition(mIcon));
firstSelect = true;
}
mIconsSpinner.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
if (!firstSelect) {
Icon icon = adapter.getItem(pos);
mIconicFontDrawable.setIcon(icon);
mIconicFontDrawableButton.setIcon(icon);
} else {
firstSelect = false;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
mIconicFontDrawable.setIconColor(Utils.randomColor());
mIconicFontDrawableButton.setIconColor(Utils.randomColor());
mCurPaddingTextView.setText("Padding: " + 0);
mPaddingSeekBar.setMax(ICON_PADDING_MAX);
mPaddingSeekBar.setProgress(0);
mPaddingSeekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
mIconicFontDrawable.setIconPadding(progress);
mCurPaddingTextView.setText("Padding: " + progress);
}
});
mChangeColorButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mIconicFontDrawable.setIconColor(Utils.randomColor());
mIconicFontDrawable.setContourColor(Utils.randomColor());
mIconicFontDrawableButton.setIconColor(Utils.randomColor());
mIconicFontDrawableButton.setContourColor(Utils.randomColor());
}
});
mDrawContourCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
mIconicFontDrawable.setContour(Utils.randomColor(), ICON_CONTOUR_WIDTH);
mIconicFontDrawableButton.setContour(Utils.randomColor(), BUTTON_ICON_CONTOUR_WIDTH);
}
mIconicFontDrawable.drawContour(isChecked);
mIconicFontDrawableButton.drawContour(isChecked);
}
});
}
use of android.view.View.OnClickListener in project LoganSquare by bluelinelabs.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mJsonStringsToParse = readJsonFromFile();
mResponsesToSerialize = getResponsesToParse();
mBarChart = (BarChart) findViewById(R.id.bar_chart);
mBarChart.setColumnTitles(new String[] { "GSON", "Jackson", "LoganSquare", "Moshi" });
findViewById(R.id.btn_parse_tests).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
performParseTests();
}
});
findViewById(R.id.btn_serialize_tests).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
performSerializeTests();
}
});
}
Aggregations