Enhanced notification details.
Bug: 26919636 Change-Id: I378dc088a6b51e3b33607937c3a12e8d51a97e5e
This commit is contained in:
@@ -30,6 +30,10 @@ public class CopyablePreference extends Preference {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public CopyablePreference(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(PreferenceViewHolder holder) {
|
||||
super.onBindViewHolder(holder);
|
||||
@@ -45,10 +49,14 @@ public class CopyablePreference extends Preference {
|
||||
});
|
||||
}
|
||||
|
||||
public static void copyPreference(Context context, Preference pref) {
|
||||
public CharSequence getCopyableText() {
|
||||
return getSummary();
|
||||
}
|
||||
|
||||
public static void copyPreference(Context context, CopyablePreference pref) {
|
||||
ClipboardManager cm =
|
||||
(ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
cm.setText(pref.getSummary());
|
||||
cm.setText(pref.getCopyableText());
|
||||
Toast.makeText(context, com.android.internal.R.string.text_copied, Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
}
|
||||
|
Reference in New Issue
Block a user