当前位置: 首页>>代码示例>>Java>>正文


Java LayoutParams类代码示例

本文整理汇总了Java中android.widget.TableLayout.LayoutParams的典型用法代码示例。如果您正苦于以下问题:Java LayoutParams类的具体用法?Java LayoutParams怎么用?Java LayoutParams使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LayoutParams类属于android.widget.TableLayout包,在下文中一共展示了LayoutParams类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CustomSeekBar

import android.widget.TableLayout.LayoutParams; //导入依赖的package包/类
public CustomSeekBar(Context context, AttributeSet attrs)
{
    super (context, attrs);

    setThumbOffset(2);

    lowerBoundView = new TextView(context, attrs);
    lowerBoundView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
    lowerBoundView.setGravity(Gravity.LEFT);

    upperBoundView = new TextView(context, attrs);
    upperBoundView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
    upperBoundView.setGravity(Gravity.RIGHT);

    initControl(context, attrs);

    updateTextColor();
}
 
开发者ID:oroca,项目名称:SkyRover_Android,代码行数:19,代码来源:CustomSeekBar.java

示例2: ParrotSeekBar

import android.widget.TableLayout.LayoutParams; //导入依赖的package包/类
public ParrotSeekBar(Context context, AttributeSet attrs)
{
	super (context, attrs);
	
	setThumbOffset(2);
	
	lowerBoundView = new TextView(context, attrs);
	lowerBoundView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
	lowerBoundView.setGravity(Gravity.LEFT);
	
	upperBoundView = new TextView(context, attrs);
	upperBoundView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
	upperBoundView.setGravity(Gravity.RIGHT);

	initControl(context, attrs);
	
	updateTextColor();
}
 
开发者ID:fblandroidhackathon,项目名称:persontracker,代码行数:19,代码来源:ParrotSeekBar.java

示例3: onShowReasonClick

import android.widget.TableLayout.LayoutParams; //导入依赖的package包/类
@Override
public void onShowReasonClick(Entry entry)
{
	PostItem item = new PostItem(KickInterfaceActivity.this, true, showNoelshackThumbnails, animateSmileys);
	JvcPost post = new JvcPost(null, 0, entry.getMessage() + "\n", entry.getPseudo(), false, false, 1, "", null, null);
	item.updateDataFromPost(post, false);

	final int tenDp = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10, getResources().getDisplayMetrics());
	LinearLayout layout = new LinearLayout(KickInterfaceActivity.this);
	layout.setOrientation(LinearLayout.VERTICAL);
	layout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
	layout.setBackgroundColor(Color.WHITE);

	TextView tv = new TextView(KickInterfaceActivity.this);
	LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
	params.bottomMargin = params.topMargin = tenDp;
	tv.setLayoutParams(params);
	tv.setTextSize(16);
	tv.setGravity(Gravity.CENTER);
	tv.setTextColor(getResources().getColor(R.color.jvcTopicName));
	tv.setTypeface(null, Typeface.BOLD);
	tv.setText("\u00AB " + entry.getSubject() + " \u00BB");
	layout.addView(tv);
	layout.addView(item.getView());

	Dialog previewDialog = new Dialog(KickInterfaceActivity.this, R.style.FullScreenNoTitleDialogTheme);
	previewDialog.setContentView(layout);
	previewDialog.setCancelable(true);
	previewDialog.show();
}
 
开发者ID:matmat94,项目名称:JVC-Forums-Reader,代码行数:31,代码来源:KickInterfaceActivity.java

示例4: forumReplyFormPreviewButtonClick

