forked from extern/Unexpected-Keyboard
clipboard: Allow removing history entries
This commit is contained in:
parent
3b2fad8996
commit
461f966e6e
@ -3,5 +3,6 @@
|
|||||||
<TextView android:id="@+id/clipboard_entry_text" style="@style/clipboardEntry"/>
|
<TextView android:id="@+id/clipboard_entry_text" style="@style/clipboardEntry"/>
|
||||||
<LinearLayout style="@style/clipboardEntryButtons">
|
<LinearLayout style="@style/clipboardEntryButtons">
|
||||||
<View android:id="@+id/clipboard_entry_addpin" style="@style/clipboardEntryButton" android:background="@android:drawable/ic_menu_add"/>
|
<View android:id="@+id/clipboard_entry_addpin" style="@style/clipboardEntryButton" android:background="@android:drawable/ic_menu_add"/>
|
||||||
|
<View android:id="@+id/clipboard_entry_removehist" style="@style/clipboardEntryButton" android:background="@android:drawable/ic_menu_delete"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -41,6 +41,12 @@ public final class ClipboardHistoryView extends NonScrollListView
|
|||||||
_service.remove_history_entry(clip);
|
_service.remove_history_entry(clip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** The history entry at index [pos] is removed from the history. */
|
||||||
|
public void remove_entry(int pos)
|
||||||
|
{
|
||||||
|
_service.remove_history_entry(_history.get(pos));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void on_clipboard_history_change()
|
public void on_clipboard_history_change()
|
||||||
{
|
{
|
||||||
@ -85,6 +91,12 @@ public final class ClipboardHistoryView extends NonScrollListView
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) { pin_entry(pos); }
|
public void onClick(View v) { pin_entry(pos); }
|
||||||
});
|
});
|
||||||
|
v.findViewById(R.id.clipboard_entry_removehist).setOnClickListener(
|
||||||
|
new View.OnClickListener()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) { remove_entry(pos); }
|
||||||
|
});
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user