private static final String SHARE_TWITTER = "twitter";
/**
* Return a custom shared data map.
* Operating Environment: Subprocess
*
* Key: Consistent with the MoreItem.id added in the getMoreItems method.
* Value: Consistent with the MoreItem.shareKey added in the getMoreItems method.
* @return
*/
@Override
public Map<String, Integer> getCustomShare(){
Map<String, Integer> objects = new HashMap<>();
objects.put(SHARE_TWITTER, ShareProxyImpl.OTHER_MORE_ITEM_2);
return objects;
}
/**
* Return the buttons for the capsule's extended panel. The ID of the extended button must be set within the range of [100, 200], otherwise, the addition will be invalid.
* Operating Environment: Subprocess
*
* @param miniAppContext - The operating environment of the mini program (mini program process, not the main process)
* @param builder
* @return
*/
@Override
public ArrayList<MoreItem> getMoreItems(IMiniAppContext miniAppContext, MoreItemList.Builder builder) {
MoreItem item2 = new MoreItem();
item2.id = ShareProxyImpl.OTHER_MORE_ITEM_2;
item2.text = getString(miniAppContext,
R.string.applet_mini_proxy_impl_other2);
item2.shareKey = SHARE_TWITTER; // The key for custom sharing, which must be set and unique, and will be used when the Mini Program end calls for control settings.
item2.drawable = R.mipmap.mini_demo_about;
builder.addMoreItem(item2)
return builder.build();
}
Was this page helpful?