Popview-Android
介绍:
对任意view实现爆炸效果,并用新的view替换,基于Tyrantgit的 Explosion field项目。
运行效果:
使用说明:
依赖
dependencies {
compile 'rb.popview:popview:0.1.0'
}
初始化
PopField popField = PopField.attach2window(activity);
爆炸过后没有替代的View(第一个图标)
popField.popView(view);
爆炸之后被另一个view替换,替换时没有动画(第二个图标)
popField.popView(view,newView);
例子:
LayoutInflater layoutInflater = (LayoutInflater) getApplicationContext()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View addView = layoutInflater.inflate(R.layout.sampleview, null); //Inflate new view from xml
TextView newTextView = (TextView) addView.findViewById(R.id.sampletextview); //Reference the newview
newTextView.setText("New Sample text");
popField.popView(view,addView);
爆炸之后被另一个view替换,替换时有动画(第三个图标)
popField.popView(view,newView,true);
例子:
LayoutInflater layoutInflater = (LayoutInflater) getApplicationContext()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View addView = layoutInflater.inflate(R.layout.sampleview, null); //Inflate new view from xml
TextView newTextView = (TextView) addView.findViewById(R.id.sampletextview); //Reference the newview
newTextView.setText("New Sample text");
popField.popView(view,addView,true);
已下载
0