Search in sources :

Example 81 with TextView

use of android.widget.TextView in project glitch-hq-android by tinyspeck.

the class EncyclopediaSkillCategoriesFragment method init.

private void init(View root) {
    boolean bUpdateData = (m_categoriesList == null);
    m_btnBack = (Button) m_root.findViewById(R.id.btnBack);
    m_btnBack.setText("Encyclopedia");
    m_btnBack.setSingleLine();
    m_btnBack.setEllipsize(TruncateAt.END);
    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_categoriesList = new Vector<String>();
    }
    TextView title = (TextView) root.findViewById(R.id.encyclopedia_skill_categories_title);
    title.setTypeface(m_application.m_vagFont);
    m_adapter = new EncyclopediaSkillCategoriesListViewAdapter(this, m_categoriesList);
    m_listView = (LinearListView) root.findViewById(R.id.encyclopedia_skill_categories_list);
    m_listView.setAdapter(m_adapter);
    if (bUpdateData) {
        getEncyclopediaSkillCategories();
    } else {
        showEncyclopediaSkillCategoriesPage();
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View)

Example 82 with TextView

use of android.widget.TextView in project glitch-hq-android by tinyspeck.

the class EncyclopediaSkillsInCategoryFragment method onRequestBack.

@Override
public void onRequestBack(String method, JSONObject response) {
    if (method == "skills.listAllInCategory") {
        m_skillsList.clear();
        JSONObject jSkills = response.optJSONObject("skills");
        if (jSkills != null && jSkills.length() > 0) {
            Iterator<String> it = jSkills.keys();
            while (it.hasNext()) {
                String key = it.next();
                JSONObject jobj = jSkills.optJSONObject(key);
                skillAvailable skill = new skillAvailable();
                skill.id = jobj.optString("class_tsid");
                skill.item = jobj.optString("name");
                skill.icon = jobj.optString("icon_44");
                skill.can_learn = (response.optInt("can_learn") == 1) ? true : false;
                skill.got = (response.optInt("got") == 1) ? true : false;
                skill.paused = (response.optInt("paused") == 1) ? true : false;
                m_skillsList.add(skill);
            }
            Collections.sort(m_skillsList, new SortByName());
        }
        if (m_skillsList.size() > 0) {
            ((TextView) m_root.findViewById(R.id.encyclopedia_skills_in_category_list_message)).setText("");
        }
        showSkillsInCategoryPage();
    }
    onRequestComplete();
}
Also used : JSONObject(org.json.JSONObject) TextView(android.widget.TextView)

Example 83 with TextView

use of android.widget.TextView in project glitch-hq-android by tinyspeck.

the class EncyclopediaSkillsInCategoryListViewAdapter 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_skills_in_category_list_item, null);
        holder = new ViewHolder();
        holder.name = (TextView) convertView.findViewById(R.id.encyclopedia_skills_in_category_name);
        holder.name.setTypeface(m_application.m_vagFont);
        holder.icon = (ImageView) convertView.findViewById(R.id.encyclopedia_skills_in_category_icon);
        holder.whole = (View) convertView.findViewById(R.id.encyclopedia_skills_in_category_item);
        convertView.setTag(holder);
    }
    holder = (ViewHolder) convertView.getTag();
    if (position < getCount()) {
        skillAvailable skill = m_skillsList.get(position);
        holder.name.setText(skill.item);
        DrawableURL.Show(holder.icon, skill.icon, false);
        holder.whole.setTag(position);
        holder.whole.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {
                skillAvailable skill = m_skillsList.get((Integer) v.getTag());
                SkillDetailFragment f = new SkillDetailFragment(m_bf, skill.id);
                ((HomeScreen) m_act).setCurrentFragment(f, true);
            }
        });
    }
    return convertView;
}
Also used : BaseFragment.skillAvailable(com.tinyspeck.glitchhq.BaseFragment.skillAvailable) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View)

Example 84 with TextView

use of android.widget.TextView in project glitch-hq-android by tinyspeck.

the class MailComposeFragment method init.

