我正在考虑使用 ActionbarSherlock,但有一个让我望而却步的查询。
所以我的应用程序需要完全向后兼容 API Level 7。
我需要在我的应用程序中实现新的 Google 地图,为此我需要使用 SupportMapFragment 类。
** 我的问题 **
是否可以同时使用该SupportMapFragment
课程ActionBarSherlock
?
提前致谢
编辑
我已经下载并查看了库。我可以看到的对扩展的唯一更改Fragments
非常简单,并且对所有更改都相同。
你认为我可以自己添加支持吗?
以下是它们的支持方式。
package com.actionbarsherlock.app;
import android.app.Activity;
import android.support.v4.app.DialogFragment;
import com.actionbarsherlock.internal.view.menu.MenuItemWrapper;
import com.actionbarsherlock.internal.view.menu.MenuWrapper;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import static com.actionbarsherlock.app.SherlockFragmentActivity.OnCreateOptionsMenuListener;
import static com.actionbarsherlock.app.SherlockFragmentActivity.OnOptionsItemSelectedListener;
import static com.actionbarsherlock.app.SherlockFragmentActivity.OnPrepareOptionsMenuListener;
public class SherlockDialogFragment extends DialogFragment implements OnCreateOptionsMenuListener, OnPrepareOptionsMenuListener, OnOptionsItemSelectedListener {
private SherlockFragmentActivity mActivity;
public SherlockFragmentActivity getSherlockActivity() {
return mActivity;
}
@Override
public void onAttach(Activity activity) {
if (!(activity instanceof SherlockFragmentActivity)) {
throw new IllegalStateException(getClass().getSimpleName() + " must be attached to a SherlockFragmentActivity.");
}
mActivity = (SherlockFragmentActivity)activity;
super.onAttach(activity);
}
@Override
public void onDetach() {
mActivity = null;
super.onDetach();
}
@Override
public final void onCreateOptionsMenu(android.view.Menu menu, android.view.MenuInflater inflater) {
onCreateOptionsMenu(new MenuWrapper(menu), mActivity.getSupportMenuInflater());
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
//Nothing to see here.
}
@Override
public final void onPrepareOptionsMenu(android.view.Menu menu) {
onPrepareOptionsMenu(new MenuWrapper(menu));
}
@Override
public void onPrepareOptionsMenu(Menu menu) {
//Nothing to see here.
}
@Override
public final boolean onOptionsItemSelected(android.view.MenuItem item) {
return onOptionsItemSelected(new MenuItemWrapper(item));
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
//Nothing to see here.
return false;
}
}