Search in sources :

Example 86 with TextView

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

the class SkillDetailFragment method UpdateSkillDetailProgress.

public void UpdateSkillDetailProgress() {
    View v = m_root.findViewById(R.id.learning_progress);
    TextView tv = (TextView) m_root.findViewById(R.id.learning_process_text);
    Util.showProgress(getActivity(), v, tv, m_currentSkill.remainTime, m_currentSkill.totalTime, m_currentSkill.curTime);
}
Also used : TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView)

Example 87 with TextView

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

the class SkillDetailFragment method UpdateUnlearnDetailProgress.

public void UpdateUnlearnDetailProgress() {
    View v = m_root.findViewById(R.id.unlearning_progress);
    TextView tv = (TextView) m_root.findViewById(R.id.unlearning_process_text);
    Util.showUnlearnProgress(getActivity(), v, tv, m_currentSkill.remainTime, m_currentSkill.totalTime, m_currentSkill.curTime);
}
Also used : TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView)

Example 88 with TextView

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

the class SkillDetailFragment method setSkillDetailView.

void setSkillDetailView() {
    ImageView icon = (ImageView) m_root.findViewById(R.id.skill_detail_icon);
    //DrawableURL.Show( icon, m_currentSkill.icon, false );
    m_application.Download(m_currentSkill.icon, icon, MyApplication.DOWNLOAD_TYPE_NORMAL);
    TextView nameTv = (TextView) m_root.findViewById(R.id.skill_detail_name);
    nameTv.setTypeface(m_application.m_vagFont);
    nameTv.setText(m_currentSkill.item);
    TextView tv = (TextView) m_root.findViewById(R.id.caption_status);
    tv.setTypeface(m_application.m_vagFont);
    tv = (TextView) m_root.findViewById(R.id.caption_giant);
    tv.setTypeface(m_application.m_vagFont);
    tv = (TextView) m_root.findViewById(R.id.caption_needed);
    tv.setTypeface(m_application.m_vagFont);
    tv = (TextView) m_root.findViewById(R.id.caption_reqs);
    tv.setTypeface(m_application.m_vagFont);
    TextView timeTv = (TextView) m_root.findViewById(R.id.skill_detail_time);
    if (!(m_bf instanceof EncyclopediaSkillsInCategoryFragment) && !(m_bf instanceof EncyclopediaCategoriesFragment)) {
        if (m_currentSkill.learning && !m_currentSkill.paused && !m_currentSkill.got)
            timeTv.setText(R.string.str_you_are_learning);
        else if (m_currentSkill.unlearning && m_fromUnlearn)
            timeTv.setText(R.string.str_you_are_unlearning);
        else
            timeTv.setText(Util.TimeToString(m_currentSkill.totalTime, false));
    } else {
        nameTv.setTextSize(20);
        timeTv.setVisibility(View.GONE);
    }
    tv = (TextView) m_root.findViewById(R.id.skill_detail_description);
    tv.setText(m_currentSkill.description);
    Button btnLearn = (Button) m_root.findViewById(R.id.btn_learn_this_skill);
    btnLearn.setTypeface(m_application.m_vagFont);
    btnLearn.setOnClickListener(new OnClickListener() {

        public void onClick(View arg0) {
            FlurryAgent.logEvent("Skill Detail - Tapped learn button");
            learnSkill();
        }
    });
    Button btnUnlearn = (Button) m_root.findViewById(R.id.btn_unlearn_this_skill);
    btnUnlearn.setTypeface(m_application.m_vagFont);
    btnUnlearn.setOnClickListener(new OnClickListener() {

        public void onClick(View arg0) {
            FlurryAgent.logEvent("Skill Detail - Tapped unlearn button");
            unlearnSkill();
        }
    });
    Button btnCancelUnlearn = (Button) m_root.findViewById(R.id.btn_cancel_unlearning_this_skill);
    btnCancelUnlearn.setTypeface(m_application.m_vagFont);
    btnCancelUnlearn.setOnClickListener(new OnClickListener() {

        public void onClick(View arg0) {
            FlurryAgent.logEvent("Skill Detail - Tapped cancel unlearn button");
            if (m_RemainingTimer != null) {
                m_RemainingTimer.cancel();
                m_RemainingTimer = null;
            }
            cancelUnlearning();
        }
    });
    View v_learn = m_root.findViewById(R.id.learning_process_bar);
    View v_unlearn = m_root.findViewById(R.id.unlearning_process_bar);
    if (m_bf instanceof EncyclopediaSkillsInCategoryFragment) {
        btnLearn.setVisibility(View.GONE);
        btnUnlearn.setVisibility(View.GONE);
        btnCancelUnlearn.setVisibility(View.GONE);
        v_learn.setVisibility(View.GONE);
        v_unlearn.setVisibility(View.GONE);
    } else if (m_currentSkill.learning && !m_currentSkill.paused && !m_currentSkill.got && !m_fromUnlearn) {
        btnLearn.setVisibility(View.GONE);
        btnUnlearn.setVisibility(View.GONE);
        btnCancelUnlearn.setVisibility(View.GONE);
        v_learn.setVisibility(View.VISIBLE);
        v_unlearn.setVisibility(View.GONE);
        UpdateSkillDetailProgress();
        InitUpdateSkillRemainingTimer();
    } else if (m_currentSkill.unlearning && m_fromUnlearn) {
        btnUnlearn.setVisibility(View.GONE);
        btnLearn.setVisibility(View.GONE);
        btnCancelUnlearn.setVisibility(View.VISIBLE);
        v_learn.setVisibility(View.GONE);
        v_unlearn.setVisibility(View.VISIBLE);
        UpdateUnlearnDetailProgress();
        InitUpdateSkillRemainingTimer();
    } else if ((m_currentSkill.got || !m_currentSkill.can_learn) && !m_currentSkill.can_unlearn) {
        v_learn.setVisibility(View.GONE);
        v_unlearn.setVisibility(View.GONE);
        btnLearn.setVisibility(View.GONE);
        btnUnlearn.setVisibility(View.GONE);
        btnCancelUnlearn.setVisibility(View.GONE);
    } else {
        v_unlearn.setVisibility(View.GONE);
        v_learn.setVisibility(View.GONE);
        btnCancelUnlearn.setVisibility(View.GONE);
        if (m_currentSkill.can_unlearn && m_fromUnlearn) {
            btnUnlearn.setVisibility(View.VISIBLE);
            btnLearn.setVisibility(View.GONE);
        } else {
            btnUnlearn.setVisibility(View.GONE);
            btnLearn.setVisibility(View.VISIBLE);
        }
    }
    View mLayout = m_root.findViewById(R.id.requirement_layout);
    LinearLayout lreq = (LinearLayout) m_root.findViewById(R.id.requirements);
    if (!addTextViewToLinearLayout(lreq, m_currentSkill.requirements, true))
        mLayout.setVisibility(View.GONE);
    else
        mLayout.setVisibility(View.VISIBLE);
    mLayout = m_root.findViewById(R.id.need_for_layout);
    LinearLayout ll = (LinearLayout) m_root.findViewById(R.id.post_request_panel);
    if (!addTextViewToLinearLayout(ll, m_currentSkill.postRequests, false))
        mLayout.setVisibility(View.GONE);
    else
        mLayout.setVisibility(View.VISIBLE);
    mLayout = m_root.findViewById(R.id.giant_layout);
    ll = (LinearLayout) m_root.findViewById(R.id.giant_panel);
    if (!addGiantToLinearLayout(ll, m_currentSkill.giants))
        mLayout.setVisibility(View.GONE);
    else
        mLayout.setVisibility(View.VISIBLE);
    tv = (TextView) m_root.findViewById(R.id.skill_status);
    if (m_currentSkill.learning && !m_currentSkill.paused && !m_currentSkill.got && !m_fromUnlearn)
        tv.setText(R.string.str_you_are_learning);
    else if (m_currentSkill.paused)
        tv.setText(R.string.str_skill_status_started);
    else if (m_currentSkill.unlearning && m_fromUnlearn)
        tv.setText(R.string.str_you_are_unlearning);
    else if (m_currentSkill.can_unlearn)
        tv.setText(R.string.str_you_can_unlearn);
    else if (m_currentSkill.got)
        tv.setText(R.string.str_you_have_skill);
    else if (!m_currentSkill.can_learn)
        tv.setText(R.string.str_you_can_not_learn);
    else
        tv.setText(R.string.str_skill_status_can_learn);
    m_root.scrollTo(0, 0);
}
Also used : Button(android.widget.Button) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) LinearLayout(android.widget.LinearLayout)

