Android Open Source - ExampleApp Action Bar Helper From Project Back to project page ExampleApp .
License The source code is released under:
Copyright (c) 2014, Altinn
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redis...
If you think the Android project ExampleApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code package net.simonvt.menudrawer.compat;
/ * f r o m w w w . j a v a 2 s . c o m * /
import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.Log;
import java.lang.reflect.Method;
public final class ActionBarHelper {
private static final String TAG = "ActionBarHelper" ;
static final boolean DEBUG = false;
private Activity mActivity;
private Object mIndicatorInfo;
private boolean mUsesCompat;
public ActionBarHelper(Activity activity) {
mActivity = activity;
try {
Class clazz = activity.getClass();
Method m = clazz.getMethod("getSupportActionBar" );
mUsesCompat = true;
} catch (NoSuchMethodException e) {
if (DEBUG) {
Log.e(TAG,
"Activity " + activity.getClass().getSimpleName() + " does not use a compatibility action bar" ,
e);
}
}
mIndicatorInfo = getIndicatorInfo();
}
private Object getIndicatorInfo() {
if (mUsesCompat && Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
return ActionBarHelperCompat.getIndicatorInfo(mActivity);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
return ActionBarHelperNative.getIndicatorInfo(mActivity);
}
return null;
}
public void setActionBarUpIndicator(Drawable drawable, int contentDesc) {
if (mUsesCompat && Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
ActionBarHelperCompat.setActionBarUpIndicator(mIndicatorInfo, mActivity, drawable, contentDesc);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
ActionBarHelperNative.setActionBarUpIndicator(mIndicatorInfo, mActivity, drawable, contentDesc);
}
}
public void setActionBarDescription(int contentDesc) {
if (mUsesCompat && Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
ActionBarHelperCompat.setActionBarDescription(mIndicatorInfo, mActivity, contentDesc);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
ActionBarHelperNative.setActionBarDescription(mIndicatorInfo, mActivity, contentDesc);
}
}
public Drawable getThemeUpIndicator() {
if (mUsesCompat && Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
return ActionBarHelperCompat.getThemeUpIndicator(mIndicatorInfo);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
return ActionBarHelperNative.getThemeUpIndicator(mIndicatorInfo, mActivity);
}
return null;
}
public void setDisplayShowHomeAsUpEnabled(boolean enabled) {
if (mUsesCompat && Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
ActionBarHelperCompat.setDisplayHomeAsUpEnabled(mIndicatorInfo, enabled);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
ActionBarHelperNative.setDisplayHomeAsUpEnabled(mActivity, enabled);
}
}
}
Java Source Code List com.altinn.apps.fisher.AppContext.java com.altinn.apps.fisher.CacheManager.java com.altinn.apps.fisher.common.AppConstants.java com.altinn.apps.fisher.common.IStatusMessage.java com.altinn.apps.fisher.common.MenuItem.java com.altinn.apps.fisher.common.StatusMessage.java com.altinn.apps.fisher.db.DataBaseHelper.java com.altinn.apps.fisher.db.FactoryDBHelper.java com.altinn.apps.fisher.db.FishCategoryDBHelper.java com.altinn.apps.fisher.db.FormDBHelper.java com.altinn.apps.fisher.db.IDBHelper.java com.altinn.apps.fisher.db.RegsDBHelper.java com.altinn.apps.fisher.db.VesselDBHelper.java com.altinn.apps.fisher.gps.CLocationProvider.java com.altinn.apps.fisher.gps.ILocationUpdateListner.java com.altinn.apps.fisher.models.CaughtInfoData.java com.altinn.apps.fisher.models.InfoData.java com.altinn.apps.fisher.models.ReportInfoData.java com.altinn.apps.fisher.models.UserProfile.java com.altinn.apps.fisher.net.AbstractWorkerTask.java com.altinn.apps.fisher.net.CookieHelper.java com.altinn.apps.fisher.net.IParser.java com.altinn.apps.fisher.net.JSParser.java com.altinn.apps.fisher.net.ParseManager.java com.altinn.apps.fisher.net.TaskNotifier.java com.altinn.apps.fisher.net.jsobj.AttachmentObj.java com.altinn.apps.fisher.net.jsobj.FormObj.java com.altinn.apps.fisher.net.jsobj.JSConstants.java com.altinn.apps.fisher.net.jsobj.JsonObj.java com.altinn.apps.fisher.net.jsobj.LinkItemObj.java com.altinn.apps.fisher.net.jsobj.LinkObj.java com.altinn.apps.fisher.net.jsobj.MessageObj.java com.altinn.apps.fisher.net.jsobj.MessagesEmbedded.java com.altinn.apps.fisher.net.jsobj.OrganisationObj.java com.altinn.apps.fisher.net.tasks.LoginTask.java com.altinn.apps.fisher.net.tasks.RefreshTokenTask.java com.altinn.apps.fisher.net.tasks.SendReportTask.java com.altinn.apps.fisher.net.tasks.UserProfileTask.java com.altinn.apps.fisher.settings.FactoryDetails.java com.altinn.apps.fisher.settings.FishDetails.java com.altinn.apps.fisher.settings.SettingItem.java com.altinn.apps.fisher.settings.VesselsDetails.java com.altinn.apps.fisher.ui.component.DurationTimePickDialog.java com.altinn.apps.fisher.ui.component.RAutoCompleteTextView.java com.altinn.apps.fisher.ui.component.RButton.java com.altinn.apps.fisher.ui.component.REditText.java com.altinn.apps.fisher.ui.component.RTextView.java com.altinn.apps.fisher.ui.screen.BaseActivity.java com.altinn.apps.fisher.ui.screen.BrowserActivity.java com.altinn.apps.fisher.ui.screen.FactoryDetailsActivity.java com.altinn.apps.fisher.ui.screen.HomeActivity.java com.altinn.apps.fisher.ui.screen.InformationActivity.java com.altinn.apps.fisher.ui.screen.MenuNavigationActivity.java com.altinn.apps.fisher.ui.screen.ReportActivity.java com.altinn.apps.fisher.ui.screen.ReportReceivedFishActivity.java com.altinn.apps.fisher.ui.screen.ReportSendDetailActivity.java com.altinn.apps.fisher.ui.screen.SplashActivity.java com.altinn.apps.fisher.ui.screen.UserProfileActivity.java com.altinn.apps.fisher.utils.PreferenceUtils.java com.altinn.apps.fisher.utils.Utils.java net.simonvt.menudrawer.BuildLayerFrameLayout.java net.simonvt.menudrawer.ColorDrawable.java net.simonvt.menudrawer.DraggableDrawer.java net.simonvt.menudrawer.FloatScroller.java net.simonvt.menudrawer.MenuDrawer.java net.simonvt.menudrawer.NoClickThroughFrameLayout.java net.simonvt.menudrawer.OverlayDrawer.java net.simonvt.menudrawer.PeekInterpolator.java net.simonvt.menudrawer.Position.java net.simonvt.menudrawer.Scroller.java net.simonvt.menudrawer.SinusoidalInterpolator.java net.simonvt.menudrawer.SlideDrawable.java net.simonvt.menudrawer.SlidingDrawer.java net.simonvt.menudrawer.SmoothInterpolator.java net.simonvt.menudrawer.StaticDrawer.java net.simonvt.menudrawer.ViewHelper.java net.simonvt.menudrawer.compat.ActionBarHelperCompat.java net.simonvt.menudrawer.compat.ActionBarHelperNative.java net.simonvt.menudrawer.compat.ActionBarHelper.java