use of com.actionbarsherlock.app.SherlockFragmentActivity in project Wallpaper-Manager by Bencodes.
the class WallpaperFragment method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
this.mNode = (NodeWallpaper) super.getArguments().getSerializable(BUNDLE_TAG);
final ActionBar ab = ((SherlockFragmentActivity) super.getActivity()).getSupportActionBar();
if (ab != null) {
ab.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
ab.setDisplayHomeAsUpEnabled(true);
ab.setDisplayShowHomeEnabled(false);
ab.setDisplayShowTitleEnabled(true);
final String title = super.getResources().getString(R.string.config_full_screen_wallpaper_title);
if (title == null || title.length() <= 0) {
ab.setTitle(mNode.name);
} else {
ab.setTitle(title);
}
}
this.mPending = (ProgressBar) super.getView().findViewById(R.id.pending);
this.mImageView = (PhotoView) mView.findViewById(R.id.wp_image);
ImageLoader.getInstance().displayImage(mNode.url, mImageView, new ImageLoadingListener() {
@Override
public void onLoadingStarted() {
mImageDrawableSet = false;
mImageView.setVisibility(View.GONE);
mPending.setVisibility(View.VISIBLE);
}
@Override
public void onLoadingFailed(FailReason failReason) {
mImageDrawableSet = false;
Toast.makeText(getActivity(), "Image Failed To Load!", Toast.LENGTH_SHORT).show();
}
@Override
public void onLoadingComplete(Bitmap bitmap) {
mImageDrawableSet = true;
mImageView.setVisibility(View.VISIBLE);
mImageView.setImageBitmap(bitmap);
mImageView.setZoomable(true);
mPending.setVisibility(View.GONE);
if (mApplyImageOnDisplay)
applyImage();
if (mSaveImageOnDisplay)
exportImage();
}
@Override
public void onLoadingCancelled() {
}
});
}
use of com.actionbarsherlock.app.SherlockFragmentActivity in project SherlockNavigationDrawer by nicolasjafelle.
the class SherlockActionBarDrawerToggleCompat method setActionBarDescription.
public static Object setActionBarDescription(Object info, Activity activity, int contentDescRes) {
if (info == null) {
info = new SetIndicatorInfo(activity);
}
final SetIndicatorInfo sii = (SetIndicatorInfo) info;
if (sii.setHomeAsUpIndicator != null) {
try {
final ActionBar actionBar = ((SherlockFragmentActivity) activity).getSupportActionBar();
sii.setHomeActionContentDescription.invoke(actionBar, contentDescRes);
} catch (Exception e) {
Log.w(TAG, "Couldn't set content description via JB-MR2 API", e);
}
}
return info;
}
use of com.actionbarsherlock.app.SherlockFragmentActivity in project little-bear-dictionary by daimajia.
the class AboutMeFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mWeibo = Weibo.getInstance(Constants.WEIBO_APP_KEY, Constants.WEIBO_REDIRECT_URI);
SherlockFragmentActivity sherlockFragmentActivity = (SherlockFragmentActivity) getActivity();
mActionBar = sherlockFragmentActivity.getSupportActionBar();
}
use of com.actionbarsherlock.app.SherlockFragmentActivity in project httpclient by pixmob.
the class ActionBarImpl method selectTab.
@Override
public void selectTab(Tab tab) {
if (getNavigationMode() != NAVIGATION_MODE_TABS) {
mSavedTabPosition = tab != null ? tab.getPosition() : INVALID_POSITION;
return;
}
FragmentTransaction trans = null;
if (mActivity instanceof SherlockFragmentActivity) {
trans = ((SherlockFragmentActivity) mActivity).getSupportFragmentManager().beginTransaction().disallowAddToBackStack();
}
if (mSelectedTab == tab) {
if (mSelectedTab != null) {
mSelectedTab.getCallback().onTabReselected(mSelectedTab, trans);
mTabScrollView.animateToTab(tab.getPosition());
}
} else {
mTabScrollView.setTabSelected(tab != null ? tab.getPosition() : Tab.INVALID_POSITION);
if (mSelectedTab != null) {
mSelectedTab.getCallback().onTabUnselected(mSelectedTab, trans);
}
mSelectedTab = (TabImpl) tab;
if (mSelectedTab != null) {
mSelectedTab.getCallback().onTabSelected(mSelectedTab, trans);
}
}
if (trans != null && !trans.isEmpty()) {
trans.commit();
}
}
use of com.actionbarsherlock.app.SherlockFragmentActivity in project SherlockNavigationDrawer by nicolasjafelle.
the class SherlockActionBarDrawerToggleCompat method setActionBarUpIndicator.
public static Object setActionBarUpIndicator(Object info, Activity activity, Drawable drawable, int contentDescRes) {
if (info == null) {
info = new SetIndicatorInfo(activity);
}
final SetIndicatorInfo sii = (SetIndicatorInfo) info;
if (sii.setHomeAsUpIndicator != null) {
try {
final ActionBar actionBar = ((SherlockFragmentActivity) activity).getSupportActionBar();
sii.setHomeAsUpIndicator.invoke(actionBar, drawable);
sii.setHomeActionContentDescription.invoke(actionBar, contentDescRes);
} catch (Exception e) {
Log.w(TAG, "Couldn't set home-as-up indicator via JB-MR2 API", e);
}
} else if (sii.upIndicatorView != null) {
sii.upIndicatorView.setImageDrawable(drawable);
} else {
Log.w(TAG, "Couldn't set home-as-up indicator");
}
return info;
}
Aggregations