use of android.support.v4.app.Fragment in project glimmr by brk3.
the class PhotosetGridFragment method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()) {
case R.id.menu_add_photos:
FragmentTransaction ft = mActivity.getSupportFragmentManager().beginTransaction();
ft.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);
Fragment prev = mActivity.getSupportFragmentManager().findFragmentByTag(AddToPhotosetDialogFragment.TAG);
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
DialogFragment newFragment = AddToPhotosetDialogFragment.newInstance(mPhotoset);
newFragment.show(ft, AddToPhotosetDialogFragment.TAG);
return true;
}
return super.onOptionsItemSelected(item);
}
use of android.support.v4.app.Fragment in project glimmr by brk3.
the class GroupPoolGridFragment method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()) {
case R.id.menu_add_photos:
FragmentTransaction ft = mActivity.getSupportFragmentManager().beginTransaction();
ft.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);
Fragment prev = mActivity.getSupportFragmentManager().findFragmentByTag(AddToGroupDialogFragment.TAG);
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
DialogFragment newFragment = AddToGroupDialogFragment.newInstance(mGroup);
newFragment.show(ft, AddToGroupDialogFragment.TAG);
return true;
}
return super.onOptionsItemSelected(item);
}
use of android.support.v4.app.Fragment in project glimmr by brk3.
the class PhotosetViewerActivity method initViewPager.
@Override
protected void initViewPager() {
mViewPager = (ViewPager) findViewById(R.id.viewPager);
mAdapter = new GlimmrPagerAdapter(getSupportFragmentManager(), mViewPager, mActionBar, CONTENT) {
@Override
public Fragment getItemImpl(int position) {
switch(position) {
case PHOTOSET_PAGE:
return PhotosetGridFragment.newInstance(mPhotoset);
}
return null;
}
};
super.initViewPager();
}
use of android.support.v4.app.Fragment in project glimmr by brk3.
the class ProfileViewerActivity method initViewPager.
@Override
protected void initViewPager() {
mViewPager = (ViewPager) findViewById(R.id.viewPager);
mAdapter = new GlimmrPagerAdapter(getSupportFragmentManager(), mViewPager, mActionBar, CONTENT) {
@Override
public Fragment getItemImpl(int position) {
switch(position) {
case PHOTO_STREAM_PAGE:
return PhotoStreamGridFragment.newInstance(mUser);
case FAVORITES_STREAM_PAGE:
return FavoritesGridFragment.newInstance(mUser);
case SETS_PAGE:
return PhotosetsFragment.newInstance(mUser);
case CONTACTS_PAGE:
// TODO
return PhotoStreamGridFragment.newInstance(mUser);
}
return null;
}
};
super.initViewPager();
}
use of android.support.v4.app.Fragment in project glide by bumptech.
the class RequestManagerRetriever method handleMessage.
@Override
public boolean handleMessage(Message message) {
boolean handled = true;
Object removed = null;
Object key = null;
switch(message.what) {
case ID_REMOVE_FRAGMENT_MANAGER:
android.app.FragmentManager fm = (android.app.FragmentManager) message.obj;
key = fm;
removed = pendingRequestManagerFragments.remove(fm);
break;
case ID_REMOVE_SUPPORT_FRAGMENT_MANAGER:
FragmentManager supportFm = (FragmentManager) message.obj;
key = supportFm;
removed = pendingSupportRequestManagerFragments.remove(supportFm);
break;
default:
handled = false;
break;
}
if (handled && removed == null && Log.isLoggable(TAG, Log.WARN)) {
Log.w(TAG, "Failed to remove expected request manager fragment, manager: " + key);
}
return handled;
}
Aggregations