
/*** Returns the buttons for the capsule's More panel. The IDs for extension buttons must be set within the range of [100, 200]; otherwise, the addition will be invalid.* Calling environment: Subprocess** @param builder* @return*/public abstract ArrayList<MoreItem> getMoreItems(MoreItemList.Builder builder);
@Overridepublic ArrayList<MoreItem> getMoreItems(IMiniAppContext miniAppContext, MoreItemList.Builder builder) {MoreItem item1 = new MoreItem();// Set the menu ID (required), the ID for extension buttons must be within the range of [100, 200]; otherwise, the addition will be invalid.item1.id = ShareProxyImpl.OTHER_MORE_ITEM_1;// Set the menu title (optional)item1.text = getString(miniAppContext, R.string.applet_mini_proxy_impl_other1);// Set the menu icon (optional)item1.drawable = R.mipmap.mini_demo_about;// Set the visual accessibility description (optional). Defaults to the menu title.item2.contentDescription = "Visual accessibility description for the menu";// Listen for tap eventsitem2.onClickListener = new MoreItem.MoreItemClickListener() {@Overridepublic void onClick(IMiniAppContext context, MoreItem item) {// Handle tap event}};// Adjust the order as neededbuilder.addMoreItem(item1)// Add built-in menu items as needed.addRestart(getString(miniAppContext, R.string.applet_mini_proxy_impl_restart),R.mipmap.mini_demo_restart_miniapp)// Add built-in menu items as needed.addAbout(getString(miniAppContext, R.string.applet_mini_proxy_impl_about),R.mipmap.mini_demo_about)// Add built-in menu items as needed.addSetting(getString(miniAppContext, R.string.mini_sdk_more_item_setting_0),R.drawable.mini_sdk_setting,// Set the visual accessibility description (optional). Defaults to the menu title."Mini program settings");return builder.build();}private String getString(IMiniAppContext miniAppContext, int id) {return miniAppContext.getContext().getString(id);}
Feedback