Search in sources :

Example 41 with OnClickListener

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);
        }
    });
}
Also used : Button(android.widget.Button) OnClickListener(android.view.View.OnClickListener) ImageView(android.widget.ImageView) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) View(android.view.View)

Example 42 with OnClickListener

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;
}
Also used : BaseFragment.glitchGiant(com.tinyspeck.glitchhq.BaseFragment.glitchGiant) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) View(android.view.View)

Example 43 with OnClickListener

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();
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) View(android.view.View)

Example 44 with OnClickListener

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);
        }
    });
}
Also used : ArrayList(java.util.ArrayList) OnSeekBarChangeListener(android.widget.SeekBar.OnSeekBarChangeListener) View(android.view.View) IconicFontDrawable(com.atermenji.android.iconicdroid.IconicFontDrawable) OnItemSelectedListener(android.widget.AdapterView.OnItemSelectedListener) OnClickListener(android.view.View.OnClickListener) EntypoSocialIcon(com.atermenji.android.iconicdroid.icon.EntypoSocialIcon) EntypoIcon(com.atermenji.android.iconicdroid.icon.EntypoIcon) Icon(com.atermenji.android.iconicdroid.icon.Icon) FontAwesomeIcon(com.atermenji.android.iconicdroid.icon.FontAwesomeIcon) IconicIcon(com.atermenji.android.iconicdroid.icon.IconicIcon)

Example 45 with OnClickListener

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();
        }
    });
}
Also used : OnClickListener(android.view.View.OnClickListener) View(android.view.View)

Aggregations

OnClickListener (android.view.View.OnClickListener)794 View (android.view.View)792 TextView (android.widget.TextView)492 Button (android.widget.Button)265 ImageView (android.widget.ImageView)256 Intent (android.content.Intent)183 ListView (android.widget.ListView)112 AdapterView (android.widget.AdapterView)91 ScrollView (android.widget.ScrollView)52 LinearLayout (android.widget.LinearLayout)49 Bundle (android.os.Bundle)43 LayoutInflater (android.view.LayoutInflater)35 ViewGroup (android.view.ViewGroup)30 ArrayList (java.util.ArrayList)30 BindView (butterknife.BindView)29 KeyEvent (android.view.KeyEvent)28 EditText (android.widget.EditText)28 DialogInterface (android.content.DialogInterface)27 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)25 FragmentManager (android.support.v4.app.FragmentManager)23