From: Anuj Kumar Singh Date: Thu, 18 May 2023 06:06:35 +0000 (+0530) Subject: Resolve bt device rename issue. X-Git-Tag: accepted/tizen/unified/20230601.163003~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e279ae0ea138996f81bbe0e4eeef15d7b75bd7e5;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsetting-bluetooth.git Resolve bt device rename issue. Change-Id: I6997ca75e87e2eedfe3e8209c72c485a5740931f Signed-off-by: Anuj Kumar Singh --- diff --git a/SettingBluetooth/SettingBluetooth/View/BtDetailView.cs b/SettingBluetooth/SettingBluetooth/View/BtDetailView.cs index a9b33ce..189bfd2 100644 --- a/SettingBluetooth/SettingBluetooth/View/BtDetailView.cs +++ b/SettingBluetooth/SettingBluetooth/View/BtDetailView.cs @@ -13,10 +13,12 @@ namespace SettingBluetooth static View mDetailView; static ContentPage mDetailPage; static string mBtDeviceName; + static Device mDevice; internal static void CreateDetailView(Device device) { Window window = NUIApplication.GetDefaultWindow(); + mDevice = device; var appBar = new AppBar() { @@ -108,26 +110,27 @@ namespace SettingBluetooth { DefaultLinearItem deviceItem = (DefaultLinearItem)sender; var deviceName = deviceItem.BindingContext as string; + deviceName = mBtDeviceName; Log.Debug(SettingBluetooth.LogTag, "Name: " + deviceName); - /* + Window window = NUIApplication.GetDefaultWindow(); - var connectPage = new RenamePage(device); + var connectPage = new RenamePage(deviceName, mDevice); mBtDeviceName = connectPage.CreateComponents(mBtDeviceName); - window.GetDefaultNavigator().Push(connectPage);*/ + window.GetDefaultNavigator().Push(connectPage); } } internal class RenamePage : DialogPage { TextField mRenameField; - Device mDevice; + static Device mDevice; private static void PopDialog() { Navigator navigator = NUIApplication.GetDefaultWindow().GetDefaultNavigator(); navigator?.Pop(); } - internal RenamePage(Device device) + internal RenamePage(string deviceName, Device device) { mDevice = device; } @@ -175,16 +178,17 @@ namespace SettingBluetooth { try { - Log.Debug(SettingBluetooth.LogTag, "Old Name " + mDevice.Name + " field value; " + mRenameField.Text); + Log.Debug(SettingBluetooth.LogTag, "Device name before rename: " + mDevice.Name); mDevice.Name = mRenameField.Text; - Log.Debug(SettingBluetooth.LogTag, "New Name " + mDevice.Name); - Navigator.Pop(); + Log.Debug(SettingBluetooth.LogTag, "Device Name after rename: " + mDevice.Name); } catch(Exception e) { Log.Debug(SettingBluetooth.LogTag, "Exception : " + e.Message); } - Navigator.Pop(); + NUIApplication.GetDefaultWindow().GetDefaultNavigator().Pop(); + NUIApplication.GetDefaultWindow().GetDefaultNavigator().Pop(); + BtDetailView.CreateDetailView(mDevice); } } } diff --git a/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk b/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk index 4d62c5a..a855a7f 100644 Binary files a/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk and b/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk differ