Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions res/layout/clipboard_history_entry.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content">
<TextView android:id="@+id/clipboard_entry_text" style="@style/clipboardEntry"/>
<LinearLayout style="@style/clipboardEntryButtons">
<View android:id="@+id/clipboard_entry_paste" style="@style/clipboardEntryButton" android:background="@drawable/ic_clipboard_paste"/>
<View android:id="@+id/clipboard_entry_addpin" style="@style/clipboardEntryButton" android:background="@drawable/ic_clipboard_save"/>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:orientation="horizontal">
<TextView
android:id="@+id/clipboard_entry_text_sno" style="@style/clipboardEntry"
android:layout_width="wrap_content" android:layout_height="match_parent"
android:gravity="center_vertical" android:maxLines="1" />
<TextView
android:id="@+id/clipboard_entry_text" style="@style/clipboardEntry"
android:layout_width="0dp" android:layout_weight="150"
android:background="@drawable/rounded_corner" android:backgroundTint="#19FFEB3B"
android:maxLines="3" />
<LinearLayout style="@style/clipboardEntryButtons">
<View android:id="@+id/clipboard_entry_addpin" style="@style/clipboardEntryButton"
android:background="@drawable/ic_clipboard_save" />
</LinearLayout>
</LinearLayout>
21 changes: 15 additions & 6 deletions res/layout/clipboard_pin_entry.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content">
<TextView android:id="@+id/clipboard_pin_text" style="@style/clipboardEntry" android:maxLines="3"/>
<LinearLayout style="@style/clipboardEntryButtons">
<View android:id="@+id/clipboard_pin_paste" style="@style/clipboardEntryButton" android:background="@drawable/ic_clipboard_paste"/>
<View android:id="@+id/clipboard_pin_remove" style="@style/clipboardEntryButton" android:background="@drawable/ic_delete"/>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView android:id="@+id/clipboard_pin_text_sno" style="@style/clipboardEntry"
android:layout_width="wrap_content" android:layout_height="match_parent"
android:gravity="center_vertical" android:maxLines="1" />
<TextView android:id="@+id/clipboard_pin_text" style="@style/clipboardEntry"
android:layout_width="0dp" android:layout_weight="150"
android:background="@drawable/rounded_corner"
android:backgroundTint="#19FFFFFF" android:maxLines="3"
android:padding="5dp" />
Comment on lines +8 to +12

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of the new attributes are duplicated in clipboard_history_entry.xml. Can you move them to the clipboardEntry style in res/values/styles.xml

<LinearLayout style="@style/clipboardEntryButtons">
<View android:id="@+id/clipboard_pin_remove" style="@style/clipboardEntryButton"
android:background="@drawable/ic_delete" />
</LinearLayout>
</LinearLayout>
5 changes: 5 additions & 0 deletions src/main/res/drawable/rounded_corner.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not the right place. The resources are in res/.
Also I prefer that the name refer to what its used for instead of what it does at the moment, for example clipboard_item_background.

<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<padding android:left="5dp" android:right="5dp" android:bottom="5dp" android:top="5dp" />
<corners android:radius="5dp" />
</shape>
40 changes: 12 additions & 28 deletions srcs/juloo.keyboard2/ClipboardHistoryView.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,40 +85,24 @@ public View getView(final int pos, View v, ViewGroup _parent)
{
if (v == null)
v = View.inflate(getContext(), R.layout.clipboard_history_entry, null);
((TextView)v.findViewById(R.id.clipboard_entry_text))
.setText(_history.get(pos));
String sno = Integer.toString(pos+1) + ".";
((TextView)v.findViewById(R.id.clipboard_entry_text_sno))
.setText(sno);
TextView text_view = v.findViewById(R.id.clipboard_entry_text);
text_view.setText(_history.get(pos));
text_view.setOnClickListener(
new View.OnClickListener(){
@Override
public void onClick(View v){paste_entry(pos);}
}
);

v.findViewById(R.id.clipboard_entry_addpin).setOnClickListener(
new View.OnClickListener()
{
@Override
public void onClick(View v) { pin_entry(pos); }
});
v.findViewById(R.id.clipboard_entry_paste).setOnClickListener(
new View.OnClickListener()
{
@Override
public void onClick(View v) { paste_entry(pos); }
});
// v.findViewById(R.id.clipboard_entry_removehist).setOnClickListener(
// new View.OnClickListener()
// {
// @Override
// public void onClick(View v)
// {
// AlertDialog d = new AlertDialog.Builder(getContext())
// .setTitle(R.string.clipboard_remove_confirm)
// .setPositiveButton(R.string.clipboard_remove_confirmed,
// new DialogInterface.OnClickListener(){
// public void onClick(DialogInterface _dialog, int _which)
// {
// _service.remove_history_entry(_history.get(pos));
// }
// })
// .setNegativeButton(android.R.string.cancel, null)
// .create();
// Utils.show_dialog_on_ime(d, v.getWindowToken());
// }
// });
return v;
}
}
Expand Down
19 changes: 11 additions & 8 deletions srcs/juloo.keyboard2/ClipboardPinView.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,17 @@ public View getView(final int pos, View v, ViewGroup _parent)
{
if (v == null)
v = View.inflate(getContext(), R.layout.clipboard_pin_entry, null);
((TextView)v.findViewById(R.id.clipboard_pin_text))
.setText(_entries.get(pos));
v.findViewById(R.id.clipboard_pin_paste).setOnClickListener(
new View.OnClickListener()
{
@Override
public void onClick(View v) { paste_entry(pos); }
});
String sno = Integer.toString(pos+1) + ".";
((TextView)v.findViewById(R.id.clipboard_pin_text_sno))
.setText(sno);
TextView text_view = v.findViewById(R.id.clipboard_pin_text);
text_view.setText(_entries.get(pos));
text_view.setOnClickListener(
new View.OnClickListener(){
@Override
public void onClick(View v){paste_entry(pos);}
}
);
v.findViewById(R.id.clipboard_pin_remove).setOnClickListener(
new View.OnClickListener()
{
Expand Down
Loading