问题标签 [recycleview]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
12 浏览

java - 在 Android Studio 中的 ArrayList 中的特定项目上 onCkick 后访问特定活动

我有一个名称数组,可以通过单击它来查看特定名称信息,但是我想打开与我通过在该选定名称 XML 中找到的按钮单击的特定名称相对应的不同活动。我有一个名称数组,可以通过单击它来查看特定名称信息,但是我想打开与我通过在该选定名称 XML 中找到的按钮单击的特定名称相对应的不同活动。

0 投票
0 回答
24 浏览

java - android RecycleView 如何更快地加载内容?

我正在使用带有 volley HTTP 库的 android 回收视图,但无法以适当的速度加载到 android 中。我在下面提交了一些示例代码。

subCategoryrecycleview = findViewById(R.id.subCategoryrecycleview);

subCategoryrecycleview.setLayoutManager(new GridLayoutManager(getContext(), Constant.GRIDCOLUMN));

0 投票
0 回答
13 浏览

android - 如何仅在 ItemBodym 中交替更改颜色,而不使用 ItemHead?

我的 RecycleView 中有 item_history,我想在我的 Adapter(RecycleView) 中改变它们的颜色,比如

  1. 一白
  2. 一灰
  3. 一白
  4. 一灰
  5. 一白
  6. 一灰
  7. 一白

但也有 item_history_head (日期),当我使用

它也计算 item_history_head 。你可以看到它 在这里计算它们图片

我的代码:

0 投票
0 回答
35 浏览

kotlin - RecycleView KOTLIN 中的 ViewModel 实例无法创建 VIEWMODAL 实例

我试图创建一个包含国家列表的视图模型。View 模态类如下所示:

函数 openCountriesFile 将只解析包含 Country 的 XML 文件并将其保存在 ModelView 内的 MutableLiveData 对象中。

稍后我想使用 Fragment 来观察更改的数据:此 Fragment 将使用我创建的 Adapter 并使用国家数据填充 Fragment。

该片段将如下所示:

我会观察是否有一个国家被点击,如果有,我想移动到我的另一个片段以获取更多详细信息。

我的适配器看起来像这样:

目标是如果用户单击 RecyclyView (OnClickListener) 中的一个国家/地区,那么我想移至第二个片段。

我有一个错误将创建 viewModal 实例,错误是:

无法创建 com.example.Country_ViewModel 类的实例

这是为什么?我初始化错了什么?

我应该在哪里创建 ViewModal 的实例?在适配器内部还是在片段本身内部?(可以将 viewModal 实例传递给适配器吗?或者还有另一种方法可以观察 CountryArray 的变化?)

谢谢你。

0 投票
1 回答
35 浏览

python - 如何访问回收视图的单击按钮?

初学者在这里。

我不完全确定下面代码中的所有内容是否正确,但它似乎可以调整由 recycleview 创建的按钮的大小,以适应每个按钮的文本。

问题: 如何在 on_release_m 方法中访问(暂时打印)单击按钮的 ID?

谢谢你的时间!

0 投票
0 回答
51 浏览

python - recycleview 创建的按钮的大小如何适应每个按钮的文本?

很抱歉在我之前的帖子中有部分错误(约翰安德森正确解决了这个问题(谢谢!))。

预期行为: 下面的代码应该使recycleview创建的按钮的大小适应每个按钮的文本。

现实生活中的行为: 在按钮七 (7) 之后滚动,使下一个按钮跳跃。请慢慢滚动,让字体大一些,效果更明显。

问题: 这是正常行为,也许是错误?还是代码错了?如果无法修复,我不应该开始我想到的项目。

谢谢一百万,对不起,即使您有解决方案,我也无法投票给您,因为我是论坛的新手!

编辑: 这可能有点接近问题的解决方法吗?你能帮我改进一下吗?我试图根据其文本长度、字数和字体大小以及一个真正的基本方程来计算每个按钮的正确高度。

编辑2: 我发现这篇文章可能是一个解决方案,但我不知道如何在我的示例中实现它:https ://gist.github.com/tito/4201bc10d9752eb2762d31ce8fb699b6

0 投票
1 回答
23 浏览

android - 在线订单回收视图中的倒数计时器

嗨, 我的食品订单应用程序有问题我想在我的 recyclew 视图中创建 countdouwn 计时器取决于开始订单时间并在 2 分钟后完成,完成后取消订单......问题是 1 - 如何每个订单都有从开始订单到 2 分钟的不同计时器 2 - 即使应用程序关闭,订单计时器如何仍然工作,如果应用程序未打开,则自动取消订单......

我正在尽一切努力做到这一点,但我提交了...

我正在阅读有关如何在后台运行 countdouwn 并阅读有关如何在 recyclew 中显示 countdouwn 计时器的信息但无法找到我的案例的解决方案...

任何帮助请...

0 投票
1 回答
49 浏览

kotlin - 如何在arraylist中获取计数值 for kotlin, if value in same array list will still count 1?

i want to get the count value of one of the children of arrayString . so i have Arraylist <resistance?>(), which contains {name, room_block, reg

i want to get the count value of one of the children of arrayString . so i have Arraylist <resistance?>(), which contains {name, room_block, registration number} let's say the values

  1. {Faisal, A-1, 628345}
  2. {Agun, A-1, 932983}
  3. {Jefri, B-1, 7820179}

then I want to get the count value from Room_Block so that it will return the value.

Number of Rooms = 2, namely A-1 and B-1

this is my temporary code which is false

this is my Arraylist value form

this is the code where i get the data Arraylist<Prisoner?>() and this my code in adapter recycleview :


Load dynamic objects from application.properties in Spring Boot

I currently have a microservice in Spring Boot, where I have some properties stored in application.properties. Right now, it is configured for one store only. But I want to change the logic so that stores can be added dynamically without needing to change any code.

I have created a model java class for a store, and it looks like this:

My application.properties looks like this today:

But I want to be able to specify which store it is, and be able to add more stores by just adding them into the application.properties, like this:

Then add this into some hashmap, and be able to check for and retrieve the variables for a specific store from any of my other classes.

For this, I have tried the following:

But getStore only returns null, and even if I check stores.size it is 0. So where am I doing wrong, and how can I do this effectively? I have thought about just skipping the crap and just making a folder called "stores" and put json files in it, and read from there. So that each Store is just a json file, so at startup the app scans the folder and for every json file makes a Store object. But I don't know if that is a good solution. This is my first time working with Spring Boot. Thanks for any help!

0 投票
1 回答
48 浏览

python - Kivy recycleview 滚动不顺畅

我正在使用kivy2.0.0开发音乐播放器移动应用程序,在应用程序中有一个播放列表屏幕,其中包含 100多个名为“ MusicListItem ”的mdboxlayout小部件。

我的应用程序有这两个问题:

  1. 滚动部分滚动不流畅,有时在android设备上滚动时会选择一些东西
  2. 当我选择一个特定的项目时,我想要一个要调用的函数并将该选定项目的 MDIconButton 的图标更改为“暂停”。

这是我的 .py 文件

.kv 文件

请任何帮助表示赞赏

0 投票
1 回答
45 浏览

python - 如何在kivy recycleview中只选择一个按钮

我正在使用 kivy recycleview 创建一个 mp3 播放器,该应用程序在播放列表屏幕中有很多按钮,每当您单击一个按钮时,该按钮的图标就会从“播放”变为“暂停”,反之亦然。

我想知道如何使它成为单击另一个按钮将所有其他按钮图标更改为“播放”的方式,只有选定的按钮应该带有“暂停”图标。

.py 文件:

.kv 文件:

谢谢