Example 89 with TextView

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

the class SkillDetailFragment method addTextViewToLinearLayout.

private boolean addTextViewToLinearLayout(LinearLayout ll, Vector<skillAvailable> skills, boolean bRequirement) {
    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);
        if (skills.get(i).type != null && skills.get(i).type.equalsIgnoreCase("level")) {
            tv_skill.setText("Level " + skills.get(i).level);
            tv_skill.setTag(skills.get(i).id);
            tv_skill.setTextColor(0xff808080);
        } else if (skills.get(i).type != null && skills.get(i).type.equalsIgnoreCase("quest")) {
            tv_skill.setText(skills.get(i).item);
            tv_skill.setTag(skills.get(i).id);
            tv_skill.setTextColor(0xff808080);
        } else if (skills.get(i).type != null && skills.get(i).type.equalsIgnoreCase("upgrade")) {
            tv_skill.setText(skills.get(i).item);
            tv_skill.setTag(skills.get(i).id);
            tv_skill.setTextColor(0xff808080);
        } else if (bRequirement && (skills.get(i).type == null || !skills.get(i).type.equalsIgnoreCase("skill"))) {
            tv_skill.setText(skills.get(i).item);
            tv_skill.setTag(skills.get(i).id);
            tv_skill.setTextColor(0xff808080);
        } else {
            tv_skill.setTypeface(m_application.m_vagFont);
            tv_skill.setText(skills.get(i).item);
            tv_skill.setTag(skills.get(i).id);
            tv_skill.setOnClickListener(new OnClickListener() {

                public void onClick(View v) {
                    String sKey = (String) v.getTag();
                    SkillDetailFragment f = new SkillDetailFragment(m_bf, sKey);
                    ((HomeScreen) getActivity()).setCurrentFragment(f, true);
                }
            });
        }
    }
    return (skills.size() > 0);
}
Also used : LayoutInflater(android.view.LayoutInflater) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView)

