android.view.ViewManager Java Examples

The following examples show how to use android.view.ViewManager. 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 check out the related API usage on the sidebar.
Example #1
Source Project: react-native-navigation   Author: wix   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   Author: stytooldex   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
Source Project: react-native-download-button   Author: prscX   File: RNDownloadButtonPackage.java    License: MIT License 5 votes vote down vote up
@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
Source Project: react-native-download-button   Author: prscX   File: RNDownloadButtonPackage.java    License: MIT License 5 votes vote down vote up
@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   Author: KeepSafe   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   Author: wix   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   Author: wix   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   Author: c3nav   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   Author: droidstealth   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   Author: ngageoint   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);
}