Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fallenstardust
YGOMobile
Commits
dfef6838
Commit
dfef6838
authored
May 26, 2018
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加菜单控件按钮动画
parent
b1c7a618
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
3 deletions
+27
-3
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
+22
-0
mobile/src/main/res/drawable-xhdpi/buttonfunction.png
mobile/src/main/res/drawable-xhdpi/buttonfunction.png
+0
-0
mobile/src/main/res/layout/activity_home.xml
mobile/src/main/res/layout/activity_home.xml
+4
-3
mobile/src/main/res/values/dimens.xml
mobile/src/main/res/values/dimens.xml
+1
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
View file @
dfef6838
package
cn.garymb.ygomobile.ui.home
;
import
android.animation.Keyframe
;
import
android.animation.ObjectAnimator
;
import
android.animation.PropertyValuesHolder
;
import
android.content.Intent
;
import
android.graphics.Color
;
import
android.os.Bundle
;
...
...
@@ -86,6 +89,8 @@ abstract class HomeActivity extends BaseActivity implements NavigationView.OnNav
checkForceUpdateSilent
();
//ServiceDuelAssistant
startService
(
new
Intent
(
this
,
ServiceDuelAssistant
.
class
));
ObjectAnimator
nope
=
shake
(
R
.
id
.
cube
);
nope
.
start
();
}
@Override
...
...
@@ -369,4 +374,21 @@ abstract class HomeActivity extends BaseActivity implements NavigationView.OnNav
UpdateHelper
.
getInstance
().
autoUpdate
(
getPackageName
(),
false
,
intervalMillis
);
}
public
static
ObjectAnimator
animator
(
View
view
)
{
int
delta
=
view
.
getResources
().
getDimensionPixelOffset
(
R
.
dimen
.
spacing_medium
);
PropertyValuesHolder
pvhTranslateY
=
PropertyValuesHolder
.
ofKeyframe
(
View
.
TRANSLATION_Y
,
Keyframe
.
ofFloat
(
0
f
,
0
),
Keyframe
.
ofFloat
(.
10
f
,
-
delta
),
Keyframe
.
ofFloat
(.
26
f
,
delta
),
Keyframe
.
ofFloat
(.
42
f
,
-
delta
),
Keyframe
.
ofFloat
(.
58
f
,
delta
),
Keyframe
.
ofFloat
(.
74
f
,
-
delta
),
Keyframe
.
ofFloat
(.
90
f
,
delta
),
Keyframe
.
ofFloat
(
1
f
,
0
f
)
);
return
ObjectAnimator
.
ofPropertyValuesHolder
(
view
,
pvhTranslateY
).
setDuration
(
500
);
}
}
mobile/src/main/res/drawable-xhdpi/buttonfunction.png
View replaced file @
b1c7a618
View file @
dfef6838
5.57 KB
|
W:
|
H:
5.79 KB
|
W:
|
H:
2-up
Swipe
Onion skin
mobile/src/main/res/layout/activity_home.xml
View file @
dfef6838
...
...
@@ -29,9 +29,10 @@
app:bmb_piecePlaceEnum=
"piecePlace_dot_9_1"
>
<ImageView
android:layout_width=
"40dp"
android:layout_height=
"40dp"
android:id=
"@+id/cube"
android:layout_width=
"50dp"
android:layout_height=
"50dp"
android:layout_gravity=
"center"
app:srcCompat=
"@drawable/
bottom_1
"
/>
app:srcCompat=
"@drawable/
cube
"
/>
</com.nightonke.boommenu.BoomMenuButton>
</FrameLayout>
\ No newline at end of file
mobile/src/main/res/values/dimens.xml
View file @
dfef6838
...
...
@@ -49,4 +49,5 @@
<dimen
name=
"brower_arrow_height"
>
150dp
</dimen>
<dimen
name=
"menu_text_size"
>
6dp
</dimen>
<dimen
name=
"menu_text_top"
>
-5dp
</dimen>
<dimen
name=
"spacing_medium"
>
1dp
</dimen>
</resources>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment