Search in sources :

Example 1 with AbsoluteLayout

use of android.widget.AbsoluteLayout in project platform_frameworks_base by android.

the class MultiProducerActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // To make things simple - we do a quick and dirty absolute layout.
    final AbsoluteLayout layout = new AbsoluteLayout(this);
    // Create the outer frame
    if (USE_FRAME) {
        mFrameTarget = new View(this);
        LayoutParams frameLP = new LayoutParams(WIDTH, HEIGHT, 0, 0);
        layout.addView(mFrameTarget, frameLP);
    }
    // Create the background which fills the gap between content and frame.
    if (USE_BACK) {
        mBackgroundTarget = new View(this);
        LayoutParams backgroundLP = new LayoutParams(WIDTH - 2 * BORDER_WIDTH, HEIGHT - 2 * BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH);
        layout.addView(mBackgroundTarget, backgroundLP);
    }
    // Create the content
    // Note: We reduce the size by CONTENT_GAP pixels on right and bottom, so that they get
    // drawn by the backdrop.
    mContent = new View(this);
    mContent.setBackground(new ColorPulse(0xFFF44336, 0xFF9C27B0, null));
    mContent.setOnClickListener(this);
    LayoutParams contentLP = new LayoutParams(WIDTH - 2 * BORDER_WIDTH - CONTENT_GAP, HEIGHT - 2 * BORDER_WIDTH - CONTENT_GAP, BORDER_WIDTH, BORDER_WIDTH);
    layout.addView(mContent, contentLP);
    setContentView(layout);
}
Also used : LayoutParams(android.widget.AbsoluteLayout.LayoutParams) View(android.view.View) AbsoluteLayout(android.widget.AbsoluteLayout)

Example 2 with AbsoluteLayout

use of android.widget.AbsoluteLayout in project android_frameworks_base by DirtyUnicorns.

the class MultiProducerActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // To make things simple - we do a quick and dirty absolute layout.
    final AbsoluteLayout layout = new AbsoluteLayout(this);
    // Create the outer frame
    if (USE_FRAME) {
        mFrameTarget = new View(this);
        LayoutParams frameLP = new LayoutParams(WIDTH, HEIGHT, 0, 0);
        layout.addView(mFrameTarget, frameLP);
    }
    // Create the background which fills the gap between content and frame.
    if (USE_BACK) {
        mBackgroundTarget = new View(this);
        LayoutParams backgroundLP = new LayoutParams(WIDTH - 2 * BORDER_WIDTH, HEIGHT - 2 * BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH);
        layout.addView(mBackgroundTarget, backgroundLP);
    }
    // Create the content
    // Note: We reduce the size by CONTENT_GAP pixels on right and bottom, so that they get
    // drawn by the backdrop.
    mContent = new View(this);
    mContent.setBackground(new ColorPulse(0xFFF44336, 0xFF9C27B0, null));
    mContent.setOnClickListener(this);
    LayoutParams contentLP = new LayoutParams(WIDTH - 2 * BORDER_WIDTH - CONTENT_GAP, HEIGHT - 2 * BORDER_WIDTH - CONTENT_GAP, BORDER_WIDTH, BORDER_WIDTH);
    layout.addView(mContent, contentLP);
    setContentView(layout);
}
Also used : LayoutParams(android.widget.AbsoluteLayout.LayoutParams) View(android.view.View) AbsoluteLayout(android.widget.AbsoluteLayout)

Example 3 with AbsoluteLayout

use of android.widget.AbsoluteLayout in project android_frameworks_base by ResurrectionRemix.

the class MultiProducerActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // To make things simple - we do a quick and dirty absolute layout.
    final AbsoluteLayout layout = new AbsoluteLayout(this);
    // Create the outer frame
    if (USE_FRAME) {
        mFrameTarget = new View(this);
        LayoutParams frameLP = new LayoutParams(WIDTH, HEIGHT, 0, 0);
        layout.addView(mFrameTarget, frameLP);
    }
    // Create the background which fills the gap between content and frame.
    if (USE_BACK) {
        mBackgroundTarget = new View(this);
        LayoutParams backgroundLP = new LayoutParams(WIDTH - 2 * BORDER_WIDTH, HEIGHT - 2 * BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH);
        layout.addView(mBackgroundTarget, backgroundLP);
    }
    // Create the content
    // Note: We reduce the size by CONTENT_GAP pixels on right and bottom, so that they get
    // drawn by the backdrop.
    mContent = new View(this);
    mContent.setBackground(new ColorPulse(0xFFF44336, 0xFF9C27B0, null));
    mContent.setOnClickListener(this);
    LayoutParams contentLP = new LayoutParams(WIDTH - 2 * BORDER_WIDTH - CONTENT_GAP, HEIGHT - 2 * BORDER_WIDTH - CONTENT_GAP, BORDER_WIDTH, BORDER_WIDTH);
    layout.addView(mContent, contentLP);
    setContentView(layout);
}
Also used : LayoutParams(android.widget.AbsoluteLayout.LayoutParams) View(android.view.View) AbsoluteLayout(android.widget.AbsoluteLayout)

Example 4 with AbsoluteLayout

use of android.widget.AbsoluteLayout in project android_frameworks_base by crdroidandroid.

the class MultiProducerActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // To make things simple - we do a quick and dirty absolute layout.
    final AbsoluteLayout layout = new AbsoluteLayout(this);
    // Create the outer frame
    if (USE_FRAME) {
        mFrameTarget = new View(this);
        LayoutParams frameLP = new LayoutParams(WIDTH, HEIGHT, 0, 0);
        layout.addView(mFrameTarget, frameLP);
    }
    // Create the background which fills the gap between content and frame.
    if (USE_BACK) {
        mBackgroundTarget = new View(this);
        LayoutParams backgroundLP = new LayoutParams(WIDTH - 2 * BORDER_WIDTH, HEIGHT - 2 * BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH);
        layout.addView(mBackgroundTarget, backgroundLP);
    }
    // Create the content
    // Note: We reduce the size by CONTENT_GAP pixels on right and bottom, so that they get
    // drawn by the backdrop.
    mContent = new View(this);
    mContent.setBackground(new ColorPulse(0xFFF44336, 0xFF9C27B0, null));
    mContent.setOnClickListener(this);
    LayoutParams contentLP = new LayoutParams(WIDTH - 2 * BORDER_WIDTH - CONTENT_GAP, HEIGHT - 2 * BORDER_WIDTH - CONTENT_GAP, BORDER_WIDTH, BORDER_WIDTH);
    layout.addView(mContent, contentLP);
    setContentView(layout);
}
Also used : LayoutParams(android.widget.AbsoluteLayout.LayoutParams) View(android.view.View) AbsoluteLayout(android.widget.AbsoluteLayout)

Aggregations

View (android.view.View)4 AbsoluteLayout (android.widget.AbsoluteLayout)4 LayoutParams (android.widget.AbsoluteLayout.LayoutParams)4