本文整理汇总了Java中android.view.ViewGroup.setTranslationY方法的典型用法代码示例。如果您正苦于以下问题:Java ViewGroup.setTranslationY方法的具体用法?Java ViewGroup.setTranslationY怎么用?Java ViewGroup.setTranslationY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.ViewGroup
的用法示例。
在下文中一共展示了ViewGroup.setTranslationY方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupMenu
import android.view.ViewGroup; //导入方法依赖的package包/类
private void setupMenu(int position)
{
menu = (ViewGroup)findViewById(R.id.menu_container);
int splash = R.drawable.ic_splash;
int colorAccent = Preferences.getAttributeColor(this, R.attr.colorAccent);
int button_menu = R.drawable.menu_btn;
addMenuItem(menu, getStringSrc(R.string.fragment_name_home), splash, colorAccent, button_menu, 0);
addMenuItem(menu, getStringSrc(R.string.fragment_name_wallpaper), splash, colorAccent, button_menu, 1);
addMenuItem(menu, getStringSrc(R.string.fragment_name_about), splash, colorAccent, button_menu, 2);
addMenuItem(menu, getStringSrc(R.string.fragment_name_settings), splash, colorAccent, button_menu, 3);
selectMenuItem(position, colorAccent);
menu.setTranslationY(20000);
}
示例2: setupSnackBar
import android.view.ViewGroup; //导入方法依赖的package包/类
public static void setupSnackBar(Activity activity, String contentText, String buttonText, View.OnClickListener listener)
{
snackbar = (ViewGroup)activity.findViewById(R.id.snackbar_container);
snackbar.setTranslationY(20000);
text = (TextView)snackbar.findViewById(R.id.id_snackbar_text);
button = (Button)snackbar.findViewById(R.id.id_snackbar_button);
text.setText(contentText);
button.setText(buttonText);
button.setOnClickListener(listener);
}
示例3: setupMenu
import android.view.ViewGroup; //导入方法依赖的package包/类
private void setupMenu() {
menu = (ViewGroup) findViewById(R.id.menu_container);
int color = getResources().getColor(R.color.splash1);
addMenuItem(menu, "Water And Noise", R.drawable.splash1, color, R.drawable.menu_btn, 0);
addMenuItem(menu, "Two Bears", R.drawable.splash2, getResources().getColor(R.color.splash2), R.drawable.menu_btn2, 1);
addMenuItem(menu, "Depth Playground", R.drawable.splash3, getResources().getColor(R.color.splash3), R.drawable.menu_btn3, 2);
addMenuItem(menu, "About", R.drawable.splash4, getResources().getColor(R.color.splash4), R.drawable.menu_btn4, 3);
selectMenuItem(0, color);
menu.setTranslationY(20000);
}