Android ViewParent - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ViewParent class.

This code example shows how to use the following methods: setEGLConfigChooser, setEGLContextClientVersion, setRenderer, getHolder, setZOrderOnTop
	@Override 
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
         
        glView = new GLSurfaceView(this);
        // Create an OpenGL ES 2.0 context. 
        glView.setEGLContextClientVersion(2);
        //rgba_8888 
        glView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
        // Set the Renderer for drawing on the GLSurfaceView 
        glView.setRenderer(new MyGLRenderer());
         
        setContentView(glView);
         
        //set translucent view 
        glView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
        // put glView on the top of window 
        glView.setZOrderOnTop(true);
 

6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getChildVisibleRect
        clip.top = 0;
        clip.right = mParent.getWidth();
        clip.bottom = mParent.getHeight();
 
        final ViewParent parent = mParent.getParent();
        if (parent == null || !parent.getChildVisibleRect(mParent, clip, null)) {
            return false; 
        } 
 
        final int[] coords = mTempCoords;
        mParent.getLocationInWindow(coords);
        final int posX = coords[0] + mPositionX + (int) mHotspotX;
        final int posY = coords[1] + mPositionY + (int) mHotspotY;
 
        return posX >= clip.left && posX <= clip.right &&
                posY >= clip.top && posY <= clip.bottom;
    } 
 
    // x and y are in physical pixels. 
    void moveTo(int x, int y) {
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getChildVisibleRect
        clip.top = 0;
        clip.right = mParent.getWidth();
        clip.bottom = mParent.getHeight();
 
        final ViewParent parent = mParent.getParent();
        if (parent == null || !parent.getChildVisibleRect(mParent, clip, null)) {
            return false; 
        } 
 
        final int[] coords = mTempCoords;
        mParent.getLocationInWindow(coords);
        final int posX = coords[0] + mPositionX + (int) mHotspotX;
        final int posY = coords[1] + mPositionY + (int) mHotspotY;
 
        return posX >= clip.left && posX <= clip.right &&
                posY >= clip.top && posY <= clip.bottom;
    } 
 
    // x and y are in physical pixels. 
    void moveTo(int x, int y) {
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getParent, getClass
    private ViewParent mActionBarView;
    private Class mActionBarViewClass;
    private Class mAbsActionBarViewClass;
 
    public ActionBarViewWrapper(ViewParent actionBarView) {
        if (!actionBarView.getClass().getName().contains("ActionBarView")) {
            String previousP = actionBarView.getClass().getName();
            actionBarView = actionBarView.getParent();
            String throwP = actionBarView.getClass().getName();
            if (!actionBarView.getClass().getName().contains("ActionBarView")) {
                throw new IllegalStateException("Cannot find ActionBarView for " +
                        "Activity, instead found " + previousP + " and " + throwP);
            } 
        } 
        mActionBarView = actionBarView;
        mActionBarViewClass = actionBarView.getClass();
        mAbsActionBarViewClass = actionBarView.getClass().getSuperclass();
    } 
 
    /** 

4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getChildVisibleRect
     */ 
    private boolean isSelectionVisible(Rect parentRect) {
        // Rescale first selection rect to be in the same coordinates system 
        final ViewParent parent = mParent.getParent();
        Rect rescaledAnchorRect = new Rect(mAnchorRect);
        parent.getChildVisibleRect(mParent, rescaledAnchorRect, null);
        return Rect.intersects(rescaledAnchorRect, parentRect);
    } 
 
    /** 
     * @return true if the selection menu should be visible in relation to its 
     * parent view. 
     */ 
    private boolean isPositionVisible(Point windowPos, Rect parentRect) {
        return windowPos.y >= parentRect.top &&
            windowPos.y + getMeasuredHeight() <= parentRect.bottom;
    } 
 
    /** 
     * @return visible rectangle of parent view. 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android ViewParent Questions & Answers:

See Code Examples for Android ViewParent Methods: