New widget provider info
This commit is contained in:
parent
746afd18c8
commit
14ee60eb6e
@ -122,7 +122,7 @@
|
|||||||
<action android:name="org.solovyev.android.calculator.BUTTON_PRESSED"/>
|
<action android:name="org.solovyev.android.calculator.BUTTON_PRESSED"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<meta-data android:name="android.appwidget.provider" android:resource="@xml/calculator_widget_info"/>
|
<meta-data android:name="android.appwidget.provider" android:resource="@xml/calculator_widget"/>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<receiver android:icon="@drawable/ic_launcher" android:label="@string/c_app_widget_3x3_name" android:name=".widget.CalculatorWidgetProvider">
|
<receiver android:icon="@drawable/ic_launcher" android:label="@string/c_app_widget_3x3_name" android:name=".widget.CalculatorWidgetProvider">
|
||||||
|
@ -169,9 +169,19 @@ public final class App {
|
|||||||
App.screenMetrics = new ScreenMetrics(application);
|
App.screenMetrics = new ScreenMetrics(application);
|
||||||
|
|
||||||
final List<Class<? extends AppWidgetProvider>> oldNotUsedWidgetClasses = findNotUsedWidgets(application);
|
final List<Class<? extends AppWidgetProvider>> oldNotUsedWidgetClasses = findNotUsedWidgets(application);
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {
|
||||||
for (Class<? extends AppWidgetProvider> oldNotUsedWidgetClass : oldNotUsedWidgetClasses) {
|
for (Class<? extends AppWidgetProvider> oldNotUsedWidgetClass : oldNotUsedWidgetClasses) {
|
||||||
Android.enableComponent(application, oldNotUsedWidgetClass, false);
|
Android.enableComponent(application, oldNotUsedWidgetClass, false);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// smaller widgets should be still used for smaller screens
|
||||||
|
if (oldNotUsedWidgetClasses.contains(CalculatorWidgetProvider4x5.class)) {
|
||||||
|
Android.enableComponent(application, CalculatorWidgetProvider4x5.class, false);
|
||||||
|
}
|
||||||
|
if (oldNotUsedWidgetClasses.contains(CalculatorWidgetProvider4x4.class)) {
|
||||||
|
Android.enableComponent(application, CalculatorWidgetProvider4x4.class, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
App.initialized = true;
|
App.initialized = true;
|
||||||
} else {
|
} else {
|
||||||
|
36
android-app/src/main/res/xml/calculator_widget.xml
Normal file
36
android-app/src/main/res/xml/calculator_widget.xml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
~ Copyright 2013 serso aka se.solovyev
|
||||||
|
~
|
||||||
|
~ 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.
|
||||||
|
~
|
||||||
|
~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
~ Contact details
|
||||||
|
~
|
||||||
|
~ Email: se.solovyev@gmail.com
|
||||||
|
~ Site: http://se.solovyev.org
|
||||||
|
-->
|
||||||
|
|
||||||
|
<appwidget-provider xmlns:a="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
a:initialKeyguardLayout="@layout/widget_layout_lockscreen"
|
||||||
|
a:initialLayout="@layout/widget_layout"
|
||||||
|
a:minHeight="250dp"
|
||||||
|
a:minResizeHeight="180dp"
|
||||||
|
a:minResizeWidth="180dp"
|
||||||
|
a:minWidth="250dp"
|
||||||
|
a:previewImage="@drawable/widget_preview"
|
||||||
|
a:resizeMode="horizontal|vertical"
|
||||||
|
a:widgetCategory="home_screen|keyguard"
|
||||||
|
tools:ignore="UnusedAttribute"/>
|
@ -23,12 +23,12 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<appwidget-provider xmlns:a="http://schemas.android.com/apk/res/android"
|
<appwidget-provider xmlns:a="http://schemas.android.com/apk/res/android"
|
||||||
a:minWidth="180dp"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
a:minHeight="180dp"
|
|
||||||
a:initialLayout="@layout/widget_layout"
|
|
||||||
a:initialKeyguardLayout="@layout/widget_layout_lockscreen"
|
a:initialKeyguardLayout="@layout/widget_layout_lockscreen"
|
||||||
a:widgetCategory="home_screen|keyguard"
|
a:initialLayout="@layout/widget_layout"
|
||||||
|
a:minHeight="180dp"
|
||||||
|
a:minWidth="180dp"
|
||||||
a:previewImage="@drawable/widget_preview"
|
a:previewImage="@drawable/widget_preview"
|
||||||
a:resizeMode="horizontal|vertical">
|
a:resizeMode="horizontal|vertical"
|
||||||
|
a:widgetCategory="home_screen|keyguard"
|
||||||
</appwidget-provider>
|
tools:ignore="UnusedAttribute"/>
|
||||||
|
@ -23,12 +23,10 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<appwidget-provider xmlns:a="http://schemas.android.com/apk/res/android"
|
<appwidget-provider xmlns:a="http://schemas.android.com/apk/res/android"
|
||||||
a:minWidth="180dp"
|
|
||||||
a:minHeight="180dp"
|
|
||||||
a:initialLayout="@layout/widget_layout"
|
|
||||||
a:initialKeyguardLayout="@layout/widget_layout_lockscreen"
|
a:initialKeyguardLayout="@layout/widget_layout_lockscreen"
|
||||||
a:widgetCategory="home_screen|keyguard"
|
a:initialLayout="@layout/widget_layout"
|
||||||
|
a:minHeight="180dp"
|
||||||
|
a:minWidth="180dp"
|
||||||
a:previewImage="@drawable/widget_preview"
|
a:previewImage="@drawable/widget_preview"
|
||||||
a:resizeMode="horizontal|vertical">
|
a:resizeMode="horizontal|vertical"
|
||||||
|
a:widgetCategory="home_screen|keyguard"/>
|
||||||
</appwidget-provider>
|
|
||||||
|
@ -23,12 +23,10 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<appwidget-provider xmlns:a="http://schemas.android.com/apk/res/android"
|
<appwidget-provider xmlns:a="http://schemas.android.com/apk/res/android"
|
||||||
a:minWidth="180dp"
|
|
||||||
a:minHeight="250dp"
|
|
||||||
a:initialLayout="@layout/widget_layout"
|
|
||||||
a:initialKeyguardLayout="@layout/widget_layout_lockscreen"
|
a:initialKeyguardLayout="@layout/widget_layout_lockscreen"
|
||||||
a:widgetCategory="home_screen|keyguard"
|
a:initialLayout="@layout/widget_layout"
|
||||||
|
a:minHeight="250dp"
|
||||||
|
a:minWidth="180dp"
|
||||||
a:previewImage="@drawable/widget_preview"
|
a:previewImage="@drawable/widget_preview"
|
||||||
a:resizeMode="horizontal|vertical">
|
a:resizeMode="horizontal|vertical"
|
||||||
|
a:widgetCategory="home_screen|keyguard"/>
|
||||||
</appwidget-provider>
|
|
||||||
|
@ -23,12 +23,14 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<appwidget-provider xmlns:a="http://schemas.android.com/apk/res/android"
|
<appwidget-provider xmlns:a="http://schemas.android.com/apk/res/android"
|
||||||
a:minWidth="250dp"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
a:minHeight="250dp"
|
|
||||||
a:initialLayout="@layout/widget_layout"
|
|
||||||
a:initialKeyguardLayout="@layout/widget_layout_lockscreen"
|
a:initialKeyguardLayout="@layout/widget_layout_lockscreen"
|
||||||
a:widgetCategory="home_screen|keyguard"
|
a:initialLayout="@layout/widget_layout"
|
||||||
|
a:minHeight="250dp"
|
||||||
|
a:minResizeHeight="180dp"
|
||||||
|
a:minResizeWidth="180dp"
|
||||||
|
a:minWidth="250dp"
|
||||||
a:previewImage="@drawable/widget_preview"
|
a:previewImage="@drawable/widget_preview"
|
||||||
a:resizeMode="horizontal|vertical">
|
a:resizeMode="horizontal|vertical"
|
||||||
|
a:widgetCategory="home_screen|keyguard"
|
||||||
</appwidget-provider>
|
tools:ignore="UnusedAttribute"/>
|
||||||
|
@ -23,12 +23,12 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<appwidget-provider xmlns:a="http://schemas.android.com/apk/res/android"
|
<appwidget-provider xmlns:a="http://schemas.android.com/apk/res/android"
|
||||||
a:minWidth="250dp"
|
|
||||||
a:minHeight="320dp"
|
|
||||||
a:initialLayout="@layout/widget_layout"
|
|
||||||
a:initialKeyguardLayout="@layout/widget_layout_lockscreen"
|
a:initialKeyguardLayout="@layout/widget_layout_lockscreen"
|
||||||
a:widgetCategory="home_screen|keyguard"
|
a:initialLayout="@layout/widget_layout"
|
||||||
|
a:minHeight="320dp"
|
||||||
|
a:minResizeHeight="180dp"
|
||||||
|
a:minResizeWidth="180dp"
|
||||||
|
a:minWidth="250dp"
|
||||||
a:previewImage="@drawable/widget_preview"
|
a:previewImage="@drawable/widget_preview"
|
||||||
a:resizeMode="horizontal|vertical">
|
a:resizeMode="horizontal|vertical"
|
||||||
|
a:widgetCategory="home_screen|keyguard"/>
|
||||||
</appwidget-provider>
|
|
Loading…
Reference in New Issue
Block a user