Search in sources :

Example 1 with LayoutParams

use of androidx.drawerlayout.widget.DrawerLayout.LayoutParams in project RxBinding by JakeWharton.

the class RxDrawerLayoutTestActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    drawerLayout = new DrawerLayout(this);
    drawerLayout.setId(android.R.id.primary);
    FrameLayout main = new FrameLayout(this);
    LayoutParams mainParams = new LayoutParams(MATCH_PARENT, MATCH_PARENT);
    drawerLayout.addView(main, mainParams);
    FrameLayout drawer = new FrameLayout(this);
    drawer.setBackgroundColor(Color.WHITE);
    LayoutParams drawerParams = new LayoutParams(300, MATCH_PARENT, RIGHT);
    drawerLayout.addView(drawer, drawerParams);
    setContentView(drawerLayout);
}
Also used : LayoutParams(androidx.drawerlayout.widget.DrawerLayout.LayoutParams) FrameLayout(android.widget.FrameLayout) DrawerLayout(androidx.drawerlayout.widget.DrawerLayout)

Aggregations

FrameLayout (android.widget.FrameLayout)1 DrawerLayout (androidx.drawerlayout.widget.DrawerLayout)1 LayoutParams (androidx.drawerlayout.widget.DrawerLayout.LayoutParams)1