gpt4 book ai didi

android - Google Play 游戏服务 : invite player dialog lacks search by name

转载 作者:行者123 更新时间:2023-11-29 01:52:14 24 4
gpt4 key购买 nike

我正在使用 Google Play 游戏服务 API (GamesClient.getSelectPlayersIntent) 提供的常用“选择玩家”对话框。

对话很棒,但它缺少一个非常重要的功能:我无法通过名字搜索 friend /对手,因此我不得不盯着我圈子里无穷无尽的人名单。

也许我遗漏了明显的东西,但我找不到任何搜索功能。没有菜单项,没有文本输入字段...是否有一些未记录的 intent extras 参数用于启用该功能?还是我必须创建自己的带有搜索功能的对话框?

是否有允许这种搜索的替代对话框?

最佳答案

如果你看这里GGS demo page你会看到

You can use the built-in player picker UI provided by game services or implement your own custom UI. To launch the built-in player picker UI, use the Intent returned by GamesClient.getSelectPlayersIntent():

在此处查看 GamesClient 文档 Google GamesClient documentation , 你需要利用

public void loadInvitablePlayers (OnPlayersLoadedListener listener, int pageSize, boolean forceReload)

Load the initial page of players the currently signed-in player can invite to a multiplayer game, sorted alphabetically by name.

The result is delivered to the given listener on the main thread. If disconnect() is called before the result is ready it will not be delivered. Parameters listener the listener that is called when the load is complete. The listener is called on the main thread. pageSize the number of entries to request for this initial page. Note that if cached data already exists, the returned buffer may contain more than this size, but it is guaranteed to contain at least this many if the collection contains enough records. This must be a value between 1 and 25. forceReload If true, this call will clear any locally cached data and attempt to fetch the latest data from the server. This would commonly be used for something like a user-initiated refresh. Normally, this should be set to false to gain advantages of data caching.

然后决定您希望 UI 如何与监听器中返回的 PlayerBuffer 对象一起工作。

关于android - Google Play 游戏服务 : invite player dialog lacks search by name,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17202416/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com