add: custom shortcut icon

This commit is contained in:
hyb1996
2017-10-25 16:43:55 +08:00
parent cf82cd2802
commit 98b3fb2c09
20 changed files with 417 additions and 77 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="4dp"/>
<solid android:color="#727379"/>
</shape>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:title="@string/_app_name"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/apps"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"/>
</LinearLayout>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackgroundBorderless"
android:padding="8dp">
</ImageView>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="16dp">
<ImageView
android:id="@+id/select_icon"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="16dp"
android:background="@drawable/shortcut_create_dialog_icon_bg"
android:padding="12dp"
android:src="@drawable/ic_add_white_48dp"/>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical">
<android.support.design.widget.TextInputEditText
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/text_name"/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>

View File

@@ -12,6 +12,9 @@
<item
android:id="@+id/delete"
android:title="@string/text_delete"/>
<item
android:id="@+id/floating_edit"
android:title="@string/text_floating_edit"/>
<item
android:id="@+id/create_shortcut"

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_select_image"
android:icon="@drawable/ic_insert_photo_white_48dp"
android:title="@string/text_select_image"
app:showAsAction="always"/>
</menu>

View File

@@ -45,7 +45,7 @@
<string name="text_start_running">开始运行</string>
<string name="text_open_by_other_apps">用其他应用打开</string>
<string name="text_rename">重命名</string>
<string name="text_send_shortcut">创建桌面快捷方式</string>
<string name="text_send_shortcut">创建快捷方式</string>
<string name="text_already_create">已创建</string>
<string name="text_delete">删除</string>
<string name="text_already_delete">已删除</string>
@@ -263,6 +263,8 @@
<string name="apk_builder_clean">清理临时文件</string>
<string name="text_source_file_path">脚本文件路径</string>
<string name="text_search">搜索</string>
<string name="text_floating_edit">悬浮编辑</string>
<string name="text_select_icon">选择图标</string>
<string-array name="ad_showing_mode_keys">