Hello
I have some code where I persist data between device orientation. It works fine. However, when I rotate the screen, the grid rotate well, and then re-rotates one more time until it gets the right orientation. It's a weird and very ugly animation. A bug perhaps?
Here's my code:
[Activity(Label = "Casos AAA")]
public class CaseControlActivity : Activity
{
private SfDataGrid grid;
private string jsonData;
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.CaseControl);
RelativeLayout layout = FindViewById<RelativeLayout>(Resource.Id.layoutCasos);
grid = new SfDataGrid(this);
grid.AllowResizingColumn = true;
grid.AllowSorting = true;
if (savedInstanceState != null)
{
jsonData = savedInstanceState.GetString("jsonData");
grid.ItemsSource = JsonConvert.DeserializeObject<List<v_Casos>>(jsonData);
}
else
{
string dpPath = Path.Combine("/data/data/TPProject.TPProject/files/", "PranfHurto.db3");
var db = new SQLiteConnection(dpPath);
var data = db.Table<v_Casos>();
grid.ItemsSource = data;
jsonData = JsonConvert.SerializeObject(data);
}
layout.AddView(grid);
grid.SelectionMode = SelectionMode.Single;
grid.GridLongPressed += RowLongPress;
}
protected override void OnSaveInstanceState(Bundle outState)
{
outState.PutString("jsonData", jsonData);
base.OnSaveInstanceState(outState);
}
Is there any workaround for my users who obviously doesn't want to see this weird rotating animation??? Thank you!