本文整理汇总了Java中android.view.View.setMinimumWidth方法的典型用法代码示例。如果您正苦于以下问题:Java View.setMinimumWidth方法的具体用法?Java View.setMinimumWidth怎么用?Java View.setMinimumWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.setMinimumWidth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addTab
import android.view.View; //导入方法依赖的package包/类
private void addTab(final int position, View tab) {
tab.setFocusable(true);
tab.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
pager.setCurrentItem(position);
// XXX INDSAT TIL DR RADIO: “Nulstil” visning, når der tappes på kanalikon i toppen, så man kommer tilbage til NU-visning (belejligt hvis man har scrollet op el. ned i epg liste)
//if (delegatePageListener != null && delegatePageListener instanceof Kanaler_frag) {
// ((Kanaler_frag) delegatePageListener).klikPåFane(position);
//}
// Grimt hack, men desværre umuligt at gøre på en anden måde
if (Kanal_frag.senesteSynligeFragment != null) {
Kanal_frag.senesteSynligeFragment.rulBlødtTilAktuelUdsendelse();
}
// XXX INDSAT TIL DR RADIO slut
}
});
tab.setPadding(tabPadding, 0, tabPadding, 0);
tab.setMinimumWidth(minBredde);
tabsContainer.addView(tab, position, shouldExpand ? expandedTabLayoutParams : defaultTabLayoutParams);
}
示例2: fuckView
import android.view.View; //导入方法依赖的package包/类
private static void fuckView(View v, boolean shouldVisibility) {
if (shouldVisibility)
v.setVisibility(View.GONE);
v.setWillNotDraw(true);
ViewGroup.LayoutParams layoutParams = v.getLayoutParams();
layoutParams.height = 0;
layoutParams.width = 0;
v.setPadding(0, 0, 0, 0);
v.setMinimumHeight(0);
v.setMinimumWidth(0);
v.setBackgroundColor(Color.TRANSPARENT);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
v.setAlpha(0f);
}
v.setLayoutParams(layoutParams);
v.clearAnimation();
}
示例3: initViews
import android.view.View; //导入方法依赖的package包/类
void initViews(View v) {
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
Rect displayRectangle = new Rect();
Window window = getActivity().getWindow();
window.getDecorView().getWindowVisibleDisplayFrame(displayRectangle);
v.setMinimumWidth((int)(displayRectangle.width() * 0.9f));
pairingInfoTextView = (TextView) v.findViewById(R.id.pairingInfoTextView);
initiatePairingButton = (Button) v.findViewById(R.id.initiatePairingButton);
saveServerBtn = (Button) v.findViewById(R.id.saveServerBtn);
v.findViewById(R.id.cancelBtn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
cancel();
}
});
}
示例4: applyMinWidth
import android.view.View; //导入方法依赖的package包/类
/**
* apply minimum Width in view
*/
public static void applyMinWidth(View view, DynamicProperty property) {
if (view != null) {
if (property.type == DynamicProperty.TYPE.DIMEN) {
view.setMinimumWidth(property.getValueInt());
}
}
}
示例5: createTabContent
import android.view.View; //导入方法依赖的package包/类
@Override
public View createTabContent(String tag) {
View v = new View(mContext);
v.setMinimumWidth(0);
v.setMinimumHeight(0);
return v;
}
示例6: createTabContent
import android.view.View; //导入方法依赖的package包/类
@Override
public View createTabContent(String tag) {
View v = new View(context);
v.setMinimumWidth(0);
v.setMinimumHeight(0);
return v;
}
示例7: setMinWidth
import android.view.View; //导入方法依赖的package包/类
/**
* 获取宽度
*
* @param width
* @return
*/
public UDView setMinWidth(int width) {
if (width >= 0) {
final View view = getView();
if (view != null) {
view.setMinimumWidth(width);
}
}
return this;
}
示例8: PasswordGenerationAdapter
import android.view.View; //导入方法依赖的package包/类
/**
* Builds the adapter to display views using data from delegate.
* @param context Android context.
* @param delegate The handler for clicking on the "saved passwords" link.
* @param passwordDisplayed Whether the auto-generated password should be suggested.
* @param password The auto-generated password to suggest.
* @param suggestionTitle The translated title of the suggestion part of the UI.
* @param explanationText The translated text for the explanation part of the UI.
* @param explanationTextLinkRangeStart The start of the range in the explanation text that
* should be a link to the saved passwords.
* @param explanationTextLinkRangeEnd The end of the range in the explanation text that should
* be a link to the saved passwords.
* @param anchorWidthInDp The width of the anchor to which the popup is attached. Used to size
* the explanation view.
*/
public PasswordGenerationAdapter(Context context, Delegate delegate, boolean passwordDisplayed,
String password, String suggestionTitle, String explanationText,
int explanationTextLinkRangeStart, int explanationTextLinkRangeEnd,
float anchorWidthInDp) {
super();
mContext = context;
mDelegate = delegate;
mViewTypes = passwordDisplayed ? Arrays.asList(SUGGESTION, EXPLANATION)
: Arrays.asList(EXPLANATION);
mPassword = password;
mSuggestionTitle = suggestionTitle;
mExplanationText = explanationText;
mExplanationTextLinkRangeStart = explanationTextLinkRangeStart;
mExplanationTextLinkRangeEnd = explanationTextLinkRangeEnd;
int horizontalMarginInPx = Math.round(mContext.getResources().getDimension(
R.dimen.password_generation_horizontal_margin));
int anchorWidthInPx = Math.round(anchorWidthInDp
* mContext.getResources().getDisplayMetrics().density);
View suggestion = getViewForType(SUGGESTION).findViewById(
R.id.password_generation_suggestion);
suggestion.setMinimumWidth(anchorWidthInPx - 2 * horizontalMarginInPx);
suggestion.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
mSuggestionMeasuredWidth = suggestion.getMeasuredWidth();
}
示例9: updateTabViews
import android.view.View; //导入方法依赖的package包/类
void updateTabViews(final boolean requestLayout) {
for (int i = 0; i < mTabStrip.getChildCount(); i++) {
View child = mTabStrip.getChildAt(i);
child.setMinimumWidth(getTabMinWidth());
updateTabViewLayoutParams((LinearLayout.LayoutParams) child.getLayoutParams());
if (requestLayout) {
child.requestLayout();
}
}
}
示例10: updateTabViews
import android.view.View; //导入方法依赖的package包/类
private void updateTabViews(boolean requestLayout) {
for (int i = 0; i < this.mTabStrip.getChildCount(); i++) {
View child = this.mTabStrip.getChildAt(i);
child.setMinimumWidth(getTabMinWidth());
updateTabViewLayoutParams((LayoutParams) child.getLayoutParams());
if (requestLayout) {
child.requestLayout();
}
}
}
示例11: createTabContent
import android.view.View; //导入方法依赖的package包/类
@Override
public View createTabContent(final String tag) {
View v = new View(mContext);
v.setMinimumWidth(0);
v.setMinimumHeight(0);
return v;
}
示例12: onCreate
import android.view.View; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.archos_info_dialog);
setCancelable(true);
setCanceledOnTouchOutside(true);
View root = findViewById(R.id.dialog_root_layout);
if (mMinWidth!=0) {
root.setMinimumWidth(mMinWidth);
}
if (mMinHeight!=0) {
root.setMinimumHeight(mMinHeight);
}
mTitleView = (TextView) findViewById(R.id.archos_info_title);
if (mTitle != null) {
mTitleView.setText(mTitle);
}
mSubtitleView = (TextView) findViewById(R.id.archos_info_subtitle);
if (mSubtitle != null) {
mSubtitleView.setText(mSubtitle);
}
mIconView = (ImageView) findViewById(R.id.archos_info_icon);
if (mIconDrawable != null) {
mIconView.setImageDrawable(mIconDrawable);
setIconSize(mIconDrawable);
} else if (mIconResId != 0) {
mIconView.setImageResource(mIconResId);
setIconSize(mIconResId);
}
// Display file info if already available
if (mFileSelection != null) {
updateFileSelectionInfo();
}
}
示例13: scaleView
import android.view.View; //导入方法依赖的package包/类
@SuppressLint("NewApi")
public static void scaleView(View view) {
if (view instanceof TextView) {
TextView textView = (TextView) view;
setTextSize(textView, textView.getTextSize());
}
ViewGroup.LayoutParams params = (ViewGroup.LayoutParams) view.getLayoutParams();
if (null != params) {
int width = INVALID;
int height = INVALID;
if (params.width != ViewGroup.LayoutParams.WRAP_CONTENT
&& params.width != ViewGroup.LayoutParams.MATCH_PARENT) {
width = params.width;
}
if (params.height != ViewGroup.LayoutParams.WRAP_CONTENT
&& params.height != ViewGroup.LayoutParams.MATCH_PARENT) {
height = params.height;
}
setViewSize(view, width, height);
setPadding(view, view.getPaddingLeft(), view.getPaddingTop(), view.getPaddingRight(), view.getPaddingBottom());
}
if (view.getLayoutParams() instanceof MarginLayoutParams) {
MarginLayoutParams mMarginLayoutParams = (MarginLayoutParams) view.getLayoutParams();
if (mMarginLayoutParams != null) {
setMargin(view, mMarginLayoutParams.leftMargin, mMarginLayoutParams.topMargin, mMarginLayoutParams.rightMargin, mMarginLayoutParams.bottomMargin);
}
}
if (VERSION.SDK_INT >= 16) {
int minWidth = scaleValue(view.getContext(), view.getMinimumWidth());
int minHeight = scaleValue(view.getContext(), view.getMinimumHeight());
view.setMinimumWidth(minWidth);
view.setMinimumHeight(minHeight);
}
}
示例14: createTabContent
import android.view.View; //导入方法依赖的package包/类
public View createTabContent(String tag) {
View v = new View(this.mContext);
v.setMinimumWidth(0);
v.setMinimumHeight(0);
return v;
}
示例15: createTabContent
import android.view.View; //导入方法依赖的package包/类
public View createTabContent(String tag) {
View v = new View(mContext);
v.setMinimumWidth(0);
v.setMinimumHeight(0);
return v;
}