Java Code Examples for android.view.ViewGroup.LayoutParams#FILL_PARENT
The following examples show how to use
android.view.ViewGroup.LayoutParams#FILL_PARENT .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FaceDetectionActivity.java From AndroidFaceRecognizer with MIT License | 6 votes |
private void initFaceImageViews(){ int wrapperHeight = screenHeight/5; LinearLayout.LayoutParams wrapperLayoutParams = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, wrapperHeight); int imageWrappers[] = {R.id.imageViewWrapper1, R.id.imageViewWrapper2, R.id.imageViewWrapper3, R.id.imageViewWrapper4, R.id.imageViewWrapper5, R.id.imageViewWrapper6, R.id.imageViewWrapper7, R.id.imageViewWrapper8, R.id.imageViewWrapper9, R.id.imageViewWrapper10}; int imageViews[] = {R.id.imageView1, R.id.imageView2, R.id.imageView3, R.id.imageView4, R.id.imageView5, R.id.imageView6, R.id.imageView7, R.id.imageView8, R.id.imageView9, R.id.imageView10}; for(int i = 0; i < imageWrappers.length; i++) { RelativeLayout wrapper = (RelativeLayout)findViewById(imageWrappers[i]); wrapper.setBackgroundResource(R.drawable.borders); wrapper.setLayoutParams(wrapperLayoutParams); } for(int i = 0; i < imageViews.length; i++) { ImageView faceImage = (ImageView)findViewById(imageViews[i]); faceImage.setPadding(1, 1, 1, 1); faceImage.setScaleType(ScaleType.FIT_XY); faceImage.setScaleType(ScaleType.FIT_XY); faceImage.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); faceImage.setBackgroundResource(R.drawable.borders); faceImage.setImageResource(R.drawable.icon); faceImages.add(faceImage); } }
Example 2
Source File: CBrowserMainFrame7.java From appcan-android with GNU Lesser General Public License v3.0 | 6 votes |
@Override public void onShowCustomView(View view, int requestedOrientation, final CustomViewCallback callback) { FrameLayout container = new FrameLayout(mContext); container.setBackgroundColor(0xff000000); FrameLayout.LayoutParams parm = new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); container.setLayoutParams(parm); container.setClickable(true); container.addView(view); // ((EBrowserActivity)mContext).requestWindowFeature() WebViewSdkCompat.CustomViewCallback compatCallback=new WebViewSdkCompat.CustomViewCallback() { @Override public void onCustomViewHidden() { callback.onCustomViewHidden(); } }; ((EBrowserActivity) mContext).showCustomView(container, compatCallback); }
Example 3
Source File: CBrowserMainFrame7.java From appcan-android with GNU Lesser General Public License v3.0 | 6 votes |
public void onShowCustomView(View view, int requestedOrientation, final CustomViewCallback callback) { FrameLayout container = new FrameLayout(mContext); container.setBackgroundColor(0xff000000); FrameLayout.LayoutParams parm = new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); container.setLayoutParams(parm); container.setClickable(true); container.addView(view); // ((EBrowserActivity)mContext).requestWindowFeature() WebViewSdkCompat.CustomViewCallback compatCallback=new WebViewSdkCompat.CustomViewCallback() { @Override public void onCustomViewHidden() { callback.onCustomViewHidden(); } }; ((EBrowserActivity) mContext).showCustomView(container, compatCallback); }
Example 4
Source File: TweetProgressDialog.java From YiBo with Apache License 2.0 | 6 votes |
private void initComponents() { LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View contentView = inflater.inflate(R.layout.widget_dialog_tweet_progress, null); tvDialogTitle = (TextView)contentView.findViewById(R.id.tvDialogTitle); lvAccount = (ListView)contentView.findViewById(R.id.lvAccount); btnPositive = (Button)contentView.findViewById(R.id.btnPositive); btnNegative = (Button)contentView.findViewById(R.id.btnNegative); btnPositive.setEnabled(false); listAdapter = new TweetProgressListAdapter(context); lvAccount.setAdapter(listAdapter); progressWindow = new PopupWindow(contentView, LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); progressWindow.setBackgroundDrawable(new ColorDrawable(Color.argb(100, 158, 158, 158))); progressWindow.setFocusable(true); progressWindow.setOutsideTouchable(true); progressWindow.setAnimationStyle(android.R.anim.fade_in); }
Example 5
Source File: FunSdkUiActivity.java From RePlugin-GameSdk with Apache License 2.0 | 5 votes |
private void initViews() { webViewLayout = new RelativeLayout(this); webViewLayout.setBackgroundColor(0xFFFFFFFF); webViewLayout.setLayoutParams(new LinearLayout.LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); mWebView = new HWWebView(this); mWebView.setBackgroundColor(0xFFFFFFFF); mWebView.clearCache(true); mWebView.setFocusable(true); mWebView.requestFocus(); mWebView.requestFocusFromTouch(); mWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); mWebView.setVerticalScrollBarEnabled(false); mWebView.setHorizontalScrollBarEnabled(false); LinearLayout.LayoutParams myWebViewParams = new LinearLayout.LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); mWebView.setLayoutParams(myWebViewParams); webViewLayout.addView(mWebView, myWebViewParams); setContentView(webViewLayout); mWebView.loadurl(urlString + "?" + postData.toString()); HWUtils.logError(TAG, "postData = " + postData.toString()); // mWebView.posturl(urlString, // EncodingUtils.getBytes(postData.toString(), "base64")); WebSettings set = mWebView.getSettings(); set.setSavePassword(false); set.setSaveFormData(false); set.setJavaScriptEnabled(true); set.setJavaScriptCanOpenWindowsAutomatically(true); }
Example 6
Source File: SkinEngine.java From styT with Apache License 2.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); toolbar = (android.support.v7.widget.Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); et_content = (EditText) findViewById(R.id.et_content); listView = (ListView) findViewById(R.id.lv_feedbacks); emptyView = new TextView(this); emptyView.setText("っ没有数据"); emptyView.setGravity(Gravity.CENTER); emptyView.setTextSize(15); //设置字体大小 LayoutParams params = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); addContentView(emptyView, params); listView.setEmptyView(emptyView); BmobQuery<xp> query = new BmobQuery<xp>(); query.order("-createdAt"); query.findObjects(new FindListener<xp>() { @Override public void done(List<xp> object, BmobException e) { if (e == null) { adapter = new FeedbackAdapter(SkinEngine.this, object); listView.setAdapter(adapter); } else { emptyView.setText((CharSequence) object); } } }); }
Example 7
Source File: ColorPickerDialog.java From PowerFileExplorer with GNU General Public License v3.0 | 5 votes |
@SuppressWarnings("deprecation") protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); OnColorChangedListener l = new OnColorChangedListener() { public void colorChanged(int fg , int bg) { mListener.colorChanged( fg , bg ); dismiss(); } }; ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); setContentView(new ColorPickerView(getContext(), l, mFgColor , mBgColor , mBgMode ), lp); setTitle(mTitle); }
Example 8
Source File: ColorPickerDialog.java From JotaTextEditor with Apache License 2.0 | 5 votes |
@SuppressWarnings("deprecation") protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); OnColorChangedListener l = new OnColorChangedListener() { public void colorChanged(int fg , int bg) { mListener.colorChanged( fg , bg ); dismiss(); } }; ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); setContentView(new ColorPickerView(getContext(), l, mFgColor , mBgColor , mBgMode ), lp); setTitle(mTitle); }
Example 9
Source File: FormEntryActivityUIController.java From commcare-android with Apache License 2.0 | 5 votes |
private void showView(QuestionsView next, AnimationType from, boolean animateLastView) { switch (from) { case RIGHT: mInAnimation = AnimationUtils.loadAnimation(activity, R.anim.push_left_in); mOutAnimation = AnimationUtils.loadAnimation(activity, R.anim.push_left_out); break; case LEFT: mInAnimation = AnimationUtils.loadAnimation(activity, R.anim.push_right_in); mOutAnimation = AnimationUtils.loadAnimation(activity, R.anim.push_right_out); break; case FADE: mInAnimation = AnimationUtils.loadAnimation(activity, R.anim.fade_in); mOutAnimation = AnimationUtils.loadAnimation(activity, R.anim.fade_out); break; } if (questionsView != null) { if (animateLastView) { questionsView.startAnimation(mOutAnimation); } mViewPane.removeView(questionsView); questionsView.teardownView(); } mInAnimation.setAnimationListener(this); RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); questionsView = next; mViewPane.addView(questionsView, lp); questionsView.startAnimation(mInAnimation); questionsView.setFocus(activity, indexOfLastChangedWidget); setupGroupLabel(); checkForOrientationRequirements(); }
Example 10
Source File: CBrowserMainFrame7.java From appcan-android with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void onShowCustomView(View view, final CustomViewCallback callback) { FullscreenHolder container = new FullscreenHolder(mContext); FrameLayout.LayoutParams parm = new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); container.setLayoutParams(parm); container.addView(view); WebViewSdkCompat.CustomViewCallback compatCallback=new WebViewSdkCompat.CustomViewCallback() { @Override public void onCustomViewHidden() { callback.onCustomViewHidden(); } }; ((EBrowserActivity) mContext).showCustomView(container, compatCallback); }
Example 11
Source File: CBrowserMainFrame7.java From appcan-android with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void onShowCustomView(View view, final CustomViewCallback callback) { FullscreenHolder container = new FullscreenHolder(mContext); FrameLayout.LayoutParams parm = new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); container.setLayoutParams(parm); container.addView(view); WebViewSdkCompat.CustomViewCallback compatCallback=new WebViewSdkCompat.CustomViewCallback() { @Override public void onCustomViewHidden() { callback.onCustomViewHidden(); } }; ((EBrowserActivity) mContext).showCustomView(container, compatCallback); }
Example 12
Source File: ListChooseDialog.java From YiBo with Apache License 2.0 | 5 votes |
private void initComponents() { LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View contentView = inflater.inflate(R.layout.widget_dialog_list_choose, null); lvItem = (ListView)contentView.findViewById(R.id.lvItem); View emptyView = contentView.findViewById(R.id.llLoadingView); lvItem.setEmptyView(emptyView); listWindow = new PopupWindow(contentView, LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); listWindow.setBackgroundDrawable(new ColorDrawable(Color.argb(100, 158, 158, 158))); listWindow.setFocusable(true); listWindow.setOutsideTouchable(true); listWindow.setAnimationStyle(android.R.anim.fade_in); }
Example 13
Source File: SeekBarPreference.java From fanfouapp-opensource with Apache License 2.0 | 5 votes |
@Override protected View onCreateDialogView() { LinearLayout.LayoutParams params; final LinearLayout layout = new LinearLayout(this.mContext); layout.setOrientation(LinearLayout.VERTICAL); layout.setPadding(6, 6, 6, 6); if (this.mDialogMessage != null) { this.mMessageText = new TextView(this.mContext); this.mMessageText.setText(this.mDialogMessage); layout.addView(this.mMessageText); } this.mValueText = new TextView(this.mContext); this.mValueText.setGravity(Gravity.CENTER_HORIZONTAL); this.mValueText.setTextSize(32); params = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); layout.addView(this.mValueText, params); this.mSeekBar = new SeekBar(this.mContext); this.mSeekBar.setOnSeekBarChangeListener(this); layout.addView(this.mSeekBar, new LinearLayout.LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); if (shouldPersist()) { this.mValue = getPersistedInt(this.mDefault); } // if(App.DEBUG){ // Log.d(TAG, "onCreateDialogView() mDefault="+mDefault); // Log.d(TAG, "onCreateDialogView() mMax="+mMax); // Log.d(TAG, "onCreateDialogView() mValue="+mValue); // } // mSeekBar.setMax(mMax); // mSeekBar.setProgress(mValue); return layout; }
Example 14
Source File: Main4Activity.java From styT with Apache License 2.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_4main); final SharedPreferences i = getSharedPreferences("pHello500", 0); Boolean o0 = i.getBoolean("FIRST", true); if (o0) {//第一次截图 /* AppCompatDialog alertDialog = new AlertDialog.Builder(this) .setTitle("其他规则") .setMessage("邀请一个人可以得*+0.10现金{0.25现金上限25人<其他现金无上限}\n推荐 一个人截一图") .setNeutralButton(android.R.string.yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { i.edit().putBoolean("FIRST", false).apply(); } }).setCancelable(false).create(); alertDialog.show();*/ } else { } toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); toolbar.setSubtitleTextAppearance(this, R.style.ts); toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp); // 设置导航图标 toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View p1) { finish(); } }); // finish(); xft(); Intent intent = new Intent(this, DownloadService.class); startService(intent); bindService(intent, mServiceConnection, BIND_AUTO_CREATE); if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1); } myUser = BmobUser.getCurrentUser(MyUser.class); init(); listView = (android.support.v7.widget.ListViewCompat) findViewById(R.id.lv_feedback); emptyView = new TextView(this); emptyView.setText(""); emptyView.setGravity(Gravity.CENTER); //emptyView.setTextSize(15); //设置字体大小 LayoutParams params = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); addContentView(emptyView, params); listView.setEmptyView(emptyView); BmobQuery<xp> query = new BmobQuery<>(); query.order("-createdAt"); query.findObjects(new FindListener<xp>() { @Override public void done(List<xp> object, BmobException e) { if (e == null) { adapter = new FeedbackAdapter(Main4Activity.this, object); listView.setAdapter(adapter); } else { emptyView.setText((CharSequence) object); } } }); }
Example 15
Source File: AccountSelectorWindow.java From YiBo with Apache License 2.0 | 4 votes |
private void initComponents() { LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View contentView = inflater.inflate(R.layout.widget_pop_account_selector, null); lvAccountSelector = (ListView)contentView.findViewById(R.id.lvAccountSelector); ImageView ivAccountSelectorFooter = (ImageView)contentView.findViewById(R.id.ivAccountSelectorFooter); Theme theme = ThemeUtil.createTheme(context); ThemeUtil.setContentBackground(lvAccountSelector); ThemeUtil.setListViewStyle(lvAccountSelector); ivAccountSelectorFooter.setBackgroundDrawable(theme.getDrawable("selector_bg_footer_account_selector")); View footerView = null; if (mode == SelectMode.Single) { footerView = inflater.inflate(R.layout.list_item_account_manage, null); LinearLayout llAccountManage = (LinearLayout)footerView.findViewById(R.id.llAccountManage); ImageView ivProfileImage = (ImageView)footerView.findViewById(R.id.ivProfileImage); TextView tvProfileName = (TextView)footerView.findViewById(R.id.tvProfileName); TextView tvImpress = (TextView)footerView.findViewById(R.id.tvImpress); ImageView ivMoreDetail = (ImageView)footerView.findViewById(R.id.ivMoreDetail); llAccountManage.setBackgroundDrawable(theme.getDrawable("selector_frame_item_no_corner")); llAccountManage.setPadding(theme.dip2px(8), theme.dip2px(4), theme.dip2px(16), theme.dip2px(4)); ivProfileImage.setImageDrawable(theme.getDrawable("icon_group")); tvProfileName.setTextColor(theme.getColor("content")); tvImpress.setTextColor(theme.getColor("remark")); ivMoreDetail.setBackgroundDrawable(theme.getDrawable("icon_more_detail")); footerView.setOnClickListener(new AccountManageClickListener(this)); } else { footerView = inflater.inflate(R.layout.list_item_account_selector_operate, null); Button btnSelectAll = (Button)footerView.findViewById(R.id.btnSelectAll); Button btnSelectInverse = (Button)footerView.findViewById(R.id.btnSelectInverse); ThemeUtil.setBtnActionPositive(btnSelectAll); ThemeUtil.setBtnActionNegative(btnSelectInverse); AccountSelectorOperateClickListener operateClickListener = new AccountSelectorOperateClickListener(this); btnSelectAll.setOnClickListener(operateClickListener); btnSelectInverse.setOnClickListener(operateClickListener); } lvAccountSelector.addFooterView(footerView); listAdapter = new AccountSelectorListAdapter(context, mode, isShowSnsAccount); lvAccountSelector.setAdapter(listAdapter); popList = new PopupWindow(contentView, LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); popList.setBackgroundDrawable(new BitmapDrawable()); popList.setFocusable(true); popList.setOutsideTouchable(true); }
Example 16
Source File: PermissionsDialog.java From FacebookNewsfeedSample-Android with Apache License 2.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.permissions_list); LayoutParams params = getWindow().getAttributes(); params.width = LayoutParams.FILL_PARENT; params.height = LayoutParams.FILL_PARENT; getWindow().setAttributes((android.view.WindowManager.LayoutParams) params); mPermissionDetails = (TextView) findViewById(R.id.permission_detail); mPermissionDetails.setMovementMethod(LinkMovementMethod.getInstance()); userPermissionsList = (ListView) findViewById(R.id.user_permissions_list); friendPermissionsList = (ListView) findViewById(R.id.friend_permissions_list); extendedPermissionsList = (ListView) findViewById(R.id.extended_permissions_list); userPermissionsAdapter = new PermissionsListAdapter(user_permissions); userPermissionsList.setAdapter(userPermissionsAdapter); friendPermissionsAdapter = new PermissionsListAdapter(friend_permissions); friendPermissionsList.setAdapter(friendPermissionsAdapter); extendedPermissionAdapter = new PermissionsListAdapter(extended_permissions); extendedPermissionsList.setAdapter(extendedPermissionAdapter); TabHost tabHost = (TabHost) findViewById(R.id.tabHost); tabHost.setup(); TabSpec spec1 = tabHost.newTabSpec("Tab 1"); spec1.setIndicator(activity.getString(R.string.user)); spec1.setContent(R.id.user_permissions_list); TabSpec spec2 = tabHost.newTabSpec("Tab 2"); spec2.setIndicator(activity.getString(R.string.friend)); spec2.setContent(R.id.friend_permissions_list); TabSpec spec3 = tabHost.newTabSpec("Tab 3"); spec3.setIndicator(activity.getString(R.string.extended)); spec3.setContent(R.id.extended_permissions_list); tabHost.addTab(spec1); tabHost.addTab(spec2); tabHost.addTab(spec3); tabHost.setCurrentTab(0); tabHost.getTabWidget().getChildAt(0).getLayoutParams().height = TAB_HEIGHT; tabHost.getTabWidget().getChildAt(1).getLayoutParams().height = TAB_HEIGHT; tabHost.getTabWidget().getChildAt(2).getLayoutParams().height = TAB_HEIGHT; mGetPermissions = (Button) findViewById(R.id.get_permissions_button); mGetPermissions.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { /* * Source Tag: perms_tag Call authorize to get the new * permissions */ if (reqPermVector.isEmpty() && Utility.mFacebook.isSessionValid()) { Toast.makeText(activity.getBaseContext(), "No Permissions selected.", Toast.LENGTH_SHORT).show(); PermissionsDialog.this.dismiss(); } else { String[] permissions = reqPermVector.toArray(new String[0]); Utility.mFacebook.authorize(activity, permissions, new LoginDialogListener()); } } }); }