use of android.widget.LinearLayout.LayoutParams in project android_frameworks_base by ResurrectionRemix.
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 ResurrectionRemix.
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 ResurrectionRemix.
the class PowerTestActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.v(LOGTAG, "onCreate, inst=" + Integer.toHexString(hashCode()));
LinearLayout contentView = new LinearLayout(this);
contentView.setOrientation(LinearLayout.VERTICAL);
setContentView(contentView);
setTitle("Idle");
webView = new WebView(this);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);
webView.getSettings().setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
webViewClient = new SimpleWebViewClient();
chromeClient = new SimpleChromeClient();
webView.setWebViewClient(webViewClient);
webView.setWebChromeClient(chromeClient);
contentView.addView(webView, new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, 0.0f));
handler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
case MSG_TIMEOUT:
handleTimeout();
return;
case MSG_NAVIGATE:
manualDelay = msg.arg2;
navigate(msg.getData().getString(MSG_NAV_URL), msg.arg1);
logTime = msg.getData().getBoolean(MSG_NAV_LOGTIME);
return;
}
}
};
pageDoneLock = new Object();
}
use of android.widget.LinearLayout.LayoutParams in project FlycoDialog_Master by H07000223.
the class ActionSheetDialog method setUiBeforShow.
@Override
public void setUiBeforShow() {
/** title */
float radius = dp2px(mCornerRadius);
mTvTitle.setHeight(dp2px(mTitleHeight));
mTvTitle.setBackgroundDrawable(CornerUtils.cornerDrawable(mTitleBgColor, new float[] { radius, radius, radius, radius, 0, 0, 0, 0 }));
mTvTitle.setText(mTitle);
mTvTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, mTitleTextSize);
mTvTitle.setTextColor(mTitleTextColor);
mTvTitle.setVisibility(mIsTitleShow ? View.VISIBLE : View.GONE);
/** title underline */
mVLineTitle.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, dp2px(mDividerHeight)));
mVLineTitle.setBackgroundColor(mDividerColor);
mVLineTitle.setVisibility(mIsTitleShow ? View.VISIBLE : View.GONE);
/** mCancel btn */
mTvCancel.setHeight(dp2px(mItemHeight));
mTvCancel.setText(mCancelText);
mTvCancel.setTextSize(TypedValue.COMPLEX_UNIT_SP, mCancelTextSize);
mTvCancel.setTextColor(mCancelTextColor);
mTvCancel.setBackgroundDrawable(CornerUtils.listItemSelector(radius, mLvBgColor, mItemPressColor, 1, 0));
mTvCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dismiss();
}
});
/** listview */
mLv.setDivider(new ColorDrawable(mDividerColor));
mLv.setDividerHeight(dp2px(mDividerHeight));
if (mIsTitleShow) {
mLv.setBackgroundDrawable(CornerUtils.cornerDrawable(mLvBgColor, new float[] { 0, 0, 0, 0, radius, radius, radius, radius }));
} else {
mLv.setBackgroundDrawable(CornerUtils.cornerDrawable(mLvBgColor, radius));
}
if (mAdapter == null) {
mAdapter = new ListDialogAdapter();
}
mLv.setAdapter(mAdapter);
mLv.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (mOnOperItemClickL != null) {
mOnOperItemClickL.onOperItemClick(parent, view, position, id);
}
}
});
mLv.setLayoutAnimation(mLac);
}
use of android.widget.LinearLayout.LayoutParams in project GridListViewAdapters by birajpatel.
the class BaseGridAdapter method addNewCardsInRow.
/**
* Adds the new cards in a new RowView by calling {@link #getNewCard(int)}
* for each card.
*
* @param rowView the row view
* @param rowViewHolder the row view holder
* @param totalCardsInRow the total cards in row
*/
private void addNewCardsInRow(LinearLayout rowView, RowViewHolder<CVH> rowViewHolder, int totalCardsInRow) {
int cardwidth = getCardWidth(totalCardsInRow);
LinearLayout.LayoutParams layoutParams = null;
CVH cardViewHolder = null;
for (int positionInRow = 0; positionInRow < totalCardsInRow; positionInRow++) {
boolean isLastCardInaRow = positionInRow == (totalCardsInRow - 1);
Card<CVH> card = getNewCard(cardwidth);
View cardView = card.getCardView();
cardView.setTag(positionInRow);
layoutParams = getCardLayoutParams(cardwidth, isLastCardInaRow);
rowView.addView(cardView, layoutParams);
cardViewHolder = card.getCardViewHolder();
rowViewHolder.getCardViewHolders().add(cardViewHolder);
registerChildrenViewClickEvents(cardViewHolder, childViewsClickHandler);
}
}
Aggregations