UITextContentType.OneTimeCode in Xamarin iOS - xamarin.ios

i'm trying to implement the OTC into my app. I'm doing the next:
_txtField = new UITextField()
{
UserInteractionEnabled = true,
TextContentType = UITextContentType.OneTimeCode
};
_txtFieldDelegate = new UITextFieldDelegate();
_txtField.Delegate = _txtFieldDelegate;
I got the SMS, but i have nothing to fill the TextField, what more i need to get this works?

Firstly,OneTimeCode is available after iOS 12.0.So,add the following code
if (UIDevice.CurrentDevice.CheckSystemVersion(12, 0))
{
_txtField.TextContentType = UITextContentType.OneTimeCode;
}
And set the textField as BecomeFirstResponder after you send the request of get SMS.
_txtField.BecomeFirstResponder();
Then the SMS code will appear on the keyboard.And it will auto fill when you click it.

Related

How to show an image in the mobile application

I have a request to add the image from a stock item to the picking screen in the mobile app in Acumatica. I took a look at the Mobile Framework documentation but, there doesn't appear to be a way to show an image in the mobile app. Has anybody tried something like this?
TIA!
I don't think there is a control for ImageURL in the mobile app as of now.
However, as long as your screen holds a Header record with Files(attachments) you could still see the attachments(images) in the mobile application.
For this you can take as an example and guidance the EP301020 - Expense Receipt screen:
add screen EP301020 {
openAs = Form
add container "ClaimDetails" {
formActionsToExpand = 1
add layout "ReceiptNumberHeader" {
displayName = "ReceiptNumberHeader"
layout = "HeaderFirstAttachment"
add field "ReceiptNumber" {
forceIsDisabled = True
}
add field "Status" {
forceIsDisabled = True
}
}
add field "DetailsExpenseDetails#Description"
.....................
attachments {
imageAdjustmentPreset = Receipt
}
}
...............
}
See more details about the layout "HeaderFirstAttachment" here:
https://help.acumatica.com/(W(1))/Help?ScreenId=ShowWiki&pageid=bd31e3a8-538f-47d5-84ff-251ca3d03c43

Xamarin iOS: BarTintColor not working in iOS 15

I came across a similar issue in this post.
I tried to convert iOS native code into Xamarin.iOS C#.
iOS Native Code:
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = <your tint color>
navigationBar.standardAppearance = appearance;
navigationBar.scrollEdgeAppearance = navigationBar.standardAppearance
my own code for Xamarin.iOS C#
if (UIDevice.CurrentDevice.CheckSystemVersion(15, 0))
{
var appearance = new UITabBarAppearance();
appearance.ConfigureWithOpaqueBackground();
appearance.BackgroundColor = UIColor.FromRGB((float)rgbColorBackground.R, (float)rgbColorBackground.G, (float)rgbColorBackground.B);
this.TabBarController.TabBar.StandardAppearance = appearance;
}
else
TabBar.BarTintColor = UIColor.FromRGB((float)rgbColorBackground.R, (float)rgbColorBackground.G, (float)rgbColorBackground.B);
However, there is no reference to "scrollEdgeAppearance" in Xamarin.iOS C#, and it seems important to add this to solve the issue. I'd be grateful if someone can give me some advice or point out my mistakes.
I did this to solve transparent tabbar in IOS 15.
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
// Color of the selected tab icon:
UITabBar.Appearance.SelectedImageTintColor = AppColors.Primary500Color.ToUIColor();
UITabBar.Appearance.BackgroundColor = AppColors.WhiteColor.ToUIColor();
if (UIDevice.CurrentDevice.CheckSystemVersion(15, 0))
UITabBar.Appearance.ScrollEdgeAppearance = new UITabBar().StandardAppearance;
Regards Joacim

Open and save file using devexpress htmlEditor

I begin using the DevExpress HtmlEditor for MVC Extensions, but there is absolutely nothing on how to open and save a file. I searched about and found that it is necessary to first add a custom button to the toolbar then write the respective code. Since I couldn't find any good example for MVC I would like to know if anyone has an example on how to do these tasks, starting with adding the custom button. Trust me I searched....
Here is the code for the partial view
#Html.DevExpress().HtmlEditor(settings =>
{
settings.Name = "HtmlEditor1";
settings.CallbackRouteValues = new { Controller = "HtmlEditor", Action = "HtmlEditorPartial" };
settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
settings.ToolbarMode = HtmlEditorToolbarMode.Menu;
settings.SettingsDialogs.InsertImageDialog.SettingsImageUpload.UploadCallbackRouteValues = new { Controller = "HtmlEditor", Action = "HtmlEditorPartialImageUpload" };
settings.SettingsDialogs.InsertImageDialog.SettingsImageUpload.UploadFolder = HtmlEditorControllerHtmlEditor1Settings.ImageUploadDirectory;
settings.SettingsDialogs.InsertImageDialog.SettingsImageUpload.ValidationSettings.Assign(HtmlEditorControllerHtmlEditor1Settings.ImageUploadValidationSettings);
settings.SettingsDialogs.InsertImageDialog.SettingsImageSelector.Assign(HtmlEditorControllerHtmlEditor1Settings.ImageSelectorSettings);
}).GetHtml()

I want to send a mail with xml layout as attachment in android application

I need some help. I want to send mail when button is clicked with xml layout(the UI design in my application) as attachment
You can use Intent to Open the Gmail App and Send your Email. Just get the Text from your XML Layout and then send the Text to the person. Just write this Code on your Button Click Listener:
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
String aEmailList[] = { getResources()
.getString(R.string.email_address) };
String aEmailCCList[] = { getResources().getString(
R.string.email_address_cc) };
String aEmailBCCList[] = { getResources().getString(
R.string.email_address_bcc) };
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, aEmailList);
emailIntent.putExtra(android.content.Intent.EXTRA_CC, aEmailCCList);
emailIntent.putExtra(android.content.Intent.EXTRA_BCC, aEmailBCCList);
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,
getResources().getString(R.string.email_subject));
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, getResources()
.getString(R.string.email_message));
startActivity(emailIntent);
Hope it helps. Thanks. :)

Spotify List : Highlight next/previous track

On my spotify app, if I click on player to play track, the track is highlighted in the list-view. But when I click on the next button of spotify the next track in the list-view is not highlighted, even when it is being played...the highlighting is totally lost. And I do not know how to do it. It works if I just reload the app or I go on next tab. Can anyone guide me as how to fix this? Thanks in advance :-)
models.Track.fromURI(track, function(track) {
models.Album.fromURI(track.album.uri, function(album) {
var pl = new views.Player();
pl.context = album;
document.getElementById('imag').appendChild ( pl.node );
var tracklist = new views.List(album);
tracklist.node.classList.add("sp-list");
$("#song1").append(tracklist.node);
Your code should work without any problems, since you are using the same context for both
Player and List views. In fact, I have tested it and it works for me (note that I have added a couple of missing lines):
var sp = getSpotifyApi(),
models = sp.require("$api/models"),
views = sp.require("$api/views"),
track = "spotify:track:6G0RXhQJGDnjgUdbQfBZRk";
models.Track.fromURI(track, function(track) {
models.Album.fromURI(track.album.uri, function(album) {
var pl = new views.Player();
pl.context = album;
document.getElementById("imag").appendChild(pl.node);
var tracklist = new views.List(album);
tracklist.node.classList.add("sp-list");
document.getElementById("song1").appendChild(tracklist.node);
});
});

Resources