Skip to content

Commit

Permalink
Record button tips
Browse files Browse the repository at this point in the history
  • Loading branch information
FrayxRulez committed May 16, 2023
1 parent d645d8a commit 4c78c75
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
11 changes: 10 additions & 1 deletion Telegram/Controls/Chats/ChatRecordButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Telegram.Common;
using Telegram.Td;
using Telegram.Td.Api;
using Telegram.ViewModels;
using Windows.Devices.Enumeration;
Expand Down Expand Up @@ -333,7 +334,9 @@ private async void OnClick(object sender, RoutedEventArgs e)
? Strings.VideoMessagesRestrictedByPrivacy
: Strings.VoiceMessagesRestrictedByPrivacy;

await MessagePopup.ShowAsync(string.Format(message, ViewModel.Chat.Title), Strings.AppName, Strings.OK);
var formatted = string.Format(message, ViewModel.Chat.Title);
var markdown = Client.Execute(new ParseMarkdown(new FormattedText(formatted, new TextEntity[0]))) as FormattedText;
Window.Current.ShowTeachingTip(this, markdown, TeachingTipPlacementMode.TopLeft);
return;
}

Expand Down Expand Up @@ -417,6 +420,12 @@ private void OnRelease()

_timer.Stop();
Mode = Mode == ChatRecordMode.Video ? ChatRecordMode.Voice : ChatRecordMode.Video;

var message = Mode == ChatRecordMode.Video
? Strings.HoldToVideo
: Strings.HoldToAudio;

Window.Current.ShowTeachingTip(this, message, TeachingTipPlacementMode.TopLeft);
}
else if (!_hasRecordVideo || _calledRecordRunnable)
{
Expand Down
12 changes: 11 additions & 1 deletion Telegram/Strings/en/Resources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5621,6 +5621,16 @@ public static class R
/// </summary>
public static string HistoryClearedUndo => Resource.GetString("HistoryClearedUndo");

/// <summary>
/// Localized resource similar to "Hold to record audio. Tap to switch to video."
/// </summary>
public static string HoldToAudio => Resource.GetString("HoldToAudio");

/// <summary>
/// Localized resource similar to "Hold to record video. Tap to switch to audio."
/// </summary>
public static string HoldToVideo => Resource.GetString("HoldToVideo");

/// <summary>
/// Localized resource similar to "If inactive for"
/// </summary>
Expand Down Expand Up @@ -7609,7 +7619,7 @@ public static class R
public static string PhoneNumberFlood => Resource.GetString("PhoneNumberFlood");

/// <summary>
/// Localized resource similar to "You can change your Telegram number from the official Telegram app for Android and iPhone. Your account and all your cloud data — messages, media, contacts, etc. will be moved to the new number."
/// Localized resource similar to "You can change your Telegram number from the official Telegram app for Android and iOS. Your account and all your cloud data — messages, media, contacts, etc. will be moved to the new number."
/// </summary>
public static string PhoneNumberHelp => Resource.GetString("PhoneNumberHelp");

Expand Down
8 changes: 7 additions & 1 deletion Telegram/Strings/en/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -3563,6 +3563,12 @@ They can still join via an invite link as long as they are not on the Removed Us
<data name="HistoryClearedUndo" xml:space="preserve">
<value>History cleared</value>
</data>
<data name="HoldToAudio" xml:space="preserve">
<value>Hold to record audio. Tap to switch to video.</value>
</data>
<data name="HoldToVideo" xml:space="preserve">
<value>Hold to record video. Tap to switch to audio.</value>
</data>
<data name="Hours_one" xml:space="preserve">
<value>{0} hour</value>
</data>
Expand Down Expand Up @@ -4902,7 +4908,7 @@ Payments will go directly to the developer of {0}. Telegram cannot provide any g
<value>Sorry, you have deleted and re-created your account too many times recently. Please wait for a few days before signing up again.</value>
</data>
<data name="PhoneNumberHelp" xml:space="preserve">
<value>You can change your Telegram number from the official Telegram app for Android and iPhone. Your account and all your cloud data — messages, media, contacts, etc. will be moved to the new number.</value>
<value>You can change your Telegram number from the official Telegram app for Android and iOS. Your account and all your cloud data — messages, media, contacts, etc. will be moved to the new number.</value>
</data>
<data name="PhotoForRestDescription" xml:space="preserve">
<value>You can upload a public photo for users who are restricted from seeing your real profile photos.</value>
Expand Down

0 comments on commit 4c78c75

Please sign in to comment.