mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-29 21:25:35 +00:00
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:
parent
3770ebc0f1
commit
dd1b6d573a
@ -89,6 +89,11 @@ public class MenuItemActionView extends LinearLayout
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setActionButton(Drawable drawable) {
|
public void setActionButton(Drawable drawable) {
|
||||||
|
if (drawable != null) {
|
||||||
mActionButton.setImageDrawable(drawable);
|
mActionButton.setImageDrawable(drawable);
|
||||||
|
mActionButton.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
mActionButton.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
android:paddingBottom="8dip"
|
android:paddingBottom="8dip"
|
||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:background="@drawable/action_bar_button"
|
android:background="@drawable/action_bar_button"
|
||||||
android:layout_gravity="center_vertical"/>
|
android:layout_gravity="center_vertical"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
</merge>
|
</merge>
|
||||||
|
@ -53,9 +53,11 @@ public class GeckoActionProvider extends ActionProvider {
|
|||||||
MenuItemActionView view = new MenuItemActionView(mContext, null);
|
MenuItemActionView view = new MenuItemActionView(mContext, null);
|
||||||
view.setActionButtonClickListener(mCallbacks);
|
view.setActionButtonClickListener(mCallbacks);
|
||||||
|
|
||||||
|
if (dataModel.getHistorySize() > 0) {
|
||||||
PackageManager packageManager = mContext.getPackageManager();
|
PackageManager packageManager = mContext.getPackageManager();
|
||||||
ResolveInfo defaultActivity = dataModel.getDefaultActivity();
|
ResolveInfo defaultActivity = dataModel.getDefaultActivity();
|
||||||
view.setActionButton(defaultActivity == null ? null : defaultActivity.loadIcon(packageManager));
|
view.setActionButton(defaultActivity == null ? null : defaultActivity.loadIcon(packageManager));
|
||||||
|
}
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user