import android.widget.TableLayout.LayoutParams; //导入依赖的package包/类
public void forumReplyFormPreviewButtonClick(View view)
{
	if(topicSubjectEdit.length() > 0)
	{
		if(topicContentEdit.length() > 0)
		{
			MainApplication appContext = (MainApplication) getApplicationContext();
			PostItem item = new PostItem(this, true, showNoelshackThumbnails, animateSmileys);
			String date = new SimpleDateFormat("d MMMM y \u00E0 HH:mm:ss", Locale.FRANCE).format(new Date());
			JvcPost post = new JvcPost(null, 0, getPostTextWithSignature() + "\n", appContext.getJvcPseudo(), false, topicPostAsMobileCheckBox.isChecked(), 1, date, null, null);
			item.updateDataFromPost(post, true);

			final int tenDp = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10, getResources().getDisplayMetrics());
			LinearLayout layout = new LinearLayout(this);
			layout.setOrientation(LinearLayout.VERTICAL);
			layout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
			layout.setBackgroundColor(Color.WHITE);

			TextView tv = new TextView(this);
			LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
			params.bottomMargin = params.topMargin = tenDp;
			tv.setLayoutParams(params);
			tv.setTextSize(16);
			tv.setGravity(Gravity.CENTER);
			tv.setTextColor(getResources().getColor(R.color.jvcTopicName));
			tv.setTypeface(null, Typeface.BOLD);
			String title = "\u00AB " + topicSubjectEdit.getText().toString() + " \u00BB\nPage 1 / 1";
			if(enableSmileys)
				tv.setText(JvcTextSpanner.getSpannableTextFromSmileyNames(title, JvcUserData.getBoolean(JvcUserData.PREF_ANIMATE_SMILEYS, JvcUserData.DEFAULT_ANIMATE_SMILEYS)));
			else
				tv.setText(title);
			layout.addView(tv);

			layout.addView(item.getView());

			Dialog previewDialog = new Dialog(this, R.style.FullScreenNoTitleDialogTheme);
			previewDialog.setContentView(layout);
			previewDialog.setCancelable(true);
			previewDialog.setOnDismissListener(new OnDismissListener()
			{
				@Override
				public void onDismiss(DialogInterface dialog)
				{
					setAnimationView(scrollView);
				}
			});
			previewDialog.show();
			setAnimationView(layout);
		}
		else
		{
			Toast.makeText(this, R.string.postEmpty, Toast.LENGTH_LONG).show();
		}
	}
	else
	{
		Toast.makeText(this, R.string.subjectEmpty, Toast.LENGTH_LONG).show();
	}
}
 
开发者ID:matmat94,项目名称:JVC-Forums-Reader,代码行数:60,代码来源:ForumActivity.java

示例5: onCreate

import android.widget.TableLayout.LayoutParams; //导入依赖的package包/类
@Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.main3);
       db1=openOrCreateDatabase("bank.db", Context.MODE_PRIVATE, null);
       db1.execSQL("CREATE TABLE IF NOT EXISTS Account_Details (AccountNo INTEGER PRIMARY KEY, DateOfOpening DATE NOT NULL," +
			" Type TEXT CHECK((Type='CURRENT')OR(Type='SAVINGS')), BankName TEXT NOT NULL, BranchName TEXT NOT NULL, " +
			"BranchAddress TEXT NOT NULL, BranchPhno INTEGER, BranchFaxNo INTEGER, IFSCCode TEXT NOT NULL, ClearBalance INTEGER, " +
			"UnclearBalance INTEGER);");
       Cursor c=db1.rawQuery("SELECT * FROM Account_Details ORDER BY DateOfOpening DESC;",null);
       if(c!=null)
     			{if(c.moveToFirst())
      	
      do{
		
		String d4=c.getString(c.getColumnIndex("BankName"));
	final Long d1=c.getLong((c.getColumnIndex("AccountNo")));
	
		String temp=d1.toString();
		Button bt=new Button(ListAccount.this);
		ViewGroup tablelayout=(ViewGroup)findViewById(R.id.table3);
		bt.setText(temp);
							
		TextView tv=new TextView(ListAccount.this);
		tv.setText(d4);
		
		tv.setTextColor(Color.parseColor("#00CCFF"));
		tv.setGravity(Gravity.CENTER);
		bt.setBackgroundColor(Color.parseColor("#CCCCCC"));	
		bt.setPadding(0, 3, 0, 0);
		
		TableRow row;
		TableLayout.LayoutParams lp = new TableLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
		lp.setMargins(0, 10, 0, 0);
		
        row = new TableRow( this );
        tablelayout.addView( row );
        row.setLayoutParams(lp);
        int px=(int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,140,getResources().getDisplayMetrics());
        int px1=(int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 35,getResources().getDisplayMetrics());
        row.addView(tv,px,px1);
        row.addView(bt,px,px1);
        registerForContextMenu(bt);
		bt.setOnClickListener(new View.OnClickListener() {
			
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
		    Intent nextscreen=new Intent(getApplicationContext(),AccDetails.class);
			nextscreen.putExtra("id", d1);
			Log.e("List Screen",".");
               startActivity(nextscreen);		
			}
		});
		
j++;	}while(c.moveToNext());
      }
       if(j==0)
       { noDet=new TextView(ListAccount.this);
	ViewGroup linearlayout=(ViewGroup)findViewById(R.id.newbutton);
	noDet.setText("No Accounts to view");
	noDet.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
	noDet.setTextColor(Color.WHITE);
	noDet.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 24);
	linearlayout.addView(noDet);
 }
 }
 
开发者ID:ashish1294,项目名称:DigitalPassbook,代码行数:69,代码来源:ListAccount.java


注:本文中的android.widget.TableLayout.LayoutParams类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。