am 8d95b500: Merge "Action bar rendering in layoutlib"
* commit '8d95b5009ce5592f55a9487536fa640724dc316b': Action bar rendering in layoutlib
This commit is contained in:
@@ -161,9 +161,11 @@ public class ShareActionProvider extends ActionProvider {
|
||||
@Override
|
||||
public View onCreateActionView() {
|
||||
// Create the view and set its data model.
|
||||
ActivityChooserModel dataModel = ActivityChooserModel.get(mContext, mShareHistoryFileName);
|
||||
ActivityChooserView activityChooserView = new ActivityChooserView(mContext);
|
||||
activityChooserView.setActivityChooserModel(dataModel);
|
||||
if (!activityChooserView.isInEditMode()) {
|
||||
ActivityChooserModel dataModel = ActivityChooserModel.get(mContext, mShareHistoryFileName);
|
||||
activityChooserView.setActivityChooserModel(dataModel);
|
||||
}
|
||||
|
||||
// Lookup and set the expand action icon.
|
||||
TypedValue outTypedValue = new TypedValue();
|
||||
|
||||
@@ -170,6 +170,15 @@ public class WindowDecorActionBar extends ActionBar {
|
||||
init(dialog.getWindow().getDecorView());
|
||||
}
|
||||
|
||||
/**
|
||||
* Only for edit mode.
|
||||
* @hide
|
||||
*/
|
||||
public WindowDecorActionBar(View layout) {
|
||||
assert layout.isInEditMode();
|
||||
init(layout);
|
||||
}
|
||||
|
||||
private void init(View decor) {
|
||||
mOverlayLayout = (ActionBarOverlayLayout) decor.findViewById(
|
||||
com.android.internal.R.id.action_bar_overlay_layout);
|
||||
@@ -559,8 +568,8 @@ public class WindowDecorActionBar extends ActionBar {
|
||||
return;
|
||||
}
|
||||
|
||||
final FragmentTransaction trans = mActivity.getFragmentManager().beginTransaction()
|
||||
.disallowAddToBackStack();
|
||||
final FragmentTransaction trans = mActionView.isInEditMode() ? null :
|
||||
mActivity.getFragmentManager().beginTransaction().disallowAddToBackStack();
|
||||
|
||||
if (mSelectedTab == tab) {
|
||||
if (mSelectedTab != null) {
|
||||
@@ -578,7 +587,7 @@ public class WindowDecorActionBar extends ActionBar {
|
||||
}
|
||||
}
|
||||
|
||||
if (!trans.isEmpty()) {
|
||||
if (trans != null && !trans.isEmpty()) {
|
||||
trans.commit();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user