Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2a6f5ea authored by Tony Huang's avatar Tony Huang Committed by Android (Google) Code Review
Browse files

Merge "Add set clickable false after clear click listener" into qt-dev

parents 458ef104 8cb5491d
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -15,13 +15,11 @@
 */
package com.android.documentsui.inspector;

import androidx.annotation.StringRes;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Paint;
import androidx.annotation.Nullable;
import android.text.Selection;
import android.text.Spannable;
import android.util.AttributeSet;
@@ -30,6 +28,9 @@ import android.view.textclassifier.TextClassifier;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.annotation.StringRes;

import com.android.documentsui.R;

/**
@@ -87,6 +88,12 @@ public class KeyValueRow extends LinearLayout {
        });
    }

    @Override
    public boolean hasOnClickListeners() {
        TextView value = findViewById(R.id.table_row_value);
        return value.hasOnClickListeners();
    }

    @Override
    public void setOnClickListener(OnClickListener callback) {
        TextView clickable = ((TextView) findViewById(R.id.table_row_value));
@@ -107,5 +114,6 @@ public class KeyValueRow extends LinearLayout {
        }
        reset.setPaintFlags(reset.getPaintFlags() & ~Paint.UNDERLINE_TEXT_FLAG);
        reset.setOnClickListener(null);
        reset.setClickable(false);
    }
}
+3 −3
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@
 */
package com.android.documentsui.inspector;

import androidx.annotation.StringRes;
import android.content.Context;
import android.content.res.Resources;
import android.text.Selection;
@@ -28,6 +27,8 @@ import android.view.textclassifier.TextClassifier;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.StringRes;

import com.android.documentsui.R;
import com.android.documentsui.inspector.InspectorController.TableDisplay;

@@ -103,7 +104,6 @@ public class TableView extends LinearLayout implements TableDisplay {
        put(mRes.getString(keyId), value);
    }


    /**
     * Puts or updates a value in the table view.
     */
@@ -114,7 +114,7 @@ public class TableView extends LinearLayout implements TableDisplay {
            row = createKeyValueRow(this);
            row.setKey(key);
            mRows.put(key, row);
        } else {
        } else if (row.hasOnClickListeners()) {
            row.removeOnClickListener();
        }