-
Notifications
You must be signed in to change notification settings - Fork 36
Conversation
It's also somewhat problematic to provide affected thread links for scrolling bug since it seems to be pretty much poorly reproducible. I have some links saved, but they works ok now. I'm not really sure now is this the same bug as the one happening on selftext selection attempts |
Also selftext view scrolls to its beginning when clicked. I haven't yet checked where even this handler is, but it's probably conflicts with selection too |
Test version of Dank has been automatically built from this pull request. |
You could identify the selectable title by reading spans: val voteSpan = title.getSpans(0, title.length, ForegroundSpan::class.java).first()
val selectableTitle = title.substring(voteSpan.start, title.length) Obviously this can fail in the future because it assumes there's only one Truss titleBuilder = new Truss();
+titleBuilder.pushSpan(new VoteCountSpan())
titleBuilder.pushSpan(new ForegroundColorSpan(ContextCompat.getColor(c, Themes.voteColor(voteDirection))));
titleBuilder.append(Strings.abbreviateScore(submissionScore));
titleBuilder.popSpan();
+titleBuilder.popSpan();
titleBuilder.append(" ");
titleBuilder.append(Html.fromHtml(submission.getTitle())); val voteSpan = title.getSpans(0, title.length, VoteCountSpan::class.java).first()
val selectableTitle = title.substring(voteSpan.start, title.length) |
The problem is rather that selection within single TextView can't be limited to some range in an obvious way, so user can freely select anything in it: I think this is somewhat possible but probably will be extremely buggy. Like listening to touch events or override |
You can't have multiline titles with two TextViews that wrap around the
vote count (without a lot of pain). I wouldn't have used a span otherwise.
What do you think of listening to copy actions and replacing the clipboard
content with text that doesn't include the vote? See `TextView#setCustomSelectionActionModeCallback()`.
…On Wed, Apr 29, 2020, 5:43 PM AbsurdlySuspicious ***@***.***> wrote:
The problem is rather that selection within single TextView can't be
limited to some range in an obvious way, so user can freely select anything
in it:
[image: Screenshot_20200430-003036_1]
<https://user-images.githubusercontent.com/46577212/80649442-aeb59380-8a7a-11ea-999b-e8541d8a48a7.jpg>
I think this is somewhat possible but probably will be extremely buggy.
Like listening to touch events or override onSelectionChange and reset
the selection or something like that. Splitting this textview in two would
be easier and more smooth than this
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#178 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AASG5YEMRMIFQECKQL6TVRDRPCNRFANCNFSM4MTEZFZQ>
.
|
I've got some nice results. Check this out: #182 |
739cc86
to
5ee6422
Compare
I've got this to work normally with this workaround in second commit. Any selectable TextView that gains focus causes RecyclerView to scroll in it's direction. Automatic scroll on tap isn't really harmful but focus gained due to selection causes RV to scroll pretty much randomly and completely messes up selection if TextView doesn't fit on screen. You can see example of this on second gif in #177. Anyway, long selftexts and comments can be selected without any problems now. Scrolls on reply and comment collapsing both still works and aren't affected by this fix. |
@@ -278,6 +282,32 @@ public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State | |||
linearSmoothScroller.setTargetPosition(position); | |||
startSmoothScroll(linearSmoothScroller); | |||
} | |||
|
|||
// Workaround to keep arrow keys navigation working |
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.
I haven't actually tested this since I've got no working OTG cable. Arrow navigation aside, two methods below can be effectively replaced by just return false
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.
Do you think that this is something we should worry about? I've actually never used arrow navigation myself so have no idea how that would affect 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.
Well, keyboards and stuff. Dawn already uses some rather heavy UI mods so I wouldn't be surprised if it's already broken. Then I just cover these methods with false?
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.
Let’s keep it. Seems good enough as is for me.
5ee6422
to
af7e19c
Compare
af7e19c
to
0186421
Compare
Please add change-log entry. |
sorry, forgot that |
…jarvis/swipe-gesture-icon-position' into features * msfjarvis/multiple_accounts: (24 commits) Adds multiple accounts support Prepare next version Update changelog for 0.9.1 (Tunous#198) Force logout all users (Tunous#196) Handle exceptions while opening a browser (Tunous#108) (Tunous#193) Prevent selection of negative ranges in SelectionLimitingTextView (fixes Tunous#190) (Tunous#194) Prepare next version Release 0.9.0 (Tunous#184) Release workflow (Tunous#185) Fix image loading issues due to http urls (Tunous#183) Selftext selection (Tunous#178) Submission title selection (Tunous#182) Update changelog with missed changes Wrap comment byline when it is too long to fit in one line (Tunous#145) Revert "Run Debug workflow only on push" Upgrade to Gradle 6.3 and add checksum field for F-Droid (Tunous#180) Run Debug workflow only on push Upgrade Gradle to 6.2.1 (Tunous#152) Use GitHub Actions (#72) Switch to on-device link unfurler (Tunous#138) ... * msfjarvis/swipe-gesture-icon-position: (26 commits) Return false to keep the touch flow going Make the gestures' icons follow touch event position on Y Swipe Actions' icons at same level as touch event Prepare next version Update changelog for 0.9.1 (Tunous#198) Force logout all users (Tunous#196) Handle exceptions while opening a browser (Tunous#108) (Tunous#193) Prevent selection of negative ranges in SelectionLimitingTextView (fixes Tunous#190) (Tunous#194) Prepare next version Release 0.9.0 (Tunous#184) Release workflow (Tunous#185) Fix image loading issues due to http urls (Tunous#183) Selftext selection (Tunous#178) Submission title selection (Tunous#182) Update changelog with missed changes Wrap comment byline when it is too long to fit in one line (Tunous#145) Revert "Run Debug workflow only on push" Upgrade to Gradle 6.3 and add checksum field for F-Droid (Tunous#180) Run Debug workflow only on push Upgrade Gradle to 6.2.1 (Tunous#152) ...
No description provided.