First look at the adjustment before and after:
Layout AllApps Appscustomizetabhost host = (appscustomizetabhost) Launcher.findviewbyid ( R.id.apps_customize_pane); if (host = null) {//Center the All Apps page indicator int pageindicatorheight = (int) (pageindic ATORHEIGHTPX * Math.min (1f, (ALLAPPSICONSIZEPX/DYNAMICGRID.DEFAULT_ICON_SIZE_PX))); Pageindicator = Host.findviewbyid (r.id.apps_customize_page_indicator); if (pageindicator! = NULL) {LP = (Framelayout.layoutparams) pageindicator.getlayoutparams (); lp.gravity = Gravity.center_horizontal | Gravity.bottom; Lp.width = layoutparams.wrap_content; Lp.height = Pageindicatorheight; PAGEINDICATOR.SETLAYOUTPARAMS (LP); } Appscustomizepagedview Pagedview = (appscustomizepagedview) Host.findviewbyid (R.ID.APPS_CU Stomize_pane_content); padding = new Rect (); if (Pagedview! = null) {//constrain the dimensions of all apps so this it does not span the full Width//tchip ZJ Add START: Remove all apps list, horizontal and left margin int paddinglr = (AVAILABLEWIDTHPX- (ALLAPPSCELLWIDTHPX * allappsnumcols)) /(2 * (Allappsnumcols + 1)); int PADDINGTB = (AVAILABLEHEIGHTPX-(ALLAPPSCELLHEIGHTPX * allappsnumrows))/(2 * (allappsnumrows + 1)); PADDINGLR = Math.min (PADDINGLR, (int) ((PADDINGLR + PADDINGTB) * 0.75f)); PADDINGTB = Math.min (PADDINGTB, (int) ((PADDINGLR + PADDINGTB) * 0.75f)); PADDINGLR = (int) (PADDINGLR * 0.75f); PADDINGTB = (int) (PADDINGTB * 0.75f); Tchip ZJ Add END//tchip ZJ minus START: Remove all application lists, margin on both sides of horizontal screen /* int PADDINGLR = 2; int PADDINGTB = 2; *///tchip ZJ minus END int maxallappswidth = (Allappsnumcols * (AllApps CELLWIDTHPX + 2 * paddinglr)); int GRIDPADDINGLR = (availablewidthpx-maxallappswidth)/4; Only adjust the side paddings on landscape phones, or tablets if ((Istablet () | | islandscape) && GRIDPADDINGLR > (ALLAPPSCELLWIDTHPX/4)) {padding.left = Padding.right = GRIDPADDINGLR; }//The icons is centered, so we can ' t just offset by the page indicator height// Because the empty space would actually be pageindicatorheight + PADDINGTB Padding.bottom = Math.max (0, Pagei NDICATORHEIGHT-PADDINGTB); Pagedview.setallappspadding (padding); Pagedview.setwidgetspageindicatorpadding (Pageindicatorheight); } }
Android Launcher3 Remove all apps list, left and right side blank on horizontal screen