Merge remote-tracking branch 'origin/dev-widget' into dev-widget

Conflicts:
	calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorButtons.java
	calculatorpp/src/main/java/org/solovyev/android/calculator/widget/CalculatorWidgetProvider.java
This commit is contained in:
Sergey Solovyev 2012-10-26 21:37:48 +04:00
commit 1a284cbf13
2 changed files with 17 additions and 23 deletions

View File

@ -9,16 +9,18 @@
# Project target.
target=android-15
android.library.reference.1=gen-external-apklibs/org.solovyev.android_android-common-core_1.0.4-SNAPSHOT
android.library.reference.2=gen-external-apklibs/org.solovyev.android_android-common-ads_1.0.4-SNAPSHOT
android.library.reference.3=gen-external-apklibs/org.solovyev.android_android-common-billing_1.0.4-SNAPSHOT
android.library.reference.4=gen-external-apklibs/org.solovyev.android_android-common-db_1.0.4-SNAPSHOT
android.library.reference.5=gen-external-apklibs/org.solovyev.android_android-common-view_1.0.4-SNAPSHOT
android.library.reference.6=gen-external-apklibs/org.solovyev.android_android-common-preferences_1.0.4-SNAPSHOT
android.library.reference.7=gen-external-apklibs/org.solovyev.android_android-common-other_1.0.4-SNAPSHOT
android.library.reference.8=gen-external-apklibs/org.solovyev.android_android-common-menu_1.0.4-SNAPSHOT
android.library.reference.9=gen-external-apklibs/org.solovyev.android_android-common-sherlock_1.0.4-SNAPSHOT
android.library.reference.10=gen-external-apklibs/com.actionbarsherlock_actionbarsherlock_4.2.0
android.library.reference.11=gen-external-apklibs/org.solovyev.android_android-common-list_1.0.4-SNAPSHOT
android.library.reference.1=gen-external-apklibs/org.solovyev.android_android-common-all_1.0.4
android.library.reference.2=gen-external-apklibs/org.solovyev.android_android-common-ads_1.0.4
android.library.reference.3=gen-external-apklibs/org.solovyev.android_android-common-core_1.0.4
android.library.reference.4=gen-external-apklibs/org.solovyev.android_android-common-billing_1.0.4
android.library.reference.5=gen-external-apklibs/org.solovyev.android_android-common-db_1.0.4
android.library.reference.6=gen-external-apklibs/org.solovyev.android_android-common-http_1.0.4
android.library.reference.7=gen-external-apklibs/org.solovyev.android_android-common-list_1.0.4
android.library.reference.8=gen-external-apklibs/org.solovyev.android_android-common-view_1.0.4
android.library.reference.9=gen-external-apklibs/org.solovyev.android_android-common-preferences_1.0.4
android.library.reference.10=gen-external-apklibs/org.solovyev.android_android-common-menu_1.0.4
android.library.reference.11=gen-external-apklibs/org.solovyev.android_android-common-other_1.0.4
android.library.reference.12=gen-external-apklibs/org.solovyev.android_android-common-sherlock_1.0.4
android.library.reference.13=gen-external-apklibs/com.actionbarsherlock_actionbarsherlock_4.2.0

View File

@ -181,21 +181,13 @@ public class CalculatorWidgetProvider extends AppWidgetProvider {
private void updateDisplayState(@NotNull Context context, @NotNull RemoteViews views, @NotNull CalculatorDisplayViewState displayState) {
if (displayState.isValid()) {
setText(views, R.id.calculatorDisplay, displayState.getText());
setTextColor(views, R.id.calculatorDisplay, context.getResources().getColor(R.color.default_text_color));
views.setTextViewText(R.id.calculatorDisplay, displayState.getText());
views.setTextColor(R.id.calculatorDisplay, context.getResources().getColor(R.color.default_text_color));
} else {
setTextColor(views, R.id.calculatorDisplay, context.getResources().getColor(R.color.display_error_text_color));
views.setTextColor(R.id.calculatorDisplay, context.getResources().getColor(R.color.display_error_text_color));
}
}
private void setText(@NotNull RemoteViews views, int textViewId, @Nullable CharSequence text) {
views.setTextViewText(textViewId, text);
}
private void setTextColor(@NotNull RemoteViews views, int textViewId, int textColor) {
views.setTextColor(textViewId, textColor);
}
private void updateEditorState(@NotNull Context context, @NotNull RemoteViews views, @NotNull CalculatorEditorViewState editorState) {
String text = editorState.getText();
@ -206,7 +198,7 @@ public class CalculatorWidgetProvider extends AppWidgetProvider {
newText = Html.fromHtml(text.substring(0, selection) + "<font color=\"#" + getCursorColor(context) + "\">|</font>" + text.substring(selection));
}
CalculatorLocatorImpl.getInstance().getNotifier().showDebugMessage(TAG, "New editor state: " + text);
setText(views, R.id.calculatorEditor, newText);
views.setTextViewText(R.id.calculatorEditor, newText);
}
/*