Java Code Examples for android.widget.LinearLayout#setClipToPadding()
The following examples show how to use
android.widget.LinearLayout#setClipToPadding() .
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: MaterialCalendarView.java From monthweekmaterialcalendarview with Apache License 2.0 | 6 votes |
private void setupChildren() { topbar = new LinearLayout(getContext()); topbar.setOrientation(LinearLayout.HORIZONTAL); topbar.setClipChildren(false); topbar.setClipToPadding(false); if (showTopBar) { addView(topbar, new LayoutParams(1)); } buttonPast.setScaleType(ImageView.ScaleType.CENTER_INSIDE); topbar.addView(buttonPast, new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1)); title.setGravity(Gravity.CENTER); topbar.addView(title, new LinearLayout.LayoutParams( 0, LayoutParams.MATCH_PARENT, DEFAULT_DAYS_IN_WEEK - 2 )); buttonFuture.setScaleType(ImageView.ScaleType.CENTER_INSIDE); topbar.addView(buttonFuture, new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1)); pager.setId(R.id.mcv_pager); pager.setOffscreenPageLimit(1); addView(pager, new LayoutParams(calendarMode.visibleWeeksCount + DAY_NAMES_ROW)); }
Example 2
Source File: CalendarView2.java From calendarview2 with MIT License | 6 votes |
private void setupChildren() { topbar = new LinearLayout(getContext()); topbar.setOrientation(LinearLayout.HORIZONTAL); topbar.setClipChildren(false); topbar.setClipToPadding(false); addView(topbar, new LayoutParams(1)); buttonPast.setScaleType(ImageView.ScaleType.CENTER_INSIDE); topbar.addView(buttonPast, new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1)); title.setGravity(Gravity.CENTER); topbar.addView(title, new LinearLayout.LayoutParams( 0, LayoutParams.MATCH_PARENT, DEFAULT_DAYS_IN_WEEK - 2 )); buttonFuture.setScaleType(ImageView.ScaleType.CENTER_INSIDE); topbar.addView(buttonFuture, new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1)); pager.setId(R.id.mcv_pager); pager.setOffscreenPageLimit(1); addView(pager, new LayoutParams(calendarMode.visibleWeeksCount + DAY_NAMES_ROW)); }
Example 3
Source File: ConversationActivity.java From deltachat-android with GNU General Public License v3.0 | 6 votes |
private void initializeResources() { chatId = getIntent().getIntExtra(CHAT_ID_EXTRA, -1); if(chatId == DcChat.DC_CHAT_NO_CHAT) throw new IllegalStateException("can't display a conversation for no chat."); dcChat = dcContext.getChat(chatId); recipient = dcContext.getRecipient(dcChat); archived = getIntent().getBooleanExtra(IS_ARCHIVED_EXTRA, false); glideRequests = GlideApp.with(this); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { LinearLayout conversationContainer = ViewUtil.findById(this, R.id.conversation_container); conversationContainer.setClipChildren(true); conversationContainer.setClipToPadding(true); } if (!dcChat.canSend()) { composePanel.setVisibility(View.GONE); } if (chatId == DcChat.DC_CHAT_ID_DEADDROP) { titleView.hideAvatar(); } }
Example 4
Source File: ConversationActivity.java From Silence with GNU General Public License v3.0 | 6 votes |
private void initializeResources() { if (recipients != null) recipients.removeListener(this); recipients = RecipientFactory.getRecipientsForIds(this, getIntent().getLongArrayExtra(RECIPIENTS_EXTRA), true); threadId = getIntent().getLongExtra(THREAD_ID_EXTRA, -1); archived = getIntent().getBooleanExtra(IS_ARCHIVED_EXTRA, false); distributionType = getIntent().getIntExtra(DISTRIBUTION_TYPE_EXTRA, ThreadDatabase.DistributionTypes.DEFAULT); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { LinearLayout conversationContainer = ViewUtil.findById(this, R.id.conversation_container); conversationContainer.setClipChildren(true); conversationContainer.setClipToPadding(true); } recipients.addListener(this); }
Example 5
Source File: MaterialHijriCalendarView.java From material-hijri-calendarview with Apache License 2.0 | 6 votes |
private void setupChildren() { topbar = new LinearLayout(getContext()); topbar.setOrientation(LinearLayout.HORIZONTAL); topbar.setClipChildren(false); topbar.setClipToPadding(false); addView(topbar, new LayoutParams(1)); buttonPast.setScaleType(ImageView.ScaleType.CENTER_INSIDE); buttonPast.setImageResource(R.drawable.mcv_action_previous); topbar.addView(buttonPast, new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1)); title.setGravity(Gravity.CENTER); topbar.addView(title, new LinearLayout.LayoutParams( 0, LayoutParams.MATCH_PARENT, MonthView.DEFAULT_DAYS_IN_WEEK - 2 )); buttonFuture.setScaleType(ImageView.ScaleType.CENTER_INSIDE); buttonFuture.setImageResource(R.drawable.mcv_action_next); topbar.addView(buttonFuture, new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1)); pager.setId(R.id.mcv_pager); pager.setOffscreenPageLimit(1); addView(pager, new LayoutParams(MonthView.DEFAULT_MONTH_TILE_HEIGHT)); }
Example 6
Source File: ConfirmPopup.java From a with GNU General Public License v3.0 | 4 votes |
/** * @see #makeHeaderView() * @see #makeCenterView() * @see #makeFooterView() */ @Override protected final View makeContentView() { LinearLayout rootLayout = new LinearLayout(activity); rootLayout.setLayoutParams(new LinearLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT)); rootLayout.setBackgroundColor(backgroundColor); rootLayout.setOrientation(LinearLayout.VERTICAL); rootLayout.setGravity(Gravity.CENTER); rootLayout.setPadding(0, 0, 0, 0); rootLayout.setClipToPadding(false); View headerView = makeHeaderView(); if (headerView != null) { rootLayout.addView(headerView); } if (topLineVisible) { View lineView = new View(activity); lineView.setLayoutParams(new LinearLayout.LayoutParams(MATCH_PARENT, topLineHeightPixels)); lineView.setBackgroundColor(topLineColor); rootLayout.addView(lineView); } if (centerView == null) { centerView = makeCenterView(); } int lr = 0; int tb = 0; if (contentLeftAndRightPadding > 0) { lr = ConvertUtils.toPx(activity, contentLeftAndRightPadding); } if (contentTopAndBottomPadding > 0) { tb = ConvertUtils.toPx(activity, contentTopAndBottomPadding); } centerView.setPadding(lr, tb, lr, tb); ViewGroup vg = (ViewGroup) centerView.getParent(); if (vg != null) { //IllegalStateException: The specified child already has a parent vg.removeView(centerView); } rootLayout.addView(centerView, new LinearLayout.LayoutParams(MATCH_PARENT, 0, 1.0f)); View footerView = makeFooterView(); if (footerView != null) { rootLayout.addView(footerView); } return rootLayout; }
Example 7
Source File: ConfirmPopup.java From MyBookshelf with GNU General Public License v3.0 | 4 votes |
/** * @see #makeHeaderView() * @see #makeCenterView() * @see #makeFooterView() */ @Override protected final View makeContentView() { LinearLayout rootLayout = new LinearLayout(activity); rootLayout.setLayoutParams(new LinearLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT)); rootLayout.setBackgroundColor(backgroundColor); rootLayout.setOrientation(LinearLayout.VERTICAL); rootLayout.setGravity(Gravity.CENTER); rootLayout.setPadding(0, 0, 0, 0); rootLayout.setClipToPadding(false); View headerView = makeHeaderView(); if (headerView != null) { rootLayout.addView(headerView); } if (topLineVisible) { View lineView = new View(activity); lineView.setLayoutParams(new LinearLayout.LayoutParams(MATCH_PARENT, topLineHeightPixels)); lineView.setBackgroundColor(topLineColor); rootLayout.addView(lineView); } if (centerView == null) { centerView = makeCenterView(); } int lr = 0; int tb = 0; if (contentLeftAndRightPadding > 0) { lr = ConvertUtils.toPx(activity, contentLeftAndRightPadding); } if (contentTopAndBottomPadding > 0) { tb = ConvertUtils.toPx(activity, contentTopAndBottomPadding); } centerView.setPadding(lr, tb, lr, tb); ViewGroup vg = (ViewGroup) centerView.getParent(); if (vg != null) { //IllegalStateException: The specified child already has a parent vg.removeView(centerView); } rootLayout.addView(centerView, new LinearLayout.LayoutParams(MATCH_PARENT, 0, 1.0f)); View footerView = makeFooterView(); if (footerView != null) { rootLayout.addView(footerView); } return rootLayout; }
Example 8
Source File: ConfirmPopup.java From AndroidPicker with MIT License | 4 votes |
/** * @see #makeHeaderView() * @see #makeCenterView() * @see #makeFooterView() */ @Override protected final View makeContentView() { LinearLayout rootLayout = new LinearLayout(activity); rootLayout.setLayoutParams(new LinearLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT)); rootLayout.setBackgroundColor(backgroundColor); rootLayout.setOrientation(LinearLayout.VERTICAL); rootLayout.setGravity(Gravity.CENTER); rootLayout.setPadding(0, 0, 0, 0); rootLayout.setClipToPadding(false); View headerView = makeHeaderView(); if (headerView != null) { rootLayout.addView(headerView); } if (topLineVisible) { View lineView = new View(activity); lineView.setLayoutParams(new LinearLayout.LayoutParams(MATCH_PARENT, topLineHeightPixels)); lineView.setBackgroundColor(topLineColor); rootLayout.addView(lineView); } if (centerView == null) { centerView = makeCenterView(); } int lr = 0; int tb = 0; if (contentLeftAndRightPadding > 0) { lr = ConvertUtils.toPx(activity, contentLeftAndRightPadding); } if (contentTopAndBottomPadding > 0) { tb = ConvertUtils.toPx(activity, contentTopAndBottomPadding); } centerView.setPadding(lr, tb, lr, tb); ViewGroup vg = (ViewGroup) centerView.getParent(); if (vg != null) { //IllegalStateException: The specified child already has a parent vg.removeView(centerView); } rootLayout.addView(centerView, new LinearLayout.LayoutParams(MATCH_PARENT, 0, 1.0f)); View footerView = makeFooterView(); if (footerView != null) { rootLayout.addView(footerView); } return rootLayout; }