Loading src/com/android/documentsui/inspector/KeyValueRow.java +16 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,10 @@ import android.content.res.ColorStateList; import android.content.res.Resources; import android.graphics.Paint; import android.support.annotation.Nullable; import android.text.Selection; import android.text.Spannable; import android.util.AttributeSet; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; Loading Loading @@ -62,7 +65,19 @@ public class KeyValueRow extends LinearLayout { } public void setValue(CharSequence value) { ((TextView) findViewById(R.id.table_row_value)).setText(value); TextView text = ((TextView) findViewById(R.id.table_row_value)); text.setText(value); text.setOnLongClickListener((View view) -> { CharSequence textValue = text.getText(); if (textValue instanceof Spannable) { Spannable spn = (Spannable) textValue; Selection.selectAll(spn); } // we still want the default selection arrows and menu after we specified to select // all text in the TextView. return false; }); } @Override Loading Loading
src/com/android/documentsui/inspector/KeyValueRow.java +16 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,10 @@ import android.content.res.ColorStateList; import android.content.res.Resources; import android.graphics.Paint; import android.support.annotation.Nullable; import android.text.Selection; import android.text.Spannable; import android.util.AttributeSet; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; Loading Loading @@ -62,7 +65,19 @@ public class KeyValueRow extends LinearLayout { } public void setValue(CharSequence value) { ((TextView) findViewById(R.id.table_row_value)).setText(value); TextView text = ((TextView) findViewById(R.id.table_row_value)); text.setText(value); text.setOnLongClickListener((View view) -> { CharSequence textValue = text.getText(); if (textValue instanceof Spannable) { Spannable spn = (Spannable) textValue; Selection.selectAll(spn); } // we still want the default selection arrows and menu after we specified to select // all text in the TextView. return false; }); } @Override Loading