diff --git a/android-app-core/res/values/text_strings.xml b/android-app-core/res/values/text_strings.xml index 8ec6b0a2..2aebeade 100644 --- a/android-app-core/res/values/text_strings.xml +++ b/android-app-core/res/values/text_strings.xml @@ -320,6 +320,7 @@ Invalid number! Graph boundaries should not be the same! Apply + Message \ No newline at end of file diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/ParcelableDialogData.java b/android-app-core/src/main/java/org/solovyev/android/calculator/ParcelableDialogData.java new file mode 100644 index 00000000..598acb20 --- /dev/null +++ b/android-app-core/src/main/java/org/solovyev/android/calculator/ParcelableDialogData.java @@ -0,0 +1,105 @@ +package org.solovyev.android.calculator; + +import android.os.Parcel; +import android.os.Parcelable; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.solovyev.common.msg.MessageType; + +/** +* User: serso +* Date: 1/20/13 +* Time: 1:04 PM +*/ +public final class ParcelableDialogData implements DialogData, Parcelable { + + /* + ********************************************************************** + * + * STATIC + * + ********************************************************************** + */ + + public final static Creator CREATOR = new Creator() { + @Override + public ParcelableDialogData createFromParcel(@NotNull Parcel in) { + return fromParcel(in); + } + + @Override + public ParcelableDialogData[] newArray(int size) { + return new ParcelableDialogData[size]; + } + }; + + /* + ********************************************************************** + * + * FIELDS + * + ********************************************************************** + */ + + @NotNull + private DialogData nestedData; + + /* + ********************************************************************** + * + * CONSTRUCTORS + * + ********************************************************************** + */ + + public ParcelableDialogData(@NotNull DialogData nestedData) { + this.nestedData = nestedData; + } + + @NotNull + public static ParcelableDialogData wrap(@NotNull DialogData nestedData) { + if (nestedData instanceof ParcelableDialogData) { + return ((ParcelableDialogData) nestedData); + } else { + return new ParcelableDialogData(nestedData); + } + } + + @NotNull + public static ParcelableDialogData fromParcel(@NotNull Parcel in) { + final String message = in.readString(); + final MessageType messageType = MessageType.values()[in.readInt()]; + final String title = in.readString(); + return wrap(StringDialogData.newInstance(message, messageType, title)); + } + + @NotNull + @Override + public String getMessage() { + return nestedData.getMessage(); + } + + @NotNull + @Override + public MessageType getMessageType() { + return nestedData.getMessageType(); + } + + @Nullable + @Override + public String getTitle() { + return nestedData.getTitle(); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(@NotNull Parcel out, int flags) { + out.writeString(this.getMessage()); + out.writeInt(this.getMessageType().ordinal()); + out.writeString(this.getTitle()); + } +} diff --git a/android-app/AndroidManifest.xml b/android-app/AndroidManifest.xml index a4870183..db630196 100644 --- a/android-app/AndroidManifest.xml +++ b/android-app/AndroidManifest.xml @@ -57,6 +57,8 @@ + + diff --git a/android-app/project.properties b/android-app/project.properties index 1b8a55be..542cf64d 100644 --- a/android-app/project.properties +++ b/android-app/project.properties @@ -12,19 +12,19 @@ target=android-15 android.library.reference.1=../android-app-core android.library.reference.2=../android-app-widget android.library.reference.3=../android-app-onscreen -android.library.reference.4=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-all_1.0.6 -android.library.reference.5=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-ads_1.0.6 -android.library.reference.6=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-core_1.0.6 -android.library.reference.7=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-billing_1.0.6 -android.library.reference.8=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-db_1.0.6 -android.library.reference.9=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-http_1.0.6 -android.library.reference.10=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-list_1.0.6 -android.library.reference.11=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-view_1.0.6 -android.library.reference.12=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-preferences_1.0.6 -android.library.reference.13=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-menu_1.0.6 -android.library.reference.14=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-other_1.0.6 -android.library.reference.15=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-sherlock_1.0.6 -android.library.reference.16=../android-app-core/gen-external-apklibs/com.actionbarsherlock_actionbarsherlock_4.2.0 -android.library.reference.17=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-keyboard_1.0.6 +android.library.reference.4=gen-external-apklibs/org.solovyev.android_android-common-all_1.0.6 +android.library.reference.5=gen-external-apklibs/org.solovyev.android_android-common-ads_1.0.6 +android.library.reference.6=gen-external-apklibs/org.solovyev.android_android-common-core_1.0.6 +android.library.reference.7=gen-external-apklibs/org.solovyev.android_android-common-billing_1.0.6 +android.library.reference.8=gen-external-apklibs/org.solovyev.android_android-common-db_1.0.6 +android.library.reference.9=gen-external-apklibs/org.solovyev.android_android-common-http_1.0.6 +android.library.reference.10=gen-external-apklibs/org.solovyev.android_android-common-list_1.0.6 +android.library.reference.11=gen-external-apklibs/org.solovyev.android_android-common-view_1.0.6 +android.library.reference.12=gen-external-apklibs/org.solovyev.android_android-common-preferences_1.0.6 +android.library.reference.13=gen-external-apklibs/org.solovyev.android_android-common-menu_1.0.6 +android.library.reference.14=gen-external-apklibs/org.solovyev.android_android-common-other_1.0.6 +android.library.reference.15=gen-external-apklibs/org.solovyev.android_android-common-sherlock_1.0.6 +android.library.reference.16=gen-external-apklibs/com.actionbarsherlock_actionbarsherlock_4.2.0 +android.library.reference.17=gen-external-apklibs/org.solovyev.android_android-common-keyboard_1.0.6 diff --git a/android-app/res/layout/cpp_dialog_fragment.xml b/android-app/res/layout/cpp_dialog_fragment.xml new file mode 100644 index 00000000..ae212b05 --- /dev/null +++ b/android-app/res/layout/cpp_dialog_fragment.xml @@ -0,0 +1,38 @@ + + + + + + + + +