add widget support
This commit is contained in:
33
app/src/main/res/layout/activity_script_widget_settings.xml
Normal file
33
app/src/main/res/layout/activity_script_widget_settings.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:clipToPadding="false"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay"
|
||||
app:title="@string/_app_name">
|
||||
|
||||
|
||||
</com.stardust.theme.widget.ThemeColorToolbar>
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<com.stardust.scriptdroid.ui.main.script_list.ScriptListWithProgressBarView
|
||||
android:id="@+id/script_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#fafafa"/>
|
||||
|
||||
</LinearLayout>
|
||||
25
app/src/main/res/layout/widget_script_shortcut.xml
Normal file
25
app/src/main/res/layout/widget_script_shortcut.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/widget"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:src="@drawable/ic_node_js_black"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
19
app/src/main/res/menu/script_widget_settings_menu.xml
Normal file
19
app/src/main/res/menu/script_widget_settings_menu.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?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_refresh"
|
||||
android:icon="@drawable/ic_refresh_white_24dp"
|
||||
android:orderInCategory="100"
|
||||
android:title="@string/text_refresh"
|
||||
app:showAsAction="ifRoom"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_clear_file_selection"
|
||||
android:orderInCategory="200"
|
||||
android:title="@string/text_clear_file_selection"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
</menu>
|
||||
8
app/src/main/res/xml/script_widget_config.xml
Normal file
8
app/src/main/res/xml/script_widget_config.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:configure="com.stardust.scriptdroid.external.widget.ScriptWidgetSettingsActivity_"
|
||||
android:initialLayout="@layout/widget_script_shortcut"
|
||||
android:minHeight="40dp"
|
||||
android:minWidth="40dp"
|
||||
android:previewImage="@drawable/ic_node_js_black"
|
||||
android:resizeMode="none"/>
|
||||
Reference in New Issue
Block a user