android_1.6_compatibility

This commit is contained in:
serso 2011-10-20 14:57:59 +04:00
parent f87d1d920d
commit 783f321dfd
18 changed files with 136 additions and 116 deletions

View File

@ -1,41 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<manifest xmlns:a="http://schemas.android.com/apk/res/android"
package="org.solovyev.android.calculator"
android:versionCode="2"
android:versionName="1.0.2">
a:versionCode="2"
a:versionName="1.0.2">
<uses-sdk android:minSdkVersion="8"/>
<uses-sdk a:minSdkVersion="4"
a:targetSdkVersion="8"/>
<application android:icon="@drawable/icon"
android:label="@string/c_app_name">
<application a:icon="@drawable/icon"
a:label="@string/c_app_name">
<activity android:name=".CalculatorActivity"
android:label="@string/c_app_name">
<activity a:name=".CalculatorActivity"
a:label="@string/c_app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action a:name="android.intent.action.MAIN"/>
<category a:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".CalculatorPreferencesActivity"
android:label="@string/c_app_settings"
android:configChanges="orientation|keyboardHidden"/>
<activity a:name=".CalculatorPreferencesActivity"
a:label="@string/c_app_settings"
a:configChanges="orientation|keyboardHidden"/>
<activity android:name=".CalculatorHistoryActivity"
android:label="@string/c_app_history"
android:configChanges="orientation|keyboardHidden">
<activity a:name=".CalculatorHistoryActivity"
a:label="@string/c_app_history"
a:configChanges="orientation|keyboardHidden">
</activity>
<activity android:name=".AboutActivity"
android:label="@string/c_about"
android:configChanges="orientation|keyboardHidden"/>
<activity a:name=".AboutActivity"
a:label="@string/c_about"
a:configChanges="orientation|keyboardHidden"/>
<activity android:name=".CalculatorVarsActivity"
android:label="@string/c_vars_and_constants"
android:configChanges="orientation|keyboardHidden">
<activity a:name=".CalculatorVarsActivity"
a:label="@string/c_vars_and_constants"
a:configChanges="orientation|keyboardHidden">
</activity>
</application>

View File

@ -8,4 +8,4 @@
# project structure.
# Project target.
target=android-8
target=android-4

View File

@ -3,19 +3,19 @@
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
xmlns:calc="http://schemas.android.com/apk/res/org.solovyev.android.calculator"
a:orientation="vertical"
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:background="#ff000000">
<LinearLayout
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:orientation="vertical"
a:layout_gravity="center">
<include layout="@layout/calc_editor"/>
<LinearLayout a:layout_weight="1" a:layout_width="match_parent" a:layout_height="0dp">
<LinearLayout a:layout_weight="1" a:layout_width="fill_parent" a:layout_height="0dp">
<org.solovyev.android.view.widgets.DirectionDragButton xmlns:a="http://schemas.android.com/apk/res/android"
xmlns:calc="http://schemas.android.com/apk/res/org.solovyev.android.calculator"
@ -25,8 +25,8 @@
calc:directionTextScale="0.5"
style="?controlButtonStyle"
a:onClick="moveLeftButtonClickHandler"
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:layout_weight="1.5"/>
@ -36,14 +36,14 @@
a:drawableTop="@drawable/sym_keyboard_delete"
style="?controlImageButtonStyle"
a:onClick="eraseButtonClickHandler"
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:layout_weight="1.5"/>
<include layout="@layout/calc_display"
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:layout_weight="1"/>
<org.solovyev.android.view.widgets.ColorButton xmlns:a="http://schemas.android.com/apk/res/android"
@ -53,8 +53,8 @@
a:textStyle="bold"
style="?controlImageButtonStyle"
a:onClick="clearButtonClickHandler"
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:layout_weight="1.5"/>
<org.solovyev.android.view.widgets.DirectionDragButton xmlns:a="http://schemas.android.com/apk/res/android"
@ -65,13 +65,13 @@
calc:directionTextScale="0.5"
style="?controlButtonStyle"
a:onClick="moveRightButtonClickHandler"
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:layout_weight="1.5"/>
</LinearLayout>
<LinearLayout a:layout_weight="1" a:layout_width="match_parent" a:layout_height="0dp">
<LinearLayout a:layout_weight="1" a:layout_width="fill_parent" a:layout_height="0dp">
<include layout="@layout/calc_history_button"/>
<include layout="@layout/calc_paste_button"/>
@ -83,7 +83,7 @@
</LinearLayout>
<LinearLayout a:layout_weight="1" a:layout_width="match_parent" a:layout_height="0dp">
<LinearLayout a:layout_weight="1" a:layout_width="fill_parent" a:layout_height="0dp">
<include layout="@layout/calc_vars_button"/>
<include layout="@layout/calc_copy_button"/>
@ -95,7 +95,7 @@
</LinearLayout>
<LinearLayout a:layout_weight="1" a:layout_width="match_parent" a:layout_height="0dp">
<LinearLayout a:layout_weight="1" a:layout_width="fill_parent" a:layout_height="0dp">
<include layout="@layout/calc_donate_button"/>
<include layout="@layout/calc_square_brackets_button"/>

