小编Ahs*_*fiq的帖子

将 RecyclerView 可见性从 Gone 更改为 Visible,在显示新添加的项目之前,会暂时错误地显示先前删除的项目

背景/背景:

在我的主要活动中,我有一个选项卡布局有两个选项卡。每个选项卡包含两个片段,SearchVehicleFragment 和 VehicleListFragment。

以下是 VehicleListFragment 的布局文件。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context=".ui.fragments.VehicleListFragment"
    android:orientation="vertical">


    <com.boulevardclan.vvp.ui.recyclerviews.VehicleRecyclerView
        android:id="@+id/rvVehicleList"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <TextView
        android:id="@+id/tvNoSearchedVehicles"
        style="?android:attr/textAppearanceMedium"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        android:gravity="center"
        android:text="You haven't searched for any vehicles yet." />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

我的 VehicleRecyclerView 的创建与此处提供的 AttractionsRecyclerView 完全一样。这是因为我想为我的 VehicleRecyclerView 实现空状态机制。此外,在初始化期间,我的 VehicleRecyclerView 有setHasFixedSize(true)

public class VehicleRecyclerView extends RecyclerView {
    private View mEmptyView;

    public VehicleRecyclerView(Context context) {
        super(context);
    }

    private AdapterDataObserver mDataObserver = new AdapterDataObserver() {
        @Override
        public void onChanged() {
            super.onChanged();
            updateEmptyView();
        }

        @Override
        public void …
Run Code Online (Sandbox Code Playgroud)

android visibility android-recyclerview

9
推荐指数
1
解决办法
1950
查看次数

在由 prometheus-operator helm 图表设置的 Kubernetes 集群上更新 Prometheus 安装的规则和配置的正确方法?

我已经通过 Helm Chart 配置了 Prometheus https://github.com/helm/charts/tree/master/stable/prometheus-operator 我需要动态更新 Prometheus 规则和配置(热重载),但由于某种原因,它是不工作。

我尝试编辑 Prometheus 规则的 cofigmap,但一旦保存更改,更改就会恢复。我尝试删除 Prometheus 配置映射,它会立即重新生成。我还尝试删除 Prometheus pod 本身,但它也会立即重新创建。

如果自定义控制器和 CRD 是其背后的原因(即拒绝更改),那么执行此操作的正确方法是什么?

prometheus prometheus-operator

6
推荐指数
1
解决办法
7232
查看次数