List of usage examples for android.view View findViewById
@Nullable public final <T extends View> T findViewById(@IdRes int id)
From source file:Main.java
public static void updateLeftTitle(View view, int viewId, String text) { View subView = view.findViewById(viewId); if (subView == null) { return;//from w w w . ja v a2 s . c o m } if (subView instanceof TextView) { ((TextView) subView).setText(text); } }
From source file:Main.java
public static void linkify(View view, int widgetId) { TextView textview = (TextView) view.findViewById(widgetId); if (textview != null) { textview.setMovementMethod(LinkMovementMethod.getInstance()); } else {/*w ww . j a v a 2s. c o m*/ Log.d(TAG, "NO " + widgetId); } }
From source file:Main.java
/** * Get a view by its resource name.//from w ww .j a v a 2 s .c o m * @param view ancestor view. * @param name view identifier resource name. * @return view or 0 if not found. */ @SuppressWarnings("unchecked") public static <T extends View> T getView(View view, String name) { return (T) view.findViewById(getId(view.getContext(), name)); }
From source file:Main.java
public static void enableView(View view, int i, OnClickListener onClickListener, boolean z) { View findViewById = view.findViewById(i); findViewById.setVisibility(z ? 0 : 8); findViewById.setOnClickListener(onClickListener); }
From source file:Main.java
private static TextView upgrade(View view, int stringId, String upgradeValue) { final TextView upgrade = (TextView) view.findViewById(stringId); upgrade.setVisibility(View.VISIBLE); if (upgradeValue != null) upgrade.setText(upgradeValue);/* w ww . j a v a2s . c om*/ return upgrade; }
From source file:Main.java
public static <T extends View> T findViewById(View view, int id) { @SuppressWarnings("unchecked") T v = (T) view.findViewById(id); return v;/* www . j a v a 2 s .c o m*/ }
From source file:Main.java
public static final EditText findEditTextX(View view, int resourceId) { EditText ret = null;/* w w w . j av a 2 s. c o m*/ ret = (EditText) view.findViewById(resourceId); if (ret == null) { throw new RuntimeException("Cannot find EditText with id = " + resourceId); } return ret; }
From source file:Main.java
public static final ListView findListViewX(View view, int resourceId) { ListView ret = null;/*ww w. j a va 2s . c om*/ ret = (ListView) view.findViewById(resourceId); if (ret == null) { throw new RuntimeException("Cannot find ListView with id = " + resourceId); } return ret; }
From source file:Main.java
public static final TextView findTextViewX(View view, int resourceId) { TextView ret = null;//from w ww.j a v a 2 s . c om ret = (TextView) view.findViewById(resourceId); if (ret == null) { throw new RuntimeException("Cannot find TextView with id = " + resourceId); } return ret; }
From source file:Main.java
public static boolean isFragmentInTop(Activity activity, int fragmentLayoutId) { View rootView = activity.findViewById(android.R.id.content); return rootView != null && rootView.findViewById(fragmentLayoutId) != null; }