private bool isSpeedOptionPopupShowing = false;
private bool isEffectOptionPopupShowing = false;
private bool isNaviRunning = false;
+
+ private ContextPopup optionPopup = null;
+ private ContextPopup speedOptionPopup = null;
+ private ContextPopup effectOptionPopup = null;
+
NaviDirection naviDirection = default(NaviDirection);
private object focusedButton = null;
private ImageViewerInfomation prevContent = null;
public static readonly BindableProperty SavedRotationCommandProperty = BindableProperty.Create("SavedRotationCommand", typeof(ICommand), typeof(ImageViewer), default(ICommand));
-
public ICommand SavedRotationCommand
{
get { return (ICommand)GetValue(SavedRotationCommandProperty); }
private void InitializeButtonFocusImage()
{
+ int focusedSacle = 3;
+ int unfocusedScale = 1;
+
RotateBtn.Focused += (s, e) =>
{
focusedButton = s;
- RotateBg.ScaleTo(3, 250);
+ RotateBg.ScaleTo(focusedSacle, 250);
RotateBg.FadeTo(1, 250);
};
ZoomBtn.Focused += (s, e) =>
{
focusedButton = s;
- ZoomBg.ScaleTo(3, 250);
+ ZoomBg.ScaleTo(focusedSacle, 250);
ZoomBg.FadeTo(1, 250);
};
LeftNaviBtn.Focused += (s, e) =>
focusedButton = s;
LeftNaviBg.TranslationX = 7;
- LeftNaviBg.ScaleTo(3, 250);
+ LeftNaviBg.ScaleTo(focusedSacle, 250);
LeftNaviBg.FadeTo(1, 250);
};
RightNaviBtn.Focused += (s, e) =>
{
focusedButton = s;
- RightNaviBg.ScaleTo(3, 250);
+ RightNaviBg.ScaleTo(focusedSacle, 250);
RightNaviBg.FadeTo(1, 250);
};
SlideShowBtn.Focused += (s, e) =>
{
focusedButton = s;
- SlideShowBg.ScaleTo(3, 250);
+ SlideShowBg.ScaleTo(focusedSacle, 250);
SlideShowBg.FadeTo(1, 250);
};
OptionBtn.Focused += (s, e) =>
{
focusedButton = s;
- OptionBG.ScaleTo(3, 250);
+ OptionBG.ScaleTo(focusedSacle, 250);
OptionBG.FadeTo(1, 250);
};
RotateBtn.Unfocused += (s, e) =>
{
- RotateBg.ScaleTo(1, 250);
+ RotateBg.ScaleTo(unfocusedScale, 250);
RotateBg.FadeTo(0, 250);
};
ZoomBtn.Unfocused += (s, e) =>
{
- ZoomBg.ScaleTo(1, 250);
+ ZoomBg.ScaleTo(unfocusedScale, 250);
ZoomBg.FadeTo(0, 250);
};
LeftNaviBtn.Unfocused += (s, e) =>
{
- LeftNaviBg.ScaleTo(1, 250);
+ LeftNaviBg.ScaleTo(unfocusedScale, 250);
LeftNaviBg.FadeTo(0, 250);
};
RightNaviBtn.Unfocused += (s, e) =>
{
- RightNaviBg.ScaleTo(1, 250);
+ RightNaviBg.ScaleTo(unfocusedScale, 250);
RightNaviBg.FadeTo(0, 250);
};
SlideShowBtn.Unfocused += (s, e) =>
{
- SlideShowBg.ScaleTo(1, 250);
+ SlideShowBg.ScaleTo(unfocusedScale, 250);
SlideShowBg.FadeTo(0, 250);
};
OptionBtn.Unfocused += (s, e) =>
{
- OptionBG.ScaleTo(1, 250);
+ OptionBG.ScaleTo(unfocusedScale, 250);
OptionBG.FadeTo(0, 250);
};
}
return;
}
- ContextPopup popup = new ContextPopup
+ optionPopup = new ContextPopup
{
IsAutoHidingEnabled = true,
Orientation = ContextPopupOrientation.Vertical,
DirectionPriorities = new ContextPopupDirectionPriorities(ContextPopupDirection.Up, ContextPopupDirection.Right, ContextPopupDirection.Left, ContextPopupDirection.Down),
};
- popup.Items.Add(new ContextPopupItem(" SLIDE SHOW SPEED "));
- popup.Items.Add(new ContextPopupItem(" SLIDE SHOW EFFECT "));
+ optionPopup.Items.Add(new ContextPopupItem(" SLIDE SHOW SPEED "));
+ optionPopup.Items.Add(new ContextPopupItem(" SLIDE SHOW EFFECT "));
- popup.SelectedIndexChanged += (s, args) =>
+ optionPopup.SelectedIndexChanged += (s, args) =>
{
var ctxPopup = s as ContextPopup;
break;
}
- popup.Dismiss();
+ optionPopup.Dismiss();
};
- popup.Dismissed += (s, args) =>
+ optionPopup.Dismissed += (s, args) =>
{
isOptionPopupShowing = false;
};
- popup.Show(PopupAnchor, (340 / 2), 144);
+ optionPopup.Show(PopupAnchor, (PopupAnchor.Width / 2), PopupAnchor.Height);
isOptionPopupShowing = true;
}
return;
}
- ContextPopup speedOptionPopup = new ContextPopup
+ speedOptionPopup = new ContextPopup
{
IsAutoHidingEnabled = true,
Orientation = ContextPopupOrientation.Vertical,
DirectionPriorities = new ContextPopupDirectionPriorities(ContextPopupDirection.Up, ContextPopupDirection.Right, ContextPopupDirection.Left, ContextPopupDirection.Down),
};
- speedOptionPopup.Items.Add(new ContextPopupItem(" Normal "));
- speedOptionPopup.Items.Add(new ContextPopupItem(" Slow "));
- speedOptionPopup.Items.Add(new ContextPopupItem(" Fast "));
+ speedOptionPopup.Items.Add(new ContextPopupItem(" NORMAL "));
+ speedOptionPopup.Items.Add(new ContextPopupItem(" SLOW "));
+ speedOptionPopup.Items.Add(new ContextPopupItem(" FAST "));
+
speedOptionPopup.SelectedIndexChanged += (s, e) =>
{
createOptionPopup();
};
- speedOptionPopup.Show(PopupAnchor, (340 / 2), 144);
+ speedOptionPopup.Show(PopupAnchor, (PopupAnchor.Width / 2), PopupAnchor.Height);
isSpeedOptionPopupShowing = true;
}
return;
}
- ContextPopup effectOptionPopup = new ContextPopup
+ effectOptionPopup = new ContextPopup
{
IsAutoHidingEnabled = true,
Orientation = ContextPopupOrientation.Vertical,
DirectionPriorities = new ContextPopupDirectionPriorities(ContextPopupDirection.Up, ContextPopupDirection.Right, ContextPopupDirection.Left, ContextPopupDirection.Down),
};
- effectOptionPopup.Items.Add(new ContextPopupItem(" Dissolve "));
- effectOptionPopup.Items.Add(new ContextPopupItem(" Fade out "));
+ effectOptionPopup.Items.Add(new ContextPopupItem(" DISSOLVE "));
+ effectOptionPopup.Items.Add(new ContextPopupItem(" FADE OUT "));
effectOptionPopup.SelectedIndexChanged += (s, e) =>
{
};
- effectOptionPopup.Show(PopupAnchor, (340 / 2), 144);
+ effectOptionPopup.Show(PopupAnchor, (PopupAnchor.Width / 2), PopupAnchor.Height);
isEffectOptionPopupShowing = true;
}
focusedBtnBG.Opacity = 0;
focusedCustomImageBtn.OnButtonReleased();
}
+
+ protected override bool OnBackButtonPressed()
+ {
+ if (isOptionPopupShowing)
+ {
+ optionPopup.Dismiss();
+
+ return true;
+ }
+
+ if (isSpeedOptionPopupShowing)
+ {
+ speedOptionPopup.Dismiss();
+
+ return true;
+ }
+
+ if (isEffectOptionPopupShowing)
+ {
+ effectOptionPopup.Dismiss();
+
+ return true;
+ }
+
+ Navigation.PopAsync();
+
+ return true;
+ }
}
}