Calculator_Fragment

The activity (GUI) for the calculator. Display and Buttons are managed here.

Author

"Martin Krischik" «krischik@users.sourceforge.net»

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
private class Font_Entry
The calculator specific font which consists of PNGs
Link copied to clipboard
private class Indicator
mapping between indicator, bitmap and drawable.

Properties

Link copied to clipboard
open var Alpha_Text: Array<Short>
Text to be displayed on the calculator display.
Link copied to clipboard
open var Button_0_RND: Calculator_Button_5
Link copied to clipboard
open var Calculator_Buttons_1: LinearLayout
calculator button table 1
Link copied to clipboard
open var Calculator_Buttons_2: LinearLayout
calculator button table 2
Link copied to clipboard
private open var charactersWidgets: Array<ImageView>
Display characters.
Link copied to clipboard
private open var exponentWidgets: Array<ImageView>
Display characters.
Link copied to clipboard
cross reference and cache all font characters.
Link copied to clipboard
open var Image_Character_0: ImageView
Link copied to clipboard
open var Image_Character_1: ImageView
Link copied to clipboard
open var Image_Character_10: ImageView
Link copied to clipboard
open var Image_Character_2: ImageView
Link copied to clipboard
open var Image_Character_3: ImageView
Link copied to clipboard
open var Image_Character_4: ImageView
Link copied to clipboard
open var Image_Character_5: ImageView
Link copied to clipboard
open var Image_Character_6: ImageView
Link copied to clipboard
open var Image_Character_7: ImageView
Link copied to clipboard
open var Image_Character_8: ImageView
Link copied to clipboard
open var Image_Character_9: ImageView
Link copied to clipboard
open var Image_Exponent_0: ImageView
Link copied to clipboard
open var Image_Exponent_1: ImageView
Link copied to clipboard
open var Image_Exponent_2: ImageView
Link copied to clipboard
open var Indicator_0: TextView
Link copied to clipboard
open var Indicator_1: TextView
Link copied to clipboard
open var Indicator_10: TextView
Link copied to clipboard
open var Indicator_2: TextView
Link copied to clipboard
open var Indicator_3: TextView
Link copied to clipboard
open var Indicator_4: TextView
Link copied to clipboard
open var Indicator_5: TextView
Link copied to clipboard
open var Indicator_6: TextView
Link copied to clipboard
open var Indicator_7: TextView
Link copied to clipboard
open var Indicator_8: TextView
Link copied to clipboard
open var Indicator_9: TextView
Link copied to clipboard
private val Indicator_Count: Int = 11
Link copied to clipboard
indicators to be displayed.
Link copied to clipboard
mapping between indicator, bitmap and drawable.
Link copied to clipboard
private open var Large_Screen: Large_Screen_Type
use large screen.
Link copied to clipboard
private val Margin_Size: Double = 1.5
Link copied to clipboard
private val Save_Alpha_Text: String = "Alpha_Text"
Save state key for Alpha_Text value
Link copied to clipboard
private val Save_Indicators: String = "Indicators"
Save state key for Indicators value
Link copied to clipboard
private val Save_Large_Screen: String = "Large_Screen"
Save state key for Large_Screen value
Link copied to clipboard
val TAG: String
logging tag
Link copied to clipboard
color for active indicatiors
Link copied to clipboard
color for inactive indicatiors
Link copied to clipboard
private open var Text_Typeface: Typeface
Font to display printout text with

Functions

Link copied to clipboard
protected open fun afterViews()
Called when the views are injected.
Link copied to clipboard
open fun asFragment(): Fragment
Returns the instance as a Fragment (saves you and instanceOf check and cast)
Link copied to clipboard
open fun bindPreferences(Preferences: IPreferences_)
Bind or unbind the calculator preferences
Link copied to clipboard
abstract fun bindService(Service: Calculator_Service)
Bind or unbind the calculator service
Link copied to clipboard
open fun displayException(Exception: Throwable)
display additional information on the error.
Link copied to clipboard
Text currently displayed
Link copied to clipboard
open fun getButton0(): Calculator_Button_5
Link copied to clipboard
open fun getDisplayText(Row: Int): Array<Short>
Link copied to clipboard
Set the indicators (Shift, Alpha, Deg, Grad, Gra, etc.
Link copied to clipboard
open fun getJavaText(): String
open fun getJavaText(Row: Int): String
Link copied to clipboard
abstract fun getResources(): Resources
Link copied to clipboard
private open fun initKeyboard(activity: FragmentActivity)
create buttons
Link copied to clipboard
open fun onActivityCreated(savedInstanceState: Bundle)
Called when the activity is first created.
Link copied to clipboard
open fun onAttach(activity: Activity)
Called when a fragment is first attached to its activity.
Link copied to clipboard
open fun onDestroy()
Calculator destroyed
Link copied to clipboard
open fun onDestroyView()
Calculator destroyed
Link copied to clipboard
open fun onDetach()
Called when the fragment is no longer attached to its activity.
Link copied to clipboard
open fun onResume()
Called after onRestoreInstanceState(Bundle), onRestart(), or onPause(), for your activity to start interacting with the user.
Link copied to clipboard
open fun onSaveInstanceState(Out_State: Bundle)
Called to ask the fragment to save its current dynamic state, so it can later be reconstructed in a new instance of its process is restarted.
Link copied to clipboard
protected open fun redrawAll()
Link copied to clipboard
private open fun redrawAlphaText()
Link copied to clipboard
private open fun redrawIndicators()
Link copied to clipboard
private open fun redrawKeyBoard()
Link copied to clipboard
open fun Send_Change_Keyboard(Change_Keyboard: Boolean)
send the change keyboard message when Change_Keyboard is true.
Link copied to clipboard
fun setDisplayText(Row: Int, Alpha_Text: Array<Short>)
Set text to be displayed (calculator alpha codes).
Link copied to clipboard
fun setIndicators(Indicators: Array<Boolean>)
Set the indicators (Shift, Alpha, Deg, Grad, Gra, etc.
Link copied to clipboard
open fun setOnOff(on: Boolean)
set the calculators on of status.
Link copied to clipboard
open fun setPressedKey(Pressed_Key: Short)
Get calculator key code of the currently pressed key.
Link copied to clipboard
open fun Switch_Display()
switch between large and normal display
Link copied to clipboard
private open fun switchDisplay(Group: ViewGroup, Large_Screen: Boolean)
switch display for view Group
Link copied to clipboard
open fun toString(): String
Generate string for debug purpose
Link copied to clipboard
private open fun useLargeScreen(): Boolean
use large screen.