use of android.widget.LinearLayout.LayoutParams in project android_frameworks_base by crdroidandroid.
the class RevealActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
ProgressBar spinner = new ProgressBar(this, null, android.R.attr.progressBarStyleLarge);
layout.addView(spinner, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
View revealView = new MyView(this);
layout.addView(revealView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
setContentView(layout);
revealView.setOnClickListener(this);
}
use of android.widget.LinearLayout.LayoutParams in project android_frameworks_base by crdroidandroid.
the class HierarchicalMove method sendMessage.
public void sendMessage(View view) {
TransitionManager.beginDelayedTransition(mSceneRoot, mTransition);
int widthSpec = wide ? LayoutParams.WRAP_CONTENT : LayoutParams.MATCH_PARENT;
LayoutParams params = new LayoutParams(widthSpec, LayoutParams.WRAP_CONTENT);
for (int i = 0; i < buttons.length; ++i) {
buttons[i].setLayoutParams(params);
}
wide = !wide;
}
use of android.widget.LinearLayout.LayoutParams in project android_frameworks_base by crdroidandroid.
the class DelayedTransition method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.two_buttons);
final Button button1 = (Button) findViewById(R.id.button1);
final Button button2 = (Button) findViewById(R.id.button2);
final LinearLayout container = (LinearLayout) findViewById(R.id.container);
button1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int buttonWidth = button1.getWidth();
int containerWidth = container.getWidth();
if (buttonWidth < containerWidth) {
TransitionManager.beginDelayedTransition(container, null);
button1.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
TransitionManager.beginDelayedTransition(container, null);
button2.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
} else {
TransitionManager.beginDelayedTransition(container, null);
button1.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
TransitionManager.beginDelayedTransition(container, null);
button2.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
}
}
});
}
Aggregations