Skip to content
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

🏆 Telegram X Android Competition: Round 1. Reactions #154

Closed
vkryl opened this issue Jun 12, 2022 · 14 comments
Closed

🏆 Telegram X Android Competition: Round 1. Reactions #154

vkryl opened this issue Jun 12, 2022 · 14 comments
Labels
contest Issues that describe the contest task task Issues that describe not an issue but the task

Comments

@vkryl
Copy link
Member

vkryl commented Jun 12, 2022

🏆 Telegram X Android Competition: Round 1. Reactions

Prize fund for Round 1: $25,000.
Deadline: 23:59 on July 2nd (Dubai time).
Who can participate: Everyone.
Results announcement: July 12th, 2022.

The Task is to implement message reactions identical to the demo materials of TGX Reactions.zip attached below, including all the animations, layouts, and other visual effects:

  • You should use the Telegram X code (https://github.com/TGX-Android/Telegram-X) available on GitHub.
  • You must avoid using existing codebase of the same functionality from other Telegram clients.
  • Final result must be submitted as the ready-to-merge pull request to this repository on the deadline date.

Your pull request should support:

  1. Sending a reaction to each message type in private chats, groups, and channels. When holding down an emoji in the reactions panel, the app is expected to display a full-screen animation effect once the reaction is sent.
  2. Allowing a user to set their preferred Quick Reaction in Settings.
  3. Accessing the list of reacted users in groups in the following ways:
    • Press and hold the specific reaction button for a quick view.
    • Open the 'Reacted' list to show a multi-tab interface, with individual sections for each reaction emoji. Users should be able to switch tabs via a swipe gesture.
  4. Turning message reactions on or off in group and channel management – including the ability for admins to disable and enable individual reaction emoji from the list.
  5. Display an unseen reaction badge both in the chat list and inside the conversation.

Evaluation Criteria:

  1. The overall code quality will be a top priority, aside animations smoothness and overall stability. Make sure to get familiar with the project structure and guide for contributors before getting started. Reactions code should keep in mind possible future use on other screens outside of the task (i.e. placing reactions through shared media).
  2. The implemented features should not impact existing functions, like causing the app to crash when interacting with other features.
  3. Ensure the app is free of major glitches, interface jumps, and severe layout issues.
  4. Your app should run smoothly on a wide range of devices. In the evaluation stage, we will test with several devices, including Samsung Galaxy (A51, S10, S21 Ultra), Xiaomi Redmi Note 8 Pro, and more.
  5. Implementing a clearly better stickers rendering (i.e. less disk space usage, better FPS, less CPU usage) will be considered a major advantage, but only in case of completing all other parts of the task.
  6. Attempts to impersonate someone else's work (i.e. submitting a copy of someone else's pull request) would lead to permanent disqualification from Telegram X contests and any potential reward systems in future.

Submissions:

Contestants will be able to submit their entries to @ContestBot at the end of this round. We will further clarify the submission instructions closer to the deadline.

P.S. For the next stage, we expect to only invite contestants who achieved 🥉 3rd place or higher in this round.


Contents of TGX Reactions.zip:

Designs (41 images)

Reactions 0 0 - Bubbles
Reactions 0 1 - Flat
Reactions 1 0 - Message
Reactions 1 1 - Media
Reactions 1 2 - Sticker
Reactions 1 3 - Rounded Video
Reactions 1 4 - Multiple
Reactions 2 0 - Message
Reactions 2 1 - Media
Reactions 2 2 - Sticker
Reactions 2 3 - Rounded Video
Reactions 2 4 - Multiple
Reactions 3 0 - Reaction bar
Reactions 3 1 - Reaction bar with counter
Reactions 3 2 - Reacted
Reactions 3 3 - Reaction bar with seen counter
Reactions 3 4 - All reacted
Reactions 3 5 - Single reaction
Reactions 3 6 - Expanded
Reactions 3 7 - Seen
Reactions 3 8 - Long pressed on reaction
Reactions 4 0 - Reaction Notification Badge
Reactions 4 1 - Reaction Notification Badge with unread
Reactions 4 2 - Reaction Notification Badge with unread and mention
Reactions 5 0 - Quick Reaction option
Reactions 5 1 - Selection
Reactions 5 2 - Reactions option
Reactions 5 3 - All disabled
Reactions 5 4 - Some enabled
Reactions 5 5 - All enabled
Reactions 6 0 - Big Reactions option
Reactions 6 1 - Selection
Reactions 7 0 - Wide Bubble
Reactions 7 1 - Narrow Bubble
Reactions 7 2 - Bubble with Big Reactions disabled
Reactions 7 3 - Flat with Big Reactions disabled
Reactions 7 4 - Media Bubble
Reactions 7 5 - Sticker and Emoji
Reactions 7 6 - Quick Reaction Bubble
Reactions 7 7 - Quick Reaction Flat
Reactions 7 8 - Chatlist Badge

