当前位置: 首页>>代码示例>>Java>>正文


Java ViewManager类代码示例

本文整理汇总了Java中android.view.ViewManager的典型用法代码示例。如果您正苦于以下问题:Java ViewManager类的具体用法?Java ViewManager怎么用?Java ViewManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ViewManager类属于android.view包,在下文中一共展示了ViewManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: makeVisible

import android.view.ViewManager; //导入依赖的package包/类
void makeVisible() {
    if (!mWindowAdded) {
        ViewManager wm = getWindowManager();
        wm.addView(mDecor, getWindow().getAttributes());
        mWindowAdded = true;
    }
    mDecor.setVisibility(View.VISIBLE);
}
 
开发者ID:JessYanCoding,项目名称:ProgressManager,代码行数:9,代码来源:a.java

示例2: detach

import android.view.ViewManager; //导入依赖的package包/类
public static boolean detach(@Nullable View view) {
    if (view != null && view.getParent() instanceof ViewManager) {
        ((ViewManager) view.getParent()).removeView(view);
        return true;
    }
    return false;
}
 
开发者ID:gnosygnu,项目名称:xowa_android,代码行数:8,代码来源:ViewUtil.java

示例3: attachChildToSelf

import android.view.ViewManager; //导入依赖的package包/类
public void attachChildToSelf() {
    ((ViewManager) child.getParent()).removeView(child);
    child.setLeft(childLeft);
    child.setTop(childTop);
    restoreTextViewSpannedText();
    addView(child, new LayoutParams(childLayoutParams));
}
 
开发者ID:wix,项目名称:react-native-navigation,代码行数:8,代码来源:SharedElementTransition.java

示例4: dismiss

import android.view.ViewManager; //导入依赖的package包/类
public void dismiss() {
    hide(new Runnable() {
        @Override
        public void run() {
            ((ViewManager) getParent()).removeView(ContextualMenu.this);
        }
    });
    NavigationApplication.instance.getEventEmitter().sendNavigatorEvent("contextualMenuDismissed", navigatorEventId);
}
 
开发者ID:wix,项目名称:react-native-navigation,代码行数:10,代码来源:ContextualMenu.java

示例5: removeView

import android.view.ViewManager; //导入依赖的package包/类
static void removeView(ViewManager parent, View child) {
  if (parent == null || child == null) {
    return;
  }

  try {
    parent.removeView(child);
  } catch (Exception ignored) {
    // This catch exists for modified versions of Android that have a buggy ViewGroup
    // implementation. See b.android.com/77639, #121 and #49
  }
}
 
开发者ID:KeepSafe,项目名称:TapTargetView,代码行数:13,代码来源:ViewUtil.java

示例6: remove

import android.view.ViewManager; //导入依赖的package包/类
public void remove() {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
        RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) getLayoutParams();
        setX(params.leftMargin);
        setY(params.topMargin);
        params.leftMargin = 0;
        params.topMargin = 0;
        setLayoutParams(params);
    }

    if (mToolTip.getAnimationType() == ToolTip.AnimationType.NONE) {
        if (getParent() != null) {
            ((ViewManager) getParent()).removeView(this);
        }
    } else {
        Collection<Animator> animators = new ArrayList<Animator>(5);
        if (mToolTip.getAnimationType() == ToolTip.AnimationType.FROM_MASTER_VIEW) {
            animators.add(ObjectAnimator.ofInt(this, TRANSLATION_Y_COMPAT, (int) getY(), mRelativeMasterViewY + mView.getHeight() / 2 - getHeight() / 2));
            animators.add(ObjectAnimator.ofInt(this, TRANSLATION_X_COMPAT, (int) getX(), mRelativeMasterViewX + mView.getWidth() / 2 - mWidth / 2));
        } else {
            animators.add(ObjectAnimator.ofFloat(this, TRANSLATION_Y_COMPAT, getY(), 0));
        }

        animators.add(ObjectAnimator.ofFloat(this, SCALE_X_COMPAT, 1, 0));
        animators.add(ObjectAnimator.ofFloat(this, SCALE_Y_COMPAT, 1, 0));

        animators.add(ObjectAnimator.ofFloat(this, ALPHA_COMPAT, 1, 0));

        AnimatorSet animatorSet = new AnimatorSet();
        animatorSet.playTogether(animators);
        animatorSet.addListener(new DisappearanceAnimatorListener());
        animatorSet.start();
    }
}
 
