-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Use custom TextViews and EditTexts in all XML resources #7061
Conversation
what's the advantage of showing the native Android share sheet? |
See the two first screenshots of #5187 to find the difference: there is no native |
I can confirm that this PR makes sharing text use the Android share sheet on EMUI. |
Please add documentation to the two new classes explaining why they are needed / used |
b1907bc
to
12934dc
Compare
@TobiGr Done |
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.
Thank you! I just have a couple of questions
app/src/main/java/org/schabi/newpipe/views/NewPipeEditText.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/views/NewPipeEditText.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/views/NewPipeTextView.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/views/NewPipeEditText.java
Outdated
Show resolved
Hide resolved
463d175
to
48b3051
Compare
app/src/main/java/org/schabi/newpipe/views/NewPipeTextView.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/views/NewPipeEditText.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/util/NewPipeTextViewHelper.java
Outdated
Show resolved
Hide resolved
48b3051
to
a7c1f8d
Compare
a7c1f8d
to
5495cab
Compare
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.
Added some suggestions for making the code way simpler and easier to understand.
Otherwise the code looks good. Tested it on my Huawei P20 and it works as expected.
Also note that there are merge conflicts.
app/src/main/java/org/schabi/newpipe/views/NewPipeEditText.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/views/NewPipeEditText.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/views/NewPipeTextView.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/views/NewPipeTextView.java
Outdated
Show resolved
Hide resolved
5495cab
to
5eee81d
Compare
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.
@TiA4f8R
I'm sorry, but somehow GitHub seems to have lost my 5th proposed key-change here.
app/src/main/java/org/schabi/newpipe/util/NewPipeTextViewHelper.java
Outdated
Show resolved
Hide resolved
…the selected text This TextView class extends the AppCompatTextView class from androidx. These changes (only in XML ressources) allow us to share the selected text by using ShareUtils.shareText, which opens the Android system chooser instead of the Huawei system chooser on EMUI devices.
…the selected text This EditText class extends the AppCompatEditText class from androidx. These changes (only in XML ressources) allow us to share the selected text by using ShareUtils.shareText, which opens the Android system chooser instead of the Huawei system chooser on EMUI devices.
Use the same logic as Android TextViews
A new class has been added in the util package: NewPipeTextViewHelper. It shares the selected text of a TextView with ShareUtils#shareText (with the created shareSelectedTextWithShareUtils static method). Only this static method can be used by other classes, other methods are private.
5eee81d
to
ddaafb6
Compare
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.
LGTM now
Reminder @Stypox that there is still an open change request that was fixed. |
@Stypox sorry, I wanted to dismiss your review, but I requested it by mistake. |
Merging this PR seems to have reverted changes made by #6824 (I don't know if it reverted more stuff). |
Thank you for letting me know! Looks like I did something bad when I rebased this PR... I opened #7348 to fix this. |
What is it?
Description of the changes in your PR
TextView
s toAppCompatTextView
sEditText
s toAppCompatEditText
sview
subpackage:NewPipeEditText
(which extends fromAppCompatEditText
) andNewPipeTextView
(extends fromAppCompatTextView
).This allows NewPipe to show the Android share sheet on EMUI devices (instead of the EMUI share sheet) when sharing selected text in
TextView
s andEditText
s, by usingShareUtils#shareText(Context, String, String)
.APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.
Due diligence