Videos (5 files)
Bottom.Sheet.with.Reactions.mp4
Quick.Reaction.Swapping.mov
Quick.Reaction.mp4
Reacting.from.Bottom.Sheet.mp4
Reaction.Long.Press.mp4
@vkryl vkryl added task Issues that describe not an issue but the task contest Issues that describe the contest task labels Jun 12, 2022
@vkryl
Copy link
Member Author

vkryl commented Jun 17, 2022

Developers wishing to discuss the task and potential implementations are welcome to join https://t.me/tgx_dev chat.

P.S. Whoever else wishing to contribute Telegram X is welcome too.

@iTaysonLab iTaysonLab pinned this issue Jun 17, 2022
@PXNX
Copy link

PXNX commented Jun 18, 2022

Why isn't this client written in Kotlin? Makes code a bit nicer to read, gets rid of most NPEs und has somesyntactic sugar :)

@TGX-Android TGX-Android deleted a comment from F1irSti Jun 18, 2022
@vkryl
Copy link
Member Author

vkryl commented Jun 18, 2022

Why isn't this client written in Kotlin? Makes code a bit nicer to read, gets rid of most NPEs und has somesyntactic sugar :)

Telegram X was created around 2014-2015, several years before Google announced first-class support for Kotlin. Telegram X uses Kotlin for some recent code though, e.g.: https://github.com/TGX-Android/Telegram-X/tree/main/vkryl

@TGX-Android TGX-Android deleted a comment from DavertMik Jun 18, 2022
@TGX-Android TGX-Android deleted a comment from Scrxtchy Jun 18, 2022
@vkryl
Copy link
Member Author

vkryl commented Jun 18, 2022

Whoever participating in the contest, make sure to not miss implementation suggestions in https://t.me/tgx_dev that will be posted with #contest hashtag.

They will not be the requirement in any kind – just suggestions that might help getting the idea and plan on completing some parts of the contest task.

@vkryl
Copy link
Member Author

vkryl commented Jun 18, 2022

Icons required by the mockups are baseline_favorite and baseline_visibility in 20 and 24 dpi available in the Telegram X source code. If you are not sure whether it's 20 or 24 on the specific mockup, ask in the group (make sure to check if anyone else already asked about the same mockup).

To create an icon in the missing dimension just create a copy, edit android:width and android:width and file name suffix to match the desired dpi.

Circular checkbox is SimplestCheckBox — used in most parts of the app and you may find a lot of samples by checking out its usages.

For rectangular checkbox you would need a CheckBoxView. You most likely do not need to create it directly, but to use TYPE_CHECKBOX_OPTION item (check out its usages in the app for examples). Such item should be passed to SettingsAdapter instance (most commonly used by RecyclerViewController).

However, patching CheckBoxView (onDraw method specifically) would still be required in order to support an intermediate state needed by one of the mockups — state when checkbox mark angle increases from 90 to 180 degrees.

@vkryl
Copy link
Member Author

vkryl commented Jun 23, 2022

Some clarification on a grid reactions selector screen.

Behavior of the reactions settings from manage chat screen:

  1. When enabling some reaction by tap on the corresponding reaction, the overlay animation should play, the same one as in messages.
  2. When all reactions are selected, checkbox should be in ✅ state
  3. When some are not selected, it should be in ➖ state
  4. When none, it should be empty
  5. When checkbox is at ✅ or ➖ state, it should unselect all reactions
  6. Otherwise it should select all reactions

Behavior of quick reactions screen:

  1. Same as Wallpapers 2.0 link support and implemented QR scanning #1 in the previous section
  2. By default only 👍 quick reaction is enabled
  3. The limit of available quick reactions is determined by developer.
  4. When trying to enable some quick reaction over reasonable limit (the amount at which point accessing it with gesture would become inconvenient or impossible), app should show the tooltip above it that limit reached.
  5. Enabling / disabling quick reactions should preserve the previously selected reactions, but exact behavior details are up to the developer

Below some additional animations examples for better understanding of the screens and intended animations.

TGX_AdditionalVideos.zip

Copy from https://t.me/tgx_dev/807

@vkryl
Copy link
Member Author

vkryl commented Jul 4, 2022