开发者ID:jp1017,项目名称:TheSceneryAlong,代码行数:35,代码来源:ToolTipView.java

示例7: removeViewParent

import android.view.ViewManager; //导入依赖的package包/类
/**
 * Remove parent of specified {@link View}
 *
 * @return {@code true} if parent was removed, {@code false} otherwise
 */
public static boolean removeViewParent(@NonNull View view) {
    ViewParent parent = view.getParent();
    if (parent instanceof ViewManager) {
        ((ViewManager) parent).removeView(view);
        return true;
    } else {
        return false;
    }
}
 
开发者ID:yuriy-budiyev,项目名称:android-wheels,代码行数:15,代码来源:CommonUtils.java

示例8: detach

import android.view.ViewManager; //导入依赖的package包/类
public static void detach(final View view) {
	final ViewManager parent = (ViewManager) view.getParent();
	if (parent == null) {
		return;
	}

	parent.removeView(view);
	Views.resetLayoutParamsType(view, new ViewGroup.LayoutParams(0, 0));
}
 
开发者ID:Widgetlabs,项目名称:fleet,代码行数:10,代码来源:ViewGroups.java

示例9: remove

import android.view.ViewManager; //导入依赖的package包/类
public void remove() {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
        RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) getLayoutParams();
        setX(params.leftMargin);
        setY(params.topMargin);
        params.leftMargin = 0;
        params.topMargin = 0;
        setLayoutParams(params);
    }

    if (mToolTip.getAnimationType() == ToolTip.AnimationType.NONE) {
        if (getParent() != null) {
            ((ViewManager) getParent()).removeView(this);
        }
    } else {
        Collection<Animator> animators = new ArrayList<>(5);
        if (mToolTip.getAnimationType() == ToolTip.AnimationType.FROM_MASTER_VIEW) {
            animators.add(ObjectAnimator.ofInt(this, TRANSLATION_Y_COMPAT, (int) getY(), mRelativeMasterViewY + mView.getHeight() / 2 - getHeight() / 2));
            animators.add(ObjectAnimator.ofInt(this, TRANSLATION_X_COMPAT, (int) getX(), mRelativeMasterViewX + mView.getWidth() / 2 - mWidth / 2));
        } else {
            animators.add(ObjectAnimator.ofFloat(this, TRANSLATION_Y_COMPAT, getY(), 0));
        }

        animators.add(ObjectAnimator.ofFloat(this, SCALE_X_COMPAT, 1, 0));
        animators.add(ObjectAnimator.ofFloat(this, SCALE_Y_COMPAT, 1, 0));

        animators.add(ObjectAnimator.ofFloat(this, ALPHA_COMPAT, 1, 0));

        AnimatorSet animatorSet = new AnimatorSet();
        animatorSet.playTogether(animators);
        animatorSet.addListener(new DisappearanceAnimatorListener());
        animatorSet.start();
    }
}
 
开发者ID:FAU-Inf2,项目名称:rpgpack-android,代码行数:35,代码来源:ToolTipView.java

示例10: deleteAdMarvelView

import android.view.ViewManager; //导入依赖的package包/类
/**
 * Delete the ad view.
 */
private void deleteAdMarvelView() {
	runOnUiThread(new Runnable() {
		@Override
		public void run() {
			try {
				((ViewManager) mAdMarvelView.getParent()).removeView(mAdMarvelView);
			}
			catch (Exception e) {
				// do nothing.
			}
		}
	});
}
 
开发者ID:jeisfeld,项目名称:Augendiagnose,代码行数:17,代码来源:AdMarvelActivity.java

示例11: onAttachedToWindow

import android.view.ViewManager; //导入依赖的package包/类
@SuppressWarnings("deprecation")
protected void onAttachedToWindow() {
	super.onAttachedToWindow();
	if (controller.active) controller.detach();
	controller.attach((ViewManager) drawview, MenuActivity.this);
	MenuActivity.this.showDialog(0, new Bundle());
}
 
开发者ID:tramzel,项目名称:overplayed,代码行数:8,代码来源:MenuActivity.java

