本文整理汇总了Java中android.widget.ScrollView.setLayoutParams方法的典型用法代码示例。如果您正苦于以下问题:Java ScrollView.setLayoutParams方法的具体用法?Java ScrollView.setLayoutParams怎么用?Java ScrollView.setLayoutParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ScrollView
的用法示例。
在下文中一共展示了ScrollView.setLayoutParams方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setMessage
import android.widget.ScrollView; //导入方法依赖的package包/类
public void setMessage(Spanned spanned) {
ScrollView scrollView = new ScrollView(getContext());
scrollView.setLayoutParams(new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.WRAP_CONTENT));
TextView tvMessage = new TextView(getContext(), null,
R.style.dialog_pinterest_text);
tvMessage.setLayoutParams(new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.WRAP_CONTENT));
tvMessage.setPadding(contentPadding, contentPadding, contentPadding,
contentPadding);
tvMessage.setLineSpacing(0.0F, 1.3F);
tvMessage.setText(spanned);
tvMessage.setTextColor(getContext().getResources().getColor(
R.color.black));
ScrollView.LayoutParams lp = new ScrollView.LayoutParams(
ScrollView.LayoutParams.MATCH_PARENT,
ScrollView.LayoutParams.WRAP_CONTENT);
scrollView.addView(tvMessage, lp);
setContent(scrollView, 0);
}
示例2: inflateViews
import android.widget.ScrollView; //导入方法依赖的package包/类
public View inflateViews() {
mScrollView = new ScrollView(getActivity());
ViewGroup.LayoutParams scrollParams = new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT);
mScrollView.setLayoutParams(scrollParams);
mLogView = new LogView(getActivity());
ViewGroup.LayoutParams logParams = new ViewGroup.LayoutParams(scrollParams);
logParams.height = ViewGroup.LayoutParams.WRAP_CONTENT;
mLogView.setLayoutParams(logParams);
mLogView.setClickable(true);
mLogView.setFocusable(true);
mLogView.setTypeface(Typeface.MONOSPACE);
// Want to set padding as 16 dips, setPadding takes pixels. Hooray math!
int paddingDips = 16;
double scale = getResources().getDisplayMetrics().density;
int paddingPixels = (int) ((paddingDips * (scale)) + .5);
mLogView.setPadding(paddingPixels, paddingPixels, paddingPixels, paddingPixels);
mLogView.setCompoundDrawablePadding(paddingPixels);
mLogView.setGravity(Gravity.BOTTOM);
mLogView.setTextAppearance(getActivity(), android.R.style.TextAppearance_Holo_Medium);
mScrollView.addView(mLogView);
return mScrollView;
}
示例3: onCreateContent
import android.widget.ScrollView; //导入方法依赖的package包/类
@Override
protected void onCreateContent(QMUIDialog dialog, ViewGroup parent) {
mScrollerView = new ScrollView(mContext);
mScrollerView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, onGetScrollHeight()));
mScrollerView.addView(onBuildContent(dialog, mScrollerView));
parent.addView(mScrollerView);
}
示例4: init
import android.widget.ScrollView; //导入方法依赖的package包/类
private void init() {
sc = new ScrollView(getContext());
sc.setLayoutParams(new FrameLayout.LayoutParams(Ui.cd.DPW+ Ui.cd.DPW, Ui.cd.DPH));
sc.setBackgroundColor(0x00FFFFFF);
addView(sc);
main = new FMlyt(getContext(), Ui.cd.DPW, Ui.cd.DPH);
main.setBackgroundColor(0x00000000);
sc.addView(main,new ScrollView.LayoutParams(Ui.cd.DPW, Ui.cd.DPH));
FMView back = new FMView(getContext(), Ui.cd.DPW, Ui.cd.DPH+ Ui.cd.DPH);
back.setLayerType(LAYER_TYPE_SOFTWARE,null);
main.addView(back);
ShapeView titleback = titleBackground.getFMview(getContext(),false);
titleback.setSize(Ui.cd.DPW, Ui.cd.getHt(60));
main.addView(titleback);
FMText titleText = textImg.getFMText(getContext() ,"AUDIO EQULIZERS", Ui.cd.getHt(18));
titleText.img.setColor(0x66FFFFFF);
titleText.InCenter(Ui.cd.DPW, Ui.cd.getHt(60));
main.addView(titleText);
int top = Ui.cd.getHt(60);
top = bassFn(top);
top = verchulizerFn(top);
top = eqlizerFn(top);
back.setSize(back.width,top);
}
示例5: createLayout
import android.widget.ScrollView; //导入方法依赖的package包/类
private void createLayout(int width) {
float scale = IceScreenUtils.densityScale(getApplicationContext());
int margin = 16 * Math.round(scale);
LinearLayout.LayoutParams baseParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
LinearLayout.LayoutParams containerParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
LinearLayout.LayoutParams imageParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1f);
ScrollView baseScroller = new ScrollView(this);
baseScroller.setLayoutParams(baseParams);
baseScroller.setBackgroundColor(0xffffffff);
setContentView(baseScroller);
baseScroller.setVisibility(View.VISIBLE);
// display width hack
Rect windowRect = new Rect();
baseScroller.getWindowVisibleDisplayFrame(windowRect);
int windowWidth = windowRect.right - windowRect.left;
LinearLayout baseLayout = new LinearLayout(this);
baseLayout.setOrientation(LinearLayout.VERTICAL);
baseLayout.setLayoutParams(layoutParams);
baseLayout.setPadding(margin, margin, 0, 0);
baseScroller.addView(baseLayout);
String[] wallpapers = getResources().getStringArray(R.array.wallpapers);
for (int i = 0; i < wallpapers.length; i++) {
if ((i % width) == 0) {
layoutList.add((i / width), new LinearLayout(this));
layoutList.get(i / width).setOrientation(LinearLayout.HORIZONTAL);
layoutList.get(i / width).setGravity(Gravity.LEFT);
layoutList.get(i / width).setLayoutParams(containerParams);
baseLayout.addView(layoutList.get(i / width));
}
imageList.add(i, new ImageView(this));
imageList.get(i).setLayoutParams(imageParams);
imageList.get(i).setScaleType(ImageView.ScaleType.FIT_XY);
imageList.get(i).setPadding(0, 0, margin, margin);
IceImageUtils.bitmapLoadAsync(imageList.get(i), getApplicationContext(), getApplicationContext().getResources(), wallpapers[i], (windowWidth / width) - (margin * width + margin) / width, (windowWidth / width) - (margin * width + margin) / width);
imageList.get(i).setAdjustViewBounds(true);
final Integer tempId = getResources().getIdentifier(wallpapers[i], "drawable", getPackageName());
imageList.get(i).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
wallpaperView(tempId);
}
});
layoutList.get(i / width).addView(imageList.get(i));
}
}
示例6: createLayout
import android.widget.ScrollView; //导入方法依赖的package包/类
private void createLayout(int width) {
float scale = IceScreenUtils.densityScale(getApplicationContext());
int margin = 16 * Math.round(scale);
LinearLayout.LayoutParams baseParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
LinearLayout.LayoutParams containerParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
LinearLayout.LayoutParams imageParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1f);
ScrollView baseScroller = new ScrollView(this);
baseScroller.setLayoutParams(baseParams);
baseScroller.setBackgroundColor(0xff000000);
setContentView(baseScroller);
baseScroller.setVisibility(View.VISIBLE);
// display width hack
Rect windowRect = new Rect();
baseScroller.getWindowVisibleDisplayFrame(windowRect);
int windowWidth = windowRect.right - windowRect.left;
LinearLayout baseLayout = new LinearLayout(this);
baseLayout.setOrientation(LinearLayout.VERTICAL);
baseLayout.setLayoutParams(layoutParams);
baseLayout.setPadding(margin, margin, 0, 0);
baseScroller.addView(baseLayout);
String[] images = getResources().getStringArray(R.array.icon_pack);
for (int i = 0; i < images.length; i++) {
if ((i % width) == 0) {
layoutList.add((i / width), new LinearLayout(this));
layoutList.get(i / width).setOrientation(LinearLayout.HORIZONTAL);
layoutList.get(i / width).setGravity(Gravity.LEFT);
layoutList.get(i / width).setLayoutParams(containerParams);
baseLayout.addView(layoutList.get(i / width));
}
imageList.add(i, new ImageView(this));
imageList.get(i).setLayoutParams(imageParams);
imageList.get(i).setScaleType(ImageView.ScaleType.FIT_XY);
imageList.get(i).setPadding(0, 0, margin, margin);
IceImageUtils.bitmapLoadAsync(imageList.get(i), getApplicationContext(), getApplicationContext().getResources(), "nodpi_" + images[i], (windowWidth / width) - (margin * width + margin) / width, (windowWidth / width) - (margin * width + margin) / width);
imageList.get(i).setAdjustViewBounds(true);
layoutList.get(i / width).addView(imageList.get(i));
}
}
示例7: createComponentView
import android.widget.ScrollView; //导入方法依赖的package包/类
public View createComponentView(Context context, ViewGroup parent, XViewBody yiew) {
ScrollView view = new ScrollView(context);
ViewGroup.LayoutParams params = Utils.createLayoutParams(parent, yiew);
view.setLayoutParams(params);
view.setVerticalFadingEdgeEnabled(false);
view.setOverScrollMode(ScrollView.OVER_SCROLL_NEVER);
view.setFadingEdgeLength(0);
ViewProcess.applyView(view, yiew);
LayoutProcess.applyaLayout(view, params, yiew);
view.setVerticalFadingEdgeEnabled(false);
view.setOverScrollMode(ScrollView.OVER_SCROLL_NEVER);
view.setFadingEdgeLength(0);
ViewGroupProcess.applyViewGroup(view,yiew);
return view;
}