Enhanced notification details.

Bug: 26919636
Change-Id: I378dc088a6b51e3b33607937c3a12e8d51a97e5e
This commit is contained in:
Dan Sandler
2016-02-14 22:17:03 -05:00
parent 0cb45a495e
commit 7a038ebb1c
4 changed files with 344 additions and 62 deletions

View File

@@ -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();
}