mirror of
https://github.com/etesync/android
synced 2025-01-11 08:10:58 +00:00
Move journal owner tests to the journal and make case insensitive.
This commit is contained in:
parent
b8299a81ce
commit
6ab3401bf5
@ -104,6 +104,10 @@ public class JournalModel {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isOwner(String username) {
|
||||
return (owner == null) || owner.equalsIgnoreCase(username);
|
||||
}
|
||||
}
|
||||
|
||||
@Entity
|
||||
|
@ -420,7 +420,7 @@ public class AccountActivity extends BaseActivity implements Toolbar.OnMenuItemC
|
||||
readOnly.setVisibility(journalEntity.isReadOnly() ? View.VISIBLE : View.GONE);
|
||||
|
||||
final View shared = v.findViewById(R.id.shared);
|
||||
boolean isOwner = (journalEntity.getOwner() == null) || journalEntity.getOwner().equals(account.name);
|
||||
boolean isOwner = journalEntity.isOwner(account.name);
|
||||
shared.setVisibility(isOwner ? View.GONE : View.VISIBLE);
|
||||
|
||||
return v;
|
||||
|
@ -75,7 +75,7 @@ public class ViewCollectionActivity extends BaseActivity implements Refreshable
|
||||
}
|
||||
|
||||
info = journalEntity.getInfo();
|
||||
isOwner = (journalEntity.getOwner() == null) || journalEntity.getOwner().equals(account.name);
|
||||
isOwner = journalEntity.isOwner(account.name);
|
||||
|
||||
final View colorSquare = findViewById(R.id.color);
|
||||
if (info.type == CollectionInfo.Type.CALENDAR) {
|
||||
@ -97,7 +97,7 @@ public class ViewCollectionActivity extends BaseActivity implements Refreshable
|
||||
desc.setText(info.description);
|
||||
|
||||
final TextView owner = (TextView) findViewById(R.id.owner);
|
||||
if (account.name.equals(journalEntity.getOwner())) {
|
||||
if (isOwner) {
|
||||
owner.setVisibility(View.GONE);
|
||||
} else {
|
||||
owner.setVisibility(View.VISIBLE);
|
||||
|
Loading…
Reference in New Issue
Block a user