private void init(View root) {
    m_btnBackToRecipientChooser = (Button) root.findViewById(R.id.btnBackToRecipientChooser);
    m_btnBackToRecipientChooser.setVisibility(View.VISIBLE);
    m_btnBackToRecipientChooser.setOnClickListener(new OnClickListener() {

        public void onClick(View arg0) {
            FlurryAgent.logEvent("MailCompose - 'To' button pressed");
            // assume always have MailChooseRecipientFragment underneath
            FragmentManager fm = getFragmentManager();
            fm.popBackStack();
        }
    });
    m_btnSendMail = (Button) root.findViewById(R.id.btnSendMail);
    m_btnSendMail.setVisibility(View.VISIBLE);
    m_btnSendMail.setOnClickListener(new OnClickListener() {

        public void onClick(View arg0) {
            FlurryAgent.logEvent("MailCompose - 'Send' button pressed");
            if (m_composer.getText().toString().length() == 0) {
                Util.Alert(getActivity(), "Your message is empty, do you want to send anyway?", "Send empty message?", true, "Send", "Cancel", new DialogInterface.OnClickListener() {

                    public void onClick(DialogInterface dialog, int which) {
                        if (which == DialogInterface.BUTTON_POSITIVE) {
                            sendMail();
                        } else {
                            dialog.dismiss();
                        }
                    }
                });
            } else if (m_composer.getText().toString().length() > 300) {
                Util.Alert(getActivity(), "Your message is longer than the 300 character limit.", "Message too long", false, "OK", "Cancel", new DialogInterface.OnClickListener() {

                    public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();
                    }
                });
            } else {
                sendMail();
            }
        }
    });
    m_btnSidebar = (Button) root.findViewById(R.id.btnSidebar);
    m_btnSidebar.setVisibility(View.GONE);
    m_recipientTextView = (TextView) root.findViewById(R.id.recipient_text_view);
    m_recipientTextView.setTypeface(m_application.m_vagFont);
    m_recipientTextView.setText("To: " + m_recipientLabel);
    m_composer = (EditText) root.findViewById(R.id.mail_composer);
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) DialogInterface(android.content.DialogInterface) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) View(android.view.View)

Example 85 with TextView

use of android.widget.TextView in project glitch-hq-android by tinyspeck.

the class SkillDetailFragment method addGiantToLinearLayout.

private boolean addGiantToLinearLayout(LinearLayout ll, Vector<skillGiant> skills) {
    LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    ll.removeAllViewsInLayout();
    for (int i = 0; i < skills.size(); i++) {
        View v = inflater.inflate(R.layout.skill_post_request_item, null);
        TextView tv_skill = (TextView) v.findViewById(R.id.tv_skillName);
        ll.addView(v);
        String s = skills.get(i).id;
        s = s.substring(0, 1).toUpperCase() + s.substring(1);
        tv_skill.setTextColor(0xff151515);
        tv_skill.setTypeface(m_application.m_vagLightFont);
        if (skills.get(i).isPrimary) {
            tv_skill.setText(Html.fromHtml("<b>" + s + "</b>" + " (Primary)"));
        } else
            tv_skill.setText(s);
    }
    return skills.size() > 0;
}
Also used : LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView)

Aggregations

TextView (android.widget.TextView)4994 View (android.view.View)2680 ImageView (android.widget.ImageView)1137 Button (android.widget.Button)442 LinearLayout (android.widget.LinearLayout)439 LayoutInflater (android.view.LayoutInflater)425 Intent (android.content.Intent)397 ListView (android.widget.ListView)389 AdapterView (android.widget.AdapterView)372 ViewGroup (android.view.ViewGroup)322 OnClickListener (android.view.View.OnClickListener)304 RecyclerView (android.support.v7.widget.RecyclerView)197 Test (org.junit.Test)197 ScrollView (android.widget.ScrollView)166 DialogInterface (android.content.DialogInterface)162 Context (android.content.Context)156 Drawable (android.graphics.drawable.Drawable)155 EditText (android.widget.EditText)149 AlertDialog (android.app.AlertDialog)144 Bundle (android.os.Bundle)144