open TV’s expanded PiP in android 13 mobile or tablet

    android 13 for TV推出了expanded PiP功能,但是只在android 13的电视上作用,在手机或者平板上,即使开了android.software.expanded_picture_in_picture feature也无法使用expanded pip。 经研究可通过修改framwork代码,将TV的expanded pip feature移植到手机或平板,在手机和平板上开启expanded pip功能,以下以手机为例。  开启android.software.expanded_picture_in_picture feature  修改frameworks/native/data/etc/handheld_core_hardware.xml文件,追加以下配置: <feature name="android.software.expanded_picture_in_picture" notLowRam="true" />  2. 移植TV 代码 修改 framework/base/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java  /*  * Copyright (C) 2021 The Android Open Source Project  *  * Licensed under the Apache License, Version 2.0 (the "License");  * you may not use this file except in compliance with the License.  * You may obtain a copy of the License at  *  *      http://www.apache.org/licenses/LICENSE-2.0  *  * Unless required by applicable law or agreed to in writing, software  * distributed under the License is distributed on an "AS IS" BASIS,  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  * See the License for the specific language governing permissions and  * limitations under the License.  */ package com.android.wm.shell.dagger; import android.content.Context; import android.content.pm.LauncherApps; import android.os.Handler; import android.os.SystemClock; import android.os.UserManager; import android.view.Choreographer; import android.view.WindowManager; import com.android.internal.jank.InteractionJankMonitor; import com.android.internal.logging.UiEventLogger; import com.android.internal.statusbar.IStatusBarService; import com.android.launcher3.icons.IconProvider; import com.android.wm.shell.RootTaskDisplayAreaOrganizer; import com.android.wm.shell.ShellTaskOrganizer; import com.android.wm.shell.TaskViewTransitions; import com.android.wm.shell.WindowManagerShellWrapper; import com.android.wm.shell.bubbles.BubbleController; import com.android.wm.shell.bubbles.BubbleData; import com.android.wm.shell.bubbles.BubbleDataRepository; … Read more

中华人民共和国行政区划数据库/爬虫

包含中国省、市、县、街道、村/居委会5级数据(港、澳、台除外(统计局官网没有给出)),数据来源为国家统计局。 程序基于tp3.2.3编写,依赖Querylist3。 主要代码: /**  * @author Adam  * Time: 2018/6/15 14:50  */ public function sheng() {     $data = QueryList::Query($this->baseurl . "index.html", array("url" => array("td>a ", "href"), "name" => array("td>a", "text")), "", 'UTF-8', 'GB2312')->getData();     foreach ($data as $k => $v) {         $data[$k]["url"] = str_replace(".html", "", $v["url"]);         $data[$k]["saveid"] = $this->generate_full_id($data[$k]["url"]);         $res = $this->areamodel->where(array("area_id" => $data[$k]["url"]))->find();         if (empty($res)) {             $this->areamodel->data(array("area_id" => $data[$k]["url"], "area_pid" => 0, "area_name" => $data[$k]["name"], "level" => 1))->add();         }     }     echo json_encode($data);     die; } /**  * 二级 市   http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2016/14.html  * @author Adam  * Time: 2018/6/20 13:43  */ public function secondway() {     $toplevel = $this->areamodel->where(array("imported" => 0, "level" => 1))->order("area_id DESC")->find();     if (empty($toplevel)) {         echo "全部导入完毕,无需重新导入";         die;     }     $fatherid = $toplevel["area_id"];     $url = $this->baseurl . $toplevel["area_id"] . ".html";     $data = QueryList::Query($url, array("url" => array("td:eq(0)>a", "href"), "name" => array("td:eq(1)>a", "text")), "tr.citytr", 'UTF-8', 'GB2312')->getData();     foreach ($data as $k => $v) {         $data[$k]["url"] = str_replace(".html", "", $this->reg_real_id($v["url"])[0]);     }     M()->startTrans();     foreach ($data as $k1 => $v1) {         $res["area_id"] = $v1["url"];         $res["area_pid"] = $toplevel["area_id"];         $res["level"] = 2;         $res["area_name"] = $v1["name"];         if (!$this->areamodel->data($res)->add()) {             echo "循环导入失败" . M()->getLastSql();             die;             M()->rollback();         }     }     $this->areamodel->where(array("area_id" => $fatherid))->save(array("imported" => 1));     $sql = M()->getLastSql();     M()->commit();     echo "导入成功 " . $sql; … Read more

拼多多之多多客SDK

前天开始撸的多多客的SDK  拼多多开放平台官方地址  http://open.pinduoduo.com/#/index 多多进宝官方地址  http://jinbao.pinduoduo.com/#/ 开源地址  https://github.com/adamin1990/Duoduoke 使用方法: require_once("Duoduoke.php"); $config['client_id']="your client id"; $config['client_secret']="your client secret"; $config['duoduoke_redirect_url']="";  //可选 $config["access_token"]="";  //可选 $ddk=new Duoduoke($config); echo $ddk->api_goods_cat_get();