setAnimationStyle()を使用してポップアップウィンドウのアニメーションスタイルを試してみたいと思いますが、ドキュメントを理解するのに苦労しています。setAnimationStyle()の明示的なアニメーション、私の選択は何ですか?
"ポップアップが表示され消えるときに使用するアニメーションスタイル。デフォルトのアニメーションは-1、アニメーションなしの場合は0、明示的なアニメーションの場合はリソース識別子です。"
これは例を示していないか、利用可能なリソースの選択肢を教えてください。私は私の目的のための最高のアニメーションが右からスライドしていると思う...それはオプションとして存在するのだろうか?リストから選択することができますか、どういうわけか自分自身を作成する必要がありますか?
EDIT:
public void completed_dialog()
{
runOnUiThread(new Runnable()
{
public void run()
{
View layout = inflater.inflate(R.layout.endofgame, null, false);
Button b1 = (Button) layout.findViewById(R.id.pu_menu);
Button b2 = (Button) layout.findViewById(R.id.pu_repeat);
Button b3 = (Button) layout.findViewById(R.id.pu_next);
b1.setBackgroundResource(R.drawable.custom_menu_but);
b2.setBackgroundResource(R.drawable.custom_repeat_but);
b3.setBackgroundResource(R.drawable.custom_next_but);
b1.setOnClickListener(menu_button_click_listener);
b2.setOnClickListener(repeat_button_click_listener);
b3.setOnClickListener(next_button_click_listener);
final PopupWindow pw = new PopupWindow(layout, canvas_width,
canvas_width /2, true);
pw.setAnimationStyle(android.R.style.Animation_Dialog);
pw.showAtLocation(game_frame_layout, Gravity.CENTER, 0, 0);
}
}
}
私は今、ファイルのres /アニメーション/のtest.xmlに次のように入れている:
私のポップアップウィンドウを作成するための私の現在のコードは次のようなもの(簡体字)であります<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:fromXScale="0.3" android:toXScale="1.0"
android:fromYScale="0.3" android:toYScale="1.0"
android:pivotX="0%" android:pivotY="0%"
android:duration="@android:integer/config_shortAnimTime"
/>
<alpha
android:interpolator="@android:anim/decelerate_interpolator"
android:fromAlpha="0.0" android:toAlpha="1.0"
android:duration="@android:integer/config_shortAnimTime"
/>
</set>
元のコードはpw.setAnimationStyle(android.R.style.Animation_Dialog)です。ダイアログが標準のアニメーションで表示されているのと同じくらいうまくいきました。しかし、その行をpw.setAnimationStyle(R.anim.test)と入れ替えてみました。アニメーションはありません。なぜ私は考えていない。
ニース! 'mce_bogus =" 1 "'ものは何ですか? – Timmmm
なぜここで固定値ですか? 'android:toYDelta =" 854 "'あなたは説明したり、いくつかの代替を提供することができますか?画面が小さくなるとどうなるでしょうか? –