Java Code Examples for android.view.ViewManager

The following examples show how to use android.view.ViewManager. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: react-native-navigation   Source File: ViewController.java    License: MIT License 6 votes vote down vote up
@CallSuper
public void destroy() {
    if (isShown) {
        isShown = false;
        onViewDisappear();
    }
    yellowBoxDelegate.destroy();
    if (view instanceof Destroyable) {
        ((Destroyable) view).destroy();
    }
    if (view != null) {
        view.getViewTreeObserver().removeOnGlobalLayoutListener(this);
        view.setOnHierarchyChangeListener(null);
        if (view.getParent() instanceof ViewGroup) {
            ((ViewManager) view.getParent()).removeView(view);
        }
        view = null;
        isDestroyed = true;
    }
}
 
Example 2
Source Project: styT   Source File: ViewUtil.java    License: Apache License 2.0 5 votes vote down vote up
static void removeView(ViewManager parent, View child) {
    if (parent == null || child == null) {
        return;
    }

    try {
        parent.removeView(child);
    } catch (NullPointerException ignored) {
        // This catch exists for modified versions of Android that have a buggy ViewGroup
        // implementation. See b.android.com/77639, #121 and #49
    }
}
 
Example 3
@Override
public List<com.facebook.react.uimanager.ViewManager> createViewManagers(ReactApplicationContext reactContext) {
    List<com.facebook.react.uimanager.ViewManager> modules = new ArrayList<>();
    modules.add(new RNDownloadButton());

    return modules;
}
 
Example 4
@Override
public List<com.facebook.react.uimanager.ViewManager> createViewManagers(ReactApplicationContext reactContext) {
    List<com.facebook.react.uimanager.ViewManager> modules = new ArrayList<>();
    modules.add(new RNDownloadButton());

    return modules;
}
 
Example 5
Source Project: TapTargetView   Source File: ViewUtil.java    License: Apache License 2.0 5 votes vote down vote up
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
  }
}
 
Example 6
Source Project: react-native-navigation   Source File: ViewUtils.java    License: MIT License 4 votes vote down vote up
public static void removeFromParent(View view) {
    ViewParent parent = view.getParent();
    if (parent != null) {
        ((ViewManager) parent).removeView(view);
    }
}
 
Example 7
Source Project: react-native-navigation   Source File: ViewController.java    License: MIT License 4 votes vote down vote up
public void detachView() {
    if (view == null || view.getParent() == null) return;
    ((ViewManager) view.getParent()).removeView(view);
}
 
Example 8
Source Project: c3nav-android   Source File: MainActivity.java    License: Apache License 2.0 4 votes vote down vote up
protected void unloadSplashVideo() {
    if (logoAnimView != null) {
        ((ViewManager) logoAnimView.getParent()).removeView(logoAnimView);
        logoAnimView = null;
    }
}
 
Example 9
Source Project: droid-stealth   Source File: Utils.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * Remove a view from a layout
 *
 * @param v the view to remove
 */
public static void remove(View v) {
	if (v.getParent() != null) {
		((ViewManager) v.getParent()).removeView(v);
	}
}
 
Example 10
Source Project: geopackage-mapcache-android   Source File: TileUrlFragment.java    License: MIT License 2 votes vote down vote up
/**
 * Delete a row from shared prefs and the Linear Layout
 * @param itemRow LinearLayout of the row to be deleted
 */
private void deleteRow(View itemRow){
    ((ViewManager)itemRow.getParent()).removeView(itemRow);
}