Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WApps] Add ItemOpacity property #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ internal void AnimateShowPage(RotaryItemWrapper wrapper, bool isReverse = true,
rotaryItem.Position = new Position(pos.X + (isReverse ? 70 : -70), pos.Y); ;

animationCore.AnimateTo(rotaryItem, "Position", pos, 167 + sTime, 84 + sTime + 334, alphaSineOut33);
animationCore.AnimateTo(rotaryItem, "Opacity", 1.0f, 167 + sTime, 84 + sTime + 334, alphaSineOut33);
animationCore.AnimateTo(rotaryItem, "Opacity", rotaryItem.ItemOpacity, 167 + sTime, 84 + sTime + 334, alphaSineOut33);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

float previousOpacity = rotaryItem.Opacity;
            rotaryItem.Opacity = 0.0f;
...
                animationCore.AnimateTo(rotaryItem, "Opacity", previousOpacity, 167 + sTime, 84 + sTime + 334, alphaSineOut33);

}
else
{
animationCore.AnimatePath(rotaryItem, mAniUtil.GetItemRotaryPath(wrapper, isReverse), Vector3.Zero, 200, 699, alphaGlideOut);
animationCore.AnimateTo(rotaryItem, "Opacity", 1.0f, 200, 300, alphaGlideOut);
animationCore.AnimateTo(rotaryItem, "Opacity", rotaryItem.ItemOpacity, 200, 300, alphaGlideOut);
}
}

Expand All @@ -167,7 +167,8 @@ internal void AnimateShowPage(RotaryItemWrapper wrapper, bool isReverse = true,
internal void AnimateHidePage(RotaryItemWrapper wrapper, bool isReverse = true, PageAnimationType type = PageAnimationType.Slide)
{
RotarySelectorItem rotaryItem = wrapper.RotaryItem;
rotaryItem.Opacity = 1.0f;
rotaryItem.ItemOpacity = rotaryItem.Opacity;
//rotaryItem.Opacity = 1.0f;
hideItemList.Add(rotaryItem);

if (type == PageAnimationType.Slide)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ public class RotarySelectorItem : ImageView
private RotaryBadege deleteBadge;
public bool IsDeleteAble { get; set; }

private float itemOpacity = 1.0f;
public float ItemOpacity
{
get
{
return itemOpacity;
}
set
{
itemOpacity = value;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+ Opacity = itemOpacity;

And after modifying test app it only then works:

-            float opacity = last.Opacity != 0.5f ? 0.5f : 1.0f;
-            last.Opacity = opacity;
+            float opacity = last.ItemOpacity != 0.5f ? 0.5f : 1.0f;^M
+            last.ItemOpacity = opacity;^M

}
}

/// <summary>
/// Creates a new instance of a RotarySelectorItem.
/// </summary>
Expand Down