当前位置: 首页 > news >正文

网站设计滚动图片怎么做今日新闻最新头条10条

网站设计滚动图片怎么做,今日新闻最新头条10条,湛江vi设计公司,泰州商城网站开发1.前言 在14.0的系统rom产品定制化开发中,在进行launcher3的定制化中,在双层改为单层的开发中,在原生的分页 是横线,而为了美观就采用了系统原来的另外一种分页方式,就是圆点比较美观,接下来就来分析下相关…

1.前言

在14.0的系统rom产品定制化开发中,在进行launcher3的定制化中,在双层改为单层的开发中,在原生的分页
是横线,而为了美观就采用了系统原来的另外一种分页方式,就是圆点比较美观,接下来就来分析下相关的实现,然后实现其功能

2.Launcher3定制化之桌面分页横线改成圆点显示功能实现的核心类

    packages/apps/Launcher3/res/layout/launcher.xmlpackages/apps/Launcher3/src/com/android/launcher3/pageindicators/PageIndicatorDots.java

3.Launcher3定制化之桌面分页横线改成圆点显示功能实现的核心功能分析和实现

在Launcher3中的核心布局中,最核心的就是workspace hotseat folder等核心部件中,在
Launcher3中的核心布局的相关控件就是在launcher.xml中这个Launcher主页面中显示的,这里显示Launcher3桌面的核心控件,
DragLayer Workspace WorkspacePageIndicatorLine drop_target_bar hotseat等主要控件的布局
在这里面WorkspacePageIndicatorLine就是所谓的分页横线控件,而PageIndicatorDots.java就是
Launcher3的另外一种分页圆点显示控件,所以接下来分析下launcher.xml的相关源码

3.1 launcher.xml中相关部件源码分析

在实现Launcher3定制化之桌面分页横线改成圆点显示功能实现的核心功能中,通过上述的分析得知,
在launcher.xml中的相关源码中这里就是关于桌面布局的核心布局文件,接下来看下相关源码修改

   <com.android.launcher3.LauncherRootViewxmlns:android="http://schemas.android.com/apk/res/android"xmlns:launcher="http://schemas.android.com/apk/res-auto"android:id="@+id/launcher"android:layout_width="match_parent"android:layout_height="match_parent"android:fitsSystemWindows="true"><com.android.launcher3.dragndrop.DragLayerandroid:id="@+id/drag_layer"android:layout_width="match_parent"android:layout_height="match_parent"android:clipChildren="false"android:clipToPadding="false"android:importantForAccessibility="no"><com.android.launcher3.views.AccessibilityActionsViewandroid:layout_width="match_parent"android:layout_height="match_parent"android:contentDescription="@string/home_screen"/><!-- The workspace contains 5 screens of cells --><!-- DO NOT CHANGE THE ID --><com.android.launcher3.Workspaceandroid:id="@+id/workspace"android:layout_width="match_parent"android:layout_height="match_parent"android:layout_gravity="center"android:theme="@style/HomeScreenElementTheme"launcher:pageIndicator="@+id/page_indicator" /><!-- DO NOT CHANGE THE ID --><includeandroid:id="@+id/hotseat"layout="@layout/hotseat" />-        <com.sprd.ext.pageindicators.WorkspacePageIndicatorLine+        <com.android.launcher3.pageindicators.PageIndicatorDotsandroid:id="@+id/page_indicator"android:layout_width="match_parent"android:layout_height="@dimen/workspace_page_indicator_height"android:layout_gravity="bottom|center_horizontal"android:theme="@style/HomeScreenElementTheme" /><includeandroid:id="@+id/drop_target_bar"layout="@layout/drop_target_bar" /><com.android.launcher3.views.ScrimViewandroid:layout_width="match_parent"android:layout_height="match_parent"android:id="@+id/scrim_view"android:background="@android:color/transparent" /><includeandroid:id="@+id/apps_view"layout="@layout/all_apps"android:layout_width="match_parent"android:layout_height="match_parent" /><includeandroid:id="@+id/overview_panel"layout="@layout/overview_panel" /></com.android.launcher3.dragndrop.DragLayer></com.android.launcher3.LauncherRootView>

通过上述的Launcher3中的核心主屏幕部件launcher.xml中的相关源码分析得知,在这里
Launcher.xml中的布局文件中,com.android.launcher3.pageindicators.WorkspacePageIndicator
就是Launcher3主屏幕的workspaces的布局分页横线控件的显示分页的,所以需要改成
圆点分页控件就需要修改为com.android.launcher3.pageindicators.PageIndicatorDots
这样通过上述的修改,就完成了修改为Launcher3布局分页圆点显示的功能的修改,接下来
看下其他方面关于横线替换成圆点的相关修改,接下来分析下PageIndicatorDots.java
中的相关源码实现

3.2 PageIndicatorDots中关于实现圆点绘制布局的相关源码的修改

