use of android.view.animation.TranslateAnimation in project smartmodule by carozhu.
the class AnimationController method slideIn.
public void slideIn(View view, long durationMillis, long delayMillis) {
TranslateAnimation animation = new TranslateAnimation(rela2, 1, rela2, 0, rela2, 0, rela2, 0);
baseIn(view, animation, durationMillis, delayMillis);
}
use of android.view.animation.TranslateAnimation in project smartmodule by carozhu.
the class AnimationController method slideFadeIn.
public void slideFadeIn(View view, long durationMillis, long delayMillis) {
TranslateAnimation animation1 = new TranslateAnimation(rela2, 1, rela2, 0, rela2, 0, rela2, 0);
AlphaAnimation animation2 = new AlphaAnimation(0, 1);
AnimationSet animation = new AnimationSet(false);
animation.addAnimation(animation1);
animation.addAnimation(animation2);
baseIn(view, animation, durationMillis, delayMillis);
}
use of android.view.animation.TranslateAnimation in project JustAndroid by chinaltz.
the class OptAnimationLoader method createAnimationFromXml.
private static Animation createAnimationFromXml(Context c, XmlPullParser parser, AnimationSet parent, AttributeSet attrs) throws XmlPullParserException, IOException {
Animation anim = null;
// Make sure we are on a start tag.
int type;
int depth = parser.getDepth();
while (((type = parser.next()) != XmlPullParser.END_TAG || parser.getDepth() > depth) && type != XmlPullParser.END_DOCUMENT) {
if (type != XmlPullParser.START_TAG) {
continue;
}
String name = parser.getName();
if (name.equals("set")) {
anim = new AnimationSet(c, attrs);
createAnimationFromXml(c, parser, (AnimationSet) anim, attrs);
} else if (name.equals("alpha")) {
anim = new AlphaAnimation(c, attrs);
} else if (name.equals("scale")) {
anim = new ScaleAnimation(c, attrs);
} else if (name.equals("rotate")) {
anim = new RotateAnimation(c, attrs);
} else if (name.equals("translate")) {
anim = new TranslateAnimation(c, attrs);
} else {
try {
anim = (Animation) Class.forName(name).getConstructor(Context.class, AttributeSet.class).newInstance(c, attrs);
} catch (Exception te) {
throw new RuntimeException("Unknown animation name: " + parser.getName() + " error:" + te.getMessage());
}
}
if (parent != null) {
parent.addAnimation(anim);
}
}
return anim;
}
use of android.view.animation.TranslateAnimation in project KJFrameForAndroid by kymjs.
the class KJScrollView method boundBack.
/**
* 将内容布局移动到原位置 可以在UP事件中调用, 也可以在其他需要的地方调用, 如手指移动到当前ScrollView外时
*/
private void boundBack() {
if (!isMoved) {
// 如果没有移动布局, 则跳过执行
return;
}
// 开启动画
TranslateAnimation anim = new TranslateAnimation(0, 0, contentView.getTop(), originalRect.top);
anim.setDuration(ANIM_TIME);
contentView.startAnimation(anim);
// 设置回到正常的布局位置
contentView.layout(originalRect.left, originalRect.top, originalRect.right, originalRect.bottom);
// 将标志位设回false
canPullDown = false;
canPullUp = false;
isMoved = false;
}
use of android.view.animation.TranslateAnimation in project newsrob by marianokamp.
the class ShowArticleActivity method toggleFullScreenMode.
private void toggleFullScreenMode() {
final View v = findViewById(R.id.outter_container);
if (inFullScreenMode) {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
if (false) {
Animation animation = new TranslateAnimation(0f, 0f, 0f, v.getHeight());
animation.setDuration(500);
v.startAnimation(animation);
}
v.setVisibility(View.VISIBLE);
hideTitlePreview();
inFullScreenMode = false;
} else {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
if (false) {
Animation animation = new TranslateAnimation(0f, 0f, 0f, -v.getHeight());
animation.setDuration(500);
v.startAnimation(animation);
}
v.setVisibility(View.GONE);
Toast.makeText(this, "- Fullscreen Mode -\n (Tap twice to exit)", Toast.LENGTH_SHORT).show();
inFullScreenMode = true;
}
}
Aggregations