mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-13 09:48:47 +00:00
Limit list text view so it doesn't go over number of items text
This commit is contained in:
parent
4c2fd8844d
commit
71b84a9854
@ -63,6 +63,8 @@ public class ShoppingListsAdapter extends BaseAdapter implements Requestor.Recei
|
||||
|
||||
tvListName = (TextView) convertView.findViewById(R.id.shopping_list_name);
|
||||
|
||||
tvListName.setText(curList.getName());
|
||||
|
||||
if(curList.isShared()) {
|
||||
Properties configs = new Properties();
|
||||
try {
|
||||
@ -73,8 +75,11 @@ public class ShoppingListsAdapter extends BaseAdapter implements Requestor.Recei
|
||||
requestor = new Requestor(am, configs.getProperty("apiKey"));
|
||||
requestor.getObject(Integer.toString(curList.getListID()), ListShare.class, this);
|
||||
}
|
||||
else {
|
||||
tvListName.setText(curList.getName());
|
||||
|
||||
String listText = tvListName.getText().toString();
|
||||
|
||||
if(listText.length() > 25) {
|
||||
tvListName.setText(listText.substring(0, 25) + "...");
|
||||
}
|
||||
|
||||
return convertView;
|
||||
@ -89,10 +94,16 @@ public class ShoppingListsAdapter extends BaseAdapter implements Requestor.Recei
|
||||
@Override
|
||||
public void run() {
|
||||
if(sharee.getShareWithEmail().equals(am.getEmail(requestor))) {
|
||||
tvListName.setText(curList.getName() + " (shared by me)");
|
||||
tvListName.setText(curList.getName() + " (sh. me)");
|
||||
}
|
||||
else {
|
||||
tvListName.setText(curList.getName() + " (shared by " + sharee.getShareWithEmail() + ")");
|
||||
tvListName.setText(curList.getName() + " (sh. " + sharee.getShareWithEmail() + ")");
|
||||
}
|
||||
|
||||
String listText = tvListName.getText().toString();
|
||||
|
||||
if(listText.length() > 25) {
|
||||
tvListName.setText(listText.substring(0, 25) + "...");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -70,10 +70,16 @@ public class ShoppingListsSwipeableAdapter extends BaseAdapter implements Reques
|
||||
@Override
|
||||
public void run() {
|
||||
if(sharee.getShareWithEmail().equals(am.getEmail(requestor))) {
|
||||
holder.listName.setText(curList.getName() + " (shared by me)");
|
||||
holder.listName.setText(curList.getName() + " (sh. me)");
|
||||
}
|
||||
else {
|
||||
holder.listName.setText(curList.getName() + " (shared by " + sharee.getShareWithEmail() + ")");
|
||||
holder.listName.setText(curList.getName() + " (sh. " + sharee.getShareWithEmail() + ")");
|
||||
}
|
||||
|
||||
String listText = holder.listName.getText().toString();
|
||||
|
||||
if(listText.length() > 25) {
|
||||
holder.listName.setText(listText.substring(0, 25) + "...");
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -114,11 +120,16 @@ public class ShoppingListsSwipeableAdapter extends BaseAdapter implements Reques
|
||||
// Bind the view to the unique list ID
|
||||
binderHelper.bind(holder.swipeLayout, Integer.toString(curList.getListID()));
|
||||
|
||||
holder.listName.setText(curList.getName());
|
||||
|
||||
if(curList.isShared()) {
|
||||
requestor.getObject(Integer.toString(curList.getListID()), ListShare.class, this);
|
||||
}
|
||||
else {
|
||||
holder.listName.setText(curList.getName());
|
||||
|
||||
String listText = holder.listName.getText().toString();
|
||||
|
||||
if(listText.length() > 25) {
|
||||
holder.listName.setText(listText.substring(0, 25) + "...");
|
||||
}
|
||||
|
||||
if (curList.getEntries() != null) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user