react-native-navigation的迁移库

BaseTitleBarButtonParams.java 944B

12345678910111213141516171819202122232425262728293031323334
  1. package com.reactnativenavigation.params;
  2. import android.graphics.drawable.Drawable;
  3. import android.view.MenuItem;
  4. public class BaseTitleBarButtonParams {
  5. public enum ShowAsAction {
  6. IfRoom(MenuItem.SHOW_AS_ACTION_IF_ROOM),
  7. Always(MenuItem.SHOW_AS_ACTION_ALWAYS),
  8. Never(MenuItem.SHOW_AS_ACTION_NEVER),
  9. WithText(MenuItem.SHOW_AS_ACTION_WITH_TEXT);
  10. public final int action;
  11. ShowAsAction(int action) {
  12. this.action = action;
  13. }
  14. }
  15. public String eventId;
  16. public String label;
  17. public Drawable icon;
  18. public StyleParams.Color color;
  19. public StyleParams.Color disabledColor;
  20. public ShowAsAction showAsAction;
  21. public boolean enabled = true;
  22. public void setColorFromScreenStyle(StyleParams.Color titleBarButtonColor) {
  23. if (!color.hasColor() && titleBarButtonColor.hasColor()) {
  24. color = titleBarButtonColor;
  25. }
  26. }
  27. }