Skip to content
Merged
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ ownCloud admins and users.
* Enhancement - Edit a space member: [#4724](https://github.com/owncloud/android/issues/4724)
* Enhancement - Remove a space member: [#4725](https://github.com/owncloud/android/issues/4725)
* Enhancement - Workflow to build APK: [#4751](https://github.com/owncloud/android/pull/4751)
* Enhancement - Copy permanent link of a space: [#4758](https://github.com/owncloud/android/issues/4758)
* Enhancement - Workflow to check Conventional Commits: [#4759](https://github.com/owncloud/android/pull/4759)
* Enhancement - QA Content Provider: [#4776](https://github.com/owncloud/android/pull/4776)

Expand Down Expand Up @@ -133,6 +134,14 @@ ownCloud admins and users.

https://github.com/owncloud/android/pull/4751

* Enhancement - Copy permanent link of a space: [#4758](https://github.com/owncloud/android/issues/4758)

A new option to copy and share the permanent link of a space has been added next
to the space header in the members section.

https://github.com/owncloud/android/issues/4758
https://github.com/owncloud/android/pull/4778

* Enhancement - Workflow to check Conventional Commits: [#4759](https://github.com/owncloud/android/pull/4759)

A new workflow has been added to check that commit names in a PR fits the
Expand Down
6 changes: 6 additions & 0 deletions changelog/unreleased/4778
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: Copy permanent link of a space

A new option to copy and share the permanent link of a space has been added next to the space header in the members section.

https://github.com/owncloud/android/issues/4758
https://github.com/owncloud/android/pull/4778
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ class ReleaseNotesViewModel(
subtitle = R.string.release_notes_4_8_0_subtitle_set_emoji_as_space_image,
type = ReleaseNoteType.ENHANCEMENT
),
ReleaseNote(
title = R.string.release_notes_4_8_0_title_spaces_permanent_links,
subtitle = R.string.release_notes_4_8_0_subtitle_spaces_permanent_links,
type = ReleaseNoteType.ENHANCEMENT
),
ReleaseNote(
title = R.string.release_notes_bugfixes_title,
subtitle = R.string.release_notes_bugfixes_subtitle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

package com.owncloud.android.presentation.spaces.members

import android.accounts.AccountManager
import android.content.Intent
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
Expand All @@ -29,6 +31,7 @@ import com.owncloud.android.databinding.MembersActivityBinding
import com.owncloud.android.domain.roles.model.OCRole
import com.owncloud.android.domain.spaces.model.OCSpace
import com.owncloud.android.domain.spaces.model.SpaceMember
import com.owncloud.android.presentation.common.ShareSheetHelper
import com.owncloud.android.ui.activity.FileActivity
import com.owncloud.android.utils.DisplayUtils

Expand Down Expand Up @@ -62,6 +65,10 @@ class SpaceMembersActivity: FileActivity(), SpaceMembersFragment.SpaceMemberFrag
quota.getRelative().toString())
}
}

permanentLinkButton.setOnClickListener {
copyOrSendPermanentLink(currentSpace.webUrl, currentSpace.name)
}
}

supportFragmentManager.transaction {
Expand Down Expand Up @@ -92,9 +99,32 @@ class SpaceMembersActivity: FileActivity(), SpaceMembersFragment.SpaceMemberFrag
}
}

private fun copyOrSendPermanentLink(permanentLink: String?, spaceName: String) {
permanentLink?.let {
val displayName = AccountManager.get(this).getUserData(account, KEY_DISPLAY_NAME)

val intentToSharePermanentLink = Intent(Intent.ACTION_SEND).apply {
type = TYPE_PLAIN
putExtra(Intent.EXTRA_TEXT, it)
putExtra(Intent.EXTRA_SUBJECT, getString(R.string.subject_user_shared_with_you, displayName, spaceName))
}

val shareSheetIntent = ShareSheetHelper().getShareSheetIntent(
intent = intentToSharePermanentLink,
context = this,
title = R.string.activity_chooser_title,
packagesToExclude = arrayOf(packageName)
)
startActivity(shareSheetIntent)
}
}

companion object {
private const val TAG_SPACE_MEMBERS_FRAGMENT = "SPACE_MEMBERS_FRAGMENT"
private const val TAG_ADD_MEMBER_FRAGMENT ="ADD_MEMBER_FRAGMENT"
private const val TYPE_PLAIN = "text/plain"
private const val KEY_DISPLAY_NAME = "oc_display_name"

const val EXTRA_SPACE = "EXTRA_SPACE"
}

Expand Down
18 changes: 16 additions & 2 deletions owncloudApp/src/main/res/layout/members_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

<TextView
android:id="@+id/item_name"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/standard_half_margin"
android:layout_marginStart="@dimen/standard_half_margin"
Expand All @@ -54,7 +54,8 @@
android:textColor="@color/black"
android:textSize="16sp"
app:layout_constraintStart_toEndOf="@id/item_icon"
app:layout_constraintTop_toTopOf="parent"/>
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toStartOf="@id/permanent_link_button"/>

<TextView
android:id="@+id/item_size"
Expand All @@ -67,6 +68,19 @@
app:layout_constraintStart_toEndOf="@id/item_icon"
app:layout_constraintTop_toBottomOf="@id/item_name"/>

<ImageButton
android:id="@+id/permanent_link_button"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="@dimen/standard_quarter_margin"
android:padding="@dimen/standard_half_padding"
android:src="@drawable/copy_link"
android:scaleType="centerCrop"
android:background="@color/transparent"
android:contentDescription="@string/content_description_permanent_link_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"/>

</androidx.constraintlayout.widget.ConstraintLayout>

<FrameLayout
Expand Down
4 changes: 4 additions & 0 deletions owncloudApp/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,9 @@
<string name="release_notes_4_8_0_subtitle_set_emoji_as_space_image">Infinite Scale users with right permissions can now set an emoji as space image</string>
<string name="release_notes_4_8_0_title_space_membership">Space membership</string>
<string name="release_notes_4_8_0_subtitle_space_membership">Infinite Scale users can see all members of a space and manage them with right permissions</string>
<string name="release_notes_4_8_0_title_spaces_permanent_links">Permanent links for spaces</string>
<string name="release_notes_4_8_0_subtitle_spaces_permanent_links">Infinite Scale users can now get a permanent link for a space and share it with other members</string>

<!-- Open in web -->
<string name="ic_action_open_in_web">Open in web</string>
<string name="ic_action_open_with_web">Open in %1$s (web)</string>
Expand Down Expand Up @@ -835,6 +838,7 @@
<string name="content_description_expiration_date_switch">Expiration date</string>
<string name="content_description_remove_member_button">Remove member %1$s</string>
<string name="content_description_edit_member_button">Edit member %1$s</string>
<string name="content_description_permanent_link_button">Get permanent link</string>

<string name="create_shortcut_dialog_title">Create a shortcut</string>
<string name="create_shortcut_dialog_url">URL</string>
Expand Down
Loading