| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <classpath> | |||||
| <classpathentry kind="src" path="src"/> | |||||
| <classpathentry kind="src" path="gen"/> | |||||
| <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> | |||||
| <classpathentry kind="output" path="bin"/> | |||||
| </classpath> |
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <projectDescription> | |||||
| <name>EasyBracketing</name> | |||||
| <comment></comment> | |||||
| <projects> | |||||
| </projects> | |||||
| <buildSpec> | |||||
| <buildCommand> | |||||
| <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> | |||||
| <arguments> | |||||
| </arguments> | |||||
| </buildCommand> | |||||
| <buildCommand> | |||||
| <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> | |||||
| <arguments> | |||||
| </arguments> | |||||
| </buildCommand> | |||||
| <buildCommand> | |||||
| <name>org.eclipse.jdt.core.javabuilder</name> | |||||
| <arguments> | |||||
| </arguments> | |||||
| </buildCommand> | |||||
| <buildCommand> | |||||
| <name>com.android.ide.eclipse.adt.ApkBuilder</name> | |||||
| <arguments> | |||||
| </arguments> | |||||
| </buildCommand> | |||||
| </buildSpec> | |||||
| <natures> | |||||
| <nature>com.android.ide.eclipse.adt.AndroidNature</nature> | |||||
| <nature>org.eclipse.jdt.core.javanature</nature> | |||||
| </natures> | |||||
| </projectDescription> |
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <manifest | |||||
| xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| package="ch.spherIC" | |||||
| android:versionCode="1" | |||||
| android:versionName="0.9.0"> | |||||
| <application | |||||
| android:icon="@drawable/icon" | |||||
| android:label="@string/app_name" | |||||
| android:theme="@style/GlassTheme"> | |||||
| <activity | |||||
| android:name=".EasyBracketMain" | |||||
| android:label="@string/app_name"> | |||||
| <intent-filter> | |||||
| <action | |||||
| android:name="android.intent.action.MAIN" /> | |||||
| <category | |||||
| android:name="android.intent.category.LAUNCHER" /> | |||||
| </intent-filter> | |||||
| </activity> | |||||
| </application> | |||||
| <uses-sdk | |||||
| android:minSdkVersion="4" /> | |||||
| </manifest> |
| # This file is automatically generated by Android Tools. | |||||
| # Do not modify this file -- YOUR CHANGES WILL BE ERASED! | |||||
| # | |||||
| # This file must be checked in Version Control Systems. | |||||
| # | |||||
| # To customize properties used by the Ant build system use, | |||||
| # "build.properties", and override values to adapt the script to your | |||||
| # project structure. | |||||
| # Project target. | |||||
| target=android-4 |
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <!-- | |||||
| Copyright (C) 2008 The Android Open Source Project 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. | |||||
| --> | |||||
| <selector | |||||
| xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
| <!-- item | |||||
| android:state_window_focused="false" | |||||
| android:drawable="@drawable/glassbutton_normal" /--> | |||||
| <item | |||||
| android:state_pressed="true" | |||||
| android:drawable="@drawable/glassbutton_pressed" /> | |||||
| <item | |||||
| android:state_enabled="false" | |||||
| android:drawable="@drawable/glassbutton_disabled" /> | |||||
| <item | |||||
| android:state_focused="true" | |||||
| android:state_pressed="false" | |||||
| android:drawable="@drawable/glassbutton_focused" /> | |||||
| <item | |||||
| android:drawable="@drawable/glassbutton_normal" /> | |||||
| </selector> | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <!-- | |||||
| Copyright (C) 2008 The Android Open Source Project 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. | |||||
| --> | |||||
| <selector | |||||
| xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
| <item | |||||
| android:state_window_focused="false" | |||||
| android:drawable="@drawable/glassdropdown_normal" /> | |||||
| <item | |||||
| android:state_pressed="true" | |||||
| android:drawable="@drawable/glassdropdown_pressed" /> | |||||
| <item | |||||
| android:state_focused="true" | |||||
| android:state_pressed="false" | |||||
| android:drawable="@drawable/glassdropdown_focused" /> | |||||
| <item | |||||
| android:drawable="@drawable/glassdropdown_normal" /> | |||||
| </selector> | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <shape | |||||
| xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| android:shape="rectangle"> | |||||
| <gradient | |||||
| android:startColor="#20000000" | |||||
| android:centerColor="@color/black" | |||||
| android:endColor="#20000000" | |||||
| android:angle="0" /> | |||||
| </shape> |
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <selector | |||||
| xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
| <item | |||||
| android:state_window_focused="false" | |||||
| android:drawable="@android:color/transparent" /> | |||||
| <!-- | |||||
| Even though these two point to the same resource, have two states so | |||||
| the drawable will invalidate itself when coming out of pressed state. | |||||
| --> | |||||
| <item | |||||
| android:state_focused="true" | |||||
| android:state_enabled="false" | |||||
| android:state_pressed="true" | |||||
| android:drawable="@drawable/z_selector_background_pressed" /> | |||||
| <item | |||||
| android:state_focused="true" | |||||
| android:state_enabled="false" | |||||
| android:drawable="@drawable/z_selector_background_focused" /> | |||||
| <item | |||||
| android:state_focused="true" | |||||
| android:state_pressed="true" | |||||
| android:drawable="@drawable/z_selector_background_pressed" /> | |||||
| <item | |||||
| android:state_focused="false" | |||||
| android:state_pressed="true" | |||||
| android:drawable="@drawable/z_selector_background_pressed" /> | |||||
| <item | |||||
| android:state_focused="true" | |||||
| android:drawable="@drawable/z_selector_background_focused" /> | |||||
| </selector> |
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <LinearLayout | |||||
| xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| android:layout_width="fill_parent" | |||||
| android:padding="10dp" | |||||
| android:layout_height="fill_parent" | |||||
| android:background="@drawable/bg_about" | |||||
| android:orientation="vertical" | |||||
| android:id="@+id/layout_AboutRoot"> | |||||
| <LinearLayout | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:orientation="horizontal" | |||||
| android:id="@+id/layout_aboutVersion"> | |||||
| <ImageView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginRight="20dip" | |||||
| android:id="@+id/about_imageAppIcon" /> | |||||
| <LinearLayout | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:id="@+id/layout_aboutVersionText" | |||||
| android:orientation="vertical"> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:textColor="#FF000000" | |||||
| android:text="iii" | |||||
| android:id="@+id/about_TextDescription" /> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:textColor="#FF000000" | |||||
| android:text="iii" | |||||
| android:id="@+id/about_TextVersion" | |||||
| android:textStyle="bold" /> | |||||
| </LinearLayout> | |||||
| </LinearLayout> | |||||
| <TextView | |||||
| android:text="@+id/TextView01" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:id="@+id/about_TextAutor" | |||||
| android:textColor="@color/black" | |||||
| android:paddingBottom="20dip" | |||||
| android:paddingTop="20dip"></TextView> | |||||
| <Button | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:background="@drawable/btn_fs" | |||||
| android:id="@+id/btn_AboutClose" | |||||
| android:textColor="@color/white" | |||||
| android:layout_gravity="center_horizontal" | |||||
| android:text="@string/BtnClose"> | |||||
| </Button> | |||||
| </LinearLayout> |
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <TableLayout | |||||
| android:layout_width="fill_parent" | |||||
| android:layout_height="fill_parent" | |||||
| xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| android:background="@drawable/bg" | |||||
| android:id="@+id/TableLayout" | |||||
| xmlns:spherIC="http://schemas.android.com/apk/res/ch.spherIC"> | |||||
| <ch.spherIC.components.XTextView | |||||
| android:autoText="false" | |||||
| android:text="@string/dynamic_range" | |||||
| android:id="@+id/Title_DynamicRange" | |||||
| android:scrollbarAlwaysDrawVerticalTrack="false" | |||||
| android:textColor="@color/white" | |||||
| android:visibility="visible" | |||||
| android:paddingBottom="1dip" | |||||
| android:paddingLeft="3dip" | |||||
| android:paddingTop="1dip" | |||||
| android:textStyle="bold" | |||||
| android:background="@drawable/glassbg_black" | |||||
| android:layout_width="wrap_content" | |||||
| spherIC:drawBorderWidth="3dip" | |||||
| spherIC:drawBorderColor="@color/white" | |||||
| spherIC:drawBorder="true" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginTop="2dip" /> | |||||
| <TextView | |||||
| android:id="@+id/Title_DarkPoint" | |||||
| android:text="@string/dark_point" | |||||
| android:textColor="@color/black" | |||||
| android:textStyle="bold" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_width="wrap_content" | |||||
| android:textSize="13dip" | |||||
| android:layout_marginLeft="3dip"></TextView> | |||||
| <TableRow | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:id="@+id/Row_DarkPoint"> | |||||
| </TableRow> | |||||
| <TableRow | |||||
| android:layout_width="wrap_content" | |||||
| android:id="@+id/Row_DP_Shutter"> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:textColor="@color/black" | |||||
| android:text="@string/shutter_speed" | |||||
| android:id="@+id/Label_DP_Shutter" | |||||
| android:layout_gravity="center_vertical" | |||||
| android:textSize="13dip" | |||||
| android:layout_marginLeft="10dip" | |||||
| android:layout_marginRight="10dip"></TextView> | |||||
| <ch.spherIC.components.ShutterSpeedSpinner | |||||
| android:layout_width="wrap_content" | |||||
| android:id="@+id/Spinner_DP_Shutter" | |||||
| android:layout_gravity="center_vertical" | |||||
| android:layout_weight="2" | |||||
| android:entries="@array/ShutterSpeeds" | |||||
| android:paddingBottom="1dip" | |||||
| android:paddingTop="1dip" android:background="@drawable/dropdown_fs"/> | |||||
| <TextView | |||||
| android:background="@color/yellow" | |||||
| android:text="@string/ev" | |||||
| android:textSize="20dip" | |||||
| android:textStyle="bold" | |||||
| android:gravity="bottom|center_horizontal" | |||||
| android:layout_gravity="bottom" | |||||
| android:layout_marginRight="3dip" | |||||
| android:layout_marginLeft="10dip" | |||||
| android:id="@+id/Text_EV_DP"></TextView> | |||||
| </TableRow> | |||||
| <TableRow | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:id="@+id/Row_DP_Aperture"> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:textColor="@color/black" | |||||
| android:layout_marginLeft="10dip" | |||||
| android:id="@+id/Label_DP_Aperture" | |||||
| android:text="@string/aperture" | |||||
| android:layout_gravity="center_vertical" | |||||
| android:textSize="13dip"></TextView> | |||||
| <ch.spherIC.components.ApertureSpinner | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_weight="2" | |||||
| android:background="@drawable/dropdown_fs" | |||||
| android:layout_gravity="center_vertical" | |||||
| android:entries="@array/Apertures" | |||||
| android:id="@+id/Spinner_DP_Aperture" | |||||
| android:paddingBottom="1dip" | |||||
| android:paddingTop="1dip" /> | |||||
| <TextView | |||||
| android:background="@color/yellow" | |||||
| android:text="16" | |||||
| android:textStyle="bold" | |||||
| android:gravity="top|center_horizontal" | |||||
| android:textSize="20dip" | |||||
| android:layout_gravity="top" | |||||
| android:layout_marginRight="3dip" | |||||
| android:layout_marginLeft="10dip" | |||||
| android:id="@+id/Text_EVVal_DP"></TextView> | |||||
| </TableRow> | |||||
| <View | |||||
| android:layout_height="2dip" | |||||
| android:layout_marginTop="2dip" | |||||
| android:layout_width="fill_parent" | |||||
| android:background="@drawable/gradient_view" /> | |||||
| <TextView | |||||
| android:id="@+id/Title_DarkPoint" | |||||
| android:textColor="@color/black" | |||||
| android:textStyle="bold" | |||||
| android:layout_marginLeft="3dip" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_width="wrap_content" | |||||
| android:textSize="13dip" | |||||
| android:text="@string/bright_point" | |||||
| android:layout_marginTop="3dip"></TextView> | |||||
| <TableRow | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:id="@+id/Row_BrightPoint"> | |||||
| </TableRow> | |||||
| <TableRow | |||||
| android:layout_width="wrap_content" | |||||
| android:id="@+id/Row_BP_Shutter"> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:textColor="@color/black" | |||||
| android:text="@string/shutter_speed" | |||||
| android:layout_marginLeft="10dip" | |||||
| android:id="@+id/Label_DP_Shutter" | |||||
| android:layout_gravity="center_vertical" | |||||
| android:textSize="13dip"></TextView> | |||||
| <ch.spherIC.components.ShutterSpeedSpinner | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_gravity="center_vertical" | |||||
| android:layout_weight="2" | |||||
| android:background="@drawable/dropdown_fs" | |||||
| android:entries="@array/ShutterSpeeds" | |||||
| android:paddingBottom="1dip" | |||||
| android:paddingTop="1dip" | |||||
| android:id="@+id/Spinner_BP_Shutter" /> | |||||
| <TextView | |||||
| android:background="@color/yellow" | |||||
| android:text="@string/ev" | |||||
| android:textSize="20dip" | |||||
| android:textStyle="bold" | |||||
| android:gravity="bottom|center_horizontal" | |||||
| android:layout_gravity="bottom" | |||||
| android:layout_marginRight="3dip" | |||||
| android:layout_marginLeft="10dip" | |||||
| android:id="@+id/Text_EV_BP"></TextView> | |||||
| </TableRow> | |||||
| <TableRow | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:id="@+id/Row_BP_Aperture"> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:textColor="@color/black" | |||||
| android:layout_marginLeft="10dip" | |||||
| android:id="@+id/Label_DP_Aperture" | |||||
| android:text="@string/aperture" | |||||
| android:layout_gravity="center_vertical" | |||||
| android:textSize="13dip"></TextView> | |||||
| <ch.spherIC.components.ApertureSpinner | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_weight="2" | |||||
| android:background="@drawable/dropdown_fs" | |||||
| android:layout_gravity="center_vertical" | |||||
| android:entries="@array/Apertures" | |||||
| android:paddingBottom="1dip" | |||||
| android:paddingTop="1dip" | |||||
| android:id="@+id/Spinner_BP_Aperture" /> | |||||
| <TextView | |||||
| android:background="@color/yellow" | |||||
| android:text="16" | |||||
| android:textStyle="bold" | |||||
| android:gravity="top|center_horizontal" | |||||
| android:textSize="20dip" | |||||
| android:layout_gravity="top" | |||||
| android:layout_marginRight="3dip" | |||||
| android:layout_marginLeft="10dip" | |||||
| android:id="@+id/Text_EVVal_BP"></TextView> | |||||
| </TableRow> | |||||
| <View | |||||
| android:layout_width="fill_parent" | |||||
| android:layout_height="2dip" | |||||
| android:layout_marginTop="2dip" | |||||
| android:background="@drawable/gradient_view" /> | |||||
| <ch.spherIC.components.XTextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:autoText="false" | |||||
| android:id="@+id/Title_CalcParams" | |||||
| android:scrollbarAlwaysDrawVerticalTrack="false" | |||||
| android:visibility="visible" | |||||
| android:paddingTop="1dip" | |||||
| android:textStyle="bold" | |||||
| android:text="@string/calcParams" | |||||
| android:textColor="@color/white" | |||||
| android:paddingLeft="3dip" | |||||
| android:layout_marginTop="3dip" | |||||
| android:paddingBottom="1dip" | |||||
| android:background="@drawable/glassbg_black" | |||||
| spherIC:drawBorderWidth="3dip" | |||||
| spherIC:drawBorderColor="@color/white" | |||||
| spherIC:drawBorder="true" /> | |||||
| <TableRow | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:id="@+id/Row_DeltaEV"> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:textColor="@color/black" | |||||
| android:text="@string/delta_EV" | |||||
| android:layout_marginLeft="10dip" | |||||
| android:id="@+id/label_deltaEV" | |||||
| android:textSize="13dip"></TextView> | |||||
| <TextView | |||||
| android:background="@color/yellow" | |||||
| android:text="16" | |||||
| android:textStyle="bold" | |||||
| android:gravity="top|center_horizontal" | |||||
| android:textSize="20dip" | |||||
| android:layout_gravity="top" | |||||
| android:layout_marginRight="3dip" | |||||
| android:layout_weight="1" | |||||
| android:layout_marginTop="2dip" | |||||
| android:id="@+id/label_deltaEV_Val" | |||||
| android:layout_marginBottom="1dip"></TextView> | |||||
| </TableRow> | |||||
| <TableRow | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:id="@+id/Row_calcP_Aperture" | |||||
| android:paddingTop="2dip"> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:textColor="@color/black" | |||||
| android:layout_marginLeft="10dip" | |||||
| android:id="@+id/label_calcP_Aperture" | |||||
| android:text="@string/aperture" | |||||
| android:layout_gravity="center_vertical" | |||||
| android:textSize="13dip"></TextView> | |||||
| <ch.spherIC.components.ApertureSpinner | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_weight="2" | |||||
| android:background="@drawable/dropdown_fs" | |||||
| android:layout_gravity="center_vertical" | |||||
| android:paddingBottom="1dip" | |||||
| android:paddingTop="1dip" | |||||
| android:entries="@array/Apertures" | |||||
| android:id="@+id/Spinner_calcP_Aperture" /> | |||||
| <Button | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginLeft="10dip" | |||||
| android:background="@drawable/btn_fs" | |||||
| android:textColor="@color/white" | |||||
| android:id="@+id/Btn_Reset" | |||||
| android:text="@string/reset" | |||||
| android:paddingBottom="1dip" | |||||
| android:paddingTop="1dip"></Button> | |||||
| </TableRow> | |||||
| <TableRow | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:id="@+id/Row_calcP_Aperture" | |||||
| android:paddingTop="2dip"> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:textColor="@color/black" | |||||
| android:layout_marginLeft="10dip" | |||||
| android:layout_gravity="center_vertical" | |||||
| android:id="@+id/label_calcP_ExpStep" | |||||
| android:text="@string/expEVStep" | |||||
| android:textSize="13dip"></TextView> | |||||
| <ch.spherIC.components.XSpinner | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_weight="2" | |||||
| android:background="@drawable/dropdown_fs" | |||||
| android:layout_gravity="center_vertical" | |||||
| android:entries="@array/EVSteps" | |||||
| android:paddingBottom="1dip" | |||||
| android:paddingTop="1dip" | |||||
| android:id="@+id/Spinner_calcP_EVStep" /> | |||||
| <Button | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginLeft="10dip" | |||||
| android:id="@+id/Btn_Calculate" | |||||
| android:text="@string/calculate" | |||||
| android:background="@drawable/btn_fs" | |||||
| android:textColor="@color/white" | |||||
| android:paddingBottom="1dip" | |||||
| android:paddingTop="1dip"></Button> | |||||
| </TableRow> | |||||
| <View | |||||
| android:layout_width="fill_parent" | |||||
| android:layout_height="2dip" | |||||
| android:layout_marginTop="2dip" | |||||
| android:background="@drawable/gradient_view" /> | |||||
| <ch.spherIC.components.XTextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:autoText="false" | |||||
| android:scrollbarAlwaysDrawVerticalTrack="false" | |||||
| android:visibility="visible" | |||||
| android:paddingTop="1dip" | |||||
| android:textStyle="bold" | |||||
| android:textColor="@color/white" | |||||
| android:paddingLeft="3dip" | |||||
| android:layout_marginTop="3dip" | |||||
| android:paddingBottom="1dip" | |||||
| android:background="@drawable/glassbg_black" | |||||
| spherIC:drawBorderWidth="3dip" | |||||
| spherIC:drawBorderColor="@color/white" | |||||
| spherIC:drawBorder="true" | |||||
| android:id="@+id/Title_BracketingRes" | |||||
| android:text="@string/bracketingRes" /> | |||||
| <LinearLayout | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:id="@+id/LinearLayout_ResultsHeader"></LinearLayout> | |||||
| <View | |||||
| android:layout_width="fill_parent" | |||||
| android:layout_height="1dip" | |||||
| android:layout_marginTop="2dip" | |||||
| android:background="@color/black" | |||||
| android:id="@+id/View_ResHeader_Understroke" /> | |||||
| <ListView | |||||
| android:layout_width="wrap_content" | |||||
| android:divider="@drawable/gradient_view" | |||||
| android:dividerHeight="1dip" | |||||
| android:layout_weight="1" | |||||
| android:layout_height="wrap_content" | |||||
| android:hapticFeedbackEnabled="true" | |||||
| android:id="@+id/ListView_ExpResults" | |||||
| android:focusable="true" | |||||
| android:clickable="true"> | |||||
| </ListView> | |||||
| </TableLayout> |
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <LinearLayout | |||||
| xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| android:orientation="vertical" | |||||
| android:layout_height="fill_parent" | |||||
| android:layout_width="fill_parent" | |||||
| android:id="@+id/linear_layout_Stg_Root" android:background="@drawable/bg_about"> | |||||
| <TextView | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_width="fill_parent" | |||||
| android:textColor="@color/black" | |||||
| android:id="@+id/settings_Title_18Gray" | |||||
| android:text="@string/Percent18Correction" | |||||
| android:paddingLeft="3dip" | |||||
| android:paddingTop="3dip" | |||||
| android:paddingBottom="3dip" | |||||
| android:background="@color/yellow" android:textStyle="bold"></TextView> | |||||
| <LinearLayout | |||||
| android:layout_height="wrap_content" | |||||
| android:id="@+id/linear_layout_Stg_u1" | |||||
| android:layout_gravity="fill_horizontal" | |||||
| android:layout_width="fill_parent" | |||||
| android:paddingTop="3dip" | |||||
| android:paddingBottom="3dip"> | |||||
| <TextView | |||||
| android:textColor="@color/black" | |||||
| android:paddingBottom="3dip" | |||||
| android:paddingLeft="3dip" | |||||
| android:paddingTop="3dip" | |||||
| android:id="@+id/txtView_BP_Corr" | |||||
| android:text="@string/Percent18CorrectionBP" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_gravity="left|center_vertical" android:layout_width="200dip"></TextView> | |||||
| <Spinner | |||||
| android:layout_height="wrap_content" | |||||
| android:paddingBottom="1dip" | |||||
| android:paddingTop="1dip" | |||||
| android:background="@drawable/dropdown_fs" | |||||
| android:layout_width="wrap_content" android:layout_weight="1" android:entries="@array/EVStepsCorrectionBP" android:id="@+id/spn_BP_Corr"> | |||||
| </Spinner> | |||||
| </LinearLayout><LinearLayout android:layout_height="wrap_content" android:layout_gravity="fill_horizontal" android:layout_width="fill_parent" android:paddingTop="3dip" android:id="@+id/linear_layout_Stg_u2" android:paddingBottom="10dip"> | |||||
| <TextView android:textColor="@color/black" android:paddingBottom="3dip" android:paddingLeft="3dip" android:paddingTop="3dip" android:layout_height="wrap_content" android:layout_gravity="left|center_vertical" android:id="@+id/txtView_DP_Corr" android:text="@string/Percent18CorrectionDP" android:layout_width="200dip"></TextView> | |||||
| <Spinner android:layout_height="wrap_content" android:paddingBottom="1dip" android:paddingTop="1dip" android:background="@drawable/dropdown_fs" android:layout_width="wrap_content" android:layout_weight="1" android:entries="@array/EVStepsCorrectionDP" android:id="@+id/spn_DP_Corr"> | |||||
| </Spinner> | |||||
| </LinearLayout><TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:textColor="@color/black" android:paddingLeft="3dip" android:paddingTop="3dip" android:paddingBottom="3dip" android:background="@color/yellow" android:textStyle="bold" android:id="@+id/settings_Title_RangePoint" android:text="@string/FixRangePoint" android:layout_marginTop="10dip"></TextView> | |||||
| <RadioGroup android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/RadioGroup"><RadioButton android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_marginTop="10dip" android:text="@string/FixRangePointBP" android:textColor="@color/black" android:paddingLeft="40dip" android:id="@+id/rdbtn_KeepBP"></RadioButton><RadioButton android:layout_height="wrap_content" android:layout_width="fill_parent" android:textColor="@color/black" android:text="@string/FixRangePointDP" android:paddingLeft="40dip" android:id="@+id/rdbtn_KeepDP"></RadioButton></RadioGroup><View android:layout_height="2dip" android:layout_marginTop="2dip" android:layout_width="fill_parent" android:background="@drawable/gradient_view" /> | |||||
| <LinearLayout android:id="@+id/LinearLayout01" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_marginTop="20dip"><Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/btn_fs" android:textColor="@color/white" android:layout_marginBottom="3dip" android:layout_marginRight="3dip" android:layout_marginTop="3dip" android:layout_weight="1" android:layout_marginLeft="10dip" android:id="@+id/btn_Stg_Save" android:text="@string/BtnSave"></Button><Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/btn_fs" android:textColor="@color/white" android:layout_marginBottom="3dip" android:layout_marginLeft="3dip" android:layout_marginTop="3dip" android:layout_weight="1" android:layout_marginRight="10dip" android:text="@string/BtnCancel" android:id="@+id/btn_Stg_Cancel"></Button></LinearLayout> | |||||
| </LinearLayout> |
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <LinearLayout | |||||
| xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| android:background="@drawable/bg_about" | |||||
| android:padding="10dp" | |||||
| android:layout_height="fill_parent" | |||||
| android:layout_width="fill_parent" | |||||
| android:orientation="vertical"> | |||||
| <LinearLayout | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:orientation="horizontal" | |||||
| android:id="@+id/layout_ugVersion"> | |||||
| <ImageView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginRight="20dip" | |||||
| android:id="@+id/ug_imageAppIcon" | |||||
| android:layout_gravity="center_vertical" /> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:textColor="#FF000000" | |||||
| android:text="iii" | |||||
| android:id="@+id/ug_TextVersion" | |||||
| android:textStyle="bold" | |||||
| android:layout_gravity="center_vertical" | |||||
| android:gravity="center_vertical" /> | |||||
| </LinearLayout> | |||||
| <ScrollView | |||||
| android:id="@+id/ug_ScrollView" | |||||
| android:layout_width="wrap_content" | |||||
| android:addStatesFromChildren="true" | |||||
| android:layout_height="250dp"> | |||||
| <LinearLayout android:id="@+id/linearLayout1" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> | |||||
| <TextView android:layout_height="wrap_content" android:layout_marginBottom="5dp" android:layout_marginTop="5dp" android:textColor="@color/black" android:text="@string/header_GeneralPurpose" android:textStyle="bold" android:id="@+id/ug_hdr_GenPourpose" android:layout_width="wrap_content"></TextView> | |||||
| <TextView android:layout_height="wrap_content" android:textSize="12dp" android:paddingRight="3dp" android:textColor="@color/black" android:text="@string/text_GeneralPurpose" android:id="@+id/ug_txt_GenPourpose" android:layout_width="wrap_content"></TextView> | |||||
| <TextView android:layout_height="wrap_content" android:layout_marginBottom="5dp" android:layout_marginTop="5dp" android:textColor="@color/black" android:text="@string/header_HowTo" android:textStyle="bold" android:id="@+id/ug_hdr_HowTo" android:layout_width="wrap_content"></TextView> | |||||
| <TextView android:layout_height="wrap_content" android:textSize="12dp" android:lineSpacingExtra="1dp" android:textColor="@color/black" android:text="@string/text_HowTo" android:id="@+id/ug_txt_HowTo" android:layout_width="wrap_content"></TextView> | |||||
| </LinearLayout> | |||||
| </ScrollView> | |||||
| <Button | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:background="@drawable/btn_fs" | |||||
| android:id="@+id/btn_ugClose" | |||||
| android:textColor="@color/white" | |||||
| android:layout_gravity="center_horizontal" | |||||
| android:layout_marginTop="20dp" android:text="@string/BtnClose"> | |||||
| </Button> | |||||
| </LinearLayout> |
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <menu | |||||
| xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
| <item android:visible="true" android:enabled="true" android:title="@string/menuAbout" android:id="@+id/itemAbout" android:icon="@android:drawable/ic_menu_info_details"></item> | |||||
| <item android:visible="true" android:enabled="true" android:title="@string/menuSettings" android:id="@+id/itemSettings" android:icon="@android:drawable/ic_menu_preferences"></item><item android:visible="true" android:enabled="true" android:title="@string/menuUserGuide" android:id="@+id/itemUserGuide" android:icon="@android:drawable/ic_menu_help"></item> | |||||
| </menu> |
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <resources> | |||||
| <string | |||||
| name="app_name">Easy Bracketing</string> | |||||
| <string | |||||
| name="dynamic_range">Dynamikbereich</string> | |||||
| <string | |||||
| name="shutter_speed">Belichtungszeit</string> | |||||
| <string | |||||
| name="aperture">Blende</string> | |||||
| <string | |||||
| name="ev">LW</string> | |||||
| <string | |||||
| name="dark_point">Werte Dunkelpunkt</string> | |||||
| <string | |||||
| name="bright_point">Werte Hellpunkt</string> | |||||
| <string | |||||
| name="calcParams">Berechnungsparameter</string> | |||||
| <string | |||||
| name="delta_EV">Δ LW</string> | |||||
| <string | |||||
| name="expEVStep">LW-Schritt</string> | |||||
| <string | |||||
| name="calculate">Berechnen</string> | |||||
| <string | |||||
| name="reset">Zurücksetzen</string> | |||||
| <string | |||||
| name="bracketingRes">Bracketing Belichtungswerte</string> | |||||
| <string | |||||
| name="expNbrLbl"># Bel.</string> | |||||
| <string | |||||
| name="toastWarningDP_BP">Das Delta zwischen dem LW des Dunkelpunkt und dem LW des Hellpunkt ist kleiner oder gleich 0. | |||||
| \nBitte korrigieren Sie die Eingaben.</string> | |||||
| <string | |||||
| name="menuUserGuide">Benutzeranleitung</string> | |||||
| <string | |||||
| name="menuSettings">Einstellungen...</string> | |||||
| <string | |||||
| name="menuAbout">Info</string> | |||||
| <string | |||||
| name="about_Description"> | |||||
| EasyBracketing dient zur schnellen und einfachen Berechnung einer Belichtungsserie ausgehend | |||||
| von den Belichtungswerten eines Dunkelpunktes und eines Hellpunktes. | |||||
| </string> | |||||
| <string | |||||
| name="AppVersionLabel">Version:</string> | |||||
| <string | |||||
| name="about_DevelopedBy">Entwickelt von spherIC (F. Smilari)\nMail an: | |||||
| merlin868@hotmail.com\n\nÜbersetzt von spherIC (F. Smilari)</string> | |||||
| <string | |||||
| name="Percent18Correction">18%-Grauwertkorrektur</string> | |||||
| <string | |||||
| name="Percent18CorrectionBP">Hellpunktkorrektur (LW)</string> | |||||
| <string | |||||
| name="Percent18CorrectionDP">Dunkelpunktkorrektur (LW)</string> | |||||
| <string | |||||
| name="FixRangePoint">Ausgangspunkt für Belichtungsserie</string> | |||||
| <string | |||||
| name="FixRangePointBP">Von Hellpunktwerten ausgehen</string> | |||||
| <string | |||||
| name="FixRangePointDP">Von Dunkelpunktwerten ausgehen</string> | |||||
| <string | |||||
| name="BtnSave">Speichern</string> | |||||
| <string | |||||
| name="BtnCancel">Abbrechen</string> | |||||
| <string | |||||
| name="BtnClose">Schliessen</string> | |||||
| <string | |||||
| name="header_GeneralPurpose">1. Allgm. Verwendungszweck</string> | |||||
| <string | |||||
| name="text_GeneralPurpose"> | |||||
| Beim Erstellen einer Belichtungsreihe für ein späteres HDR-Bild, stellt sich oftmals das Problem, | |||||
| dass der Kontrastumfang zu gross ist um von der typischen \"+2LW/0LW/-2LW\"-Vorgehensweise abgedeckt zu werden.\nHier | |||||
| kommt \"EasyBracketing\" zum Zug.\nAusgehend von gemessenen Werten für den hellsten Punkt resp. den dunkelsten Punkt | |||||
| werden über definierbare Parameter alle notwendigen Belichtungen einer Belichtungsreihe berechnet. Diese können dann | |||||
| an der Kamera sukzessive eingestellt und die Aufnahme ausgelöst werden. | |||||
| </string> | |||||
| <string | |||||
| name="header_HowTo">2. Vorgehensweise</string> | |||||
| <string | |||||
| name="text_HowTo" formatted="false"> | |||||
| 1. Stellen Sie die Kamera auf Spotbelichtungsmessung. | |||||
| \n2. Wählen Sie eine geeignete Blende. | |||||
| \n3. Messen Sie mit der Kamera die Belichtungswerte für den dunkelsten Punkt ihres Bildausschnitts. | |||||
| \n4. Messen Sie mit der Kamera die Belichtungswerte für den hellsten Punkt ihres Bildausschnitts. | |||||
| \n5. Stellen Sie die gemessenen Werte im Bereich \"Dynamikbereich\" von EasyBracketing ein. | |||||
| \n6. Verändern Sie, falls gewünscht die Berechnungsparamter nach Ihren Vorstellungen. | |||||
| \n7. Klicken Sie auf \"Berechnen\" um die Belichtungsreihe zu berechnen. | |||||
| \n | |||||
| \nEinstellungen: | |||||
| \n | |||||
| \n18%-Grauwertkorrektur: | |||||
| \nDie meisten Kameras versuchen bei der Belichtungsmessung auf ein sogenanntes 18%-Grau gleichmässig zu belichten. | |||||
| Dies ist für Belichtungsreihen eher unerwünscht. Mit dieser Einstellung können Sie dem entgegenwirken. Den einzustellenden | |||||
| Wert muss man über Belichtungsversuche empirisch ermitteln, da die Sensoren bei jedem Hersteller anders sind. | |||||
| \n | |||||
| \nAusgangspukt der Belichtungsreihe: | |||||
| \nIn den meisten Fällen, wird der Dynamikumfang (Delta LW) einen gebrochenen Wert aufweisen, der in der Berechnung aufgerundet | |||||
| wird. Dies führt dazu, dass der Dynamikumfang der Berechnung grösser ist als der Gemessene. Mit dieser Einstellung bestimmen Sie | |||||
| von welchem Ende des Dynamikumfangs (Anker) die Berechnung der Belichtungsreihe starten soll. | |||||
| </string> | |||||
| </resources> |
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <resources> | |||||
| <declare-styleable | |||||
| name="XTextView"> | |||||
| <attr | |||||
| name="drawBorder" | |||||
| format="boolean" /> | |||||
| <attr | |||||
| name="drawBorderWidth" | |||||
| format="dimension" /> | |||||
| <attr | |||||
| name="drawBorderColor" | |||||
| format="color" /> | |||||
| </declare-styleable> | |||||
| </resources> |
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <resources> | |||||
| <color | |||||
| name="translucent">#00000000</color> | |||||
| <color | |||||
| name="semi_translucent_black">#80000000</color> | |||||
| <color | |||||
| name="black">#FF000000</color> | |||||
| <color | |||||
| name="yellow">#AAFFFFAA</color> | |||||
| <color | |||||
| name="white">#FFFFFFFF</color> | |||||
| </resources> |
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <resources> | |||||
| <string | |||||
| name="app_name">Easy Bracketing</string> | |||||
| <string | |||||
| name="dynamic_range">Dynamic Range</string> | |||||
| <string | |||||
| name="shutter_speed">Shutter Speed</string> | |||||
| <string | |||||
| name="aperture">Aperture</string> | |||||
| <string | |||||
| name="ev">EV</string> | |||||
| <string | |||||
| name="dark_point">Dark Point Values</string> | |||||
| <string | |||||
| name="bright_point">Bright Point Values</string> | |||||
| <string | |||||
| name="calcParams">Calculation Parameters</string> | |||||
| <string | |||||
| name="delta_EV">Δ EV</string> | |||||
| <string | |||||
| name="expEVStep">EV Step</string> | |||||
| <string | |||||
| name="calculate">Calculate</string> | |||||
| <string | |||||
| name="reset">Reset</string> | |||||
| <string | |||||
| name="bracketingRes">Bracketing Exposures Values</string> | |||||
| <string | |||||
| name="expNbrLbl"># Exp.</string> | |||||
| <string | |||||
| name="toastWarningDP_BP">The delta between dark point EV and bright point EV is less or | |||||
| equal to 0. Please correct the inputs.</string> | |||||
| <string | |||||
| name="menuUserGuide">User Guide</string> | |||||
| <string | |||||
| name="menuSettings">Settings...</string> | |||||
| <string | |||||
| name="menuAbout">About</string> | |||||
| <string name="about_Description">EasyBracketing allows you to easy calculate a serie of exposure | |||||
| values according to initial dark and bright point values.</string> | |||||
| <string | |||||
| name="AppVersionLabel">Version:</string> | |||||
| <string name="about_DevelopedBy">Developed by spherIC (F. Smilari)\nMail to: | |||||
| merlin868@hotmail.com\n\nTranslated by spherIC (F. Smilari)</string> | |||||
| <string | |||||
| name="Percent18Correction">18%-Gray Correction</string> | |||||
| <string | |||||
| name="Percent18CorrectionBP">Bright Pt. Value Correction (EV)</string> | |||||
| <string | |||||
| name="Percent18CorrectionDP">Dark Pt. Value Correction (EV)</string> | |||||
| <string | |||||
| name="FixRangePoint">Fixed EV Range Value</string> | |||||
| <string | |||||
| name="FixRangePointBP">Keep Bright Point Values fixed</string> | |||||
| <string | |||||
| name="FixRangePointDP">Keep Dark Point Value fixed</string> | |||||
| <string | |||||
| name="BtnSave">Save</string> | |||||
| <string | |||||
| name="BtnCancel">Cancel</string> | |||||
| <string | |||||
| name="BtnClose">Close</string> | |||||
| <string | |||||
| name="header_GeneralPurpose">1. General Purpose</string> | |||||
| <string | |||||
| name="text_GeneralPurpose">When doing a bracketing for a later HDR image, often a problem araises: The dynamic range of the | |||||
| composition is too large to fit the classic \"+2EV/0EV/-2EV\" approach. | |||||
| \nThis is the moment when \"EasyBracketing\" comes to its own. | |||||
| \nStarting with camera-measured values for the brightest and darkest point and according to some configurable calculation parameters | |||||
| you can calculate all the exposure values for the bracketing and do the shots. | |||||
| </string> | |||||
| <string | |||||
| name="header_HowTo">2. How to use</string> | |||||
| <string name="text_HowTo" formatted="false">1. Set your camera to spot measuring. | |||||
| \n2. Choose a suitable aperture. | |||||
| \n3. With your camera measure the exposure values for the darkest point of your composition. | |||||
| \n4. With your camera measure the exposure values for the brightest point of your composition. | |||||
| \n5. Set these values in the area \"Dynamic Range\" of EasyBracketing. | |||||
| \n6. Modify the calculation parameters to your needs if necessary. | |||||
| \n7. Click on \"Calculate\" to start the computing of the exposure values of the bracketing. | |||||
| \n | |||||
| \nSettings: | |||||
| \n | |||||
| \n18%-Gray Correction: | |||||
| \nMost cameras try to achieve a so called 18%-Gray exposure value on measuring. This is not exactly what we want when doing bracketing. | |||||
| This setting helps to counteract this behavior. Beacuse each sensor, depending on the manufacturer, has a little bit different behavior, | |||||
| the exact values have to be determined by experimental trials. | |||||
| \n | |||||
| \nFixed EV Range Value: | |||||
| \nIn most cases, the resulting delta EV from the measuring is a floating value which is rounded to the next integer value on calculation. | |||||
| This means that the calculation value is always bigger than the measured. With this setting you can determine on which edge of the dynamic | |||||
| range (anchor) the bracketing calculation should start.</string> | |||||
| </resources> |
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <resources> | |||||
| <string-array | |||||
| name="Apertures"> | |||||
| <item>f/1</item> | |||||
| <item>f/1.4</item> | |||||
| <item>f/2</item> | |||||
| <item>f/3.5</item> | |||||
| <item>f/4</item> | |||||
| <item>f/4.2</item> | |||||
| <item>f/4.5</item> | |||||
| <item>f/4.8</item> | |||||
| <item>f/5</item> | |||||
| <item>f/5.3</item> | |||||
| <item>f/5.6</item> | |||||
| <item>f/6.3</item> | |||||
| <item>f/7.1</item> | |||||
| <item>f/8</item> | |||||
| <item>f/9</item> | |||||
| <item>f/10</item> | |||||
| <item>f/11</item> | |||||
| <item>f/13</item> | |||||
| <item>f/14</item> | |||||
| <item>f/16</item> | |||||
| <item>f/18</item> | |||||
| <item>f/20</item> | |||||
| <item>f/22</item> | |||||
| <item>f/32</item> | |||||
| <item>f/45</item> | |||||
| </string-array> | |||||
| <string-array | |||||
| name="ShutterSpeeds"> | |||||
| <item>1/8000</item> | |||||
| <item>1/4000</item> | |||||
| <item>1/3200</item> | |||||
| <item>1/2500</item> | |||||
| <item>1/2000</item> | |||||
| <item>1/1600</item> | |||||
| <item>1/1250</item> | |||||
| <item>1/1000</item> | |||||
| <item>1/800</item> | |||||
| <item>1/640</item> | |||||
| <item>1/500</item> | |||||
| <item>1/400</item> | |||||
| <item>1/320</item> | |||||
| <item>1/250</item> | |||||
| <item>1/200</item> | |||||
| <item>1/160</item> | |||||
| <item>1/125</item> | |||||
| <item>1/100</item> | |||||
| <item>1/80</item> | |||||
| <item>1/60</item> | |||||
| <item>1/50</item> | |||||
| <item>1/40</item> | |||||
| <item>1/30</item> | |||||
| <item>1/25</item> | |||||
| <item>1/20</item> | |||||
| <item>1/15</item> | |||||
| <item>1/13</item> | |||||
| <item>1/10</item> | |||||
| <item>1/8</item> | |||||
| <item>1/6</item> | |||||
| <item>1/5</item> | |||||
| <item>1/4</item> | |||||
| <item>1/3</item> | |||||
| <item>1/2.5</item> | |||||
| <item>1/2</item> | |||||
| <item>1/1.6</item> | |||||
| <item>1/1.3</item> | |||||
| <item>1</item> | |||||
| <item>1.3</item> | |||||
| <item>1.6</item> | |||||
| <item>2</item> | |||||
| <item>2.5</item> | |||||
| <item>3</item> | |||||
| <item>4</item> | |||||
| <item>5</item> | |||||
| <item>6</item> | |||||
| <item>8</item> | |||||
| <item>10</item> | |||||
| <item>13</item> | |||||
| <item>15</item> | |||||
| <item>20</item> | |||||
| <item>25</item> | |||||
| <item>30</item> | |||||
| </string-array> | |||||
| <string-array | |||||
| name="EVSteps"> | |||||
| <item>0.3</item> | |||||
| <item>0.7</item> | |||||
| <item>1.0</item> | |||||
| <item>1.3</item> | |||||
| <item>1.7</item> | |||||
| <item>2.0</item> | |||||
| </string-array> | |||||
| <string-array | |||||
| name="EVStepsCorrectionDP"> | |||||
| <item>±0.0</item> | |||||
| <item>-1.0</item> | |||||
| <item>-2.0</item> | |||||
| <item>-3.0</item> | |||||
| </string-array> | |||||
| <string-array | |||||
| name="EVStepsCorrectionBP"> | |||||
| <item>±0.0</item> | |||||
| <item>+1.0</item> | |||||
| </string-array> | |||||
| </resources> |
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <resources> | |||||
| <style | |||||
| name="ResultExposureText" | |||||
| parent="@android:style/TextAppearance"> | |||||
| <item | |||||
| name="android:textSize">16dip</item> | |||||
| <item | |||||
| name="android:textStyle">normal</item> | |||||
| <item | |||||
| name="android:textColor">#FF000000</item> | |||||
| </style> | |||||
| <style | |||||
| name="ResultExposureTextSpecial" | |||||
| parent="@android:style/TextAppearance"> | |||||
| <item | |||||
| name="android:textSize">16dip</item> | |||||
| <item | |||||
| name="android:textStyle">italic|bold</item> | |||||
| <item | |||||
| name="android:textColor">#FF3C3CFF</item> | |||||
| </style> | |||||
| <style | |||||
| name="GlassDropdownItem" | |||||
| parent="@android:style/Widget.TextView.SpinnerItem"> | |||||
| <item | |||||
| name="android:textColor">@color/white</item> | |||||
| <item | |||||
| name="android:gravity">center_vertical|center_horizontal</item> | |||||
| </style> | |||||
| <style | |||||
| name="ResultsListView" | |||||
| parent="@android:style/Widget.ListView"> | |||||
| <item | |||||
| name="android:cacheColorHint">@color/translucent</item> | |||||
| <item | |||||
| name="android:listSelector">@drawable/z_selector_background</item> | |||||
| </style> | |||||
| <style | |||||
| name="GlassTheme" | |||||
| parent="@android:style/Theme"> | |||||
| <item | |||||
| name="android:spinnerItemStyle">@style/GlassDropdownItem</item> | |||||
| <item | |||||
| name="android:listViewStyle">@style/ResultsListView</item> | |||||
| </style> | |||||
| <style | |||||
| name="GlassThemeDialog" | |||||
| parent="@android:style/Theme.Dialog"> | |||||
| <item | |||||
| name="android:spinnerItemStyle">@style/GlassDropdownItem</item> | |||||
| <item | |||||
| name="android:listViewStyle">@style/ResultsListView</item> | |||||
| </style> | |||||
| </resources> |
| /* | |||||
| * $URL$ | |||||
| * $Revision$ | |||||
| * $LastChangedBy$ | |||||
| * $LastChangedDate$ | |||||
| * | |||||
| * Copyright (c) 2005 syseca AG, Switzerland | |||||
| * All rights reserved. | |||||
| * | |||||
| * This software is the confidential and proprietary information | |||||
| * of syseca AG. ("Confidential Information"). You shall not | |||||
| * disclose such Confidential Information and shall use it only | |||||
| * in accordance with the terms of the license agreement you | |||||
| * entered into with syseca AG. | |||||
| */ | |||||
| package ch.spherIC; | |||||
| import android.app.Activity; | |||||
| import android.app.Dialog; | |||||
| import android.content.pm.PackageManager; | |||||
| import android.content.pm.PackageManager.NameNotFoundException; | |||||
| import android.view.View; | |||||
| import android.view.View.OnClickListener; | |||||
| import android.widget.Button; | |||||
| import android.widget.ImageView; | |||||
| import android.widget.TextView; | |||||
| import ch.spherIC.settings.SettingsDlg; | |||||
| /** | |||||
| * Dialog factory class. | |||||
| */ | |||||
| public final class DialogFactory { | |||||
| /** | |||||
| * Static main method to initialize classes | |||||
| * | |||||
| * @param dlgCode Code of dialog to instantiate. See {@link EasyBracketMain} | |||||
| * @param parent Parent {@link Activity} | |||||
| * | |||||
| * @return Instantiated dialog. | |||||
| */ | |||||
| public static Dialog createDialog(int dlgCode, Activity parent) { | |||||
| Dialog dlg; | |||||
| switch (dlgCode) { | |||||
| case EasyBracketMain.ABOUT_DLG: | |||||
| dlg = createAboutDialog(parent); | |||||
| break; | |||||
| case EasyBracketMain.SETTINGS_DLG: | |||||
| dlg = createSettingsDialog(parent); | |||||
| break; | |||||
| case EasyBracketMain.USERGUIDE_DLG: | |||||
| dlg = createUserGuideDialog(parent); | |||||
| break; | |||||
| default: | |||||
| dlg = null; | |||||
| break; | |||||
| } | |||||
| return dlg; | |||||
| } | |||||
| /** | |||||
| * Creates the About Dialog | |||||
| */ | |||||
| private static Dialog createAboutDialog(Activity parent) { | |||||
| String versionName = ""; | |||||
| final Dialog dialog = new Dialog(parent); | |||||
| dialog.setContentView(R.layout.about_dialog); | |||||
| parent.getResources().getText(R.string.menuAbout); | |||||
| dialog.setTitle(parent.getResources().getText(R.string.menuAbout) + " EasyBracketing..."); | |||||
| try { | |||||
| versionName = parent.getPackageManager().getPackageInfo("ch.spherIC", PackageManager.GET_CONFIGURATIONS) | |||||
| .versionName; | |||||
| } catch (NameNotFoundException e) { | |||||
| versionName = "-"; | |||||
| } | |||||
| ImageView image = (ImageView) dialog.findViewById(R.id.about_imageAppIcon); | |||||
| image.setImageResource(R.drawable.icon); | |||||
| TextView text = (TextView) dialog.findViewById(R.id.about_TextDescription); | |||||
| text.setText(parent.getResources().getText(R.string.about_Description)); | |||||
| text = (TextView) dialog.findViewById(R.id.about_TextVersion); | |||||
| text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString() + " " + versionName); | |||||
| text = (TextView) dialog.findViewById(R.id.about_TextAutor); | |||||
| text.setText(parent.getResources().getText(R.string.about_DevelopedBy).toString()); | |||||
| ((Button) dialog.findViewById(R.id.btn_AboutClose)).setOnClickListener(new OnClickListener() { | |||||
| @Override | |||||
| public void onClick(View v) { | |||||
| dialog.dismiss(); | |||||
| } | |||||
| }); | |||||
| return dialog; | |||||
| } | |||||
| /** | |||||
| * Creates the Settings Dialog | |||||
| */ | |||||
| private static Dialog createSettingsDialog(Activity parent) { | |||||
| final Dialog dialog = new SettingsDlg(parent); | |||||
| return dialog; | |||||
| } | |||||
| /** | |||||
| * Creates the User Guide Dialog | |||||
| */ | |||||
| private static Dialog createUserGuideDialog(Activity parent) { | |||||
| String versionName = ""; | |||||
| final Dialog dialog = new Dialog(parent); | |||||
| dialog.setContentView(R.layout.userguide_dialog); | |||||
| parent.getResources().getText(R.string.menuUserGuide); | |||||
| dialog.setTitle(parent.getResources().getText(R.string.menuUserGuide)); | |||||
| try { | |||||
| versionName = parent.getPackageManager().getPackageInfo("ch.spherIC", PackageManager.GET_CONFIGURATIONS) | |||||
| .versionName; | |||||
| } catch (NameNotFoundException e) { | |||||
| versionName = "-"; | |||||
| } | |||||
| ImageView image = (ImageView) dialog.findViewById(R.id.ug_imageAppIcon); | |||||
| image.setImageResource(R.drawable.icon); | |||||
| TextView text = (TextView) dialog.findViewById(R.id.ug_TextVersion); | |||||
| text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString() + " " + versionName); | |||||
| ((Button) dialog.findViewById(R.id.btn_ugClose)).setOnClickListener(new OnClickListener() { | |||||
| @Override | |||||
| public void onClick(View v) { | |||||
| dialog.dismiss(); | |||||
| } | |||||
| }); | |||||
| return dialog; | |||||
| } | |||||
| } |
| /* | |||||
| * $URL$ | |||||
| * $Revision$ | |||||
| * $LastChangedBy$ | |||||
| * $LastChangedDate$ | |||||
| * | |||||
| * Copyright (c) 2005 syseca AG, Switzerland | |||||
| * All rights reserved. | |||||
| * | |||||
| * This software is the confidential and proprietary information | |||||
| * of syseca AG. ("Confidential Information"). You shall not | |||||
| * disclose such Confidential Information and shall use it only | |||||
| * in accordance with the terms of the license agreement you | |||||
| * entered into with syseca AG. | |||||
| */ | |||||
| package ch.spherIC; | |||||
| /** | |||||
| * Class representing the Exposure Values formula <code>2^EV = f^2 / t</code>. | |||||
| * | |||||
| * <p>With:<br> | |||||
| * EV = Exposure Value<br> | |||||
| * f = Aperture<br> | |||||
| * t = shutter speed</p> | |||||
| */ | |||||
| public class EVFormula { | |||||
| /** | |||||
| * Calculates the exposure value <code>EV</code> from aperture <code>f</code> and shutter speed <code>t</code>. | |||||
| * | |||||
| * <p>EV = (2 * log f - log t) / log 2</p> | |||||
| * | |||||
| * @param aperture Aperture value | |||||
| * @param sutterSpeed Shutter speed value | |||||
| * | |||||
| * @return Calculated Exposure value | |||||
| */ | |||||
| public static double calcEV(double aperture, double shutterSpeed) { | |||||
| return (2 * Math.log10(aperture) - Math.log10(shutterSpeed)) / Math.log10(2f); | |||||
| } | |||||
| /** | |||||
| * Calculates the shutter speed <code>t</code> from aperture <code>f</code> and exposure value <code>EV</code>. | |||||
| * | |||||
| * <p>t = f^2 / 2^EV</p> | |||||
| * | |||||
| * @param aperture Aperture value | |||||
| * @param EV Exposure value | |||||
| * | |||||
| * @return Calculated Shutter speed value | |||||
| */ | |||||
| public static double calcShutterSpeed(double aperture, double EV) { | |||||
| return (Math.pow(aperture, 2) / Math.pow(2, EV)); | |||||
| } | |||||
| } |
| package ch.spherIC; | |||||
| import java.text.DecimalFormat; | |||||
| import java.util.ArrayList; | |||||
| import java.util.List; | |||||
| import android.app.Activity; | |||||
| import android.app.Dialog; | |||||
| import android.content.Context; | |||||
| import android.content.SharedPreferences; | |||||
| import android.os.Bundle; | |||||
| import android.view.Gravity; | |||||
| import android.view.Menu; | |||||
| import android.view.MenuInflater; | |||||
| import android.view.MenuItem; | |||||
| import android.view.View; | |||||
| import android.view.View.OnClickListener; | |||||
| import android.widget.AdapterView; | |||||
| import android.widget.Button; | |||||
| import android.widget.LinearLayout; | |||||
| import android.widget.ListView; | |||||
| import android.widget.TextView; | |||||
| import android.widget.Toast; | |||||
| import android.widget.AdapterView.OnItemSelectedListener; | |||||
| import ch.spherIC.components.ApertureSpinner; | |||||
| import ch.spherIC.components.ShutterSpeedSpinner; | |||||
| import ch.spherIC.components.XSpinner; | |||||
| import ch.spherIC.resultlist.Exposure; | |||||
| import ch.spherIC.resultlist.ExposureAdapter; | |||||
| import ch.spherIC.resultlist.ExposureFactory; | |||||
| import ch.spherIC.settings.SettingsDlg; | |||||
| /** | |||||
| * Main class EasyBracketing | |||||
| */ | |||||
| public class EasyBracketMain extends Activity { | |||||
| public static final int ABOUT_DLG = 0; | |||||
| public static final int SETTINGS_DLG = 1; | |||||
| public static final int USERGUIDE_DLG = 2; | |||||
| private static String DEF_SHUTTER_SPEED = "1/125"; | |||||
| private static String DEF_APERTURE = "f/8"; | |||||
| private static String DEF_EVSTEP = "2.0"; | |||||
| private ShutterSpeedSpinner spnDPShutterSpeed; | |||||
| private ApertureSpinner spnDPAperture; | |||||
| private ShutterSpeedSpinner spnBPShutterSpeed; | |||||
| private ApertureSpinner spnBPAperture; | |||||
| private TextView txtDPEVValue; | |||||
| private TextView txtBPEVValue; | |||||
| private TextView txtCalcPDeltaEV; | |||||
| private ApertureSpinner spnCalcPAperture; | |||||
| private XSpinner spnCalcPEVStep; | |||||
| private Button resetBtn; | |||||
| private Button calculateBtn; | |||||
| private ListView resultList; | |||||
| private LinearLayout resultsHeader; | |||||
| private double bpCorrection; | |||||
| private double dpCorrection; | |||||
| private boolean fixBP; | |||||
| private double dpEV; | |||||
| private double bpEV; | |||||
| public static final DecimalFormat DF = new DecimalFormat("0.##"); | |||||
| /** | |||||
| * Called when the activity is first created. | |||||
| */ | |||||
| @Override | |||||
| public void onCreate(Bundle savedInstanceState) { | |||||
| super.onCreate(savedInstanceState); | |||||
| setContentView(R.layout.main); | |||||
| initComponents(); | |||||
| setDefaults(); | |||||
| loadSettings(); | |||||
| } | |||||
| /** | |||||
| * Loads and stores the settings | |||||
| */ | |||||
| public void loadSettings() { | |||||
| // Load settings | |||||
| SharedPreferences settings = getSharedPreferences(SettingsDlg.PREFS_NAME, Context.MODE_PRIVATE); | |||||
| this.fixBP = settings.getBoolean("fixBrightPoint", true); | |||||
| this.bpCorrection = settings.getFloat("brightPointCorrection", 0f); | |||||
| this.dpCorrection = settings.getFloat("darkPointCorrection", 0f); | |||||
| } | |||||
| /** | |||||
| * {@inheritDoc} | |||||
| */ | |||||
| @Override | |||||
| public boolean onCreateOptionsMenu(Menu menu) { | |||||
| super.onCreateOptionsMenu(menu); | |||||
| MenuInflater inflater = getMenuInflater(); | |||||
| inflater.inflate(R.menu.mainmenu, menu); | |||||
| return true; | |||||
| } | |||||
| /** | |||||
| * @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem) | |||||
| */ | |||||
| @Override | |||||
| public boolean onOptionsItemSelected(MenuItem item) { | |||||
| // Handle item selection | |||||
| switch (item.getItemId()) { | |||||
| case R.id.itemAbout: | |||||
| showDialog(ABOUT_DLG); | |||||
| return true; | |||||
| case R.id.itemSettings: | |||||
| showDialog(SETTINGS_DLG); | |||||
| return true; | |||||
| case R.id.itemUserGuide: | |||||
| showDialog(USERGUIDE_DLG); | |||||
| return true; | |||||
| default: | |||||
| return super.onOptionsItemSelected(item); | |||||
| } | |||||
| } | |||||
| /** | |||||
| * Initialization method | |||||
| */ | |||||
| private void initComponents() { | |||||
| // initialize dropdowns | |||||
| OnItemSelectedListener evRangeItemSelListener = new OnItemSelectedListener() { | |||||
| @Override | |||||
| public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { | |||||
| EasyBracketMain.this.dpEV = EVFormula.calcEV(EasyBracketMain.this.spnDPAperture.getSelectedAperture(), | |||||
| EasyBracketMain.this.spnDPShutterSpeed | |||||
| .getSelectedShutterSpeed()); | |||||
| EasyBracketMain.this.bpEV = EVFormula.calcEV(EasyBracketMain.this.spnBPAperture.getSelectedAperture(), | |||||
| EasyBracketMain.this.spnBPShutterSpeed | |||||
| .getSelectedShutterSpeed()); | |||||
| EasyBracketMain.this.txtDPEVValue.setText(EasyBracketMain.DF.format(EasyBracketMain.this.dpEV)); | |||||
| EasyBracketMain.this.txtBPEVValue.setText(EasyBracketMain.DF.format(EasyBracketMain.this.bpEV)); | |||||
| EasyBracketMain.this.txtCalcPDeltaEV.setText(EasyBracketMain.DF.format((EasyBracketMain.this.bpEV | |||||
| + EasyBracketMain.this.bpCorrection) | |||||
| - (EasyBracketMain.this.dpEV | |||||
| - EasyBracketMain.this.dpCorrection))); | |||||
| EasyBracketMain.this.calculateBtn.setEnabled(EasyBracketMain.this.bpEV > EasyBracketMain.this.dpEV); | |||||
| EasyBracketMain.this.resultsHeader.setVisibility(View.INVISIBLE); | |||||
| findViewById(R.id.View_ResHeader_Understroke).setVisibility(View.INVISIBLE); | |||||
| EasyBracketMain.this.resultList.setAdapter(null); | |||||
| if (EasyBracketMain.this.bpEV < EasyBracketMain.this.dpEV) { | |||||
| Toast toast = Toast.makeText(EasyBracketMain.this, R.string.toastWarningDP_BP, Toast.LENGTH_LONG); | |||||
| toast.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL, 0, 0); | |||||
| toast.show(); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void onNothingSelected(AdapterView<?> parent) { | |||||
| } | |||||
| }; | |||||
| OnItemSelectedListener calcPItemSelListener = new OnItemSelectedListener() { | |||||
| @Override | |||||
| public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { | |||||
| toggleResultsList(false); | |||||
| } | |||||
| @Override | |||||
| public void onNothingSelected(AdapterView<?> parent) { | |||||
| } | |||||
| }; | |||||
| this.spnDPShutterSpeed = (ShutterSpeedSpinner) findViewById(R.id.Spinner_DP_Shutter); | |||||
| this.spnDPAperture = (ApertureSpinner) findViewById(R.id.Spinner_DP_Aperture); | |||||
| this.spnBPShutterSpeed = (ShutterSpeedSpinner) findViewById(R.id.Spinner_BP_Shutter); | |||||
| this.spnBPAperture = (ApertureSpinner) findViewById(R.id.Spinner_BP_Aperture); | |||||
| this.spnCalcPAperture = (ApertureSpinner) findViewById(R.id.Spinner_calcP_Aperture); | |||||
| this.spnCalcPEVStep = (XSpinner) findViewById(R.id.Spinner_calcP_EVStep); | |||||
| this.txtDPEVValue = (TextView) findViewById(R.id.Text_EVVal_DP); | |||||
| this.txtBPEVValue = (TextView) findViewById(R.id.Text_EVVal_BP); | |||||
| this.txtCalcPDeltaEV = (TextView) findViewById(R.id.label_deltaEV_Val); | |||||
| this.resultsHeader = (LinearLayout) ExposureAdapter.getHeaderView(this, | |||||
| (LinearLayout) | |||||
| findViewById(R.id.LinearLayout_ResultsHeader)); | |||||
| this.resultsHeader.setVisibility(View.INVISIBLE); | |||||
| findViewById(R.id.View_ResHeader_Understroke).setVisibility(View.INVISIBLE); | |||||
| this.resultList = (ListView) findViewById(R.id.ListView_ExpResults); | |||||
| this.resultList.setAdapter(null); | |||||
| this.resetBtn = (Button) findViewById(R.id.Btn_Reset); | |||||
| this.calculateBtn = (Button) findViewById(R.id.Btn_Calculate); | |||||
| this.calculateBtn.setEnabled(false); | |||||
| this.spnDPShutterSpeed.setOnItemSelectedListener(evRangeItemSelListener); | |||||
| this.spnDPAperture.setOnItemSelectedListener(evRangeItemSelListener); | |||||
| this.spnBPShutterSpeed.setOnItemSelectedListener(evRangeItemSelListener); | |||||
| this.spnBPAperture.setOnItemSelectedListener(evRangeItemSelListener); | |||||
| this.resetBtn.setOnClickListener(new OnClickListener() { | |||||
| @Override | |||||
| public void onClick(View v) { | |||||
| setDefaults(); | |||||
| toggleResultsList(false); | |||||
| } | |||||
| }); | |||||
| this.calculateBtn.setOnClickListener(new OnClickListener() { | |||||
| @Override | |||||
| public void onClick(View v) { | |||||
| toggleResultsList(true); | |||||
| calculateExposures(); | |||||
| } | |||||
| }); | |||||
| this.spnCalcPAperture.setOnItemSelectedListener(calcPItemSelListener); | |||||
| this.spnCalcPEVStep.setOnItemSelectedListener(calcPItemSelListener); | |||||
| } | |||||
| /** | |||||
| * Clears the results list. | |||||
| */ | |||||
| private void toggleResultsList(boolean visible) { | |||||
| if (visible) { | |||||
| EasyBracketMain.this.resultsHeader.setVisibility(View.VISIBLE); | |||||
| findViewById(R.id.View_ResHeader_Understroke).setVisibility(View.VISIBLE); | |||||
| } else { | |||||
| EasyBracketMain.this.resultsHeader.setVisibility(View.INVISIBLE); | |||||
| findViewById(R.id.View_ResHeader_Understroke).setVisibility(View.INVISIBLE); | |||||
| EasyBracketMain.this.resultList.setAdapter(null); | |||||
| } | |||||
| } | |||||
| /** | |||||
| * Sets the default values. | |||||
| */ | |||||
| public void setDefaults() { | |||||
| this.spnDPShutterSpeed.setSelectionByVal(DEF_SHUTTER_SPEED); | |||||
| this.spnDPAperture.setSelectionByVal(DEF_APERTURE); | |||||
| this.spnBPShutterSpeed.setSelectionByVal(DEF_SHUTTER_SPEED); | |||||
| this.spnBPAperture.setSelectionByVal(DEF_APERTURE); | |||||
| this.spnCalcPAperture.setSelectionByVal(DEF_APERTURE); | |||||
| this.spnCalcPEVStep.setSelectionByVal(DEF_EVSTEP); | |||||
| this.txtDPEVValue.setText(DF.format(EVFormula.calcEV(this.spnDPAperture.getSelectedAperture(), | |||||
| this.spnDPShutterSpeed.getSelectedShutterSpeed()))); | |||||
| this.txtBPEVValue.setText(DF.format(EVFormula.calcEV(this.spnBPAperture.getSelectedAperture(), | |||||
| this.spnBPShutterSpeed.getSelectedShutterSpeed()))); | |||||
| this.txtCalcPDeltaEV.setText(DF.format(this.bpEV + this.bpCorrection - (this.dpEV - this.dpCorrection))); | |||||
| } | |||||
| /** | |||||
| * Initiates the calculation of the exposure values according to the input parameters. | |||||
| */ | |||||
| private void calculateExposures() { | |||||
| List<Exposure> exposureList; | |||||
| double calcPrmAperture = this.spnCalcPAperture.getSelectedAperture(); | |||||
| double calcPrmEvStep = Double.valueOf(this.spnCalcPEVStep.getSelectedItem().toString()); | |||||
| List<Double> allowedShutters = getShutterSpeeds(); | |||||
| exposureList = ExposureFactory.calculateExposures(this, this.dpEV - this.dpCorrection, | |||||
| this.bpEV + this.bpCorrection, calcPrmAperture, calcPrmEvStep, | |||||
| this.fixBP, allowedShutters); | |||||
| this.resultList.setAdapter(new ExposureAdapter(this, exposureList)); | |||||
| } | |||||
| /** | |||||
| * Retrieves the list of all shutter speeds in drop down list as Double's. | |||||
| * | |||||
| * @return list of all shutter speeds in drop down list as Double's | |||||
| */ | |||||
| private List<Double> getShutterSpeeds() { | |||||
| List<Double> shutterSpeeds = new ArrayList<Double>(); | |||||
| for (int i = 0; i < this.spnBPShutterSpeed.getCount(); i++) { | |||||
| shutterSpeeds.add(this.spnBPShutterSpeed.getShutterSpeedAt(i)); | |||||
| } | |||||
| return shutterSpeeds; | |||||
| } | |||||
| /** | |||||
| * {@inheritDoc} | |||||
| */ | |||||
| @Override | |||||
| protected Dialog onCreateDialog(int id) { | |||||
| return DialogFactory.createDialog(id, this); | |||||
| } | |||||
| } |
| /* | |||||
| * $URL$ | |||||
| * $Revision$ | |||||
| * $LastChangedBy$ | |||||
| * $LastChangedDate$ | |||||
| * | |||||
| * Copyright (c) 2005 syseca AG, Switzerland | |||||
| * All rights reserved. | |||||
| * | |||||
| * This software is the confidential and proprietary information | |||||
| * of syseca AG. ("Confidential Information"). You shall not | |||||
| * disclose such Confidential Information and shall use it only | |||||
| * in accordance with the terms of the license agreement you | |||||
| * entered into with syseca AG. | |||||
| */ | |||||
| package ch.spherIC.components; | |||||
| import android.content.Context; | |||||
| import android.util.AttributeSet; | |||||
| /** | |||||
| * Aperture Spinner | |||||
| */ | |||||
| public class ApertureSpinner extends XSpinner { | |||||
| /** | |||||
| * Creates a new ApertureSpinner object. | |||||
| * | |||||
| * @param context {@link Context} | |||||
| */ | |||||
| public ApertureSpinner(Context context) { | |||||
| super(context); | |||||
| } | |||||
| /** | |||||
| * Creates a new ApertureSpinner object. | |||||
| * | |||||
| * @param context {@link Context} | |||||
| * @param attrs {@link AttributeSet} | |||||
| */ | |||||
| public ApertureSpinner(Context context, AttributeSet attrs) { | |||||
| super(context, attrs); | |||||
| } | |||||
| /** | |||||
| * Creates a new ApertureSpinner object. | |||||
| * | |||||
| * @param context {@link Context} | |||||
| * @param attrs {@link AttributeSet} | |||||
| * @param defStyle int | |||||
| */ | |||||
| public ApertureSpinner(Context context, AttributeSet attrs, int defStyle) { | |||||
| super(context, attrs, defStyle); | |||||
| } | |||||
| /** | |||||
| * Retrieves floating value of the selected aperture item. | |||||
| * | |||||
| * @return Selected aperture as {@link Double} | |||||
| */ | |||||
| public double getSelectedAperture() { | |||||
| String valStr = getSelectedItem().toString().substring(2); | |||||
| return new Double(valStr).doubleValue(); | |||||
| } | |||||
| } |
| /* | |||||
| * $URL$ | |||||
| * $Revision$ | |||||
| * $LastChangedBy$ | |||||
| * $LastChangedDate$ | |||||
| * | |||||
| * Copyright (c) 2005 syseca AG, Switzerland | |||||
| * All rights reserved. | |||||
| * | |||||
| * This software is the confidential and proprietary information | |||||
| * of syseca AG. ("Confidential Information"). You shall not | |||||
| * disclose such Confidential Information and shall use it only | |||||
| * in accordance with the terms of the license agreement you | |||||
| * entered into with syseca AG. | |||||
| */ | |||||
| package ch.spherIC.components; | |||||
| import android.content.Context; | |||||
| import android.util.AttributeSet; | |||||
| /** | |||||
| * Shutter speed spinner. | |||||
| */ | |||||
| public class ShutterSpeedSpinner extends XSpinner { | |||||
| /** | |||||
| * Creates a new ShutterSpeedSpinner object. | |||||
| * | |||||
| * @param context {@link Context} | |||||
| */ | |||||
| public ShutterSpeedSpinner(Context context) { | |||||
| super(context); | |||||
| } | |||||
| /** | |||||
| * Creates a new ShutterSpeedSpinner object. | |||||
| * | |||||
| * @param context {@link Context} | |||||
| * @param attrs {@link AttributeSet} | |||||
| */ | |||||
| public ShutterSpeedSpinner(Context context, AttributeSet attrs) { | |||||
| super(context, attrs); | |||||
| } | |||||
| /** | |||||
| * Creates a new ShutterSpeedSpinner object. | |||||
| * | |||||
| * @param context {@link Context} | |||||
| * @param attrs {@link AttributeSet} | |||||
| * @param defStyle int | |||||
| */ | |||||
| public ShutterSpeedSpinner(Context context, AttributeSet attrs, int defStyle) { | |||||
| super(context, attrs, defStyle); | |||||
| } | |||||
| /** | |||||
| * Retrieves floating value of the selected shutter speed item. | |||||
| * | |||||
| * @return Selected shutter speed as {@link Double} | |||||
| */ | |||||
| public double getSelectedShutterSpeed() { | |||||
| double resVal; | |||||
| String valStr = getSelectedItem().toString(); | |||||
| if (valStr.contains("1/")) { | |||||
| resVal = 1 / new Double(valStr.substring(2)).doubleValue(); | |||||
| } else { | |||||
| resVal = new Double(valStr).doubleValue(); | |||||
| } | |||||
| return resVal; | |||||
| } | |||||
| /** | |||||
| * Retrieves floating value of the selected shutter speed item. | |||||
| * | |||||
| * @return Selected shutter speed as {@link Double} | |||||
| */ | |||||
| public double getShutterSpeedAt(int position) { | |||||
| double resVal; | |||||
| String valStr = getItemAtPosition(position).toString(); | |||||
| if (valStr.contains("1/")) { | |||||
| resVal = 1 / new Double(valStr.substring(2)).doubleValue(); | |||||
| } else { | |||||
| resVal = new Double(valStr).doubleValue(); | |||||
| } | |||||
| return resVal; | |||||
| } | |||||
| } |
| /* | |||||
| * $URL$ | |||||
| * $Revision$ | |||||
| * $LastChangedBy$ | |||||
| * $LastChangedDate$ | |||||
| * | |||||
| * Copyright (c) 2005 syseca AG, Switzerland | |||||
| * All rights reserved. | |||||
| * | |||||
| * This software is the confidential and proprietary information | |||||
| * of syseca AG. ("Confidential Information"). You shall not | |||||
| * disclose such Confidential Information and shall use it only | |||||
| * in accordance with the terms of the license agreement you | |||||
| * entered into with syseca AG. | |||||
| */ | |||||
| package ch.spherIC.components; | |||||
| import android.content.Context; | |||||
| import android.util.AttributeSet; | |||||
| import android.widget.Spinner; | |||||
| /** | |||||
| * XSpinner class with special functionality | |||||
| */ | |||||
| public class XSpinner extends Spinner { | |||||
| /** | |||||
| * Creates a new XSpinner object. | |||||
| * | |||||
| * @param context {@link Context} | |||||
| */ | |||||
| public XSpinner(Context context) { | |||||
| super(context); | |||||
| } | |||||
| /** | |||||
| * Creates a new XSpinner object. | |||||
| * | |||||
| * @param context {@link Context} | |||||
| * @param attrs {@link AttributeSet} | |||||
| */ | |||||
| public XSpinner(Context context, AttributeSet attrs) { | |||||
| super(context, attrs); | |||||
| } | |||||
| /** | |||||
| * Creates a newXSpinner object. | |||||
| * | |||||
| * @param context {@link Context} | |||||
| * @param attrs {@link AttributeSet} | |||||
| * @param defStyle int | |||||
| */ | |||||
| public XSpinner(Context context, AttributeSet attrs, int defStyle) { | |||||
| super(context, attrs, defStyle); | |||||
| } | |||||
| /** | |||||
| * Sets the value of $param.name$ | |||||
| * | |||||
| * @param value DOCUMENT ME! | |||||
| */ | |||||
| public void setSelectionByVal(String value) { | |||||
| int count = getAdapter().getCount(); | |||||
| for (int i = 0; i < count; i++) { | |||||
| if (getAdapter().getItem(i).toString().equals(value)) { | |||||
| setSelection(i); | |||||
| break; | |||||
| } | |||||
| } | |||||
| } | |||||
| } |
| /* | |||||
| * $URL$ | |||||
| * $Revision$ | |||||
| * $LastChangedBy$ | |||||
| * $LastChangedDate$ | |||||
| * | |||||
| * Copyright (c) 2005 syseca AG, Switzerland | |||||
| * All rights reserved. | |||||
| * | |||||
| * This software is the confidential and proprietary information | |||||
| * of syseca AG. ("Confidential Information"). You shall not | |||||
| * disclose such Confidential Information and shall use it only | |||||
| * in accordance with the terms of the license agreement you | |||||
| * entered into with syseca AG. | |||||
| */ | |||||
| package ch.spherIC.components; | |||||
| import android.content.Context; | |||||
| import android.content.res.TypedArray; | |||||
| import android.graphics.Canvas; | |||||
| import android.graphics.Paint; | |||||
| import android.graphics.Rect; | |||||
| import android.util.AttributeSet; | |||||
| import android.widget.TextView; | |||||
| import ch.spherIC.R; | |||||
| /** | |||||
| * DOCUMENT ME! | |||||
| * | |||||
| * @author $author$ | |||||
| * @version $Revision$, $Date$ | |||||
| */ | |||||
| public class XTextView extends TextView { | |||||
| private boolean drawborder; | |||||
| private int drawborderColor; | |||||
| private int drawborderWidth; | |||||
| /** | |||||
| * Creates a new XTextView object. | |||||
| * | |||||
| * @param context DOCUMENT ME! | |||||
| */ | |||||
| public XTextView(Context context) { | |||||
| super(context); | |||||
| } | |||||
| /** | |||||
| * Creates a new $class.name$ object. | |||||
| * | |||||
| * @param context DOCUMENT ME! | |||||
| * @param attrs DOCUMENT ME! | |||||
| * @param defStyle DOCUMENT ME! | |||||
| */ | |||||
| public XTextView(Context context, AttributeSet attrs, int defStyle) { | |||||
| super(context, attrs, defStyle); | |||||
| init(attrs); | |||||
| } | |||||
| /** | |||||
| * Creates a new $class.name$ object. | |||||
| * | |||||
| * @param context DOCUMENT ME! | |||||
| * @param attrs DOCUMENT ME! | |||||
| */ | |||||
| public XTextView(Context context, AttributeSet attrs) { | |||||
| super(context, attrs); | |||||
| init(attrs); | |||||
| } | |||||
| /** | |||||
| * DOCUMENT ME! | |||||
| * | |||||
| * @param attrs DOCUMENT ME! | |||||
| */ | |||||
| private void init(AttributeSet attrs) { | |||||
| TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.XTextView); | |||||
| this.drawborder = a.getBoolean(R.styleable.XTextView_drawBorder, false); | |||||
| this.drawborderColor = a.getColor(R.styleable.XTextView_drawBorderColor, 0xffff0000); | |||||
| this.drawborderWidth = a.getDimensionPixelSize(R.styleable.XTextView_drawBorderWidth, 1); | |||||
| if (this.drawborder) { | |||||
| setPadding(getPaddingLeft() + this.drawborderWidth, getPaddingTop() + this.drawborderWidth, | |||||
| getPaddingRight() + this.drawborderWidth, getPaddingBottom() + this.drawborderWidth); | |||||
| } | |||||
| } | |||||
| /** | |||||
| * @see android.widget.TextView#onDraw(android.graphics.Canvas) | |||||
| */ | |||||
| @Override | |||||
| protected void onDraw(Canvas canvas) { | |||||
| super.onDraw(canvas); | |||||
| if (this.drawborder) { | |||||
| Rect rect = new Rect(); | |||||
| Paint paint = new Paint(); | |||||
| paint.setStyle(Paint.Style.STROKE); | |||||
| paint.setColor(this.drawborderColor); | |||||
| paint.setStrokeWidth(this.drawborderWidth); | |||||
| getLocalVisibleRect(rect); | |||||
| rect.bottom -= 1; | |||||
| rect.right -= 1; | |||||
| canvas.drawRect(rect, paint); | |||||
| } | |||||
| } | |||||
| } |
| /* | |||||
| * $URL$ | |||||
| * $Revision$ | |||||
| * $LastChangedBy$ | |||||
| * $LastChangedDate$ | |||||
| * | |||||
| * Copyright (c) 2005 syseca AG, Switzerland | |||||
| * All rights reserved. | |||||
| * | |||||
| * This software is the confidential and proprietary information | |||||
| * of syseca AG. ("Confidential Information"). You shall not | |||||
| * disclose such Confidential Information and shall use it only | |||||
| * in accordance with the terms of the license agreement you | |||||
| * entered into with syseca AG. | |||||
| */ | |||||
| package ch.spherIC.resultlist; | |||||
| import java.text.DecimalFormat; | |||||
| import android.graphics.Bitmap; | |||||
| /** | |||||
| * Exposure result class. | |||||
| */ | |||||
| public class Exposure { | |||||
| private int nbr; | |||||
| private String aperture; | |||||
| private String shutterSpeed; | |||||
| private double evStep; | |||||
| private double evRange; | |||||
| private Bitmap evStepBtmp; | |||||
| /** | |||||
| * Creates a new Exposure object. | |||||
| * | |||||
| * @param nbr Number | |||||
| * @param aperture Aperture value | |||||
| * @param shutterSpeed Shutter speed value | |||||
| * @param evStep EV step | |||||
| * @param evRng Measured and maybe corrected ev range | |||||
| * @param evStepBtmp Bitmap | |||||
| */ | |||||
| public Exposure(int nbr, String aperture, String shutterSpeed, double evStep, double evRng, Bitmap evStepBtmp) { | |||||
| super(); | |||||
| this.nbr = nbr; | |||||
| this.aperture = aperture; | |||||
| this.shutterSpeed = shutterSpeed; | |||||
| this.evStep = evStep; | |||||
| this.evRange = evRng; | |||||
| this.evStepBtmp = evStepBtmp; | |||||
| } | |||||
| /** | |||||
| * Gibt den Wert des Feldes <code>nbr</code> zurück. | |||||
| * | |||||
| * @return Wert des Feldes <code>nbr</code>. | |||||
| * | |||||
| * @see #nbr | |||||
| */ | |||||
| public int getNbr() { | |||||
| return this.nbr; | |||||
| } | |||||
| /** | |||||
| * Setzt einen neuen Wert für das Feld <code>nbr</code>. | |||||
| * | |||||
| * @param nbr Neuer Wert für das Feld <code>nbr</code>. | |||||
| * | |||||
| * @see #nbr | |||||
| */ | |||||
| public void setNbr(int nbr) { | |||||
| this.nbr = nbr; | |||||
| } | |||||
| /** | |||||
| * Gibt den Wert des Feldes <code>aperture</code> zurück. | |||||
| * | |||||
| * @return Wert des Feldes <code>aperture</code>. | |||||
| * | |||||
| * @see #aperture | |||||
| */ | |||||
| public String getAperture() { | |||||
| return this.aperture; | |||||
| } | |||||
| /** | |||||
| * Setzt einen neuen Wert für das Feld <code>aperture</code>. | |||||
| * | |||||
| * @param aperture Neuer Wert für das Feld <code>aperture</code>. | |||||
| * | |||||
| * @see #aperture | |||||
| */ | |||||
| public void setAperture(String aperture) { | |||||
| this.aperture = aperture; | |||||
| } | |||||
| /** | |||||
| * Gibt den Wert des Feldes <code>shutterSpeed</code> zurück. | |||||
| * | |||||
| * @return Wert des Feldes <code>shutterSpeed</code>. | |||||
| * | |||||
| * @see #shutterSpeed | |||||
| */ | |||||
| public String getShutterSpeed() { | |||||
| return this.shutterSpeed; | |||||
| } | |||||
| /** | |||||
| * Setzt einen neuen Wert für das Feld <code>shutterSpeed</code>. | |||||
| * | |||||
| * @param shutterSpeed Neuer Wert für das Feld <code>shutterSpeed</code>. | |||||
| * | |||||
| * @see #shutterSpeed | |||||
| */ | |||||
| public void setShutterSpeed(String shutterSpeed) { | |||||
| this.shutterSpeed = shutterSpeed; | |||||
| } | |||||
| /** | |||||
| * Gibt den Wert des Feldes <code>evStep</code> zurück. | |||||
| * | |||||
| * @return Wert des Feldes <code>evStep</code>. | |||||
| * | |||||
| * @see #evStep | |||||
| */ | |||||
| public double getEvStep() { | |||||
| return this.evStep; | |||||
| } | |||||
| /** | |||||
| * Gibt den Wert des Feldes <code>evStep</code> als String der Form +2.0 oder -1.0 oder ±0.0 zurück. | |||||
| * | |||||
| * @return Wert des Feldes <code>evStep</code> als String | |||||
| */ | |||||
| public String getEvStepAsString() { | |||||
| String res = ""; | |||||
| String prefix = "+"; | |||||
| if (this.evStep == 0.0f) { | |||||
| prefix = "±"; | |||||
| } else if (this.evStep < 0) { | |||||
| prefix = ""; | |||||
| } | |||||
| res = prefix + new DecimalFormat("0.0").format(getEvStep()); | |||||
| return res; | |||||
| } | |||||
| /** | |||||
| * Setzt einen neuen Wert für das Feld <code>evStep</code>. | |||||
| * | |||||
| * @param evStep Neuer Wert für das Feld <code>evStep</code>. | |||||
| * | |||||
| * @see #evStep | |||||
| */ | |||||
| public void setEvStep(double evStep) { | |||||
| this.evStep = evStep; | |||||
| } | |||||
| /** | |||||
| * Gibt den Wert des Feldes <code>evStepRange</code> zurück. | |||||
| * | |||||
| * @return Wert des Feldes <code>evStepRange</code>. | |||||
| * | |||||
| * @see #evRange | |||||
| */ | |||||
| public double getEvStepRange() { | |||||
| return this.evRange; | |||||
| } | |||||
| /** | |||||
| * Setzt einen neuen Wert für das Feld <code>evStepRange</code>. | |||||
| * | |||||
| * @param evStepRange Neuer Wert für das Feld <code>evStepRange</code>. | |||||
| * | |||||
| * @see #evRange | |||||
| */ | |||||
| public void setEvStepRange(double evStepRange) { | |||||
| this.evRange = evStepRange; | |||||
| } | |||||
| /** | |||||
| * Gibt den Wert des Feldes <code>evStepBtmp</code> zurück. | |||||
| * | |||||
| * @return Wert des Feldes <code>evStepBtmp</code>. | |||||
| * | |||||
| * @see #evStepBtmp | |||||
| */ | |||||
| public Bitmap getEvStepBtmp() { | |||||
| return this.evStepBtmp; | |||||
| } | |||||
| /** | |||||
| * Setzt einen neuen Wert für das Feld <code>evStepBtmp</code>. | |||||
| * | |||||
| * @param evStepBtmp Neuer Wert für das Feld <code>evStepBtmp</code>. | |||||
| * | |||||
| * @see #evStepBtmp | |||||
| */ | |||||
| public void setEvStepBtmp(Bitmap evStepBtmp) { | |||||
| this.evStepBtmp = evStepBtmp; | |||||
| } | |||||
| } |
| /* | |||||
| * $URL$ | |||||
| * $Revision$ | |||||
| * $LastChangedBy$ | |||||
| * $LastChangedDate$ | |||||
| * | |||||
| * Copyright (c) 2005 syseca AG, Switzerland | |||||
| * All rights reserved. | |||||
| * | |||||
| * This software is the confidential and proprietary information | |||||
| * of syseca AG. ("Confidential Information"). You shall not | |||||
| * disclose such Confidential Information and shall use it only | |||||
| * in accordance with the terms of the license agreement you | |||||
| * entered into with syseca AG. | |||||
| */ | |||||
| package ch.spherIC.resultlist; | |||||
| import java.util.List; | |||||
| import android.app.Activity; | |||||
| import android.content.Context; | |||||
| import android.util.DisplayMetrics; | |||||
| import android.view.Gravity; | |||||
| import android.view.View; | |||||
| import android.view.ViewGroup; | |||||
| import android.widget.BaseAdapter; | |||||
| import android.widget.ImageView; | |||||
| import android.widget.LinearLayout; | |||||
| import android.widget.TextView; | |||||
| import android.widget.LinearLayout.LayoutParams; | |||||
| import ch.spherIC.R; | |||||
| /** | |||||
| * Exposure adapter view class. | |||||
| */ | |||||
| class ExposureAdapterView extends LinearLayout { | |||||
| /** | |||||
| * Creates a new ExposureAdapterView object. | |||||
| * | |||||
| * @param context DOCUMENT ME! | |||||
| * @param weather DOCUMENT ME! | |||||
| */ | |||||
| public ExposureAdapterView(Context context, Exposure exposure) { | |||||
| super(context); | |||||
| this.setOrientation(HORIZONTAL); | |||||
| DisplayMetrics metrics = new DisplayMetrics(); | |||||
| ((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics); | |||||
| int width = metrics.widthPixels; | |||||
| // Nbr | |||||
| TextView nbrControl = new TextView(context); | |||||
| LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width), | |||||
| LayoutParams.WRAP_CONTENT, 0.2f); | |||||
| nbrParams.setMargins(3, 1, 1, 1); | |||||
| nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL); | |||||
| nbrControl.setTextAppearance(context, R.style.ResultExposureText); | |||||
| nbrControl.setText(Integer.toString(exposure.getNbr())); | |||||
| addView(nbrControl, nbrParams); | |||||
| // Aperture | |||||
| TextView apertureControl = new TextView(context); | |||||
| LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(Math.round(0.20833f * width), | |||||
| LayoutParams.WRAP_CONTENT, 0.2f); | |||||
| apertureParams.setMargins(1, 1, 1, 1); | |||||
| apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL); | |||||
| apertureControl.setTextAppearance(context, R.style.ResultExposureText); | |||||
| apertureControl.setText(exposure.getAperture()); | |||||
| addView(apertureControl, apertureParams); | |||||
| // Shutter speed | |||||
| TextView shutterControl = new TextView(context); | |||||
| LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(Math.round(0.35417f * width), | |||||
| LayoutParams.WRAP_CONTENT, 0.2f); | |||||
| shutterParams.setMargins(1, 1, 1, 1); | |||||
| shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL); | |||||
| shutterControl.setTextAppearance(context, R.style.ResultExposureTextSpecial); | |||||
| shutterControl.setText(exposure.getShutterSpeed()); | |||||
| addView(shutterControl, shutterParams); | |||||
| // EV Step | |||||
| TextView evStepControl = new TextView(context); | |||||
| LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width), | |||||
| LayoutParams.WRAP_CONTENT, 0.2f); | |||||
| evStepParams.setMargins(1, 1, 1, 1); | |||||
| evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL); | |||||
| evStepControl.setTextAppearance(context, R.style.ResultExposureText); | |||||
| evStepControl.setText(exposure.getEvStepAsString()); | |||||
| addView(evStepControl, evStepParams); | |||||
| // Icon | |||||
| ImageView expIconControl = new ImageView(context); | |||||
| LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width), | |||||
| LayoutParams.WRAP_CONTENT, 0.2f); | |||||
| expIconParams.setMargins(1, 1, 1, 1); | |||||
| expIconControl.setImageBitmap(exposure.getEvStepBtmp()); | |||||
| addView(expIconControl, expIconParams); | |||||
| } | |||||
| } | |||||
| /** | |||||
| * Exposure results adapter. | |||||
| */ | |||||
| public class ExposureAdapter extends BaseAdapter { | |||||
| private static DisplayMetrics metrics; | |||||
| private Context context; | |||||
| private List<Exposure> exposureList; | |||||
| /** | |||||
| * Creates a new ExposureAdapter object. | |||||
| */ | |||||
| public ExposureAdapter(Context context, List<Exposure> expList) { | |||||
| this.context = context; | |||||
| this.exposureList = expList; | |||||
| } | |||||
| /** | |||||
| * Retrieves list size. | |||||
| * | |||||
| * @return list size | |||||
| */ | |||||
| @Override | |||||
| public int getCount() { | |||||
| return this.exposureList.size(); | |||||
| } | |||||
| /** | |||||
| * Retrieves the exposure at index <code>position</code>. | |||||
| * | |||||
| * @param position Index in list | |||||
| * | |||||
| * @return Exposure at index <code>position</code> | |||||
| */ | |||||
| @Override | |||||
| public Object getItem(int position) { | |||||
| return this.exposureList.get(position); | |||||
| } | |||||
| /** | |||||
| * Retrieves the number of the exposure at index <code>position</code>. | |||||
| * | |||||
| * @param position Index in list | |||||
| * | |||||
| * @return the number of the exposure at index <code>position</code> | |||||
| */ | |||||
| @Override | |||||
| public long getItemId(int position) { | |||||
| //return this.exposureList.get(position).getNbr(); | |||||
| return position; | |||||
| } | |||||
| /** | |||||
| * Retrieves a view representing a single result row. | |||||
| * | |||||
| * @param position Index in list | |||||
| * @param convertView view | |||||
| * @param parent parent | |||||
| * | |||||
| * @return {@link ExposureAdapterView} | |||||
| */ | |||||
| @Override | |||||
| public View getView(int position, View convertView, ViewGroup parent) { | |||||
| Exposure exposure = this.exposureList.get(position); | |||||
| return new ExposureAdapterView(this.context, exposure); | |||||
| } | |||||
| /** | |||||
| * Retrieves the value of | |||||
| * | |||||
| * @return DOCUMENT ME! | |||||
| */ | |||||
| public static View getHeaderView(Context context, LinearLayout headerLL) { | |||||
| int black = headerLL.getResources().getColor(R.color.black); | |||||
| int width = getMetrics(context).widthPixels; | |||||
| // Nbr | |||||
| TextView nbrControl = new TextView(context); | |||||
| LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width), | |||||
| LayoutParams.WRAP_CONTENT, 0.2f); | |||||
| nbrParams.setMargins(3, 1, 1, 1); | |||||
| nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL); | |||||
| nbrControl.setTextSize(13f); | |||||
| nbrControl.setTextColor(black); | |||||
| nbrControl.setText(R.string.expNbrLbl); | |||||
| headerLL.addView(nbrControl, nbrParams); | |||||
| // Aperture | |||||
| TextView apertureControl = new TextView(context); | |||||
| LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(Math.round(0.20833f * width), | |||||
| LayoutParams.WRAP_CONTENT, 0.2f); | |||||
| apertureParams.setMargins(1, 1, 1, 1); | |||||
| apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL); | |||||
| apertureControl.setTextSize(13f); | |||||
| apertureControl.setTextColor(black); | |||||
| apertureControl.setText(R.string.aperture); | |||||
| headerLL.addView(apertureControl, apertureParams); | |||||
| // Shutter speed | |||||
| TextView shutterControl = new TextView(context); | |||||
| LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(Math.round(0.35417f * width), | |||||
| LayoutParams.WRAP_CONTENT, 0.2f); | |||||
| shutterParams.setMargins(1, 1, 1, 1); | |||||
| shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL); | |||||
| shutterControl.setTextSize(13f); | |||||
| shutterControl.setTextColor(black); | |||||
| shutterControl.setText(R.string.shutter_speed); | |||||
| headerLL.addView(shutterControl, shutterParams); | |||||
| // EV Step | |||||
| TextView evStepControl = new TextView(context); | |||||
| LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width), | |||||
| LayoutParams.WRAP_CONTENT, 0.2f); | |||||
| evStepParams.setMargins(1, 1, 1, 1); | |||||
| evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL); | |||||
| evStepControl.setTextSize(13f); | |||||
| evStepControl.setTextColor(black); | |||||
| evStepControl.setText(R.string.expEVStep); | |||||
| headerLL.addView(evStepControl, evStepParams); | |||||
| // Icon | |||||
| ImageView expIconControl = new ImageView(context); | |||||
| LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width), | |||||
| LayoutParams.WRAP_CONTENT, 0.2f); | |||||
| expIconParams.setMargins(1, 1, 1, 1); | |||||
| headerLL.addView(expIconControl, expIconParams); | |||||
| return headerLL; | |||||
| } | |||||
| /** | |||||
| * Retrieves the value of | |||||
| * | |||||
| * @return DOCUMENT ME! | |||||
| */ | |||||
| private static DisplayMetrics getMetrics(Context context) { | |||||
| if (metrics == null) { | |||||
| metrics = new DisplayMetrics(); | |||||
| ((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics); | |||||
| } | |||||
| return metrics; | |||||
| } | |||||
| } |
| /* | |||||
| * $URL$ | |||||
| * $Revision$ | |||||
| * $LastChangedBy$ | |||||
| * $LastChangedDate$ | |||||
| * | |||||
| * Copyright (c) 2005 syseca AG, Switzerland | |||||
| * All rights reserved. | |||||
| * | |||||
| * This software is the confidential and proprietary information | |||||
| * of syseca AG. ("Confidential Information"). You shall not | |||||
| * disclose such Confidential Information and shall use it only | |||||
| * in accordance with the terms of the license agreement you | |||||
| * entered into with syseca AG. | |||||
| */ | |||||
| package ch.spherIC.resultlist; | |||||
| import java.text.DecimalFormat; | |||||
| import java.util.ArrayList; | |||||
| import java.util.List; | |||||
| import android.app.Activity; | |||||
| import android.content.Context; | |||||
| import android.content.res.Resources; | |||||
| import android.graphics.Bitmap; | |||||
| import android.graphics.BitmapFactory; | |||||
| import android.graphics.Canvas; | |||||
| import android.graphics.Color; | |||||
| import android.graphics.Paint; | |||||
| import android.graphics.PorterDuff; | |||||
| import android.graphics.PorterDuffXfermode; | |||||
| import android.graphics.Bitmap.Config; | |||||
| import android.graphics.Paint.Style; | |||||
| import android.util.DisplayMetrics; | |||||
| import ch.spherIC.EVFormula; | |||||
| import ch.spherIC.EasyBracketMain; | |||||
| import ch.spherIC.R; | |||||
| /** | |||||
| * Factory that creates the exposure icons according to the EV range and values. | |||||
| */ | |||||
| public class ExposureFactory { | |||||
| public static final DecimalFormat evDF = new DecimalFormat("0.######"); | |||||
| /** | |||||
| * DOCUMENT ME! | |||||
| * | |||||
| * @param context DOCUMENT ME! | |||||
| * @param dpEV DOCUMENT ME! | |||||
| * @param bpEv DOCUMENT ME! | |||||
| * @param calcPrmAperture DOCUMENT ME! | |||||
| * @param calcPrmEvStep DOCUMENT ME! | |||||
| * @param fixBP DOCUMENT ME! | |||||
| * | |||||
| * @return DOCUMENT ME! | |||||
| */ | |||||
| public static List<Exposure> calculateExposures(Context context, double dpEV, double bpEv, double calcPrmAperture, | |||||
| double calcPrmEvStep, boolean fixBP, List<Double> allowedShutters) { | |||||
| Exposure exp; | |||||
| List<Exposure> exposures = new ArrayList<Exposure>(); | |||||
| double deltaEV = bpEv - dpEV; | |||||
| long nbrExposures = Math.round(deltaEV / calcPrmEvStep) + 1; | |||||
| // correct the deltaEV | |||||
| deltaEV = calcPrmEvStep * (nbrExposures - 1); | |||||
| double baseEVStep = -deltaEV / 2; | |||||
| for (int i = 0; i < nbrExposures; i++) { | |||||
| boolean found = false; | |||||
| String shutterSpeed = ""; | |||||
| double shutter; | |||||
| double evValue = 0; | |||||
| double evStep = baseEVStep + i * calcPrmEvStep; | |||||
| if (fixBP) { | |||||
| evValue = bpEv - (nbrExposures - 1 - i) * calcPrmEvStep; | |||||
| } else { | |||||
| evValue = dpEV + i * calcPrmEvStep; | |||||
| } | |||||
| shutter = Double.valueOf(evDF.format((EVFormula.calcShutterSpeed(calcPrmAperture, evValue)))); | |||||
| for (int j = 1; j < allowedShutters.size(); j++) { | |||||
| double v1 = allowedShutters.get(j - 1); | |||||
| double v2 = allowedShutters.get(j); | |||||
| if ((v1 <= shutter && shutter <= v2) || (v2 <= shutter && shutter <= v1)) { | |||||
| if (Math.abs(shutter - v1) <= Math.abs(shutter - v2)) { | |||||
| shutterSpeed = (v1 < 1) ? "1/" + evDF.format((1 / v1)) | |||||
| : "" + EasyBracketMain.DF.format(v1) + "''"; | |||||
| } else { | |||||
| shutterSpeed = (v2 < 1) ? "1/" + evDF.format((1 / v2)) | |||||
| : "" + EasyBracketMain.DF.format(v2) + "''"; | |||||
| } | |||||
| found = true; | |||||
| break; | |||||
| } | |||||
| } | |||||
| if (!found) { | |||||
| shutterSpeed = (shutter < 1) ? "1/" + Math.round(1 / shutter) | |||||
| : "" + EasyBracketMain.DF.format(shutter) + "''"; | |||||
| } | |||||
| exp = new Exposure(i + 1, "f/" + EasyBracketMain.DF.format(calcPrmAperture), shutterSpeed, evStep, deltaEV, | |||||
| getExpIcon(context, i + 1, (int) nbrExposures)); | |||||
| exposures.add(exp); | |||||
| } | |||||
| return exposures; | |||||
| } | |||||
| /** | |||||
| * Retrieves Icon. | |||||
| * | |||||
| * @param context Context | |||||
| * @param exp {@link Exposure} object | |||||
| * | |||||
| * @return Color stepped icon | |||||
| */ | |||||
| private static Bitmap getExpIcon(Context context, int expNbr, int nbrExposures) { | |||||
| Bitmap mIcon; | |||||
| Bitmap mIconBG; | |||||
| Bitmap mIconSymbol; | |||||
| Bitmap mIconSymbol_bl; | |||||
| Canvas canvas; | |||||
| Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); | |||||
| final Resources res = context.getResources(); | |||||
| final int twentyPercentGray = Math.round(255f * 0.8f); | |||||
| int deltaRGB = twentyPercentGray; | |||||
| int iSize; | |||||
| int iSize_r; | |||||
| int iStart; | |||||
| DisplayMetrics metrics = new DisplayMetrics(); | |||||
| ((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics); | |||||
| switch (metrics.densityDpi) { | |||||
| case DisplayMetrics.DENSITY_LOW: | |||||
| iSize = 18; | |||||
| iSize_r = 17; | |||||
| iStart = 1; | |||||
| break; | |||||
| case DisplayMetrics.DENSITY_MEDIUM: | |||||
| iSize = 24; | |||||
| iSize_r = 22; | |||||
| iStart = 2; | |||||
| break; | |||||
| default: | |||||
| iSize = 36; | |||||
| iSize_r = 33; | |||||
| iStart = 2; | |||||
| break; | |||||
| } | |||||
| if (expNbr > 1 || nbrExposures > 1) { | |||||
| deltaRGB = twentyPercentGray / (nbrExposures - 1) * (expNbr - 1); | |||||
| } | |||||
| // The background | |||||
| mIconBG = Bitmap.createBitmap(iSize, iSize, Config.ARGB_8888); | |||||
| mIconBG.eraseColor(0x00000000); | |||||
| canvas = new Canvas(mIconBG); | |||||
| mPaint.setStyle(Style.FILL); | |||||
| mPaint.setColor(Color.argb(255, deltaRGB, deltaRGB, deltaRGB)); | |||||
| canvas.drawRect(iStart, iStart, iSize_r, iSize_r, mPaint); | |||||
| // Let's retrieve all icon pieces as Bitmaps. | |||||
| mIcon = BitmapFactory.decodeResource(res, R.drawable.exposureicon_frame); | |||||
| mIconSymbol = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_white); | |||||
| mIconSymbol_bl = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_black); | |||||
| // Prepares the paint that will be used to draw our icon mask. Using | |||||
| // PorterDuff.Mode.SRC_OVER means the image that will be drawn will | |||||
| // mask the already drawn image. | |||||
| mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER)); | |||||
| // We're now ready to drawn our Android-like icon :) | |||||
| if (deltaRGB > twentyPercentGray / 2) { | |||||
| canvas.drawBitmap(mIconSymbol_bl, 0, 0, mPaint); | |||||
| } else { | |||||
| canvas.drawBitmap(mIconSymbol, 0, 0, mPaint); | |||||
| } | |||||
| canvas.drawBitmap(mIcon, 0, 0, mPaint); | |||||
| return mIconBG; | |||||
| } | |||||
| } |
| /* | |||||
| * $URL$ | |||||
| * $Revision$ | |||||
| * $LastChangedBy$ | |||||
| * $LastChangedDate$ | |||||
| * | |||||
| * Copyright (c) 2005 syseca AG, Switzerland | |||||
| * All rights reserved. | |||||
| * | |||||
| * This software is the confidential and proprietary information | |||||
| * of syseca AG. ("Confidential Information"). You shall not | |||||
| * disclose such Confidential Information and shall use it only | |||||
| * in accordance with the terms of the license agreement you | |||||
| * entered into with syseca AG. | |||||
| */ | |||||
| package ch.spherIC.resultlist; | |||||
| import android.content.Context; | |||||
| import android.content.res.Resources; | |||||
| import android.graphics.Bitmap; | |||||
| import android.graphics.BitmapFactory; | |||||
| import android.graphics.Canvas; | |||||
| import android.graphics.Paint; | |||||
| import android.graphics.PorterDuff; | |||||
| import android.graphics.PorterDuffXfermode; | |||||
| import android.graphics.Bitmap.Config; | |||||
| import android.graphics.Paint.Style; | |||||
| import ch.spherIC.R; | |||||
| /** | |||||
| * Factory that creates the exposure icons according to the EV range and values. | |||||
| */ | |||||
| public class ExposureIconFactory { | |||||
| /** | |||||
| * Retrieves Icon. | |||||
| * | |||||
| * @param context Context | |||||
| * @param exp {@link Exposure} object | |||||
| * | |||||
| * @return Color stepped icon | |||||
| */ | |||||
| public static Bitmap getExpIcon(Context context, Exposure exp) { | |||||
| Bitmap mIcon; | |||||
| Bitmap mIconBG; | |||||
| Bitmap mIconSymbol; | |||||
| Bitmap mIconSymbol_bl; | |||||
| Canvas canvas; | |||||
| Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); | |||||
| final Resources res = context.getResources(); | |||||
| // The background | |||||
| mIconBG = Bitmap.createBitmap(36, 36, Config.ARGB_8888); | |||||
| mIconBG.eraseColor(0x00000000); | |||||
| canvas = new Canvas(mIconBG); | |||||
| mPaint.setStyle(Style.FILL); | |||||
| mPaint.setColor(0xFF000000); | |||||
| canvas.drawRect(2, 2, 33, 33, mPaint); | |||||
| // Let's retrieve all icon pieces as Bitmaps. | |||||
| mIcon = BitmapFactory.decodeResource(res, R.drawable.exposureicon_frame); | |||||
| mIconSymbol = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_white); | |||||
| mIconSymbol_bl = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_black); | |||||
| // Prepares the paint that will be used to draw our icon mask. Using | |||||
| // PorterDuff.Mode.SRC_OVER means the image that will be drawn will | |||||
| // mask the already drawn image. | |||||
| mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER)); | |||||
| // We're now ready to drawn our Android-like icon :) | |||||
| canvas.drawBitmap(mIconSymbol, 0, 0, mPaint); | |||||
| canvas.drawBitmap(mIcon, 0, 0, mPaint); | |||||
| return mIconBG; | |||||
| } | |||||
| } |
| /* | |||||
| * $URL$ | |||||
| * $Revision$ | |||||
| * $LastChangedBy$ | |||||
| * $LastChangedDate$ | |||||
| * | |||||
| * Copyright (c) 2005 syseca AG, Switzerland | |||||
| * All rights reserved. | |||||
| * | |||||
| * This software is the confidential and proprietary information | |||||
| * of syseca AG. ("Confidential Information"). You shall not | |||||
| * disclose such Confidential Information and shall use it only | |||||
| * in accordance with the terms of the license agreement you | |||||
| * entered into with syseca AG. | |||||
| */ | |||||
| package ch.spherIC.settings; | |||||
| import android.app.Dialog; | |||||
| import android.content.Context; | |||||
| import android.content.SharedPreferences; | |||||
| import android.os.Bundle; | |||||
| import android.view.View; | |||||
| import android.widget.Button; | |||||
| import android.widget.RadioButton; | |||||
| import android.widget.Spinner; | |||||
| import ch.spherIC.EasyBracketMain; | |||||
| import ch.spherIC.R; | |||||
| /** | |||||
| * Settings / Preferences Dialog | |||||
| */ | |||||
| public class SettingsDlg extends Dialog { | |||||
| public static final String PREFS_NAME = "SettingsFile"; | |||||
| private Context prnt; | |||||
| /** | |||||
| * Creates a new SettingsDlg object. | |||||
| */ | |||||
| public SettingsDlg(Context context) { | |||||
| super(context, R.style.GlassThemeDialog); | |||||
| this.prnt = context; | |||||
| } | |||||
| /** | |||||
| * Called when the activity is first created. | |||||
| */ | |||||
| @Override | |||||
| public void onCreate(Bundle savedInstanceState) { | |||||
| super.onCreate(savedInstanceState); | |||||
| setContentView(R.layout.settings); | |||||
| setTitle(this.prnt.getResources().getText(R.string.menuSettings)); | |||||
| ((Button) findViewById(R.id.btn_Stg_Save)).setOnClickListener(new View.OnClickListener() { | |||||
| @Override | |||||
| public void onClick(View v) { | |||||
| saveSettings(); | |||||
| SettingsDlg.this.dismiss(); | |||||
| ((EasyBracketMain) SettingsDlg.this.prnt).loadSettings(); | |||||
| ((EasyBracketMain) SettingsDlg.this.prnt).setDefaults(); | |||||
| } | |||||
| }); | |||||
| ((Button) findViewById(R.id.btn_Stg_Cancel)).setOnClickListener(new View.OnClickListener() { | |||||
| @Override | |||||
| public void onClick(View v) { | |||||
| SettingsDlg.this.dismiss(); | |||||
| } | |||||
| }); | |||||
| } | |||||
| /** | |||||
| * {@inheritDoc} | |||||
| */ | |||||
| @Override | |||||
| protected void onStart() { | |||||
| super.onStart(); | |||||
| applySettings(); | |||||
| } | |||||
| /** | |||||
| * {@inheritDoc} | |||||
| */ | |||||
| @Override | |||||
| protected void onStop() { | |||||
| super.onStop(); | |||||
| } | |||||
| /** | |||||
| * Reads and applies the settings. | |||||
| */ | |||||
| private void applySettings() { | |||||
| boolean fixBP; | |||||
| float bpCorrection; | |||||
| float dpCorrection; | |||||
| // Restore settings | |||||
| SharedPreferences settings = getContext().getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE); | |||||
| fixBP = settings.getBoolean("fixBrightPoint", true); | |||||
| ((RadioButton) findViewById(R.id.rdbtn_KeepBP)).setChecked(fixBP); | |||||
| ((RadioButton) findViewById(R.id.rdbtn_KeepDP)).setChecked(!fixBP); | |||||
| bpCorrection = settings.getFloat("brightPointCorrection", 0f); | |||||
| dpCorrection = settings.getFloat("darkPointCorrection", 0f); | |||||
| ((Spinner) findViewById(R.id.spn_BP_Corr)).setSelection((int) bpCorrection); | |||||
| ((Spinner) findViewById(R.id.spn_DP_Corr)).setSelection((int) dpCorrection); | |||||
| } | |||||
| /** | |||||
| * Saves the settings | |||||
| */ | |||||
| private void saveSettings() { | |||||
| // Save settings | |||||
| SharedPreferences settings = getContext().getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE); | |||||
| SharedPreferences.Editor editor = settings.edit(); | |||||
| editor.putBoolean("fixBrightPoint", ((RadioButton) findViewById(R.id.rdbtn_KeepBP)).isChecked()); | |||||
| editor.putFloat("brightPointCorrection", ((Spinner) findViewById(R.id.spn_BP_Corr)).getSelectedItemPosition()); | |||||
| editor.putFloat("darkPointCorrection", ((Spinner) findViewById(R.id.spn_DP_Corr)).getSelectedItemPosition()); | |||||
| // Commit the edits! | |||||
| editor.commit(); | |||||
| } | |||||
| } |