View File

@ -2,27 +2,27 @@
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:orientation="vertical"
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:background="#ff000000">
<LinearLayout
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:orientation="vertical"
a:layout_gravity="center">
<include layout="@layout/calc_editor"/>
<LinearLayout a:layout_weight="1" a:layout_width="match_parent" a:layout_height="0dp">
<LinearLayout a:layout_weight="1" a:layout_width="fill_parent" a:layout_height="0dp">
<include layout="@layout/calc_display"
a:layout_width="match_parent"
a:layout_height="match_parent"/>
a:layout_width="fill_parent"
a:layout_height="fill_parent"/>
</LinearLayout>
<LinearLayout a:layout_weight="1" a:layout_width="match_parent" a:layout_height="0dp">
<LinearLayout a:layout_weight="1" a:layout_width="fill_parent" a:layout_height="0dp">
<include layout="@layout/calc_one_digit_button"/>
<include layout="@layout/calc_two_digit_button"/>
@ -32,7 +32,7 @@
</LinearLayout>
<LinearLayout a:layout_weight="1" a:layout_width="match_parent" a:layout_height="0dp">
<LinearLayout a:layout_weight="1" a:layout_width="fill_parent" a:layout_height="0dp">
<include layout="@layout/calc_four_digit_button"/>
<include layout="@layout/calc_five_digit_button"/>
@ -42,7 +42,7 @@
</LinearLayout>
<LinearLayout a:layout_weight="1" a:layout_width="match_parent" a:layout_height="0dp">
<LinearLayout a:layout_weight="1" a:layout_width="fill_parent" a:layout_height="0dp">
<include layout="@layout/calc_seven_digit_button"/>
<include layout="@layout/calc_eight_digit_button"/>
@ -52,7 +52,7 @@
</LinearLayout>
<LinearLayout a:layout_weight="1" a:layout_width="match_parent" a:layout_height="0dp">
<LinearLayout a:layout_weight="1" a:layout_width="fill_parent" a:layout_height="0dp">
<include layout="@layout/calc_round_brackets_button"/>
<include layout="@layout/calc_zero_digit_button"/>
@ -63,7 +63,7 @@
</LinearLayout>
<LinearLayout a:layout_weight="1" a:layout_width="match_parent" a:layout_height="0dp">
<LinearLayout a:layout_weight="1" a:layout_width="fill_parent" a:layout_height="0dp">
<include layout="@layout/calc_left_button"/>
<include layout="@layout/calc_right_button"/>

View File

