Search in sources :

Example 11 with FragmentManager

use of android.support.v4.app.FragmentManager in project PreLollipopTransition by takahirom.

the class ExitFragmentTransition method startExitListening.

public void startExitListening(final Runnable popBackStackRunnable) {
    if (interpolator == null) {
        interpolator = new DecelerateInterpolator();
    }
    final View toView = moveData.toView;
    toView.setFocusableInTouchMode(true);
    toView.requestFocus();
    toView.setOnKeyListener(new View.OnKeyListener() {

        @Override
        public boolean onKey(View v, int keyCode, KeyEvent event) {
            if (keyCode == KeyEvent.KEYCODE_BACK) {
                if (event.getAction() != KeyEvent.ACTION_UP) {
                    return true;
                }
                TransitionAnimation.startExitAnimation(moveData, interpolator, new Runnable() {

                    @Override
                    public void run() {
                        if (popBackStackRunnable != null) {
                            popBackStackRunnable.run();
                            return;
                        }
                        if (fragment == null) {
                            if (!supportFragment.isResumed()) {
                                return;
                            }
                            final FragmentManager fragmentManager = supportFragment.getFragmentManager();
                            if (fragmentManager != null) {
                                fragmentManager.popBackStack();
                            }
                        } else {
                            if (!fragment.isResumed()) {
                                return;
                            }
                            final android.app.FragmentManager fragmentManager = fragment.getFragmentManager();
                            if (fragmentManager != null) {
                                fragmentManager.popBackStack();
                            }
                        }
                    }
                }, listener);
                return true;
            }
            return false;
        }
    });
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) KeyEvent(android.view.KeyEvent) FragmentManager(android.support.v4.app.FragmentManager) View(android.view.View)

Example 12 with FragmentManager

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

the class EncyclopediaLocationHubsFragment method init.

private void init(View root) {
    boolean bUpdateData = (m_hubsList == 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_hubsList = new Vector<glitchLocationHub>();
    }
    TextView title = (TextView) root.findViewById(R.id.encyclopedia_location_hubs_title);
    title.setTypeface(m_application.m_vagFont);
    m_adapter = new EncyclopediaLocationHubsListViewAdapter(this, m_hubsList);
    m_listView = (LinearListView) root.findViewById(R.id.encyclopedia_location_hubs_list);
    m_listView.setAdapter(m_adapter);
    if (bUpdateData) {
        getEncyclopediaLocationHubs();
    } else {
        showEncyclopediaLocationHubsPage();
    }
}
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 13 with FragmentManager

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

the class EncyclopediaGiantsListFragment method init.

private void init(View root) {
    boolean bUpdateData = (m_giantsList == 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_giantsList = new Vector<glitchGiant>();
    }
    TextView title = (TextView) root.findViewById(R.id.encyclopedia_giants_list_title);
    title.setTypeface(m_application.m_vagFont);
    m_adapter = new EncyclopediaGiantsListListViewAdapter(this, m_giantsList);
    m_listView = (LinearListView) root.findViewById(R.id.encyclopedia_giants_list_list);
    m_listView.setAdapter(m_adapter);
    if (bUpdateData) {
        getEncyclopediaGiantsList();
    } else {
        showEncyclopediaGiantsListPage();
    }
}
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 14 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 15 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)

Aggregations

FragmentManager (android.support.v4.app.FragmentManager)293 FragmentTransaction (android.support.v4.app.FragmentTransaction)106 Fragment (android.support.v4.app.Fragment)99 View (android.view.View)53 TextView (android.widget.TextView)35 Bundle (android.os.Bundle)31 OnClickListener (android.view.View.OnClickListener)24 DialogFragment (android.support.v4.app.DialogFragment)23 Intent (android.content.Intent)20 ImageView (android.widget.ImageView)16 ScrollView (android.widget.ScrollView)14 ListFragment (android.support.v4.app.ListFragment)12 Button (android.widget.Button)11 ArrayList (java.util.ArrayList)9 FrontPageFragment (ingage.ingage20.fragments.FrontPageFragment)8 SearchResultFragment (ingage.ingage20.fragments.SearchResultFragment)8 ViewPager (android.support.v4.view.ViewPager)7 ActionBar (android.support.v7.app.ActionBar)7 RecyclerView (android.support.v7.widget.RecyclerView)7 CategoriesPageFragment (ingage.ingage20.fragments.CategoriesPageFragment)7