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

那个网站专门做二手衣服的深圳网络推广解决方案

那个网站专门做二手衣服的,深圳网络推广解决方案,上海网站高端定制,温州网站建设wmwl一)需求-场景 Android13 实现允许桌面自动旋转 Android13 版本开始后,支持屏幕自动旋转,优化体验和兼容性,适配不同屏幕 主界面可自动旋转 二)参考资料 android framework13-launcher3【06手机旋转问题】 Launcher默…

一)需求-场景

Android13 实现允许桌面自动旋转
Android13 版本开始后,支持屏幕自动旋转,优化体验和兼容性,适配不同屏幕 主界面可自动旋转

在这里插入图片描述

二)参考资料

android framework13-launcher3【06手机旋转问题】
Launcher默认支持旋转
Launcher默认支持旋转
Launcher3 布局
Launcher3 版本变化
展讯Android9.0 Launcher 简介:

三)遇到问题

定制化屏幕旋转遇到两个核心问题

  • 屏幕自动旋转后,最近历史任务并没有旋转,方向异常。
  • 定制的好多案子,比如平板产品中旋转没有问题,但是好多手机方案新品来做平板产品。就遇到好多问题了,当成手机了,需要默认为平板。无法解决最近历史任务异常问题。
  • 在GMS 产品中,是存在配置是存在覆盖问题的。

四) 修改点

/packages/apps/Launcher3/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
/packages/apps/Launcher3/src/com/android/launcher3/states/RotationHelper.java
/packages/apps/Launcher3/src/com/android/launcher3/util/window/WindowManagerProxy.java/packages/apps/Launcher3/quickstep/res/xml/indexable_launcher_prefs.xml 
/packages/apps/Launcher3/res/xml/launcher_preferences.xml
/vendor/google/apps/SearchLauncher/res/xml/launcher_preferences.xm

备注:仅针对大多数产品,各家平台需要根据自己的实际产品类型和方案类型来实际更改。思路是没问题的

五)属性Launcher3 种类及构成

为什么要了解这个,一方面搞清楚源码里面好多个Launcher,或者 Launcher 相关的究竟是什么。特别是GMS 版本,需要怎么改,不然改了还是会覆盖的。【暂不分析源码配置哪个Launcher】
总之:如果是GMS项目,先搞清楚自己Launcher构成,如何组合编译的,然后配置相关的建议都修改。
在这里插入图片描述

六)实现方案

主要解决三个问题:

修改默认配置,自动旋转改为true

/packages/apps/Launcher3/res/xml/launcher_preferences.xml
/vendor/google/apps/SearchLauncher/res/xml/launcher_preferences.xm
defaultValue 默认值改为ture <SwitchPreferenceandroid:key="pref_allowRotation"android:title="@string/allow_rotation_title"android:summary="@string/allow_rotation_desc"android:defaultValue="false"android:persistent="true"launcher:logIdOn="615"launcher:logIdOff="616" /><SwitchPreferenceandroid:key="pref_allowRotation"android:title="@string/allow_rotation_title"android:summary="@string/allow_rotation_desc"android:defaultValue="false"android:persistent="true" />

RecentsOrientedState 允许桌面旋转设置

