@Override public Object getTag(int key) { if (mViewTags != null) { final Object value = mViewTags.get(key); if (value != null) { return value; } } return super.getTag(key); }
@DoNotStrip @Override public Object getTag() { if (mViewTag != null) { return mViewTag; } return super.getTag(); }
@NonNull private static ArrayList<Transition> getRunningTransitions(@NonNull ViewGroup viewGroup) { ArrayList<Transition> transitions = (ArrayList<Transition>) viewGroup.getTag(R.id.runningTransitions); if (transitions == null) { transitions = new ArrayList<Transition>(); viewGroup.setTag(R.id.runningTransitions, transitions); } return transitions; }
private void onImageClick(View image) { final ViewGroup parent = (ViewGroup) image.getParent(); final int itemPos = (int) parent.getTag(R.id.tag_item); final int imagePos = (int) image.getTag(R.id.tag_item); listener.onImageClick(itemPos, imagePos); }
/** * Returns a Scene described by the resource file associated with the given * <code>layoutId</code> parameter. If such a Scene has already been created, * that same Scene will be returned. This caching of layoutId-based scenes enables * sharing of common scenes between those created in code and those referenced * by {@link TransitionManager} XML resource files. * * @param sceneRoot The root of the hierarchy in which scene changes * and transitions will take place. * @param layoutId The id of a standard layout resource file. * @param context The context used in the process of inflating * the layout resource. * @return */ @NonNull public static Scene getSceneForLayout(@NonNull ViewGroup sceneRoot, int layoutId, @NonNull Context context) { SparseArray<Scene> scenes = (SparseArray<Scene>) sceneRoot.getTag(R.id.scene_layoutid_cache); if (scenes == null) { scenes = new SparseArray<Scene>(); sceneRoot.setTag(R.id.scene_layoutid_cache, scenes); } Scene scene = scenes.get(layoutId); if (scene != null) { return scene; } else { scene = new Scene(sceneRoot, layoutId, context); scenes.put(layoutId, scene); return scene; } }
OnScrollListener sl = (OnScrollListener) parent.getTag(AQuery.TAG_SCROLL_LISTENER);
group.getTag(R.id.group_layouttransition_backup); if (layoutTransition != null) { group.setTag(R.id.group_layouttransition_backup, null);
/** * Gets current location. * * @return current location, can be {@code null}. */ private IFile getLocation() { return (IFile) mViewLocations.getTag(); }// getLocation()
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_main, container, false); String result = container.getTag().toString(); // do something with the result return view;
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_main, container, false); String result = container.getTag().toString(); // do something with the result return view;
private boolean isMyNoteViewShowing(ViewGroup parent) { Object tag = parent.getTag(); return tag!=null && tag.equals(TAG); } }
@Override public int getItemPosition(Object object) { String tag = ((ViewGroup) object).getTag().toString(); if (tags.contains(tag)) { tags.remove(tag); return POSITION_NONE; } return POSITION_UNCHANGED; }
@Override public boolean call(ViewGroup view) { return view.getTag().equals("dotView"); } }, nDotsMatcher, "number of dots");
@Override public boolean call(ViewGroup view) { return view.getTag().equals("separatorView"); } }, nSeparatorsMatcher, "number of separators");
private TraversalState ensureTag(ViewGroup container) { TraversalState traversalState = (TraversalState) container.getTag(tagKey); if (traversalState == null) { traversalState = new TraversalState(); container.setTag(tagKey, traversalState); } return traversalState; } }
@Override public boolean call(ViewGroup view) { boolean isDotView = view.getTag().equals("dotView"); if (!isDotView) return false; View dotViewVisitedStep = view.findViewWithTag("dotViewVisitedStep"); return dotViewVisitedStep.getScaleX() == 1; } }, nDotsMatcher, "number of dots visited");
@Override public boolean call(ViewGroup view) { boolean isSeparatorView = view.getTag().equals("separatorView"); if (!isSeparatorView) return false; View dotViewVisitedStep = view.findViewWithTag("separatorViewVisitedStep"); return dotViewVisitedStep.getScaleX() == 1; } }, nSeparatorsMatcher, "number of separators visited");
@Override public void onGlobalLayout() { content.getViewTreeObserver().removeOnGlobalLayoutListener(this); ObjectAnimator anim; if (TAG_CROP_TOP_AND_SIDES.equals(content.getTag())) { content.setTranslationY(-content.getMeasuredHeight()); anim = LauncherAnimUtils.ofFloat(content, "translationY", 0); } else { content.setScaleX(0); content.setScaleY(0); PropertyValuesHolder scaleX = PropertyValuesHolder.ofFloat("scaleX", 1); PropertyValuesHolder scaleY = PropertyValuesHolder.ofFloat("scaleY", 1); anim = LauncherAnimUtils.ofPropertyValuesHolder(content, scaleX, scaleY); } anim.setDuration(SHOW_CLING_DURATION); anim.setInterpolator(new LogDecelerateInterpolator(100, 0)); anim.start(); } });