Submissions are closed and judges are now evaluating the results.

Here's the list of 11 participants: #188, #187, #180, #177, #182, #184, #179, #186, #183, #189, #185.

All APKs can be found in this channel: https://t.me/tgx_prs/148. Everyone is welcome to leave feedback and bug reports to developers inside of corresponding PR.

@grishka
Copy link

grishka commented Jul 4, 2022

There will be no contest.com pages for this particular contest, right?

@vkryl
Copy link
Member Author

vkryl commented Jul 4, 2022

There will be no contest.com pages for this particular contest, right?

Soon they will be available there too.

@PXNX
Copy link

PXNX commented Jul 5, 2022

There will be no contest.com pages for this particular contest, right?

There is: https://contest.com/android-x-r1

@Sonofjoy
Copy link

I think is nice so we should keep calm and carry on

@vkryl
Copy link
Member Author

vkryl commented Jul 12, 2022

Check out the results for the first round: 🏆 Telegram X Android Competition, Round 1 Results

Keeping this issue open until the 1st place will be determined.

@seik0ixtem
Copy link

seik0ixtem commented Jul 17, 2022

can't see from discussion - can reactions be fully disabled on client on winner's PR?

it's the most annoying feature ever existed in telegram and i'm chosing alt clients where it can be disabled.

upd. inability to disable reactions client-wise - the second most annoying feature ever existed.

vkryl added a commit that referenced this issue Aug 9, 2022
* Telegram X Android Competition: Round 1 - main commit

* Smallest Fix)

* add vkryl changes

* Update submodule

* Adding modified vkryl files to the repository

* Rejecting changes in vkryl android submodule

* fix color in reaction badge

* Revert gitmodules file

* Quick reactions update + Premium features

* Reactions preloading on starting app

* Haptic feedbacks

* Disable Reactions to a Sponsored Post

* Fixes - Animate reaction button bubble

* Support TextSize settings + flat mode reactions mockup

* Fix GifThread crashes?

* Fix design + fix crashes

* Quick reaction fixes

* Reactions bottom sheet Improvements

* Reactions bottom sheet Improvements

* Disable message list animator

* Quick gesture improvements

* Fix bottom sheet jumping

* Reaction Bubble Improvements

* Reaction button improvements

* Improving mockup compliance

* Change toast to tooltip

* some fixes

* Improving the fidelity of animations

* Bottom sheet improvements + bugfixes

* Round video reaction fix?

* -

* fix quick buttons

* -

* Round video fix

* Unread reactions fixes

* Update app/src/main/java/org/thunderdog/challegram/unsorted/Settings.java

Co-authored-by: Vyacheslav <6242627+vkryl@users.noreply.github.com>

* 1

* Fix phantom buttons

* Fixes

* Bottom sheet fix? + overlay translation fix

* fix for fix

* Remove log output

* Color fixes

* improving the accuracy of full-screen animation

* canGetAddedReactions fix

* Update app/src/main/java/org/thunderdog/challegram/navigation/ViewPagerTopView.java

Co-authored-by: Vyacheslav <6242627+vkryl@users.noreply.github.com>

* Update app/src/main/java/org/thunderdog/challegram/unsorted/Settings.java

Co-authored-by: Vyacheslav <6242627+vkryl@users.noreply.github.com>

* Update app/src/main/java/org/thunderdog/challegram/unsorted/Settings.java

Co-authored-by: Vyacheslav <6242627+vkryl@users.noreply.github.com>

* Thread safety fix

* Update Paints.java

* archive fix

* Theme fix

* Update TGReactions.java

* Update MessageOptionsPagerController.java

* Update MessageOptionsPagerController.java

* bugfixes

* Bottom shit fix

* Bottom sheet fixes 2

* Bottom sheet fixes 3

* Bottomsheet  fixes 3

* Update PopupLayout.java

* scroll fix?

* Add visibleIfZero option to Counter class

* Layout accuracy improvement

* Fix width if bubble is stretched

* Update TGMessage.java

* Update ReactionsSelectorRecyclerView.java

* Update TGMessage.java

* Scroll fix 2

* Start animation position fix

* Fixes

* Scroll fixes

* -

* Update MessageView.java

* Update MessagesManager.java

* Update MessageView.java

* Scroll fix?

* Update ComplexReceiver.java

* Update MessagesManager.java

* Update MessagesManager.java

* Fixes

* Fixes

* Update MessagesManager.java

* Update TGMessage.java

* fixes

* Optimizations

* Add timeExpandAnimation

* Update TGMessage.java

* Update TGMessage.java