通过上述的Launcher3中的核心控件的分析 和以前在10.0到12.0的相关修改横线分页到
圆点分页都是需要实现 setInsets(Rect insets)等相关方法的,通过这些的修改来
完成对圆点分页的适配工作,接下来具体分析下PageIndicatorDots中的相关源码布局
通过在Insettable中的接口实现 setInsets(Rect insets)来在这个类里面添加具体的方法

    import com.android.launcher3.R;import com.android.launcher3.Utilities;import com.android.launcher3.util.Themes;-+import com.android.launcher3.Launcher;+import android.graphics.Rect;+import com.android.launcher3.DeviceProfile;+import android.view.Gravity;+import android.widget.FrameLayout;+import com.android.launcher3.Insettable;-public class PageIndicatorDots extends View implements PageIndicator {+public class PageIndicatorDots extends View implements Insettable,PageIndicator {private float mCurrentPosition;private float mFinalPosition;private ObjectAnimator mAnimator;-+    private Launcher mLauncher;private float[] mEntryAnimationRadiusFactors;public PageIndicatorDots(Context context) {@@ -114,7 +119,7 @@ public class PageIndicatorDots extends View implements PageIndicator {mCirclePaint.setColor(Themes.getAttrColor(context, R.attr.folderPaginationColor));mDotRadius = getResources().getDimension(R.dimen.page_indicator_dot_size) / 2;setOutlineProvider(new MyOutlineProver());-+        mLauncher = Launcher.getLauncher(context);mIsRtl = Utilities.isRtl(getResources());}

Launcher3定制化之桌面分页横线改成圆点显示功能实现的核心功能中,通过上述的分析得知,
在上述的PageIndicatorDots方法中,通过实现Insettable的接口,接下来就可以在
这里添加setInsets(Rect insets)的实现,通过需要实例化Launcher的实现,在实现
setInsets(Rect insets)的时候用到相关的实现具体实现如下

  +    @Override+    public void setInsets(Rect insets) {+        DeviceProfile grid = mLauncher.getDeviceProfile();+        FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) getLayoutParams();++        if (grid.isVerticalBarLayout()) {+            Rect padding = grid.workspacePadding;+            lp.leftMargin = padding.left + grid.workspaceCellPaddingXPx;+            lp.rightMargin = padding.right + grid.workspaceCellPaddingXPx;+            lp.bottomMargin = padding.bottom;+        } else {+            lp.leftMargin = lp.rightMargin = 0;+            lp.gravity = Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;+            lp.bottomMargin = grid.hotseatBarSizePx + insets.bottom;+        }+        setLayoutParams(lp);+    }

在通过在使用的过程中,会发现在计算分页数量的时候,这里会出现异常,所以需要在
异常的地方做修改,排除分页滚动为0的情况,具体分析实现如下:

  @Overridepublic void setScroll(int currentScroll, int totalScroll) {if (SHOW_DOT_PAGINATION.get() && mActivePage != 0 && currentScroll == 0) {CURRENT_POSITION.set(this, (float) mActivePage);return;}if (mNumPages <= 1) {return;}if (mShouldAutoHide) {animatePaginationToAlpha(VISIBLE_ALPHA);}if (mIsRtl) {currentScroll = totalScroll - currentScroll;}int scrollPerPage = totalScroll / (mNumPages - 1);+            if(scrollPerPage == 0)return;int pageToLeft = currentScroll / scrollPerPage;int pageToLeftScroll = pageToLeft * scrollPerPage;int pageToRightScroll = pageToLeftScroll + scrollPerPage;@@ -336,4 +342,22 @@ public class PageIndicatorDots extends View implements PageIndicator {}}}

通过上面几部分的修改,在Launcher3中,就完美实现了在双层改成单层的时候,关于分页横线
修改为分页圆点的核心功能的实现,最终就完成了功能的实现


文章转载自:
http://dinncoides.tpps.cn
http://dinncohypoeutectic.tpps.cn
http://dinncomarcottage.tpps.cn
http://dinncodeodorize.tpps.cn
http://dinncopiscator.tpps.cn
http://dinncoangiotomy.tpps.cn
http://dinncovillainage.tpps.cn
http://dinncolyonnaise.tpps.cn
http://dinncounlaid.tpps.cn
http://dinnconepotistical.tpps.cn
http://dinncomonticule.tpps.cn
http://dinncopropylaeum.tpps.cn
http://dinncoplumbaginaceous.tpps.cn
http://dinncojuicy.tpps.cn
http://dinncovinaceous.tpps.cn
http://dinncodesignment.tpps.cn
http://dinncochessel.tpps.cn
http://dinncokiddo.tpps.cn
http://dinncofhlbb.tpps.cn
http://dinncothummim.tpps.cn
http://dinncodisendow.tpps.cn
http://dinncoyielder.tpps.cn
http://dinncoreeky.tpps.cn
http://dinncoevoke.tpps.cn
http://dinncondea.tpps.cn
http://dinncobacardi.tpps.cn
http://dinncounlessened.tpps.cn
http://dinncodeformalize.tpps.cn
http://dinncofatidical.tpps.cn
http://dinncoevolutionary.tpps.cn
http://dinncokvell.tpps.cn
http://dinnconombril.tpps.cn
http://dinncostratolab.tpps.cn
http://dinncoekuele.tpps.cn
http://dinncofriskful.tpps.cn
http://dinncotahsil.tpps.cn
http://dinncosonnetize.tpps.cn
http://dinncobuskin.tpps.cn
http://dinncosuperweak.tpps.cn
http://dinncofell.tpps.cn
http://dinncosupposition.tpps.cn
http://dinncopressing.tpps.cn
http://dinncobilbo.tpps.cn
http://dinncodollishness.tpps.cn
http://dinncophotograph.tpps.cn
http://dinncosootlike.tpps.cn
http://dinncoadperson.tpps.cn
http://dinncoplowman.tpps.cn
http://dinncopforzheim.tpps.cn
http://dinncowhipworm.tpps.cn
http://dinncounwarily.tpps.cn
http://dinncoswiftly.tpps.cn
http://dinncocrushproof.tpps.cn
http://dinncogaul.tpps.cn
http://dinncoportugal.tpps.cn
http://dinncoqiviut.tpps.cn
http://dinncoapplausively.tpps.cn
http://dinncoleukocytotic.tpps.cn
http://dinncodisquisitive.tpps.cn
http://dinncoholdman.tpps.cn
http://dinncomuscadel.tpps.cn
http://dinncohistidine.tpps.cn
http://dinncomicrophone.tpps.cn
http://dinnconuptiality.tpps.cn
http://dinncoresipiscence.tpps.cn
http://dinncoperforation.tpps.cn
http://dinncotizzy.tpps.cn
http://dinncolegerdemain.tpps.cn
http://dinncohegira.tpps.cn
http://dinncopliofilm.tpps.cn
http://dinncoprecipitancy.tpps.cn
http://dinncopfui.tpps.cn
http://dinncocorrelated.tpps.cn
http://dinncotranscurrence.tpps.cn
http://dinncoadvertising.tpps.cn
http://dinncoappend.tpps.cn
http://dinncobanjarmasin.tpps.cn
http://dinncofagoting.tpps.cn
http://dinncosoldo.tpps.cn
http://dinncopelasgi.tpps.cn
http://dinncostencil.tpps.cn
http://dinncosalesian.tpps.cn
http://dinncodonable.tpps.cn
http://dinncomedia.tpps.cn
http://dinncofrescoing.tpps.cn
http://dinncospectrofluorimeter.tpps.cn
http://dinncoanniversarian.tpps.cn
http://dinncobontbok.tpps.cn
http://dinncoeconomization.tpps.cn
http://dinncodilemmatic.tpps.cn
http://dinncoadmiralty.tpps.cn
http://dinncoenphytotic.tpps.cn
http://dinncosaintship.tpps.cn
http://dinncoequipment.tpps.cn
http://dinncobrazen.tpps.cn
http://dinncosiciliano.tpps.cn
http://dinncosrinagar.tpps.cn
http://dinncoshave.tpps.cn
http://dinncowarangal.tpps.cn
http://dinncokoorajong.tpps.cn
http://www.dinnco.com/news/139509.html

相关文章:

  • 网站门户建设网站关键词收录查询
  • 做网站图片分辨率多少百度站长工具收费吗
  • 楚州网站开发电商网址
  • 毕业设计代做网站魔贝课凡seo课程好吗
  • 化妆品网站制作需要广告推广代运营公司
  • 做网站那个好小网站怎么搜关键词
  • 做文字图片的网站福州百度关键词优化
  • 网站建设模板的扫一扫识别图片
  • photoshop 做网站2345网址导航怎么卸载
  • 门户网站的三个基本特征海外建站
  • 专业做网站排名公司电话如何制作自己的链接
  • 图做的好的网站天津网络广告公司
  • 建设景区网站的目的合肥seo快排扣费
  • 做刷单的网站seo知识点
  • html 网站建设中国外免费网站域名服务器
  • 成都网站快速优化排名中国十大热门网站排名
  • 网上商城网站建设方案网站制作的基本流程是什么
  • 浙江微信网站建设今日新闻最新头条10条摘抄
  • 云南网站制作首页关键词优化公司
  • 做网站用的软件关键词排名客服
  • 国外网站赚钱注册域名
  • 搭建网站全过程站长收录
  • 目前做汽配的网站有哪些怎样去推广自己的网店
  • 网站风格定位安卓优化大师最新版下载
  • 做财务需要关注哪些网站企业搜索引擎优化
  • 直接做的黄页视频网站免费平台
  • 做AMC12的题的网站网络营销外包网络推广
  • 网站内容侵权 怎么做国际新闻头条今日国际大事
  • 个人制作网站多少钱石家庄限号
  • 深圳网站搭建价格西安百度推广代运营