Example 90 with TextView

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

the class SkillFragment method init.

private void init(View root) {
    boolean bUpdateData = m_skillList == null;
    if (bUpdateData) {
        m_skillList = new Vector<skillAvailable>();
        m_learningList = new Vector<skillAvailable>();
        m_unlearningList = new Vector<skillAvailable>();
    }
    m_skillListView = (LinearListView) root.findViewById(R.id.skill_list);
    TextView tv = (TextView) root.findViewById(R.id.available_skills);
    tv.setTypeface(m_application.m_vagFont);
    m_skillAdapter = new SkillListAdapter(m_this, m_skillList);
    m_skillListView.setAdapter(m_skillAdapter);
    m_learningSkillName = (TextView) root.findViewById(R.id.tv_skillName);
    m_learningSkillTime = (TextView) root.findViewById(R.id.tv_skillTime);
    m_learningSkillProgress = (View) root.findViewById(R.id.learning_progress);
    m_learningSkillName.setTypeface(m_application.m_vagLightFont);
    m_learningSkillTime.setTypeface(m_application.m_vagLightFont);
    FrameLayout learningPanel = (FrameLayout) m_root.findViewById(R.id.skill_view_learning_panel);
    learningPanel.setOnClickListener(new OnClickListener() {

        public void onClick(View arg0) {
            skillAvailable skill = m_learningList.get(0);
            SkillDetailFragment fm = new SkillDetailFragment(m_this, skill);
            ((HomeScreen) getActivity()).setCurrentFragment(fm, true);
        }
    });
    m_unlearningSkillName = (TextView) root.findViewById(R.id.tv_unlearnName);
    m_unlearningSkillTime = (TextView) root.findViewById(R.id.tv_unlearnTime);
    m_unlearningSkillProgress = (View) root.findViewById(R.id.unlearning_progress);
    m_unlearningSkillName.setTypeface(m_application.m_vagLightFont);
    m_unlearningSkillTime.setTypeface(m_application.m_vagLightFont);
    FrameLayout unlearningPanel = (FrameLayout) m_root.findViewById(R.id.unlearn_view_unlearning_panel);
    unlearningPanel.setOnClickListener(new OnClickListener() {

        public void onClick(View arg0) {
            skillAvailable skill = m_unlearningList.get(0);
            SkillDetailFragment fm = new SkillDetailFragment(m_this, skill);
            ((HomeScreen) getActivity()).setCurrentFragment(fm, true);
        }
    });
    if (bUpdateData) {
        getSkills();
    } else {
        showSkillPage();
    }
}
Also used : FrameLayout(android.widget.FrameLayout) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) View(android.view.View)

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