Co-authored-by: Vyacheslav <6242627+vkryl@users.noreply.github.com>
@vkryl
Copy link
Member Author

vkryl commented Aug 9, 2022

Thanks everyone who participated in this contest.

PR #185 was chosen to be rolled out to users and merged in 9224e8b commit. Wanted to also note #183 who did a great job implementing 60fps reactions playback and better reaction animation curve ("fly out" and "land" animation), which can be tested in this APK: https://t.me/tgx_prs/297.

The main reasons #185 was chosen over #183 is that it implemented animations fully (such as animating all bubble width and height changes when reaction is set or unset, better buttons sorting, etc), had less frame drops and freezes on low-end devices (especially in channels with extensive amount of reactions set) and didn't override much of app's basic components only for the code style preferences (which is just an addition to the previous points, but not the key reason why it was chosen).

Follow https://t.me/contest for the final result announcement and any new upcoming contests.

@vkryl vkryl closed this as completed Aug 9, 2022
@vkryl vkryl unpinned this issue Oct 13, 2022
s3va pushed a commit to s3va/sevatgx that referenced this issue Apr 27, 2024
* Telegram X Android Competition: Round 1 - main commit

* Smallest Fix)

* add vkryl changes

* Update submodule

* Adding modified vkryl files to the repository

* Rejecting changes in vkryl android submodule

* fix color in reaction badge

* Revert gitmodules file

* Quick reactions update + Premium features

* Reactions preloading on starting app

* Haptic feedbacks

* Disable Reactions to a Sponsored Post

* Fixes - Animate reaction button bubble

* Support TextSize settings + flat mode reactions mockup

* Fix GifThread crashes?

* Fix design + fix crashes

* Quick reaction fixes

* Reactions bottom sheet Improvements

* Reactions bottom sheet Improvements

* Disable message list animator

* Quick gesture improvements

* Fix bottom sheet jumping

* Reaction Bubble Improvements

* Reaction button improvements

* Improving mockup compliance

* Change toast to tooltip

* some fixes

* Improving the fidelity of animations

* Bottom sheet improvements + bugfixes

* Round video reaction fix?

* -

* fix quick buttons

* -

* Round video fix

* Unread reactions fixes

* Update app/src/main/java/org/thunderdog/challegram/unsorted/Settings.java

Co-authored-by: Vyacheslav <6242627+vkryl@users.noreply.github.com>

* 1

* Fix phantom buttons

* Fixes

* Bottom sheet fix? + overlay translation fix

* fix for fix

* Remove log output

* Color fixes

* improving the accuracy of full-screen animation

* canGetAddedReactions fix

* Update app/src/main/java/org/thunderdog/challegram/navigation/ViewPagerTopView.java

Co-authored-by: Vyacheslav <6242627+vkryl@users.noreply.github.com>

* Update app/src/main/java/org/thunderdog/challegram/unsorted/Settings.java

Co-authored-by: Vyacheslav <6242627+vkryl@users.noreply.github.com>

* Update app/src/main/java/org/thunderdog/challegram/unsorted/Settings.java

Co-authored-by: Vyacheslav <6242627+vkryl@users.noreply.github.com>

* Thread safety fix

* Update Paints.java

* archive fix

* Theme fix

* Update TGReactions.java

* Update MessageOptionsPagerController.java

* Update MessageOptionsPagerController.java

* bugfixes

* Bottom shit fix

* Bottom sheet fixes 2

* Bottom sheet fixes 3

* Bottomsheet  fixes 3

* Update PopupLayout.java

* scroll fix?

* Add visibleIfZero option to Counter class

* Layout accuracy improvement

* Fix width if bubble is stretched

* Update TGMessage.java

* Update ReactionsSelectorRecyclerView.java

* Update TGMessage.java

* Scroll fix 2

* Start animation position fix

* Fixes

* Scroll fixes

* -

* Update MessageView.java

* Update MessagesManager.java

* Update MessageView.java

* Scroll fix?

* Update ComplexReceiver.java

* Update MessagesManager.java

* Update MessagesManager.java

* Fixes

* Fixes

* Update MessagesManager.java

* Update TGMessage.java

* fixes

* Optimizations

* Add timeExpandAnimation

* Update TGMessage.java

* Update TGMessage.java

Co-authored-by: Vyacheslav <6242627+vkryl@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contest Issues that describe the contest task task Issues that describe not an issue but the task
Projects
None yet
Development

No branches or pull requests

7 participants
@grishka @seik0ixtem @vkryl @PXNX @Sonofjoy and others