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;
}
});
}
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();
}
}
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();
}
}
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();
}
}
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();
}
}
Aggregations