{
public class Program : Xamarin.Forms.Platform.Tizen.FormsApplication, IAppLifeControl
{
- IPlatformNotification notification;
+ private static Program instance;
+ private IPlatformNotification notification;
public static string AppResourcePath
{
static void Main(string[] args)
{
- var app = new Program();
+ instance = new Program();
Xamarin.Forms.DependencyService.Register<DebuggingPort>();
Xamarin.Forms.DependencyService.Register<DBPort>();
- Xamarin.Forms.DependencyService.Register<IAppLifeControl>();
+ Xamarin.Forms.DependencyService.Register<Program>();
Xamarin.Forms.DependencyService.Register<AppControlPort>();
Xamarin.Forms.DependencyService.Register<PackageManagerPort>();
Xamarin.Forms.DependencyService.Register<WifiModulePort>();
Xamarin.Forms.DependencyService.Register<ApplicationManagerPort>();
Xamarin.Forms.DependencyService.Register<FileSystemPort>();
// TODO : add true argument at end.
- Xamarin.Forms.Platform.Tizen.Forms.Init(app);
+ Xamarin.Forms.Platform.Tizen.Forms.Init(instance);
- app.Run(args);
+ instance.Run(args);
}
public void SelfTerminate()
{
- Exit();
+ instance.Exit();
}
}
}
HorizontalOptions="Center"
TextColor="#F7F7F7"></Label>
+ <!--
<Image Grid.Row="0" Grid.Column="0"
x:Name="BackgroundImage"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand"
Source="btn_tizen_dropdown_line_normal.9.png"/>
-
+ -->
<Controls:CustomButton Grid.Row="0" Grid.Column="0"
x:Name="HiddenButton"
VerticalOptions="FillAndExpand"
set;
}
- private static String ButtonImagePressed = "btn_tizen_dropdown_line_dimmed.9.png";
- private static String ButtonImageReleased = "btn_tizen_dropdown_line_normal.9.png";
+ // TODO : revert this after 9 patch image is displaying properly
+ //private static String ButtonImagePressed = "btn_tizen_dropdown_line_dimmed.9.png";
+ //private static String ButtonImageReleased = "btn_tizen_dropdown_line_normal.9.png";
public TVButton()
{
public void ButtonUpListener(Object sender, EventArgs e)
{
- BackgroundImage.Source = ButtonImageReleased;
+ //BackgroundImage.Source = ButtonImageReleased;
Command?.Execute(CommandParameter);
}
public void ButtonDownListener(Object sender, EventArgs e)
{
- BackgroundImage.Source = ButtonImagePressed;
+ //BackgroundImage.Source = ButtonImagePressed;
}
<!-- This StackLayout is temporary code for Long Press test -->
<Button Grid.Row="0" Grid.Column="1"
- Text="Set LongPress"
- FontSize="30"
Style="{StaticResource button}"
Command="{Binding SetLongPressCommand}"
CommandParameter="org.tizen.example.TVHome.TizenTV"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand"/>
<Button Grid.Row="2" Grid.Column="1"
- Text="UnSet LongPress"
- FontSize="30"
Style="{StaticResource button}"
Command="{Binding UnSetLongPressCommand}"
CommandParameter="org.tizen.example.TVHome.TizenTV"
}
}
+ // TODO : remove this
+ private static bool IsBackKeyPressed;
+
private async Task<bool> OnBackKeyPressedAtMain()
{
- if (!AppList.IsFirstItemFocused)
+ if (!AppList.IsFirstItemFocused &&
+ IsBackKeyPressed == false)
{
+ IsBackKeyPressed = true;
DebuggingUtils.Dbg("OnBackKeyPressedAtMain - focus move");
AppList.InitializeFocus();
return true;
if (answer)
{
DebuggingUtils.Dbg("OnBackKeyPressedAtMain - Yes");
- // TODO : app screen inconized.
- await this.Navigation.PopAsync();
+ AppControlUtils.SelfTerminate();
return true;
}
return true;
}
- /*
protected override bool OnBackButtonPressed()
{
DebuggingUtils.Dbg("OnBackButtonPressed");
}, "");
return true;
}
- */
}
}