Search in sources :

Example 71 with FragmentManager

use of android.support.v4.app.FragmentManager in project glitch-hq-android by tinyspeck.

the class AchievementCategoriesFragment method init.

private void init(View root) {
    boolean bUpdateData = (m_categoriesList == null);
    if (m_fromEncyclopedia) {
        Button 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);
        Button m_btnSidebar = (Button) m_root.findViewById(R.id.btnSidebar);
        m_btnSidebar.setVisibility(View.GONE);
    }
    if (bUpdateData) {
        m_categoriesList = new Vector<glitchAchievementCategory>();
    }
    TextView title = (TextView) root.findViewById(R.id.categories_title);
    title.setTypeface(m_application.m_vagFont);
    m_adapter = new AchievementCategoriesListViewAdapter(this, m_categoriesList);
    m_listView = (LinearListView) root.findViewById(R.id.categories_list);
    m_listView.setAdapter(m_adapter);
    if (bUpdateData) {
        getCategories();
    } else {
        showCategoriesPage();
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) Button(android.widget.Button) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View)

Example 72 with FragmentManager

use of android.support.v4.app.FragmentManager 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 73 with FragmentManager

use of android.support.v4.app.FragmentManager 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 74 with FragmentManager

use of android.support.v4.app.FragmentManager in project glitch-hq-android by tinyspeck.

the class MailChooseRecipientFragment method init.

private void init(View root) {
    boolean bUpdateData = m_recipientsList == null;
    if (bUpdateData)
        m_recipientsList = new Vector<glitchFriend>();
    m_filterText = (EditText) root.findViewById(R.id.recipients_search_box);
    m_filterText.addTextChangedListener(filterTextWatcher);
    m_filterClearImg = (ImageView) root.findViewById(R.id.recipients_filter_clear);
    m_filterClearImg.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            m_filterText.setText("");
        }
    });
    m_btnClose = (Button) root.findViewById(R.id.btnCloseRecipientChooser);
    m_btnClose.setVisibility(View.VISIBLE);
    m_btnClose.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            FragmentManager fm = getFragmentManager();
            fm.popBackStack();
        }
    });
    m_btnSidebar = (Button) root.findViewById(R.id.btnSidebar);
    m_btnSidebar.setVisibility(View.GONE);
    m_adapter = new FriendsListViewAdapter(this, m_recipientsList);
    m_listView = (LinearListView) root.findViewById(R.id.RecipientsListView);
    m_listView.setAdapter(m_adapter);
    if (bUpdateData) {
        getRecipients();
    } else {
        updateRecipients();
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) OnClickListener(android.view.View.OnClickListener) Vector(java.util.Vector) ImageView(android.widget.ImageView) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) View(android.view.View)

Example 75 with FragmentManager

use of android.support.v4.app.FragmentManager 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)

Aggregations

FragmentManager (android.support.v4.app.FragmentManager)265 FragmentTransaction (android.support.v4.app.FragmentTransaction)98 Fragment (android.support.v4.app.Fragment)76 View (android.view.View)46 TextView (android.widget.TextView)34 OnClickListener (android.view.View.OnClickListener)24 Bundle (android.os.Bundle)23 Intent (android.content.Intent)20 ImageView (android.widget.ImageView)15 ScrollView (android.widget.ScrollView)14 DialogFragment (android.support.v4.app.DialogFragment)13 ListFragment (android.support.v4.app.ListFragment)12 Button (android.widget.Button)11 FragmentActivity (android.support.v4.app.FragmentActivity)6 ArrayList (java.util.ArrayList)6 ViewPager (android.support.v4.view.ViewPager)5 UiThreadTest (android.test.UiThreadTest)5 BackStackEntry (android.support.v4.app.FragmentManager.BackStackEntry)4 AppCompatActivity (android.support.v7.app.AppCompatActivity)4 Time (android.text.format.Time)4