示例12: attach

import android.view.ViewManager; //导入依赖的package包/类
public void attach(ViewManager wm, Context context) {
	this.wm = wm;
	// Add the buttons so when we activate the controller we don't
	// get an exception
	/*
	 * if (!customize) { wm.addView(hideButton, hideButton.params);
	 * wm.addView(alphaButton, alphaButton.params); wm.addView(stopButton,
	 * stopButton.params); }
	 */
	setActive(context);
}
 
开发者ID:tramzel,项目名称:overplayed,代码行数:12,代码来源:Controller.java

示例13: onCreateView

import android.view.ViewManager; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
  View view;
  if (settingsType == SettingsType.EditChannel)
  {
    getDialog().setTitle(R.string.channels);
    view = inflater.inflate(R.layout.fragment_edit, container);
    Button saveButton = (Button) view.findViewById(R.id.saveButton);
    saveButton.setOnClickListener(this);
    this.channelName = (EditText) view.findViewById(R.id.channelName);
    this.channelUrl = (EditText) view.findViewById(R.id.channelUrl);
    this.channelIcon = (Spinner) view.findViewById(R.id.channelIconSpinner);
    SimpleArrayAdapter channelAdapter = new SimpleArrayAdapter(inflater.getContext());
    channelIcon.setAdapter(channelAdapter);
    channelAdapter.add(new WebRadioChannel("[e] Electro",""));
    channelAdapter.add(new WebRadioChannel("[r] Rock",""));
    channelAdapter.add(new WebRadioChannel("[o] Oldies",""));
    channelAdapter.add(new WebRadioChannel("[c] Classic",""));
    channelAdapter.add(new WebRadioChannel("[j] Jazz",""));
    channelAdapter.add(new WebRadioChannel("[u] Undef",""));
    
    WebRadioChannel selChannel = ChannelList.getInstance().getSelectedChannel();
    if (selChannel != null)
    {
      channelName.setText(selChannel.getName());
      channelUrl.setText(selChannel.getUrl());
    }
  }
  else
  {
    getDialog().setTitle(R.string.settings);
    view = inflater.inflate(R.layout.fragment_settings, container);
    Button addButton = (Button) view.findViewById(R.id.addChannel);
    if (settingsType==SettingsType.Main) { ((ViewManager)view).removeView(addButton); }
    Button editButton = (Button) view.findViewById(R.id.editChannel);
    if (settingsType!=SettingsType.CustomChannel) { ((ViewManager)view).removeView(editButton); }
    Button editCsButton = (Button) view.findViewById(R.id.editChannels);
    if (settingsType!=SettingsType.Main) { ((ViewManager)view).removeView(editCsButton); }
    Button rmButton = (Button) view.findViewById(R.id.rmChannel);
    if (settingsType!=SettingsType.CustomChannel) { ((ViewManager)view).removeView(rmButton); }
    Button aboutButton = (Button) view.findViewById(R.id.about);
    if (settingsType!=SettingsType.Main) { ((ViewManager)view).removeView(aboutButton); }
    else { aboutButton.setText(R.string.about); }
    addButton.setOnClickListener(this);
    editButton.setOnClickListener(this);
    editCsButton.setOnClickListener(this);
    rmButton.setOnClickListener(this);
    aboutButton.setOnClickListener(this);
    view.forceLayout();
  }
  return view;
}
 
开发者ID:Starcommander,项目名称:StreamRadio,代码行数:54,代码来源:SettingsDialog.java

示例14: onAnimationEnd

import android.view.ViewManager; //导入依赖的package包/类
@Override
public void onAnimationEnd(final Animator animation) {
    if (getParent() != null) {
        ((ViewManager) getParent()).removeView(ToolTipView.this);
    }
}
 
开发者ID:jp1017,项目名称:TheSceneryAlong,代码行数:7,代码来源:ToolTipView.java

示例15: getParentViewManager

import android.view.ViewManager; //导入依赖的package包/类
public ViewManager getParentViewManager() {
	return (ViewManager) getParent();
}
 
开发者ID:TheFakeMontyOnTheRun,项目名称:knightsofalentejo,代码行数:4,代码来源:GameViewGLES2.java


注:本文中的android.view.ViewManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。