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

Commit 8cb5491d authored by Tony Huang's avatar Tony Huang
Browse files

Add set clickable false after clear click listener

Enter inspector activity, back to home and switch to files again.
Inspector text will become clickable.
Although it set null to click listener, it will set clickable
to true automatically. Add set clickable false after clear click
listener.

Fix: 123209419
Test: manual
Test: DocumentsUIGoogleTests
Change-Id: I8c0a41e50445744d3c2e0901f4df2658710d2164
parent e8b5fce4
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();
        }