@ -8,8 +8,8 @@
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:orientation="vertical"
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:background="#ff000000">
<ImageView a:layout_width="wrap_content"
@ -22,12 +22,26 @@
<TextView
a:id="@+id/aboutTextView"
a:text="@string/c_copyright"
a:layout_height="match_parent"
a:layout_width="match_parent"
a:layout_height="fill_parent"
a:layout_width="fill_parent"
a:layout_gravity="top|center_horizontal"
a:layout_weight="1"
a:scrollbars="vertical"
style="@style/about_style"/>
<!--
a:scrollbarFadeDuration="0" is not support in android_1.6_compatibility
<TextView
a:id="@+id/aboutTextView"
a:text="@string/c_copyright"
a:layout_height="fill_parent"
a:layout_width="fill_parent"
a:layout_gravity="top|center_horizontal"
a:layout_weight="1"
a:scrollbars="vertical"
a:scrollbarFadeDuration="0"
style="@style/about_style"/>
-->
</LinearLayout>

View File

@ -8,7 +8,7 @@
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:layout_weight="2"
a:layout_width="match_parent"
a:layout_width="fill_parent"
a:layout_height="0dp">
<org.solovyev.android.calculator.CalculatorEditor

View File

@ -9,7 +9,7 @@
xmlns:a="http://schemas.android.com/apk/res/android"
a:id="@+id/equalsButton"
a:text="="
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
style="?controlButtonStyle"
a:onClick="numericButtonClickHandler"/>

View File

@ -7,13 +7,13 @@
-->
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:layout_width="match_parent"
a:layout_height="match_parent">
a:layout_width="fill_parent"
a:layout_height="fill_parent">
<TextView a:id="@+id/donateText"
style="@style/about_style"
a:layout_width="match_parent"
a:layout_width="fill_parent"
a:text="@string/c_donate_text"
a:layout_height="match_parent"/>
a:layout_height="fill_parent"/>
</LinearLayout>

View File

@ -3,18 +3,18 @@
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
xmlns:calc="http://schemas.android.com/apk/res/org.solovyev.android.calculator"
a:orientation="vertical"
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:background="#ff000000">
<LinearLayout
a:id="@+id/simplePad"
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:orientation="vertical"
a:layout_gravity="center">
<LinearLayout a:layout_weight="1" a:layout_width="match_parent" a:layout_height="0dp">
<LinearLayout a:layout_weight="1" a:layout_width="fill_parent" a:layout_height="0dp">
<ImageView a:id="@+id/calibrationArrowLeft"
a:layout_gravity="left"

View File

@ -8,20 +8,20 @@
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:orientation="vertical"
a:layout_width="match_parent"
a:layout_height="match_parent">
a:layout_width="fill_parent"
a:layout_height="fill_parent">
<TextView a:id="@+id/history_time"
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:textColor="@android:color/white"
a:paddingLeft="6dp"
a:paddingRight="6dp"
a:textStyle="bold"/>
<TextView a:id="@+id/history_item"
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:paddingBottom="6dp"
a:paddingLeft="6dp"
a:paddingRight="6dp"/>

View File

@ -8,12 +8,12 @@
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:orientation="vertical"
a:layout_width="match_parent"
a:layout_height="match_parent">
a:layout_width="fill_parent"
a:layout_height="fill_parent">
<ListView
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:layout_weight="1"
a:id="@android:id/list"/>

View File

@ -9,12 +9,12 @@
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<org.solovyev.android.view.widgets.NumberPickerButton android:id="@+id/increment"
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/timepicker_up_btn" />
<EditText android:id="@+id/timepicker_input"
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:singleLine="true"
@ -24,7 +24,7 @@
android:background="@drawable/timepicker_input" />
<org.solovyev.android.view.widgets.NumberPickerButton android:id="@+id/decrement"
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/timepicker_down_btn" />

View File

