1
0
mirror of https://github.com/etesync/android synced 2025-01-11 08:10:58 +00:00

ViewCollection: list the journal's owner if it's not owned by us.

This commit is contained in:
Tom Hacohen 2017-04-20 20:10:43 +01:00
parent 348e24c3e3
commit 0bade21aae
3 changed files with 16 additions and 3 deletions

View File

@ -29,8 +29,6 @@ import com.etesync.syncadapter.R;
import com.etesync.syncadapter.model.CollectionInfo; import com.etesync.syncadapter.model.CollectionInfo;
import com.etesync.syncadapter.model.EntryEntity; import com.etesync.syncadapter.model.EntryEntity;
import com.etesync.syncadapter.model.JournalEntity; import com.etesync.syncadapter.model.JournalEntity;
import com.etesync.syncadapter.model.JournalModel;
import com.etesync.syncadapter.model.ServiceEntity;
import com.etesync.syncadapter.resource.LocalAddressBook; import com.etesync.syncadapter.resource.LocalAddressBook;
import com.etesync.syncadapter.resource.LocalCalendar; import com.etesync.syncadapter.resource.LocalCalendar;
import com.etesync.syncadapter.ui.importlocal.ImportActivity; import com.etesync.syncadapter.ui.importlocal.ImportActivity;
@ -96,6 +94,13 @@ public class ViewCollectionActivity extends AppCompatActivity implements Refresh
final TextView desc = (TextView) findViewById(R.id.description); final TextView desc = (TextView) findViewById(R.id.description);
desc.setText(info.description); desc.setText(info.description);
final TextView owner = (TextView) findViewById(R.id.owner);
if (account.name.equals(journalEntity.getOwner())) {
owner.setVisibility(View.GONE);
} else {
owner.setText(getString(R.string.account_owner, journalEntity.getOwner()));
}
} }
@Override @Override

View File

@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
@ -32,5 +33,11 @@
android:id="@+id/description" android:id="@+id/description"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="16dp" /> tools:text="Description" />
<TextView
android:id="@+id/owner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="Owner: some@email.com"/>
</LinearLayout> </LinearLayout>

View File

@ -103,6 +103,7 @@
<!-- ViewCollection --> <!-- ViewCollection -->
<string name="change_journal_title">Change Journal</string> <string name="change_journal_title">Change Journal</string>
<string name="account_showcase_import">In order to import contacts and calendars into EteSync, you need to click on the menu, and choose \"Import\".</string> <string name="account_showcase_import">In order to import contacts and calendars into EteSync, you need to click on the menu, and choose \"Import\".</string>
<string name="account_owner">Owner: %s</string>
<string name="members_owner_only">Only the owner of this collection (%s) is allowed to view its members.</string> <string name="members_owner_only">Only the owner of this collection (%s) is allowed to view its members.</string>
<string name="not_allowed_title">Not Allowed</string> <string name="not_allowed_title">Not Allowed</string>
<string name="edit_owner_only">Only the owner of this collection (%s) is allowed to edit it.</string> <string name="edit_owner_only">Only the owner of this collection (%s) is allowed to edit it.</string>