diff --git a/android-app/src/main/AndroidManifest.xml b/android-app/src/main/AndroidManifest.xml index 3431bffb..9068e9f7 100644 --- a/android-app/src/main/AndroidManifest.xml +++ b/android-app/src/main/AndroidManifest.xml @@ -122,7 +122,7 @@ - + diff --git a/android-app/src/main/java/org/solovyev/android/calculator/App.java b/android-app/src/main/java/org/solovyev/android/calculator/App.java index a708d000..eb63faf9 100644 --- a/android-app/src/main/java/org/solovyev/android/calculator/App.java +++ b/android-app/src/main/java/org/solovyev/android/calculator/App.java @@ -169,8 +169,18 @@ public final class App { App.screenMetrics = new ScreenMetrics(application); final List> oldNotUsedWidgetClasses = findNotUsedWidgets(application); - for (Class oldNotUsedWidgetClass : oldNotUsedWidgetClasses) { - Android.enableComponent(application, oldNotUsedWidgetClass, false); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) { + for (Class oldNotUsedWidgetClass : oldNotUsedWidgetClasses) { + 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; diff --git a/android-app/src/main/res/xml/calculator_widget.xml b/android-app/src/main/res/xml/calculator_widget.xml new file mode 100644 index 00000000..a0f72dc1 --- /dev/null +++ b/android-app/src/main/res/xml/calculator_widget.xml @@ -0,0 +1,36 @@ + + + + + diff --git a/android-app/src/main/res/xml/calculator_widget_info.xml b/android-app/src/main/res/xml/calculator_widget_info.xml index 8ca2536e..40343fc4 100644 --- a/android-app/src/main/res/xml/calculator_widget_info.xml +++ b/android-app/src/main/res/xml/calculator_widget_info.xml @@ -23,12 +23,12 @@ --> - - \ No newline at end of file + a:resizeMode="horizontal|vertical" + a:widgetCategory="home_screen|keyguard" + tools:ignore="UnusedAttribute"/> diff --git a/android-app/src/main/res/xml/calculator_widget_info_3x3.xml b/android-app/src/main/res/xml/calculator_widget_info_3x3.xml index 8ca2536e..b0a9e5f0 100644 --- a/android-app/src/main/res/xml/calculator_widget_info_3x3.xml +++ b/android-app/src/main/res/xml/calculator_widget_info_3x3.xml @@ -23,12 +23,10 @@ --> - - \ No newline at end of file + a:resizeMode="horizontal|vertical" + a:widgetCategory="home_screen|keyguard"/> diff --git a/android-app/src/main/res/xml/calculator_widget_info_3x4.xml b/android-app/src/main/res/xml/calculator_widget_info_3x4.xml index c19ef448..641bb157 100644 --- a/android-app/src/main/res/xml/calculator_widget_info_3x4.xml +++ b/android-app/src/main/res/xml/calculator_widget_info_3x4.xml @@ -23,12 +23,10 @@ --> - - \ No newline at end of file + a:resizeMode="horizontal|vertical" + a:widgetCategory="home_screen|keyguard"/> diff --git a/android-app/src/main/res/xml/calculator_widget_info_4x4.xml b/android-app/src/main/res/xml/calculator_widget_info_4x4.xml index 99425b46..a0f72dc1 100644 --- a/android-app/src/main/res/xml/calculator_widget_info_4x4.xml +++ b/android-app/src/main/res/xml/calculator_widget_info_4x4.xml @@ -23,12 +23,14 @@ --> - - \ No newline at end of file + a:resizeMode="horizontal|vertical" + a:widgetCategory="home_screen|keyguard" + tools:ignore="UnusedAttribute"/> diff --git a/android-app/src/main/res/xml/calculator_widget_info_4x5.xml b/android-app/src/main/res/xml/calculator_widget_info_4x5.xml index 1c71062e..e165e891 100644 --- a/android-app/src/main/res/xml/calculator_widget_info_4x5.xml +++ b/android-app/src/main/res/xml/calculator_widget_info_4x5.xml @@ -23,12 +23,12 @@ --> - - \ No newline at end of file + a:resizeMode="horizontal|vertical" + a:widgetCategory="home_screen|keyguard"/> \ No newline at end of file