@ -8,17 +8,17 @@
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:orientation="vertical"
a:layout_width="match_parent"
a:layout_height="match_parent">
a:layout_width="fill_parent"
a:layout_height="fill_parent">
<LinearLayout
a:orientation="horizontal"
a:layout_width="match_parent"
a:layout_height="match_parent">
a:layout_width="fill_parent"
a:layout_height="fill_parent">
<TextView a:id="@+id/var_text"
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:textSize="20dp"
a:textColor="@android:color/white"
a:paddingBottom="3dp"
@ -31,8 +31,8 @@
</LinearLayout>
<TextView a:id="@+id/var_description"
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:paddingBottom="6dp"
a:paddingLeft="6dp"
a:paddingRight="6dp"

View File

@ -7,47 +7,47 @@
-->
<ScrollView xmlns:a="http://schemas.android.com/apk/res/android"
a:layout_width="match_parent"
a:layout_height="match_parent">
a:layout_width="fill_parent"
a:layout_height="fill_parent">
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:id="@+id/var_edit"
a:orientation="vertical"
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:scrollbars="vertical"
a:scrollbarAlwaysDrawVerticalTrack="true">
<TextView a:layout_height="match_parent"
<TextView a:layout_height="fill_parent"
a:layout_width="wrap_content"
a:padding="6dp"
a:text="@string/c_var_name"/>
<EditText a:id="@+id/var_edit_name"
a:layout_width="match_parent"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:textSize="20dp">
</EditText>
<TextView a:layout_height="match_parent"
<TextView a:layout_height="fill_parent"
a:layout_width="wrap_content"
a:padding="6dp"
a:text="@string/c_var_value"/>
<EditText a:id="@+id/var_edit_value"
a:layout_width="match_parent"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:inputType="numberDecimal"
a:textSize="20dp">
</EditText>
<TextView a:layout_height="match_parent"
<TextView a:layout_height="fill_parent"
a:layout_width="wrap_content"
a:padding="6dp"
a:text="@string/c_var_description"/>
<EditText a:id="@+id/var_edit_description"
a:layout_width="match_parent"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:textSize="20dp">
</EditText>

View File

@ -8,12 +8,12 @@
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:orientation="vertical"
a:layout_width="match_parent"
a:layout_height="match_parent">
a:layout_width="fill_parent"
a:layout_height="fill_parent">
<ListView
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:layout_weight="1"
a:id="@android:id/list"/>

View File

@ -8,8 +8,8 @@
</style>
<style name="button_style">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:layout_weight">1</item>
<item name="android:focusable">true</item>
<item name="android:textSize">20dp</item>
@ -58,8 +58,8 @@
<item name="android:textColor">@color/text_color</item>
<item name="android:gravity">left|top</item>
<item name="android:padding">5dp</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
</style>
<style name="display_style">
@ -68,8 +68,8 @@
<item name="android:textColor">@color/text_color</item>
<item name="android:gravity">right|center_vertical</item>
<item name="android:padding">5dp</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
</style>
<style name="about_style">
@ -78,8 +78,8 @@
<item name="android:textColor">@color/text_color</item>
<item name="android:gravity">center</item>
<item name="android:padding">5dp</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
</style>
<style name="default_theme">

View File

@ -341,13 +341,18 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster, Sh
public void restart() {
final Intent intent = getIntent();
/*
for compatibility with android_1.6_compatibility
overridePendingTransition(0, 0);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);*/
Log.d(this.getClass().getName(), "Finishing current activity!");
finish();
overridePendingTransition(0, 0);
/*
for compatibility with android_1.6_compatibility
overridePendingTransition(0, 0);*/
Log.d(this.getClass().getName(), "Starting new activity!");
startActivity(intent);
}

View File

@ -283,8 +283,8 @@ public class NumberPicker extends LinearLayout {
if (displayedValues != null) {
// Allow text entry rather than strictly numeric entry.
mText.setRawInputType(InputType.TYPE_CLASS_TEXT |
InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
mText.setRawInputType(InputType.TYPE_CLASS_TEXT/* |
InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS*/);
}
}