• 大小: 1.61MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-25
  • 语言: Java
  • 标签: Launcher3  Android  Studio  

资源简介

更改官方的Launcher3使得可以在Android Studio编译,增加了 Launcher3上滑显示应用列表和下滑关闭显示应用列表。

资源截图

代码片段和文件信息

#!/usr/bin/env python2.5

import cgi
import os
import shutil
import sys
import sqlite3

SCREENS = 5
COLUMNS = 4
ROWS = 4
CELL_SIZE = 110

DIR = “db_files“
AUTO_FILE = “launcher.db“

APPLICATION_COMPONENTS = [
  “com.android.calculator2/com.android.calculator2.Calculator“
  “com.android.providers.downloads.ui/com.android.providers.downloads.ui.DownloadList“
  “com.android.settings/com.android.settings.Settings“
  “com.android.mms/com.android.mms.ui.ConversationList“
  “com.android.contacts/com.android.contacts.activities.PeopleActivity“
  “com.android.dialer/com.android.dialer.DialtactsActivity“
]

def usage():
  print “usage: fill_screens.py -- fills up the launcher db“


def make_dir():
  shutil.rmtree(DIR True)
  os.makedirs(DIR)

def pull_file(fn):
  print “pull_file: “ + fn
  rv = os.system(“adb pull“
    + “ /data/data/com.android.launcher/databases/launcher.db“
    + “ “ + fn);
  if rv != 0:
    print “adb pull failed“
    sys.exit(1)

def push_file(fn):
  print “push_file: “ + fn
  rv = os.system(“adb push“
    + “ “ + fn
    + “ /data/data/com.android.launcher/databases/launcher.db“)
  if rv != 0:
    print “adb push failed“
    sys.exit(1)

def process_file(fn):
  print “process_file: “ + fn
  conn = sqlite3.connect(fn)
  c = conn.cursor()
  c.execute(“DELETE FROM favorites“)

  intentFormat = “#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=%s;end“

  id = 0;
  for s in range(SCREENS):
    for x in range(ROWS):
      for y in range(COLUMNS):
        id += 1
        insert = “INSERT into favorites (_id title intent container screen cellX cellY spanX spanY itemType appWidgetId iconType) VALUES (%d ‘%s‘ ‘%s‘ %d %d %d %d %d %d %d %d %d)“
        insert = insert % (id “title“ ““ -100 s x y 1 1 2 -1 0)
        c.execute(insert)
        folder_id = id

        for z in range(15):
          id += 1
          intent = intentFormat % (APPLICATION_COMPONENTS[id % len(APPLICATION_COMPONENTS)])
          insert = “INSERT into favorites (_id title intent container screen cellX cellY spanX spanY itemType appWidgetId iconType) VALUES (%d ‘%s‘ ‘%s‘ %d %d %d %d %d %d %d %d %d)“
          insert = insert % (id “title“ intent folder_id 0 0 0 1 1 0 -1 0)
          c.execute(insert)

  conn.commit()
  c.close()

def main(argv):
  if len(argv) == 1:
    make_dir()
    pull_file(AUTO_FILE)
    process_file(AUTO_FILE)
    push_file(AUTO_FILE)
  else:
    usage()

if __name__==“__main__“:
  main(sys.argv)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-05-15 06:56  Launcher3_mx-master\
     文件          70  2017-05-15 06:56  Launcher3_mx-master\.gitignore
     目录           0  2017-05-15 06:56  Launcher3_mx-master\.idea\
     文件         264  2017-05-15 06:56  Launcher3_mx-master\.idea\modules.xml
     文件         564  2017-05-15 06:56  Launcher3_mx-master\.idea\runConfigurations.xml
     文件         167  2017-05-15 06:56  Launcher3_mx-master\.idea\vcs.xml
     文件        2139  2017-05-15 06:56  Launcher3_mx-master\Android.mk
     文件        3551  2017-05-15 06:56  Launcher3_mx-master\AndroidManifest-common.xml
     文件        6918  2017-05-15 06:56  Launcher3_mx-master\AndroidManifest.xml
     文件       13192  2017-05-15 06:56  Launcher3_mx-master\Launcher3-7.1.1-r38.iml
     文件       11748  2017-05-15 06:56  Launcher3_mx-master\Launcher3_mx.iml
     文件        2754  2017-05-15 06:56  Launcher3_mx-master\README.md
     目录           0  2017-05-15 06:56  Launcher3_mx-master\art\
     文件       46829  2017-05-15 06:56  Launcher3_mx-master\art\launcher1.jpg
     文件       80508  2017-05-15 06:56  Launcher3_mx-master\art\launcher2.jpg
     文件       64108  2017-05-15 06:56  Launcher3_mx-master\art\launcher3.jpg
     文件       40768  2017-05-15 06:56  Launcher3_mx-master\art\launcher4.jpg
     文件       51894  2017-05-15 06:56  Launcher3_mx-master\art\launcher5.jpg
     文件        2203  2017-05-15 06:56  Launcher3_mx-master\build.gradle
     文件        2574  2017-05-15 06:56  Launcher3_mx-master\fill_screens.py
     目录           0  2017-05-15 06:56  Launcher3_mx-master\gradle\
     目录           0  2017-05-15 06:56  Launcher3_mx-master\gradle\wrapper\
     文件       53636  2017-05-15 06:56  Launcher3_mx-master\gradle\wrapper\gradle-wrapper.jar
     文件         232  2017-05-15 06:56  Launcher3_mx-master\gradle\wrapper\gradle-wrapper.properties
     文件        4971  2017-05-15 06:56  Launcher3_mx-master\gradlew
     文件        2404  2017-05-15 06:56  Launcher3_mx-master\gradlew.bat
     文件         541  2017-05-15 06:56  Launcher3_mx-master\local.properties
     文件        8182  2017-05-15 06:56  Launcher3_mx-master\print_db.py
     文件        2151  2017-05-15 06:56  Launcher3_mx-master\proguard.flags
     目录           0  2017-05-15 06:56  Launcher3_mx-master\protos\
     文件        3475  2017-05-15 06:56  Launcher3_mx-master\protos\launcher_log.proto
............此处省略692个文件信息

评论

共有 条评论