本文整理汇总了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);
}
示例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;
}
示例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));
}
示例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);
}
示例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
}
}
示例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();
}
}
示例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;
}
}
示例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));
}
示例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();
}
}
示例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.
}
}
});
}
示例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());
}
示例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);
}
示例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;
}
示例14: onAnimationEnd
import android.view.ViewManager; //导入依赖的package包/类
@Override
public void onAnimationEnd(final Animator animation) {
if (getParent() != null) {
((ViewManager) getParent()).removeView(ToolTipView.this);
}
}
示例15: getParentViewManager
import android.view.ViewManager; //导入依赖的package包/类
public ViewManager getParentViewManager() {
return (ViewManager) getParent();
}