-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Session sharing functionality was implemented. #1029
Merged
tkhs0604
merged 11 commits into
DroidKaigi:main
from
Corvus400:feature/implement_share_function
Sep 1, 2023
+49
−4
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
01f5ac2
:sparkles: Session sharing functionality was implemented.
Corvus400 c30a9bf
:wrench: ./gradlew detekt --auto-correct
Corvus400 7cbc666
:wrench: fix test.
Corvus400 28b969c
:wrench: Modified to use co.touchlab.kermit.Logger.
Corvus400 7c41b6d
Merge branch 'main' into feature/implement_share_function
Corvus400 900303c
:wastebasket: Removed redundant interfaces.
Corvus400 109c6e1
Merge branch 'main' into feature/implement_share_function
Corvus400 66b0144
:recycle: Date added to share text.
Corvus400 19dc407
Merge branch 'main' into feature/implement_share_function
takahirom a8fda49
Revert ":recycle: Date added to share text."
Corvus400 fefd2f1
Merge branch 'main' into feature/implement_share_function
tkhs0604 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
app-android/src/main/java/io/github/droidkaigi/confsched2023/share/ShareNavigator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.github.droidkaigi.confsched2023.share | ||
|
||
import android.content.ActivityNotFoundException | ||
import android.content.Context | ||
import androidx.core.app.ShareCompat | ||
import co.touchlab.kermit.Logger | ||
|
||
class ShareNavigator(private val context: Context) { | ||
fun share(text: String) { | ||
try { | ||
ShareCompat.IntentBuilder(context) | ||
.setText(text) | ||
.setType("text/plain") | ||
.startChooser() | ||
} catch (e: ActivityNotFoundException) { | ||
Logger.e("ActivityNotFoundException Fail startActivity: $e") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding date info too? 👀
Perhaps, we are referring the formatted datetime property on the detail screen, so we may reuse it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Corvus400
Ah, sorry. My intention was to use
timetableItem.formattedDateTimeString
🙇♂️I think it is not suitable to use
getDropDownText
here since it is literally prepared for the drop down menu.On the other hand, the value of
timetableItem.formattedDateTimeString
was much longer than I originally expected. This is just an optional, so please revert it if it is difficult to add date info in a simple way 🙏There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tkhs0604
It seems that we can add a method to get only month and date by adding it to TimetableItem.kt.
However, I felt it was a bit redundant to add a method that is only used for the share function, so I decided to revert to the original method. 🙇