Bug 884566: Don't show default activity until some activity is choosen for first time in QuickShare. [r=mfinkle]

--HG--
extra : rebase_source : 4ede125667edcbed18559f3346ee559f5d5cb7bc
This commit is contained in:
Sriram Ramasubramanian 2013-06-24 15:49:16 -07:00
parent 3770ebc0f1
commit dd1b6d573a
3 changed files with 13 additions and 5 deletions

View File

@ -89,6 +89,11 @@ public class MenuItemActionView extends LinearLayout
}
public void setActionButton(Drawable drawable) {
mActionButton.setImageDrawable(drawable);
if (drawable != null) {
mActionButton.setImageDrawable(drawable);
mActionButton.setVisibility(View.VISIBLE);
} else {
mActionButton.setVisibility(View.GONE);
}
}
}

View File

@ -21,6 +21,7 @@
android:paddingBottom="8dip"
android:scaleType="centerInside"
android:background="@drawable/action_bar_button"
android:layout_gravity="center_vertical"/>
android:layout_gravity="center_vertical"
android:visibility="gone"/>
</merge>

View File

@ -53,9 +53,11 @@ public class GeckoActionProvider extends ActionProvider {
MenuItemActionView view = new MenuItemActionView(mContext, null);
view.setActionButtonClickListener(mCallbacks);
PackageManager packageManager = mContext.getPackageManager();
ResolveInfo defaultActivity = dataModel.getDefaultActivity();
view.setActionButton(defaultActivity == null ? null : defaultActivity.loadIcon(packageManager));
if (dataModel.getHistorySize() > 0) {
PackageManager packageManager = mContext.getPackageManager();
ResolveInfo defaultActivity = dataModel.getDefaultActivity();
view.setActionButton(defaultActivity == null ? null : defaultActivity.loadIcon(packageManager));
}
return view;
}