直接设置为true

  private void updateHomeRotationSetting() {boolean homeRotationEnabled = true;//mSharedPrefs.getBoolean(ALLOW_ROTATION_PREFERENCE_KEY, true);//huanghb modifysetFlag(FLAG_HOME_ROTATION_ALLOWED_IN_PREFS, homeRotationEnabled);SystemUiProxy.INSTANCE.get(mContext).setHomeRotationEnabled(homeRotationEnabled);}

手机方案适配平板方案,模拟为平板方案

RotationHelper.java getAllowRotationDefaultValue 判断当前是否允许旋转,不用计算,直接返回 true

/*** Returns the default value of {@link #ALLOW_ROTATION_PREFERENCE_KEY} preference.*/public static boolean getAllowRotationDefaultValue(DeviceProfile deviceProfile) {// If the device's pixel density was scaled (usually via settings for A11y), use the// original dimensions to determine if rotation is allowed of not.float originalSmallestWidth = dpiFromPx(Math.min(deviceProfile.widthPx, deviceProfile.heightPx), DENSITY_DEVICE_STABLE);return true;}

WindowManagerProxy.java 判断当前是平板的的判断。

public static final int MIN_TABLET_WIDTH = 1boolean isTablet = swDp >= MIN_TABLET_WIDTH;boolean isTablet = config.smallestScreenWidthDp > MIN_TABLET_WIDTH;
这样在判断的时候,就直接以平板的方式来判断了,就满足自动旋转要求了。

分享部分git 修改记录

diff --git a/packages/apps/Launcher3/quickstep/res/xml/indexable_launcher_prefs.xml b/packages/apps/Launcher3/quickstep/res/xml/indexable_launcher_prefs.xml
old mode 100644
new mode 100755
index b4740e5..aa1fd4d
--- a/packages/apps/Launcher3/quickstep/res/xml/indexable_launcher_prefs.xml
+++ b/packages/apps/Launcher3/quickstep/res/xml/indexable_launcher_prefs.xml
@@ -26,7 +26,7 @@android:key="pref_allowRotation"android:title="@string/allow_rotation_title"android:summary="@string/allow_rotation_desc"
-        android:defaultValue="false"
+        android:defaultValue="true"android:persistent="true" /></PreferenceScreen>
diff --git a/packages/apps/Launcher3/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java b/packages/apps/Launcher3/quickstep/src/com/android/quickstep/util/RecentsOrientedState.jav
old mode 100644
new mode 100755
index 6038a22..76dd118
--- a/packages/apps/Launcher3/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
+++ b/packages/apps/Launcher3/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
@@ -291,7 +291,7 @@ public class RecentsOrientedState implements}private void updateHomeRotationSetting() {
-        boolean homeRotationEnabled = mSharedPrefs.getBoolean(ALLOW_ROTATION_PREFERENCE_KEY, false);
+        boolean homeRotationEnabled = true;//mSharedPrefs.getBoolean(ALLOW_ROTATION_PREFERENCE_KEY, true);//huanghb modifysetFlag(FLAG_HOME_ROTATION_ALLOWED_IN_PREFS, homeRotationEnabled);SystemUiProxy.INSTANCE.get(mContext).setHomeRotationEnabled(homeRotationEnabled);}
diff --git a/packages/apps/Launcher3/res/xml/launcher_preferences.xml b/packages/apps/Launcher3/res/xml/launcher_preferences.xml
old mode 100644
new mode 100755
index 8a0c909..171eeb2
--- a/packages/apps/Launcher3/res/xml/launcher_preferences.xml
+++ b/packages/apps/Launcher3/res/xml/launcher_preferences.xml
@@ -45,7 +45,7 @@android:key="pref_allowRotation"android:title="@string/allow_rotation_title"android:summary="@string/allow_rotation_desc"
-        android:defaultValue="false"
+        android:defaultValue="true"android:persistent="true"launcher:logIdOn="615"launcher:logIdOff="616" />
diff --git a/packages/apps/Launcher3/src/com/android/launcher3/states/RotationHelper.java b/packages/apps/Launcher3/src/com/android/launcher3/states/RotationHelper.java
old mode 100644
new mode 100755
index 38b62d4..bf88c9d
--- a/packages/apps/Launcher3/src/com/android/launcher3/states/RotationHelper.java
+++ b/packages/apps/Launcher3/src/com/android/launcher3/states/RotationHelper.java
@@ -49,7 +49,7 @@ public class RotationHelper implements OnSharedPreferenceChangeListener,// original dimensions to determine if rotation is allowed of not.float originalSmallestWidth = dpiFromPx(Math.min(deviceProfile.widthPx, deviceProfile.heightPx), DENSITY_DEVICE_STABLE);
-        return originalSmallestWidth >= MIN_TABLET_WIDTH;
+        return true;}public static final int REQUEST_NONE = 0;
diff --git a/packages/apps/Launcher3/src/com/android/launcher3/util/window/WindowManagerProxy.java b/packages/apps/Launcher3/src/com/android/launcher3/util/window/WindowManagerProxy.java
old mode 100644
new mode 100755
index 9665bf9..d81565c
--- a/packages/apps/Launcher3/src/com/android/launcher3/util/window/WindowManagerProxy.java
+++ b/packages/apps/Launcher3/src/com/android/launcher3/util/window/WindowManagerProxy.java
@@ -61,7 +61,7 @@ import com.android.launcher3.util.WindowBounds;*/public class WindowManagerProxy implements ResourceBasedOverride {-    public static final int MIN_TABLET_WIDTH = 600;
+    public static final int MIN_TABLET_WIDTH = 1;//huanghb modifypublic static final MainThreadInitializedObject<WindowManagerProxy> INSTANCE =forOverride(WindowManagerProxy.class, R.string.window_manager_proxy_class);
diff --git a/vendor/google/apps/SearchLauncher/res/xml/launcher_preferences.xml b/vendor/google/apps/SearchLauncher/res/xml/launcher_preferences.xml
old mode 100644
new mode 100755
index a70bb30..f95219b
--- a/vendor/google/apps/SearchLauncher/res/xml/launcher_preferences.xml
+++ b/vendor/google/apps/SearchLauncher/res/xml/launcher_preferences.xml
@@ -50,7 +50,7 @@android:title="@string/title_show_google_app"/><SwitchPreference
-        android:defaultValue="false"
+        android:defaultValue="true"android:key="pref_allowRotation"android:persistent="true"android:summary="@string/allow_rotation_desc"
(END)

七)总结:

如需要解决的问题一样
1)更改配置
2)解决最近历史任务允许旋转设置
3)把产品当做pad 来,判断是否pad 地方判断,更改逻辑判断条件实现

