OGK-Inspector v1.0.7
🚀 OGK-Inspector v1.0.7
Features Added
1. 🗂 Dialog for Choosing a Spectrum File
-
Feature Description:
ADialogFragmenthas been added to enable users to choose a spectrum file in JSON format. The dialog includes:- 🖼 Selected File Name Display: A
TextViewto show the file name. - 🔘 File Chooser Button: An
ImageButtonto open the file picker dialog. - 🛑 Cancel and ✅ Open buttons for file actions.
- 🖼 Selected File Name Display: A
-
Additional Enhancements:
- 🧰 Modern File Picker: Leveraging
ActivityResultLauncherAPI for streamlined file selection. - ❌ Error Handling: Notifications for parsing failures of invalid JSON files.
- 🧰 Modern File Picker: Leveraging
2. 📄 Handle File Selection and Parsing
- Feature Description:
Added functionality to:- 📜 Read File Contents: Converts file content to a string buffer for processing.
- ✅ JSON Parsing: Utilizes Kotlinx Serialization for parsing spectrum files (
decodeFromString). - 🛑 Error Notification: Alerts users upon parsing failure.
3. 🔗 SpectrumFragment Navigation
- Feature Description:
Allows seamless navigation fromDialogFragmenttoSpectrumFragmentwhen a spectrum file is selected:- 🔄 Pass File URI: Sends file URI via a
Bundle. - 🧭 Controlled Navigation: Ensures proper transitions without leftover dialog interruptions.
- 🔄 Pass File URI: Sends file URI via a
4. 📊 Convert Data for Visualization
- Feature Description:
Enables conversion of data for numerical visualization.- 🧮 Input: Takes a
List<Long>of data points. - 📈 Output: Produces a
float[][]array for use in charting libraries.
- 🧮 Input: Takes a
5. ⚙️ Settings Feature
-
Feature Description:
Introduced a settings screen to configure the default measure mode during app boot or device connection:- 🔘 Options:
<None>,<Counter>,<Spectrum> - 🛠 Customizable Settings Layout: Features a dropdown menu and explanation text.
- 🎯 Persist Settings: Stores preferences using
SharedPreferences.
- 🔘 Options:
-
Logic for First App Run:
- 🟡 First-Time Settings Prompt: Automatically shows the settings screen when the app is launched for the first time.
- 🔒 Settings Memory: Saves default measure mode for subsequent sessions.
6. 🌎 Global App State with Flags
- Feature Description:
Introduced a global flag mechanism to manage app state across fragments:- 🚨 Persistent State: The flag resets only when the app terminates completely (not on pause).
- 🧭 Access from Anywhere: The flag is accessible globally via a custom
Applicationclass.
7. 🎯 MainActivity Behavior on App Launch
- Feature Description:
Added logic to open the corresponding fragment based on selected measure mode and device connection:- 🟢 Counter Mode: Opens
CounterFragment. - 🟣 Spectrum Mode: Opens
SpectrumFragment.
- 🟢 Counter Mode: Opens
8. 🧪 Isotope Database Screen
- Added support for loading isotope data and display the list
- Each isotope entry includes:
- Name
- Gamma Energies (keV)
- Half-life, automatically converted from seconds into an appropriate human-readable format (years, months, days, hours, minutes, or seconds).
9. 🧮 Smart Half-life Display
- Half-life values are shown with precision:
- Automatically scaled to a readable unit based on duration.
- Exponential format used for large values (e.g., >999 years).
10. 🧭 UI Improvements
- Clean, horizontal layout: Each isotope is shown in a single row with its attributes clearly aligned.
- Sorting support: Users can sort the list by:
- Name
- Energy
- Half-life
🛠 Technical Highlights
- Kotlin Fragment for UI with recycler view.
- Smart formatting of half-life via
formatHalfLife()function. - Sortable table-style list implemented using standard Android components.
Full Changelog: 1.0.6...1.0.7
Thank you for your feedback and contributions!