http://www.yayakq.cn/news/215193/

相关文章:

  • 做的网站每年都要交费吗好的网站开发
  • 企业网站建设服务内容深圳外贸建站网络推广公司
  • 用于手机的导航网站要怎么做百度竞价网站谁做
  • 长兴县网站建设青岛栈桥景区
  • 长治做网站多少钱多少钱翻译
  • 服装网站建设与实现公众号运营平台
  • 上海seo优化服务公司关键词优化
  • 网站的推广方式组合微信公众号模板哪里找
  • 网上书店网网站建设上海网站优化上
  • 徐州网站建设费用福州营销网站建设模板
  • 涉县手机网站建设一品猪网站开发
  • 哪种nas可以做网站服务器w3c网站怎么做
  • 中国机械加工网站官网商城网站系统建设方案
  • 建设网站0基础需要学什么如何上传安装wordpress
  • 边境网站建设方案设计师关注的十大网站
  • 上海网站建设包括哪些网站开发人员的职业要求
  • 亿度网络 网站建设如何做电影网站不违法
  • 网站建设公司业务员cf网站编程
  • 遵义制作网站网络维护电话
  • 学院网站建设进度情况说明景德镇seo
  • 上海建设工程招投标网站在线html编辑
  • 新华书店网站建设做网站需要具备什么
  • 网站开发的上市公司有哪些为什么大公司开发网站
  • 郑州网站建设+论坛餐饮企业网站模板
  • 网站目录文件网站用绝对路径好还是相对路径seo
  • 网站建设的人性分析济南微信网站
  • 云南昆明做网站win7 iis 默认网站
  • 重庆网站建设学习搜索引擎优化教材答案
  • 做网站备案要多久建立无上气运皇朝
  • google网站管理员中心宁夏网页制作公司