Full Code of odaridavid/WeatherApp for AI

develop 0e9641f3c9f0 cached
128 files
274.0 KB
74.5k tokens
1 requests
Download .txt
Showing preview only (313K chars total). Download the full file or copy to clipboard to get everything.
Repository: odaridavid/WeatherApp
Branch: develop
Commit: 0e9641f3c9f0
Files: 128
Total size: 274.0 KB

Directory structure:
gitextract_68o3_ggl/

├── .github/
│   └── workflows/
│       ├── code-analysis.yml
│       └── update-dependencies-action.yml
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── app/
│   ├── .gitignore
│   ├── build.gradle.kts
│   ├── google-services.json
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── kotlin/
│       │       └── com/
│       │           └── github/
│       │               └── odaridavid/
│       │                   └── weatherapp/
│       │                       └── SettingsRepositoryTest.kt
│       ├── debug/
│       │   └── res/
│       │       ├── drawable/
│       │       │   └── ic_launcher_background.xml
│       │       ├── drawable-v24/
│       │       │   └── ic_launcher_foreground.xml
│       │       └── mipmap-anydpi-v26/
│       │           ├── ic_launcher.xml
│       │           └── ic_launcher_round.xml
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── github/
│       │   │           └── odaridavid/
│       │   │               └── weatherapp/
│       │   │                   ├── MainViewModel.kt
│       │   │                   ├── WeatherApp.kt
│       │   │                   ├── common/
│       │   │                   │   ├── AndroidExtensions.kt
│       │   │                   │   └── LocationRequest.kt
│       │   │                   ├── data/
│       │   │                   │   ├── Extensions.kt
│       │   │                   │   ├── settings/
│       │   │                   │   │   └── DefaultSettingsRepository.kt
│       │   │                   │   └── weather/
│       │   │                   │       ├── DefaultWeatherRepository.kt
│       │   │                   │       ├── FirebaseLogger.kt
│       │   │                   │       └── remote/
│       │   │                   │           ├── DefaultRemoteWeatherDataSource.kt
│       │   │                   │           ├── Mappers.kt
│       │   │                   │           ├── OpenWeatherService.kt
│       │   │                   │           ├── RemoteWeatherDataSource.kt
│       │   │                   │           └── WeatherResponse.kt
│       │   │                   ├── designsystem/
│       │   │                   │   ├── Theme.kt
│       │   │                   │   ├── atom/
│       │   │                   │   │   ├── Color.kt
│       │   │                   │   │   ├── Dimensions.kt
│       │   │                   │   │   ├── Shape.kt
│       │   │                   │   │   └── Type.kt
│       │   │                   │   ├── molecule/
│       │   │                   │   │   ├── Buttons.kt
│       │   │                   │   │   ├── Image.kt
│       │   │                   │   │   └── Text.kt
│       │   │                   │   ├── organism/
│       │   │                   │   │   ├── BottomSheets.kt
│       │   │                   │   │   ├── Dialogs.kt
│       │   │                   │   │   ├── NavBars.kt
│       │   │                   │   │   ├── Row.kt
│       │   │                   │   │   └── TextWidgets.kt
│       │   │                   │   └── templates/
│       │   │                   │       ├── ErrorScreen.kt
│       │   │                   │       ├── InfoScreens.kt
│       │   │                   │       └── ProgressScreens.kt
│       │   │                   ├── di/
│       │   │                   │   ├── ClientModule.kt
│       │   │                   │   └── RepositoryModule.kt
│       │   │                   └── ui/
│       │   │                       ├── AppNavGraph.kt
│       │   │                       ├── MainActivity.kt
│       │   │                       ├── about/
│       │   │                       │   └── AboutScreen.kt
│       │   │                       ├── home/
│       │   │                       │   ├── HomeScreen.kt
│       │   │                       │   ├── HomeScreenIntent.kt
│       │   │                       │   ├── HomeViewModel.kt
│       │   │                       │   └── Mappers.kt
│       │   │                       ├── settings/
│       │   │                       │   ├── SettingsScreen.kt
│       │   │                       │   ├── SettingsScreenIntent.kt
│       │   │                       │   ├── SettingsViewModel.kt
│       │   │                       │   └── UIMapper.kt
│       │   │                       └── update/
│       │   │                           ├── UpdateAppException.kt
│       │   │                           ├── UpdateManager.kt
│       │   │                           └── UpdateStateFactory.kt
│       │   └── res/
│       │       ├── drawable/
│       │       │   ├── ic_arrow_back.xml
│       │       │   ├── ic_exclude_24.xml
│       │       │   ├── ic_info_24.xml
│       │       │   ├── ic_language.xml
│       │       │   ├── ic_launcher_background.xml
│       │       │   ├── ic_settings.xml
│       │       │   ├── ic_time_24.xml
│       │       │   └── ic_units.xml
│       │       ├── drawable-night/
│       │       │   ├── ic_arrow_back.xml
│       │       │   ├── ic_exclude_24.xml
│       │       │   ├── ic_info_24.xml
│       │       │   ├── ic_language.xml
│       │       │   ├── ic_settings.xml
│       │       │   ├── ic_time_24.xml
│       │       │   └── ic_units.xml
│       │       ├── drawable-v24/
│       │       │   └── ic_launcher_foreground.xml
│       │       ├── mipmap-anydpi-v26/
│       │       │   ├── ic_launcher.xml
│       │       │   └── ic_launcher_round.xml
│       │       ├── values/
│       │       │   ├── colors.xml
│       │       │   ├── strings.xml
│       │       │   └── themes.xml
│       │       └── xml/
│       │           ├── backup_rules.xml
│       │           └── data_extraction_rules.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── github/
│                       └── odaridavid/
│                           └── weatherapp/
│                               ├── HomeViewModelTest.kt
│                               ├── MainViewModelTest.kt
│                               ├── SettingsRepositoryTest.kt
│                               ├── SettingsViewModelTest.kt
│                               ├── UIMapperTest.kt
│                               ├── WeatherRepositoryTest.kt
│                               ├── fakes/
│                               │   ├── FakeSettingsRepository.kt
│                               │   └── Fakes.kt
│                               └── rules/
│                                   └── MainCoroutineRule.kt
├── build.gradle.kts
├── gradle/
│   ├── libs.versions.toml
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── iOSApp/
│   ├── iOSApp/
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   └── Contents.json
│   │   ├── ContentView.swift
│   │   ├── Preview Content/
│   │   │   └── Preview Assets.xcassets/
│   │   │       └── Contents.json
│   │   └── iOSAppApp.swift
│   ├── iOSApp.xcodeproj/
│   │   ├── project.pbxproj
│   │   ├── project.xcworkspace/
│   │   │   ├── contents.xcworkspacedata
│   │   │   ├── xcshareddata/
│   │   │   │   └── IDEWorkspaceChecks.plist
│   │   │   └── xcuserdata/
│   │   │       └── odari.xcuserdatad/
│   │   │           └── UserInterfaceState.xcuserstate
│   │   └── xcuserdata/
│   │       └── odari.xcuserdatad/
│   │           └── xcschemes/
│   │               └── xcschememanagement.plist
│   ├── iOSAppTests/
│   │   └── iOSAppTests.swift
│   └── iOSAppUITests/
│       ├── iOSAppUITests.swift
│       └── iOSAppUITestsLaunchTests.swift
├── pull_request_template.md
├── settings.gradle.kts
└── shared/
    ├── build.gradle.kts
    └── src/
        └── commonMain/
            └── kotlin/
                └── com/
                    └── github/
                        └── odaridavid/
                            └── weatherapp/
                                ├── api/
                                │   ├── Logger.kt
                                │   ├── SettingsRepository.kt
                                │   └── WeatherRepository.kt
                                └── model/
                                    ├── DefaultLocation.kt
                                    ├── ExcludedData.kt
                                    ├── Result.kt
                                    ├── SupportedLanguage.kt
                                    ├── Throwables.kt
                                    ├── TimeFormat.kt
                                    ├── Units.kt
                                    └── Weather.kt

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/workflows/code-analysis.yml
================================================
name: Code Analysis
on:
  pull_request:
    branches:
      - develop
jobs:
  code-analysis:
    runs-on: macos-latest
    environment: Dev
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Download & Copy local.properties
        run: |
          curl -o local.properties "${{ secrets.LOCAL_PROPERTIES_URL }}"
          mv local.properties ./local.properties
      - name: Set up JDK
        uses: actions/setup-java@v4
        with:
          distribution: 'oracle'
          java-version: '17'
      - name: Run Ktlint
        run: ./gradlew ktlintCheck
        continue-on-error: true
      - name: Run Detekt
        run: ./gradlew detekt
        continue-on-error: true




================================================
FILE: .github/workflows/update-dependencies-action.yml
================================================
name: Update Dependencies
on:
  schedule:
    - cron: '00 08 * * 4'
jobs:
  version-update:
    runs-on: macos-latest
    environment: Dev
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Download & Copy local.properties
        run: |
          curl -o local.properties "${{ secrets.LOCAL_PROPERTIES_URL }}"
          mv local.properties ./local.properties
      - name: Set up JDK
        uses: actions/setup-java@v4
        with:
          distribution: 'oracle'
          java-version: '17'

      - name: Version Update
        run: |
          ./gradlew versionCatalogUpdate

      - name: Open Pull Request
        uses: peter-evans/create-pull-request@v6
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          title: "Update Version Catalog"
          body: "Automated version update using GitHub Actions."
          commit-message: "Update version catalog"


================================================
FILE: .gitignore
================================================
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
/.idea/


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to Weather App

👍🎉 First off, thank you for taking the time to contribute! 🎉👍

The following is a set of guidelines for contributing to Weather App. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.

## How Can I Contribute?

### Reporting Bugs

Before submitting a bug report, please check if the issue has already been reported by searching through the [existing issues](https://github.com/odaridavid/weather-app/issues). If you can't find an existing issue addressing the problem, feel free to open a new one. When you report a bug, please include as much detail as possible, including:

- Steps to reproduce the bug
- Expected behavior
- Actual behavior
- Screenshots or code snippets, if applicable
- Your Android Version.

### Suggesting Enhancements

If you have an idea for an enhancement or new feature, we'd love to hear about it! You can submit your suggestion by opening a new issue. Please provide a clear description of the enhancement you're proposing and any relevant context or examples that might help us understand your idea better.

### Contributing Code

We welcome contributions in the form of code improvements, bug fixes, or new features. To contribute code:

1. Fork the repository to your GitHub account.
2. Create a new branch for your feature or bug fix.
3. Make your changes and commit them with clear, descriptive messages.
4. Push your changes to your fork.
5. Submit a pull request to the main repository, explaining the changes you've made and why they're valuable.

### Code Style

When contributing code, please adhere to the existing code style and formatting conventions used in the project. If you're unsure about the style or formatting, feel free to ask for guidance in your pull request.

### Code Review

All contributions will go through a code review process before being merged. During the review, feedback may be provided to help improve the quality of the code. Please be receptive to feedback and be prepared to make any necessary changes to your code.

### Testing

If you're adding new features or fixing bugs, please ensure that appropriate tests are included to cover the changes you've made. This helps maintain the overall quality and stability of the application.


## Questions

If you have any questions about contributing or anything else related to the project, feel free to reach out to [maintainer's email or contact details](davidkibzodari@gmail.com).

Once again, thank you for contributing to Weather App! Your support and contributions are greatly appreciated. 🌤️🌈


================================================
FILE: LICENSE
================================================
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   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.


================================================
FILE: README.md
================================================
### Weather App

[![Build Status](https://app.bitrise.io/app/80f9b4627fc90757/status.svg?token=3KnRQl0WRfDT5UTzPDiRgA&branch=develop)](https://app.bitrise.io/app/80f9b4627fc90757)
[![codecov](https://codecov.io/gh/odaridavid/WeatherApp/branch/develop/graph/badge.svg?token=eZcGjGhF83)](https://codecov.io/gh/odaridavid/WeatherApp)

*Summary*

A simple weather app that gets your location and displays the forecast for the current day and a few
days after that.

*API :* [OpenWeatherMap](https://openweathermap.org/api)

Reason for choosing mentioned API :

- 1000 free api calls per day, good for a small project.
- Ability to specify different units in requests and receive a formatted response based on the unit
  i.e imperial/metric etc.
- Api response can also be modified to include the amount of needed data all with one call ,
  contains icons for different conditions and has multilingual support if adopting for a wider
  audience is ever needed.
- They have a large user base and handle millions of requests, if the app were ever to scale,
  there's confidence on the api providing high availability.
- Has capabilities for alerts for severe weather conditions

More info on how to make an api call [here](https://openweathermap.org/api/one-call-3#multi).

# Pre-requisite 📝

In your `local.properties` you will need to add your Open Weather API key and copy the urls in.

```properties
OPEN_WEATHER_API_KEY=YOUR KEY
OPEN_WEATHER_BASE_URL=https://api.openweathermap.org
OPEN_WEATHER_ICONS_URL=https://openweathermap.org/img/wn/
```

Check for one under  [`Api Keys`](https://home.openweathermap.org/api_keys)

*Environment*

- Built on A.S Hedgehog+
- JDK 17

# Design/Architectural decisions 📐

The project makes use of common android patterns in modern android codebases.

**Project Structure**

The folders are split into 4 boundaries:
<details>
  <summary>Core</summary> 
 Contains the models/data classes that are independent of any framework specific dependencies and represent the business logic. 
   In a Clean Arch world you can consider these as your domain classes and interfaces.
</details>

<details>
  <summary>Data</summary>
  Contains data sources , local or remote, this is where the implementation for such is kept. All
  data related actions and formatting happens in this layer as well.
  It may contain framework related dependencies to orchestrate and create instances of data stores
  like a database or shared preference etc.
  One common pattern used in this area is the repository pattern, which mediates data sources and
  acts as a source of truth to the consumer.
</details>

<details>
  <summary>DI</summary>
  This acts as the glue between the core ,data and UI.The UI relies on the core models and
  interfaces which are implemented in data.
</details>

<details>
  <summary>UI</summary>
  Contains the presentation layer of the app, the screen components and viewmodels. Framework
  specific dependencies are best suited for this layer.
  In this layer MVI is also used, it looks similar to MVVM but the difference is the actions from a
  screen a.k.a intents e.g ```HomeScreenIntent``` are predefined and are finite,making the
  the screen state a bit more predictable and it's easier to scan through what actions are possible
  from a given screen.

The screen state e.g ```HomeScreenViewState``` is also modelled as a class with immutable
properties and makes state management way easier by reducing the state whenever their is a new
update received.
Some design patterns that can be seen here are the Observer pattern when consuming the flow ->
state flows in the composables and provides a reactive app.
</details>

![Add flow diagram here](/docs/MVI.png)

<details>
  <summary>Testing</summary>

The data layer is unit tested by mocking out external dependencies and the ui layer on the
viewmodels, an integration test is written that makes use of fake,so as to mimic the real scenario
as much as possible over using mocks, which would also turn it to a unit test.
</details>

# Other Stuff 📦

*Code style*

For now there is no strict adherence to a code style, but the project is formatted using the default
android studio formatter.
You can run `./gradlew detekt` to check for any code smells and `./gradlew ktlint` to check for any
linting issues.
Alternatively for ktlint
the [IDE plugin](https://pinterest.github.io/ktlint/latest/install/setup/#recommended-setup) might
be a much better option :)
Or setting up
a [pre-commit/pre-push hook](https://pinterest.github.io/ktlint/latest/install/cli/#git-hooks) to
run the checks before a commit is made or pushed.

*CI/CD*

The project is built on Bitrise and the workflow is maintained from its dashboard.Github actions are
responsible for
dependency updates and running code quality checks ,defined in the `.github/workflows` folder.

*Design System*

Under the `designsystem` package ,it follows a tiered approach to styling the app i.e
<details>
<summary>Atoms (Smallest Components)</summary>
Typography:
Define font styles, sizes, and weights for headers, paragraphs, and other text elements.

Color Palette:
Establish a color palette with primary, secondary, and accent colors. Specify their usage in
different contexts.

Icons:
Design a set of basic icons that represent common actions or concepts. Ensure consistency in style
and sizing.

Buttons:
Create button styles with variations for primary, secondary, and tertiary actions. Include states
like hover and disabled.

Input Fields:
Design consistent styles for text inputs, checkboxes, radio buttons, and other form elements.
</details>
<details>
<summary>Molecules (Simple Components)</summary>
Form Elements:
Combine atoms to create complete form components. Ensure consistency in spacing and alignment.

Cards:
Combine text, images, and buttons to create card components. Define variations for different use
cases.

Badges:
Assemble icons and text to create badge components for notifications or status indicators.

Avatars:
Design avatar components for user profiles, incorporating images or initials.
</details>
<details>
<summary>Organisms (Complex Components)</summary>
Navigation Bars:
Create a consistent navigation bar design that includes menus, icons, and navigation elements.

Headers and Footers:
Define headers and footers with appropriate spacing, logos, and navigation links.

Lists:
Assemble atoms and molecules to create list components, incorporating variations like simple lists,
detailed lists, and nested lists.

Modals:
Design modal components for overlays or pop-ups, ensuring consistency in styles and behavior.
</details>
<details>
<summary>Templates (Page-Level Structures)</summary>
Page Layouts:
Establish consistent layouts for different types of pages (e.g., home page, product page, settings 
page).

Grid Systems:
Define grid systems that ensure alignment and consistency across various screen sizes.
</details>

*Performance*

The app is monitored using Firebase Performance and Crashlytics,for performance it's using the
default
traces but can be extended as the app grows to monitor specific parts of the app that might be slow.
LeakCanary is also used to monitor for any memory leaks that might occur in debug mode.

*Build Times*

The current CI build time , factoring in the project size, the number of tests etc.

| Task                                    | Avg Time |
|-----------------------------------------|----------|
| Build -  Bitrise                        | 4m 30s   |
| Code Analysis    - Github Actions       | 6m 30s   |
| Update Dependencies    - Github Actions | 8m 30s   |

# Technologies 🔨

**Language :** [Kotlin](https://github.com/JetBrains/kotlin)

**Libraries :**
<details>
  <summary>UI</summary> 
  <a href="https://developer.android.com/jetpack/compose">Compose</a><br>
  <a href="https://coil-kt.github.io/coil/compose/">Coil</a><br>
  <a href="https://developer.android.com/guide/playcore/in-app-updates">InAppUpdate</a>
</details>

<details>
  <summary>Data</summary> 
  <a href="https://square.github.io/retrofit/">Retrofit</a><br>
  <a href="https://square.github.io/okhttp/">OkHTTP</a><br>
  <a href="https://kotlinlang.org/docs/serialization.html">kotlinx.serialization</a><br>
  <a href="https://developer.android.com/topic/libraries/architecture/datastore">Preference Data Store</a>
</details>

<details>
  <summary>Testing</summary> 
  <a href="https://junit.org/junit4/">JUnit</a><br>
  <a href="https://mockk.io/">Mockk</a><br>
  <a href="https://truth.dev/">Truth</a><br>
  <a href="https://github.com/cashapp/turbine">Turbine</a>
</details>

<details>
  <summary>Tooling/Project setup</summary>
  <a href="https://github.com/google/secrets-gradle-plugin">Gradle secrets plugin</a><br>
  <a href="https://developer.android.com/training/dependency-injection/hilt-android">Hilt (DI)</a><br>
  <a href="https://firebase.google.com/docs">Firebase - Crashlytics, Performance</a><br>
  <a href="https://www.bitrise.io/">Bitrise</a><br>
  <a href="https://about.codecov.io/">Codecov</a><br>
  <a href="https://github.com/detekt/detekt">Detekt</a><br>
  <a href="https://ktlint.github.io/">Ktlint</a><br>
  <a href="https://square.github.io/leakcanary/">LeakCanary</a><br>
  <a href="https://github.com/mikepenz/AboutLibraries">About Libraries</a><br>
  <a href="https://kotlinlang.org/docs/multiplatform.html">KMM</a>
</details>

# LICENSE

```
   Copyright 2023 David Odari

   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.
   
```

# Screenshots 📱

|                               Light Theme                                |                               Dark Theme                                |
|:------------------------------------------------------------------------:|:-----------------------------------------------------------------------:|
|       <img src="/docs/screenshots/(Light)Main.png" width="250px">        |       <img src="/docs/screenshots/(Dark)Main.png" width="250px">        |
|     <img src="/docs/screenshots/(Light)Settings.png" width="250px">      |     <img src="/docs/screenshots/(Dark)Settings.png" width="250px">      |
| <img src="/docs/screenshots/(Light)Settings-Exclude.png" width="250px">  | <img src="/docs/screenshots/(Dark)Settings-Exclude.png" width="250px">  |
|       <img src="/docs/screenshots/(Light)About.png" width="250px">       |       <img src="/docs/screenshots/(Dark)About.png" width="250px">       |
|       <img src="/docs/screenshots/(Light)Error.png" width="250px">       |       <img src="/docs/screenshots/(Dark)Error.png" width="250px">       |
| <img src="/docs/screenshots/(Light)Settings-Language.png" width="250px"> | <img src="/docs/screenshots/(Dark)Settings-Language.png" width="250px"> |
|   <img src="/docs/screenshots/(Light)Settings-Time.png" width="250px">   |   <img src="/docs/screenshots/(Dark)Settings-Time.png" width="250px">   |
|         <img src="/docs/screenshots/Excluded.png" width="250px">         |                                    -                                    |

![](https://media.giphy.com/media/hWvk9iUU4uBBeyBq0k/giphy.gif)




================================================
FILE: app/.gitignore
================================================
/build

================================================
FILE: app/build.gradle.kts
================================================
import com.google.firebase.perf.plugin.FirebasePerfExtension

plugins {
    alias(libs.plugins.com.android.application)
    alias(libs.plugins.org.jetbrains.kotlin.android)
    alias(libs.plugins.mapsplatform.secrets.gradle.plugin)
    kotlin("kapt")
    alias(libs.plugins.dagger.hilt.android)
    alias(libs.plugins.org.jetbrains.kotlin.plugin.serialization)
    id("com.google.gms.google-services")
    id("com.google.firebase.crashlytics")
    id("io.gitlab.arturbosch.detekt")
    jacoco
    alias(libs.plugins.firebase.perf.plugin)
    alias(libs.plugins.about.lib.plugin)
    alias(libs.plugins.compose.compiler)
}

jacoco {
    toolVersion = "0.8.11"
}

project.afterEvaluate {
    setupAndroidReporting()
}

fun setupAndroidReporting() {
    val buildTypes = listOf("debug")

    buildTypes.forEach { buildTypeName ->
        val sourceName = buildTypeName
        val testTaskName = "test${sourceName.capitalize()}UnitTest"
        println("Task -> $testTaskName")

        tasks.register<JacocoReport>("${testTaskName}Coverage") {
            dependsOn(tasks.findByName(testTaskName))

            group = "Reporting"
            description =
                "Generate Jacoco coverage reports on the ${sourceName.capitalize()} build."

            reports {
                xml.required.set(true)
                csv.required.set(false)
                html.required.set(true)
            }

            val fileFilter = listOf(
                // android
                "**/R.class",
                "**/R$*.class",
                "**/BuildConfig.*",
                "**/Manifest*.*",
                "**/*Test*.*",
                "android/**/*.*",
                // kotlin
                "**/*MapperImpl*.*",
                "**/*\$ViewInjector*.*",
                "**/*\$ViewBinder*.*",
                "**/BuildConfig.*",
                "**/*Component*.*",
                "**/*BR*.*",
                "**/Manifest*.*",
                "**/*\$Lambda$*.*",
                "**/*Companion*.*",
                "**/*Module*.*",
                "**/*Dagger*.*",
                "**/*Hilt*.*",
                "**/*MembersInjector*.*",
                "**/*_MembersInjector.class",
                "**/*_Factory*.*",
                "**/*_Provide*Factory*.*",
                // sealed and data classes
                "**/*\$Result.*",
                "**/*\$Result$*.*",
                // adapters generated by moshi
                "**/*JsonAdapter.*",
                "**/*Activity*",
                "**/di/**",
                "**/hilt*/**",
                // TODO Remove once UI and instrumented tests are added
                "**/entrypoint/**",
                "**/designsystem/**",
                "**/*Screen*.*",
                "**/*NavGraph*.*",
                "**/*Destinations*.*",
                "**/common/**",
                "**/*Extensions*.*",
            )

            val javaTree = fileTree("${project.buildDir}/intermediates/javac/$sourceName/classes") {
                exclude(fileFilter)
            }
            val kotlinTree = fileTree("${project.buildDir}/tmp/kotlin-classes/$sourceName") {
                exclude(fileFilter)
            }
            classDirectories.setFrom(files(javaTree, kotlinTree))

            executionData.setFrom(files("${project.buildDir}/jacoco/$testTaskName.exec"))
            val coverageSourceDirs = listOf(
                "${project.projectDir}/src/main/java",
                "${project.projectDir}/src/$buildTypeName/java"
            )

            sourceDirectories.setFrom(files(coverageSourceDirs))
            additionalSourceDirs.setFrom(files(coverageSourceDirs))
        }
    }
}

android {
    namespace = "com.github.odaridavid.weatherapp"
    compileSdk = 35

    defaultConfig {
        applicationId = "com.github.odaridavid.weatherapp"
        minSdk = 23
        targetSdk = 35
        versionCode = 1
        versionName = "1.0"

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables {
            useSupportLibrary = true
        }
    }

    buildTypes {
        debug {
            applicationIdSuffix = ".debug"
            configure<FirebasePerfExtension> {
                // Set this flag to 'false' to disable @AddTrace annotation processing and
                // automatic monitoring of HTTP/S network requests
                // for a specific build variant at compile time.
                // Breaks jacoco reporting if true see https://github.com/firebase/firebase-android-sdk/issues/3948
                setInstrumentationEnabled(false)
            }
            enableAndroidTestCoverage = true
        }

        release {
            isMinifyEnabled = false
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_17
        targetCompatibility = JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_17.toString()
        freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn" + listOf(
            "-P",
            // See https://github.com/androidx/androidx/blob/androidx-main/compose/compiler/design/compiler-metrics.md
            "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=${project.buildDir}/reports/kotlin-compile/compose"
        )
    }
    buildFeatures {
        compose = true
        buildConfig = true
    }
    packaging {
        resources {
            excludes += "/META-INF/{AL2.0,LGPL2.1}"
        }
    }
}

dependencies {

    implementation(project(":shared"))
    // Jetpack Core
    implementation(libs.bundles.androidx)
    implementation(platform(libs.compose.bom))
    implementation(libs.bundles.compose)

    // Google Play Services
    implementation(libs.playservices.location)

    // Data & Async
    implementation(libs.retrofit)
    implementation(platform(libs.okhttp.bom))
    implementation(libs.okhttp)
    implementation(libs.okhttp.logging.interceptor)
    implementation(libs.kotlinx.coroutines.android)
    implementation(libs.kotlinx.serialization.converter)
    implementation(libs.kotlinx.serialization)
    implementation(libs.coil)

    // DI
    implementation(libs.hilt.android)
    kapt(libs.hilt.compiler)

    // Firebase
    implementation(platform(libs.firebase.bom))
    implementation(libs.bundles.firebase)

    // Test
    testImplementation(libs.junit)
    testImplementation(libs.turbine)
    testImplementation(libs.mock.android)
    testImplementation(libs.mock.agent)
    testImplementation(libs.truth)
    testImplementation(libs.coroutines.test)
    debugImplementation(libs.compose.ui.tooling)
    debugImplementation(libs.compose.ui.test.manifest)
    // Android Test
    androidTestImplementation(libs.bundles.android.test)
    androidTestImplementation(libs.coroutines.test)
    androidTestImplementation(libs.turbine)

    // Chucker
    debugImplementation(libs.chucker.debug)
    releaseImplementation(libs.chucker.release)

    // Memory Leak Detection
    debugImplementation(libs.leakcanary)

    // In-app update
    implementation(libs.bundles.google.play)

    // About
    implementation(libs.about.lib.core)
    implementation(libs.about.lib.compose.ui)
}

kapt {
    correctErrorTypes = true
}


================================================
FILE: app/google-services.json
================================================
{
  "project_info": {
    "project_number": "610111461146",
    "project_id": "weatherapp-e7fb4",
    "storage_bucket": "weatherapp-e7fb4.appspot.com"
  },
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "1:610111461146:android:93477e9051250424edbea3",
        "android_client_info": {
          "package_name": "com.github.odaridavid.weatherapp"
        }
      },
      "oauth_client": [
        {
          "client_id": "610111461146-na7se6v73h0i76v52d4g53snq48p9vi2.apps.googleusercontent.com",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "AIzaSyAZXonDiplhz8zSQJbC1JT0XiqVmtHbKy0"
        }
      ],
      "services": {
        "appinvite_service": {
          "other_platform_oauth_client": [
            {
              "client_id": "610111461146-na7se6v73h0i76v52d4g53snq48p9vi2.apps.googleusercontent.com",
              "client_type": 3
            }
          ]
        }
      }
    },
    {
      "client_info": {
        "mobilesdk_app_id": "1:610111461146:android:1b766bcb5b1f3602edbea3",
        "android_client_info": {
          "package_name": "com.github.odaridavid.weatherapp.debug"
        }
      },
      "oauth_client": [
        {
          "client_id": "610111461146-na7se6v73h0i76v52d4g53snq48p9vi2.apps.googleusercontent.com",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "AIzaSyAZXonDiplhz8zSQJbC1JT0XiqVmtHbKy0"
        }
      ],
      "services": {
        "appinvite_service": {
          "other_platform_oauth_client": [
            {
              "client_id": "610111461146-na7se6v73h0i76v52d4g53snq48p9vi2.apps.googleusercontent.com",
              "client_type": 3
            }
          ]
        }
      }
    },
    {
      "client_info": {
        "mobilesdk_app_id": "1:610111461146:android:c4a8151c04739b83edbea3",
        "android_client_info": {
          "package_name": "dev.davidodari.weatherupdates"
        }
      },
      "oauth_client": [
        {
          "client_id": "610111461146-na7se6v73h0i76v52d4g53snq48p9vi2.apps.googleusercontent.com",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "AIzaSyAZXonDiplhz8zSQJbC1JT0XiqVmtHbKy0"
        }
      ],
      "services": {
        "appinvite_service": {
          "other_platform_oauth_client": [
            {
              "client_id": "610111461146-na7se6v73h0i76v52d4g53snq48p9vi2.apps.googleusercontent.com",
              "client_type": 3
            }
          ]
        }
      }
    }
  ],
  "configuration_version": "1"
}

================================================
FILE: app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile


================================================
FILE: app/src/androidTest/kotlin/com/github/odaridavid/weatherapp/SettingsRepositoryTest.kt
================================================
package com.github.odaridavid.weatherapp

import android.content.Context
import androidx.test.core.app.ApplicationProvider
import androidx.test.filters.SmallTest
import app.cash.turbine.test
import com.github.odaridavid.weatherapp.api.SettingsRepository
import com.github.odaridavid.weatherapp.data.settings.DefaultSettingsRepository
import com.github.odaridavid.weatherapp.model.DefaultLocation
import com.github.odaridavid.weatherapp.model.ExcludedData
import com.github.odaridavid.weatherapp.model.SupportedLanguage
import com.github.odaridavid.weatherapp.model.TimeFormat
import com.github.odaridavid.weatherapp.model.Units
import kotlinx.coroutines.test.runTest
import org.junit.Before
import org.junit.Test

@SmallTest
class SettingsRepositoryTest {

    // TODO instrumentation test coverage
    private lateinit var settingsRepository: SettingsRepository

    @Before
    fun setup() {
        val context = ApplicationProvider.getApplicationContext<Context>()
        settingsRepository = DefaultSettingsRepository(context)
    }

    @Test
    fun when_we_update_language_then_we_get_the_updated_language() = runTest {
        settingsRepository.setLanguage(SupportedLanguage.FRENCH)
        val language = settingsRepository.getLanguage()
        language.test {
            awaitItem().also { language ->
                assert(language == SupportedLanguage.FRENCH)
            }
        }
    }

    @Test
    fun when_we_update_units_then_we_get_the_updated_units() = runTest {
        settingsRepository.setUnits(Units.IMPERIAL)
        val units = settingsRepository.getUnits()
        units.test {
            awaitItem().also { units ->
                assert(units == Units.IMPERIAL)
            }
        }
    }

    @Test
    fun when_we_update_time_format_then_we_get_the_updated_time_format() = runTest {
        settingsRepository.setFormat(TimeFormat.TWENTY_FOUR_HOUR)
        val timeFormat = settingsRepository.getFormat()
        timeFormat.test {
            awaitItem().also { timeFormat ->
                assert(timeFormat == TimeFormat.TWENTY_FOUR_HOUR)
            }
        }
    }

    @Test
    fun when_we_update_excluded_data_then_we_get_the_updated_excluded_data() = runTest {
        val excludedData = listOf(ExcludedData.MINUTELY, ExcludedData.ALERTS)
        settingsRepository.setExcludedData(excludedData)
        val data = settingsRepository.getExcludedData()
        data.test {
            awaitItem().also { data ->
                assert(data == "minutely,alerts")
            }
        }
    }

    @Test
    fun when_we_update_default_location_then_we_get_the_updated_default_location() = runTest {
        val defaultLocation = DefaultLocation(23.23, 34.12)
        settingsRepository.setDefaultLocation(defaultLocation)
        val location = settingsRepository.getDefaultLocation()
        location.test {
            awaitItem().also { location ->
                assert(location == defaultLocation)
            }
        }
    }
}


================================================
FILE: app/src/debug/res/drawable/ic_launcher_background.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="108dp"
    android:height="108dp"
    android:viewportWidth="108"
    android:viewportHeight="108">
    <path
        android:fillColor="#CD9914"
        android:pathData="M0,0h108v108h-108z" />
    <path
        android:fillColor="#00000000"
        android:pathData="M9,0L9,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,0L19,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M29,0L29,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M39,0L39,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M49,0L49,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M59,0L59,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M69,0L69,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M79,0L79,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M89,0L89,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M99,0L99,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,9L108,9"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,19L108,19"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,29L108,29"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,39L108,39"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,49L108,49"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,59L108,59"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,69L108,69"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,79L108,79"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,89L108,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,99L108,99"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,29L89,29"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,39L89,39"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,49L89,49"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,59L89,59"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,69L89,69"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,79L89,79"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M29,19L29,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M39,19L39,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M49,19L49,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M59,19L59,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M69,19L69,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M79,19L79,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
</vector>


================================================
FILE: app/src/debug/res/drawable-v24/ic_launcher_foreground.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:aapt="http://schemas.android.com/aapt"
    android:width="108dp"
    android:height="108dp"
    android:viewportWidth="108"
    android:viewportHeight="108">
    <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
        <aapt:attr name="android:fillColor">
            <gradient
                android:endX="85.84757"
                android:endY="92.4963"
                android:startX="42.9492"
                android:startY="49.59793"
                android:type="linear">
                <item
                    android:color="#44000000"
                    android:offset="0.0" />
                <item
                    android:color="#00000000"
                    android:offset="1.0" />
            </gradient>
        </aapt:attr>
    </path>
    <path
        android:fillColor="#18879A"
        android:fillType="nonZero"
        android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
        android:strokeWidth="1"
        android:strokeColor="#00000000" />
</vector>


================================================
FILE: app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_launcher_background"/>
    <foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

================================================
FILE: app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_launcher_background"/>
    <foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

================================================
FILE: app/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

    <application
        android:name=".WeatherApp"
        android:allowBackup="true"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.WeatherApp"
        tools:targetApi="31">
        <activity
            android:name=".ui.MainActivity"
            android:exported="true"
            android:theme="@style/Theme.WeatherApp"
            android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

            <meta-data
                android:name="android.app.lib_name"
                android:value="" />
        </activity>
        <!--        TODO Add new activity launcher with different icon for debug stuff-->
    </application>

</manifest>


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/MainViewModel.kt
================================================
package com.github.odaridavid.weatherapp

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.github.odaridavid.weatherapp.api.Logger
import com.github.odaridavid.weatherapp.api.SettingsRepository
import com.github.odaridavid.weatherapp.model.DefaultLocation
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.launch
import javax.inject.Inject

@HiltViewModel
class MainViewModel @Inject constructor(
    private val settingsRepository: SettingsRepository,
    private val logger: Logger
) : ViewModel() {

    private val _state = MutableStateFlow(MainViewState())
    val state: StateFlow<MainViewState> = _state.asStateFlow()

    private val _hasAppUpdate = MutableStateFlow(false)
    val hasAppUpdate: StateFlow<Boolean> = _hasAppUpdate.asStateFlow()

    fun processIntent(mainViewIntent: MainViewIntent) {
        when (mainViewIntent) {
            is MainViewIntent.GrantPermission -> {
                setState { copy(isPermissionGranted = mainViewIntent.isGranted) }
            }

            is MainViewIntent.CheckLocationSettings -> {
                setState { copy(isLocationSettingEnabled = mainViewIntent.isEnabled) }
            }

            is MainViewIntent.ReceiveLocation -> {
                val defaultLocation = DefaultLocation(
                    longitude = mainViewIntent.longitude,
                    latitude = mainViewIntent.latitude
                )
                viewModelScope.launch {
                    settingsRepository.setDefaultLocation(defaultLocation)
                }
                setState { copy(defaultLocation = defaultLocation) }
            }

            is MainViewIntent.LogException -> {
                logger.logException(mainViewIntent.throwable)
            }

            is MainViewIntent.UpdateApp -> {
                viewModelScope.launch {
                    _hasAppUpdate.emit(true)
                }
            }
        }
    }

    private fun setState(stateReducer: MainViewState.() -> MainViewState) {
        viewModelScope.launch {
            _state.emit(stateReducer(state.value))
        }
    }
}

data class MainViewState(
    val isPermissionGranted: Boolean = false,
    val isLocationSettingEnabled: Boolean = false,
    val defaultLocation: DefaultLocation? = DefaultLocation(longitude = 0.0, latitude = 0.0)
)

sealed class MainViewIntent {

    data class GrantPermission(val isGranted: Boolean) : MainViewIntent()

    data class CheckLocationSettings(val isEnabled: Boolean) : MainViewIntent()

    data class ReceiveLocation(val latitude: Double, val longitude: Double) : MainViewIntent()

    data class LogException(val throwable: Throwable) : MainViewIntent()

    data object UpdateApp : MainViewIntent()
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/WeatherApp.kt
================================================
package com.github.odaridavid.weatherapp

import android.app.Application
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class WeatherApp : Application()
// TODO Add global error handling
// TODO Timber logging.


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/common/AndroidExtensions.kt
================================================
package com.github.odaridavid.weatherapp.common

import android.Manifest
import android.app.Activity
import android.content.Context
import android.content.pm.PackageManager
import android.location.Address
import android.location.Geocoder
import android.os.Build
import androidx.activity.result.ActivityResultLauncher
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.core.content.ContextCompat
import com.github.odaridavid.weatherapp.designsystem.organism.PermissionRationaleDialog
import java.util.Locale

private const val NO_OF_ADDRESSES = 1
fun Context.getCityName(longitude: Double, latitude: Double, onAddressReceived: (Address) -> Unit) {
    val geoCoder = Geocoder(this, Locale.getDefault())

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
        geoCoder.getFromLocation(latitude, longitude, NO_OF_ADDRESSES) { addresses ->
            if (addresses.isNotEmpty()) {
                 onAddressReceived(addresses[0])
            }
        }
    } else {
        try {
            val addresses = geoCoder.getFromLocation(latitude, longitude, NO_OF_ADDRESSES)
            if (addresses?.isNotEmpty() == true) {
                  onAddressReceived(addresses[0])
            }
        } catch (e: Exception) {
            e.printStackTrace()
        }
    }
}

@Composable
fun Activity.OnPermissionDenied(
    activityPermissionResult: ActivityResultLauncher<String>,
) {
    val showWeatherUI = remember { mutableStateOf(false) }
    if (shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_COARSE_LOCATION)) {
        val isDialogShown = remember { mutableStateOf(true) }
        if (isDialogShown.value) {
            PermissionRationaleDialog(
                isDialogShown,
                activityPermissionResult,
                showWeatherUI
            )
        }
    } else {
        activityPermissionResult.launch(Manifest.permission.ACCESS_COARSE_LOCATION)
    }
}

@Composable
fun Context.CheckForPermissions(
    onPermissionGranted: @Composable () -> Unit,
    onPermissionDenied: @Composable () -> Unit
) {
    when (ContextCompat.checkSelfPermission(
        this,
        Manifest.permission.ACCESS_COARSE_LOCATION
    )) {
        PackageManager.PERMISSION_GRANTED -> {
            onPermissionGranted()
        }
        PackageManager.PERMISSION_DENIED -> {
            onPermissionDenied()
        }
    }
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/common/LocationRequest.kt
================================================
package com.github.odaridavid.weatherapp.common

import android.app.Activity
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.IntentSenderRequest
import com.google.android.gms.common.api.ApiException
import com.google.android.gms.common.api.ResolvableApiException
import com.google.android.gms.location.*
import com.google.android.gms.tasks.Task

fun createLocationRequest(
    activity: Activity,
    locationRequestLauncher: ActivityResultLauncher<IntentSenderRequest>,
    onLocationRequestSuccessful: () -> Unit
) {
    val locationRequest = LocationRequest.Builder(30_000L)
        .setPriority(Priority.PRIORITY_BALANCED_POWER_ACCURACY)
        .build()

    val locationSettingsRequest = LocationSettingsRequest.Builder()
        .addLocationRequest(locationRequest)

    val task: Task<LocationSettingsResponse> =
        LocationServices.getSettingsClient(activity)
            .checkLocationSettings(locationSettingsRequest.build())

    task.addOnCompleteListener { response ->
        try {
            val result = response.getResult(ApiException::class.java)
            val hasLocationAccess = result.locationSettingsStates?.isLocationUsable == true
            if (hasLocationAccess) {
                onLocationRequestSuccessful()
            }
        } catch (exception: ApiException) {
            when (exception.statusCode) {
                LocationSettingsStatusCodes.RESOLUTION_REQUIRED -> {
                    val resolvable = exception as ResolvableApiException
                    val intentSender =
                        IntentSenderRequest.Builder(resolvable.resolution).build()
                    locationRequestLauncher.launch(intentSender)
                }
                LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE -> {
                    // Do nothing, location settings can't be changed
                }
            }
        }
    }
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/data/Extensions.kt
================================================
package com.github.odaridavid.weatherapp.data

import android.content.Context
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.preferencesDataStore

val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = "settings")


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/data/settings/DefaultSettingsRepository.kt
================================================
package com.github.odaridavid.weatherapp.data.settings

import android.content.Context
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.core.edit
import androidx.datastore.preferences.core.stringPreferencesKey
import com.github.odaridavid.weatherapp.BuildConfig
import com.github.odaridavid.weatherapp.api.SettingsRepository
import com.github.odaridavid.weatherapp.data.dataStore
import com.github.odaridavid.weatherapp.model.DefaultLocation
import com.github.odaridavid.weatherapp.model.ExcludedData
import com.github.odaridavid.weatherapp.model.SupportedLanguage
import com.github.odaridavid.weatherapp.model.TimeFormat
import com.github.odaridavid.weatherapp.model.Units
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
import javax.inject.Inject

class DefaultSettingsRepository @Inject constructor(
    @ApplicationContext private val context: Context
) : SettingsRepository {

    private val prefLanguage by lazy { stringPreferencesKey(KEY_LANGUAGE) }
    private val prefUnits by lazy { stringPreferencesKey(KEY_UNITS) }
    private val prefTimeFormat by lazy { stringPreferencesKey(KEY_TIME_FORMAT) }
    private val prefLatLng by lazy { stringPreferencesKey(KEY_LAT_LNG) }
    private val prefExcludedData by lazy { stringPreferencesKey(KEY_EXCLUDED_DATA) }

    override suspend fun setLanguage(language: SupportedLanguage) {
        set(key = prefLanguage, value = language.name)
    }

    override suspend fun getLanguage(): Flow<SupportedLanguage> {
        return get(key = prefLanguage, default = SupportedLanguage.ENGLISH.name).map {
            SupportedLanguage.valueOf(it)
        }
    }

    override suspend fun setUnits(units: Units) {
        set(key = prefUnits, value = units.name)
    }

    override suspend fun getUnits(): Flow<Units> {
        return get(key = prefUnits, default = Units.METRIC.name).map {
            Units.valueOf(it)
        }
    }

    override fun getAppVersion(): String =
        "Version : ${BuildConfig.VERSION_NAME}-${BuildConfig.BUILD_TYPE}"

    override suspend fun setDefaultLocation(defaultLocation: DefaultLocation) {
        set(key = prefLatLng, value = "${defaultLocation.latitude}/${defaultLocation.longitude}")
    }

    override suspend fun getDefaultLocation(): Flow<DefaultLocation> {
        return get(
            key = prefLatLng,
            default = "$DEFAULT_LATITUDE/$DEFAULT_LONGITUDE"
        ).map { latlng ->
            val latLngList = latlng.split("/").map { it.toDouble() }
            DefaultLocation(latitude = latLngList[0], longitude = latLngList[1])
        }
    }

    override suspend fun getFormat(): Flow<TimeFormat> {
        return get(key = prefTimeFormat, default = TimeFormat.TWENTY_FOUR_HOUR.name).map {
            TimeFormat.valueOf(it)
        }
    }

    override suspend fun setFormat(format: TimeFormat) {
        set(key = prefTimeFormat, value = format.name)
    }

    // TODO Refactor to flow of list of excluded data
    override suspend fun getExcludedData(): Flow<String> = get(
        key = prefExcludedData,
        default = "${ExcludedData.MINUTELY.value},${ExcludedData.ALERTS.value}"
    )

    override suspend fun setExcludedData(excludedData: List<ExcludedData>) {
        val formattedData = excludedData.joinToString(separator = ",") { it.value }
        set(key = prefExcludedData, value = formattedData)
    }

    private suspend fun <T> set(key: Preferences.Key<T>, value: T) {
        context.dataStore.edit { settings ->
            settings[key] = value
        }
    }

    private fun <T> get(key: Preferences.Key<T>, default: T): Flow<T> {
        return context.dataStore.data.map { settings ->
            settings[key] ?: default
        }
    }

    companion object {
        // Düsseldorf
        const val DEFAULT_LONGITUDE = 6.773456
        const val DEFAULT_LATITUDE = 51.227741

        const val KEY_LANGUAGE = "language"
        const val KEY_UNITS = "units"
        const val KEY_LAT_LNG = "lat_lng"
        const val KEY_TIME_FORMAT = "time_formats"
        const val KEY_EXCLUDED_DATA = "excluded_data"
    }
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/data/weather/DefaultWeatherRepository.kt
================================================
package com.github.odaridavid.weatherapp.data.weather

import com.github.odaridavid.weatherapp.api.Logger
import com.github.odaridavid.weatherapp.api.SettingsRepository
import com.github.odaridavid.weatherapp.api.WeatherRepository
import com.github.odaridavid.weatherapp.data.weather.remote.RemoteWeatherDataSource
import com.github.odaridavid.weatherapp.data.weather.remote.mapThrowableToErrorType
import com.github.odaridavid.weatherapp.model.DefaultLocation
import com.github.odaridavid.weatherapp.model.ExcludedData
import com.github.odaridavid.weatherapp.model.Result
import com.github.odaridavid.weatherapp.model.Result.Error
import com.github.odaridavid.weatherapp.model.Weather
import kotlinx.coroutines.flow.first
import javax.inject.Inject

class DefaultWeatherRepository @Inject constructor(
    private val remoteWeatherDataSource: RemoteWeatherDataSource,
    private val logger: Logger,
    private val settingsRepository: SettingsRepository,
) : WeatherRepository {

    override suspend fun fetchWeatherData(
        defaultLocation: DefaultLocation,
        language: String,
        units: String,
    ): Result<Weather> =
        try {
            val format = settingsRepository.getFormat().first().value

            val excludedData = settingsRepository
                .getExcludedData()
                .first()
                .replace(ExcludedData.NONE.value, "")

            remoteWeatherDataSource.fetchWeatherData(
                defaultLocation = defaultLocation,
                units = units,
                language = language,
                format = format,
                excludedData = excludedData
            )
        } catch (throwable: Throwable) {
            val errorType = mapThrowableToErrorType(throwable)
            logger.logException(throwable)
            Error(errorType)
        }
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/data/weather/FirebaseLogger.kt
================================================
package com.github.odaridavid.weatherapp.data.weather

import com.github.odaridavid.weatherapp.api.Logger
import com.google.firebase.crashlytics.ktx.crashlytics
import com.google.firebase.ktx.Firebase
import javax.inject.Inject

class FirebaseLogger @Inject constructor() : Logger {
    override fun logException(throwable: Throwable) {
        Firebase.crashlytics.recordException(throwable)
    }
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/data/weather/remote/DefaultRemoteWeatherDataSource.kt
================================================
package com.github.odaridavid.weatherapp.data.weather.remote

import com.github.odaridavid.weatherapp.BuildConfig
import com.github.odaridavid.weatherapp.model.DefaultLocation
import com.github.odaridavid.weatherapp.model.Result
import com.github.odaridavid.weatherapp.model.Weather
import javax.inject.Inject

class DefaultRemoteWeatherDataSource @Inject constructor(
    private val openWeatherService: OpenWeatherService,
) : RemoteWeatherDataSource {

    override suspend fun fetchWeatherData(
        defaultLocation: DefaultLocation,
        language: String,
        units: String,
        format: String,
        excludedData: String,
    ): Result<Weather> =
        try {

            val response = openWeatherService.getWeatherData(
                longitude = defaultLocation.longitude,
                latitude = defaultLocation.latitude,
                excludedInfo = excludedData,
                units = units,
                language = language,
                appid = BuildConfig.OPEN_WEATHER_API_KEY,
            )

            if (response.isSuccessful && response.body() != null) {
                val weatherData = response.body()!!.toCoreModel(unit = units, format = format)
                Result.Success(data = weatherData)
            } else {
                val throwable = mapResponseCodeToThrowable(response.code())
                throw throwable
            }
        } catch (e: Exception) {
            throw e
        }
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/data/weather/remote/Mappers.kt
================================================
package com.github.odaridavid.weatherapp.data.weather.remote

import com.github.odaridavid.weatherapp.BuildConfig
import com.github.odaridavid.weatherapp.model.ClientException
import com.github.odaridavid.weatherapp.model.CurrentWeather
import com.github.odaridavid.weatherapp.model.DailyWeather
import com.github.odaridavid.weatherapp.model.ErrorType
import com.github.odaridavid.weatherapp.model.GenericException
import com.github.odaridavid.weatherapp.model.HourlyWeather
import com.github.odaridavid.weatherapp.model.ServerException
import com.github.odaridavid.weatherapp.model.Temperature
import com.github.odaridavid.weatherapp.model.TimeFormat
import com.github.odaridavid.weatherapp.model.Units
import com.github.odaridavid.weatherapp.model.Weather
import com.github.odaridavid.weatherapp.model.WeatherInfo
import java.io.IOException
import java.net.HttpURLConnection
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
import kotlin.math.roundToInt

fun WeatherResponse.toCoreModel(unit: String, format: String): Weather = Weather(
    current = current?.toCoreModel(unit = unit),
    daily = daily?.map { it.toCoreModel(unit = unit) },
    hourly = hourly?.map { it.toCoreModel(unit = unit, format = format) }
)

fun CurrentWeatherResponse.toCoreModel(unit: String): CurrentWeather =
    CurrentWeather(
        temperature = formatTemperatureValue(temperature, unit),
        feelsLike = formatTemperatureValue(feelsLike, unit),
        weather = weather.map { it.toCoreModel() }
    )

fun DailyWeatherResponse.toCoreModel(unit: String): DailyWeather =
    DailyWeather(
        forecastedTime = getDate(forecastedTime, "EEEE dd/M"),
        temperature = temperature.toCoreModel(unit = unit),
        weather = weather.map { it.toCoreModel() }
    )

fun HourlyWeatherResponse.toCoreModel(unit: String, format: String): HourlyWeather {
    val formatPattern = when (format) {
        TimeFormat.TWELVE_HOUR.value -> "h:mm a"
        TimeFormat.TWENTY_FOUR_HOUR.value -> "HH:SS"
        else -> "HH:SS"
    }
    return HourlyWeather(
        forecastedTime = getDate(forecastedTime, formatPattern),
        temperature = formatTemperatureValue(temperature, unit),
        weather = weather.map { it.toCoreModel() }
    )
}

fun WeatherInfoResponse.toCoreModel(): WeatherInfo =
    WeatherInfo(
        id = id,
        main = main,
        description = description,
        icon = "${BuildConfig.OPEN_WEATHER_ICONS_URL}$icon@2x.png"
    )

fun TemperatureResponse.toCoreModel(unit: String): Temperature =
    Temperature(
        min = formatTemperatureValue(min, unit),
        max = formatTemperatureValue(max, unit)
    )

private fun formatTemperatureValue(temperature: Float, unit: String): String =
    "${temperature.roundToInt()}${getUnitSymbols(unit = unit)}"

private fun getUnitSymbols(unit: String) = when (unit) {
    Units.METRIC.value -> Units.METRIC.tempLabel
    Units.IMPERIAL.value -> Units.IMPERIAL.tempLabel
    Units.STANDARD.value -> Units.STANDARD.tempLabel
    else -> "N/A"
}

private fun getDate(utcInMillis: Long, formatPattern: String): String {
    // TODO use locale from supported languages
    val sdf = SimpleDateFormat(formatPattern, Locale.ENGLISH)
    val dateFormat = Date(utcInMillis * 1000)
    return sdf.format(dateFormat)
}

fun mapResponseCodeToThrowable(code: Int): Throwable = when (code) {
    HttpURLConnection.HTTP_BAD_REQUEST -> ClientException("Bad request : $code: Check request parameters")
    HttpURLConnection.HTTP_UNAUTHORIZED -> ClientException("Unauthorized access : $code: Check API Token")
    HttpURLConnection.HTTP_NOT_FOUND -> ClientException("Resource not found : $code: Check parameters")
    TOO_MANY_REQUESTS -> ClientException("Too many requests : $code: Rate limit exceeded")
    in CLIENT_ERRORS -> ClientException("Client error : $code")
    in SERVER_ERRORS -> ServerException("Server error : $code")
    else -> GenericException("Generic error : $code")
}

fun mapThrowableToErrorType(throwable: Throwable): ErrorType {
    val errorType = when (throwable) {
        is IOException -> ErrorType.IO_CONNECTION
        is ClientException -> ErrorType.CLIENT
        is ServerException -> ErrorType.SERVER
        else -> ErrorType.GENERIC
    }
    return errorType
}

private val SERVER_ERRORS = 500..600
private val CLIENT_ERRORS = 400..499
private const val TOO_MANY_REQUESTS = 429


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/data/weather/remote/OpenWeatherService.kt
================================================
package com.github.odaridavid.weatherapp.data.weather.remote

import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Query

interface OpenWeatherService {

    @GET("/data/3.0/onecall")
    suspend fun getWeatherData(
        @Query("lat") latitude: Double,
        @Query("lon") longitude: Double,
        @Query("appid") appid: String,
        @Query("exclude") excludedInfo: String,
        @Query("units") units: String,
        @Query("lang") language: String
    ): Response<WeatherResponse>

}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/data/weather/remote/RemoteWeatherDataSource.kt
================================================
package com.github.odaridavid.weatherapp.data.weather.remote

import com.github.odaridavid.weatherapp.model.DefaultLocation
import com.github.odaridavid.weatherapp.model.Result
import com.github.odaridavid.weatherapp.model.Weather

interface RemoteWeatherDataSource {

    suspend fun fetchWeatherData(
        defaultLocation: DefaultLocation,
        language: String,
        units: String,
        format: String,
        excludedData: String
    ): Result<Weather>
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/data/weather/remote/WeatherResponse.kt
================================================
package com.github.odaridavid.weatherapp.data.weather.remote

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class WeatherResponse(
    @SerialName("current") val current: CurrentWeatherResponse? = null,
    @SerialName("hourly") val hourly: List<HourlyWeatherResponse>? = null,
    @SerialName("daily") val daily: List<DailyWeatherResponse>? = null,
)

@Serializable
data class CurrentWeatherResponse(
    @SerialName("temp") val temperature: Float,
    @SerialName("feels_like") val feelsLike: Float,
    @SerialName("weather") val weather: List<WeatherInfoResponse>
)

@Serializable
data class HourlyWeatherResponse(
    @SerialName("dt") val forecastedTime: Long,
    @SerialName("temp") val temperature: Float,
    @SerialName("weather") val weather: List<WeatherInfoResponse>
)

@Serializable
data class DailyWeatherResponse(
    @SerialName("dt") val forecastedTime: Long,
    @SerialName("temp") val temperature: TemperatureResponse,
    @SerialName("weather") val weather: List<WeatherInfoResponse>
)

@Serializable
data class WeatherInfoResponse(
    val id: Int,
    val main: String,
    val description: String,
    val icon: String
)

@Serializable
data class TemperatureResponse(
    @SerialName("min") val min: Float,
    @SerialName("max") val max: Float,
)


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/designsystem/Theme.kt
================================================
package com.github.odaridavid.weatherapp.designsystem

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import com.github.odaridavid.weatherapp.designsystem.atom.DarkColorPalette
import com.github.odaridavid.weatherapp.designsystem.atom.Dimensions
import com.github.odaridavid.weatherapp.designsystem.atom.LightColorPalette
import com.github.odaridavid.weatherapp.designsystem.atom.LocalDimens
import com.github.odaridavid.weatherapp.designsystem.atom.LocalWeight
import com.github.odaridavid.weatherapp.designsystem.atom.Weight
import com.github.odaridavid.weatherapp.designsystem.atom.shapes
import com.github.odaridavid.weatherapp.designsystem.atom.typography

// TODO Debug menu or app to preview design system components
@Composable
fun WeatherAppTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) {
    val colors = if (darkTheme) {
        DarkColorPalette
    } else {
        LightColorPalette
    }

    MaterialTheme(
        colorScheme = colors,
        typography = typography,
        shapes = shapes,
        content = content
    )
}

object WeatherAppTheme {
    val dimens: Dimensions
        @Composable
        get() = LocalDimens.current

    val weight: Weight
        @Composable
        get() = LocalWeight.current
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/designsystem/atom/Color.kt
================================================
package com.github.odaridavid.weatherapp.designsystem.atom

import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.ui.graphics.Color

// TODO Expand color range
val pink50 = Color(0xffffE9F7)
val pink200 = Color(0xffff7597)
val pinkA200 = Color(0xffff3886)
val pink500 = Color(0xffff0266)
val pink600 = Color(0xffd8004d)
val black = Color(0xff24191c)
val darkBlue = Color(0xff1976D2)
val blue500 = Color(0xff448aff)
val blue200 = Color(0xff92Aeff)
val lightBlue = Color(0xffbbdefb)
val grey = Color(0xff757575)
val lightGrey = Color(0xffBDBDBD)
val white = Color(0xffffffff)

val LightColorPalette = lightColorScheme(
    primary = pink500,
    secondary = blue500,
    onPrimary = pink50,
    onSecondary = black,
    primaryContainer = pink200,
    onPrimaryContainer = black,
    secondaryContainer = blue200,
    onSecondaryContainer = black,
    surface = white
)

val DarkColorPalette = darkColorScheme(
    primary = blue500,
    secondary = pinkA200,
    surface = black,
    onPrimary = black,
    onSecondary = white,
    primaryContainer = blue200,
    onPrimaryContainer = black,
    secondaryContainer = pink200,
    onSecondaryContainer = black
)


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/designsystem/atom/Dimensions.kt
================================================
package com.github.odaridavid.weatherapp.designsystem.atom

import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.unit.dp

object Dimensions {
    val none = 0.dp
    val extraSmall = 4.dp
    val small = 8.dp
    val medium = 16.dp
    val large = 24.dp
    val extraLarge = 32.dp
}

object Weight {
    const val NONE = 0f
    const val HALF = 0.5f
    const val FULL = 1f
}

val LocalDimens = staticCompositionLocalOf { Dimensions }
val LocalWeight = staticCompositionLocalOf { Weight }


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/designsystem/atom/Shape.kt
================================================
package com.github.odaridavid.weatherapp.designsystem.atom

import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Shapes
import androidx.compose.ui.unit.dp

val shapes = Shapes(
    extraSmall = RoundedCornerShape(4.dp),
    small = RoundedCornerShape(8.dp),
    medium = RoundedCornerShape(size = 0f),
    large = RoundedCornerShape(
        topStart = 16.dp,
        topEnd = 0.dp,
        bottomEnd = 0.dp,
        bottomStart = 16.dp
    )
)


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/designsystem/atom/Type.kt
================================================
package com.github.odaridavid.weatherapp.designsystem.atom

import androidx.compose.material3.Typography
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.LineHeightStyle
import androidx.compose.ui.text.style.LineHeightStyle.Alignment
import androidx.compose.ui.text.style.LineHeightStyle.Trim
import androidx.compose.ui.unit.sp
import com.github.odaridavid.weatherapp.R

private val fonts = FontFamily(
    Font(R.font.rubik_regular),
    Font(R.font.rubik_medium, FontWeight.W500),
    Font(R.font.rubik_bold, FontWeight.Bold)
)

// typography adapted from NIA Design System, to be improved and tweaked later.
val typography = typographyFromDefaults(
    displayLarge = TextStyle(
        fontFamily = fonts,
        fontWeight = FontWeight.Bold,
        fontSize = 64.sp,
        lineHeight = 64.sp,
        letterSpacing = (-0.25).sp,
    ),
    displayMedium = TextStyle(
        fontFamily = fonts,
        fontWeight = FontWeight.Bold,
        fontSize = 48.sp,
        lineHeight = 52.sp,
        letterSpacing = 0.sp,
    ),
    displaySmall = TextStyle(
        fontFamily = fonts,
        fontWeight = FontWeight.Normal,
        fontSize = 36.sp,
        lineHeight = 44.sp,
        letterSpacing = 0.sp,
    ),
    headlineLarge = TextStyle(
        fontFamily = fonts,
        fontWeight = FontWeight.Normal,
        fontSize = 32.sp,
        lineHeight = 40.sp,
        letterSpacing = 0.sp,
    ),
    headlineMedium = TextStyle(
        fontFamily = fonts,
        fontWeight = FontWeight.Normal,
        fontSize = 28.sp,
        lineHeight = 36.sp,
        letterSpacing = 0.sp,
    ),
    headlineSmall = TextStyle(
        fontFamily = fonts,
        fontWeight = FontWeight.Normal,
        fontSize = 24.sp,
        lineHeight = 32.sp,
        letterSpacing = 0.sp,
        lineHeightStyle = LineHeightStyle(
            alignment = Alignment.Bottom,
            trim = Trim.None,
        ),
    ),
    titleLarge = TextStyle(
        fontFamily = fonts,
        fontWeight = FontWeight.Bold,
        fontSize = 22.sp,
        lineHeight = 28.sp,
        letterSpacing = 0.sp,
        lineHeightStyle = LineHeightStyle(
            alignment = Alignment.Bottom,
            trim = Trim.LastLineBottom,
        ),
    ),
    titleMedium = TextStyle(
        fontFamily = fonts,
        fontWeight = FontWeight.Bold,
        fontSize = 18.sp,
        lineHeight = 24.sp,
        letterSpacing = 0.1.sp,
    ),
    titleSmall = TextStyle(
        fontFamily = fonts,
        fontWeight = FontWeight.Medium,
        fontSize = 14.sp,
        lineHeight = 20.sp,
        letterSpacing = 0.1.sp,
    ),
    // Default text style
    bodyLarge = TextStyle(
        fontFamily = fonts,
        fontWeight = FontWeight.Normal,
        fontSize = 16.sp,
        lineHeight = 24.sp,
        letterSpacing = 0.5.sp,
        lineHeightStyle = LineHeightStyle(
            alignment = Alignment.Center,
            trim = Trim.None,
        ),
    ),
    bodyMedium = TextStyle(
        fontFamily = fonts,
        fontWeight = FontWeight.Normal,
        fontSize = 14.sp,
        lineHeight = 20.sp,
        letterSpacing = 0.25.sp,
    ),
    bodySmall = TextStyle(
        fontFamily = fonts,
        fontWeight = FontWeight.Normal,
        fontSize = 12.sp,
        lineHeight = 16.sp,
        letterSpacing = 0.4.sp,
    ),
    labelLarge = TextStyle(
        fontFamily = fonts,
        fontWeight = FontWeight.Medium,
        fontSize = 14.sp,
        lineHeight = 20.sp,
        letterSpacing = 0.1.sp,
        lineHeightStyle = LineHeightStyle(
            alignment = Alignment.Center,
            trim = Trim.LastLineBottom,
        ),
    ),
    labelMedium = TextStyle(
        fontFamily = fonts,
        fontWeight = FontWeight.Medium,
        fontSize = 12.sp,
        lineHeight = 16.sp,
        letterSpacing = 0.5.sp,
        lineHeightStyle = LineHeightStyle(
            alignment = Alignment.Center,
            trim = Trim.LastLineBottom,
        ),
    ),
    labelSmall = TextStyle(
        fontFamily = fonts,
        fontWeight = FontWeight.Medium,
        fontSize = 10.sp,
        lineHeight = 14.sp,
        letterSpacing = 0.sp,
        lineHeightStyle = LineHeightStyle(
            alignment = Alignment.Center,
            trim = Trim.LastLineBottom,
        ),
    ),
)

fun typographyFromDefaults(
    displayLarge: TextStyle?,
    displayMedium: TextStyle?,
    displaySmall: TextStyle?,
    headlineLarge: TextStyle?,
    headlineMedium: TextStyle?,
    headlineSmall: TextStyle?,
    titleLarge: TextStyle?,
    titleMedium: TextStyle?,
    titleSmall: TextStyle?,
    bodyLarge: TextStyle?,
    bodyMedium: TextStyle?,
    bodySmall: TextStyle?,
    labelLarge: TextStyle?,
    labelMedium: TextStyle?,
    labelSmall: TextStyle?,
): Typography {
    val defaults = Typography()
    return Typography(
        displayLarge = defaults.displayLarge.merge(displayLarge),
        displayMedium = defaults.displayMedium.merge(displayMedium),
        displaySmall = defaults.displaySmall.merge(displaySmall),
        headlineLarge = defaults.headlineLarge.merge(headlineLarge),
        headlineMedium = defaults.headlineMedium.merge(headlineMedium),
        headlineSmall = defaults.headlineSmall.merge(headlineSmall),
        titleLarge = defaults.titleLarge.merge(titleLarge),
        titleMedium = defaults.titleMedium.merge(titleMedium),
        titleSmall = defaults.titleSmall.merge(titleSmall),
        bodyLarge = defaults.bodyLarge.merge(bodyLarge),
        bodyMedium = defaults.bodyMedium.merge(bodyMedium),
        bodySmall = defaults.bodySmall.merge(bodySmall),
        labelLarge = defaults.labelLarge.merge(labelLarge),
        labelMedium = defaults.labelMedium.merge(labelMedium),
        labelSmall = defaults.labelSmall.merge(labelSmall)
    )
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/designsystem/molecule/Buttons.kt
================================================
package com.github.odaridavid.weatherapp.designsystem.molecule

import androidx.compose.foundation.background
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier

@Composable
fun PositiveButton(
    text: String,
    modifier: Modifier = Modifier,
    onClick: () -> Unit
) {
    Button(
        modifier = modifier.background(
            color = MaterialTheme.colorScheme.primaryContainer,
            shape = MaterialTheme.shapes.small
        ),
        onClick = {
            onClick()
        },
        colors = ButtonDefaults.buttonColors(
            containerColor = MaterialTheme.colorScheme.primaryContainer,
            contentColor = MaterialTheme.colorScheme.onPrimaryContainer
        )
    ) {
        LargeLabel(text = text)
    }
}

@Composable
fun NegativeButton(
    text: String,
    modifier: Modifier = Modifier,
    onClick: () -> Unit
) {
    Button(
        modifier = modifier.background(
            color = MaterialTheme.colorScheme.secondaryContainer,
            shape = MaterialTheme.shapes.small
        ),
        onClick = {
            onClick()
        },
        colors = ButtonDefaults.buttonColors(
            containerColor = MaterialTheme.colorScheme.secondaryContainer,
            contentColor = MaterialTheme.colorScheme.onSecondaryContainer
        )
    ) {
        LargeLabel(text = text)
    }
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/designsystem/molecule/Image.kt
================================================
package com.github.odaridavid.weatherapp.designsystem.molecule

import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage

// todo check with 48
private val ICON_SIZE = 40.dp

@Composable
fun RemoteImage(
    url: String,
    contentDescription: String,
    modifier: Modifier = Modifier
) {
    AsyncImage(
        model = url,
        contentDescription = contentDescription,
        modifier = modifier,
    )
}

@Composable
fun ActionIcon(
    painter: Painter,
    contentDescription: String,
    modifier: Modifier = Modifier,
    onClicked: () -> Unit
) {
    Image(
        painter = painter,
        contentDescription = contentDescription,
        modifier = modifier
            .defaultMinSize(ICON_SIZE)
            .clickable { onClicked() }
    )
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/designsystem/molecule/Text.kt
================================================
package com.github.odaridavid.weatherapp.designsystem.molecule

import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign

@Composable
fun LargeDisplay(text: String, modifier: Modifier = Modifier) {
    Text(
        text = text,
        modifier = modifier,
        style = MaterialTheme.typography.displayLarge
    )
}

@Composable
fun MediumDisplay(text: String, modifier: Modifier = Modifier) {
    Text(
        text = text,
        modifier = modifier,
        style = MaterialTheme.typography.displayMedium
    )
}

@Composable
fun SmallDisplay(text: String, modifier: Modifier = Modifier) {
    Text(
        text = text,
        modifier = modifier,
        style = MaterialTheme.typography.displaySmall
    )
}

@Composable
fun LargeLabel(
    text: String,
    modifier: Modifier = Modifier,
    color: Color = Color.Unspecified,
    fontWeight: FontWeight = FontWeight.Medium
) {
    Text(
        text = text,
        style = MaterialTheme.typography.labelLarge.copy(fontWeight = fontWeight),
        modifier = modifier,
        color = color
    )
}

@Composable
fun MediumLabel(
    text: String,
    modifier: Modifier = Modifier,
    color: Color = Color.Unspecified,
    textAlign: TextAlign = TextAlign.Start
) {
    Text(
        text = text,
        style = MaterialTheme.typography.labelMedium,
        modifier = modifier,
        color = color,
        textAlign = textAlign
    )
}

@Composable
fun MediumHeadline(
    text: String,
    modifier: Modifier = Modifier,
    color: Color = Color.Unspecified,
    textAlign: TextAlign? = null,
) {
    Text(
        text = text,
        style = MaterialTheme.typography.headlineMedium.copy(fontWeight = FontWeight.Bold),
        color = color,
        modifier = modifier,
        textAlign = textAlign,
    )
}

@Composable
fun SmallHeadline(
    text: String,
    modifier: Modifier = Modifier,
) {
    Text(
        text = text,
        style = MaterialTheme.typography.headlineSmall.copy(fontWeight = FontWeight.Bold),
        modifier = modifier,
    )
}

@Composable
fun LargeBody(
    text: String,
    modifier: Modifier = Modifier,
) {
    Text(
        text = text,
        style = MaterialTheme.typography.bodyLarge,
        modifier = modifier,
    )
}

@Composable
fun SmallBody(
    text: String,
    modifier: Modifier = Modifier,
) {
    Text(
        text = text,
        style = MaterialTheme.typography.bodySmall,
        modifier = modifier,
    )
}

@Composable
fun MediumBody(
    text: String,
    modifier: Modifier = Modifier,
    color: Color = Color.Unspecified,
    textAlign: TextAlign? = null,
) {
    Text(
        text = text,
        style = MaterialTheme.typography.bodyMedium,
        color = color,
        modifier = modifier,
        textAlign = textAlign
    )
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/designsystem/organism/BottomSheets.kt
================================================
package com.github.odaridavid.weatherapp.designsystem.organism

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material3.Checkbox
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ModalBottomSheet
import androidx.compose.material3.RadioButton
import androidx.compose.material3.SheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.snapshots.SnapshotStateList
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import com.github.odaridavid.weatherapp.R
import com.github.odaridavid.weatherapp.designsystem.WeatherAppTheme
import com.github.odaridavid.weatherapp.designsystem.molecule.MediumBody
import com.github.odaridavid.weatherapp.designsystem.molecule.PositiveButton
import com.github.odaridavid.weatherapp.designsystem.molecule.SmallHeadline
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch

// todo reuse some logic for single select and multi select
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun MultiSelectBottomSheet(
    title: String,
    items: List<BottomSheetItem>,
    selectedItems: List<BottomSheetItem>,
    sheetState: SheetState,
    onSaveState: (List<BottomSheetItem>) -> Unit,
    onDismiss: (() -> Unit)? = null,
) {
    val scope = rememberCoroutineScope()
    ModalBottomSheet(
        onDismissRequest = {
            scope.launch {
                sheetState.hide()
            }
            if (onDismiss != null) {
                onDismiss()
            }
        },
        sheetState = sheetState,
//        windowInsets = WindowInsets.navigationBars,
    ) {
        Column(
            modifier = Modifier
                .fillMaxWidth()
        ) {
            SmallHeadline(
                text = title,
                modifier = Modifier.padding(
                    vertical = WeatherAppTheme.dimens.small,
                    horizontal = WeatherAppTheme.dimens.medium
                )
            )
            val selectedItemsState =
                remember { mutableStateListOf(*selectedItems.toTypedArray()) }

            LazyColumn() {
                items(items) { item ->
                    Row {
                        Checkbox(
                            checked = selectedItemsState.count { it.id == item.id } > 0,
                            onCheckedChange = { isSelected ->
                                if (isSelected) {
                                    if (item.id == NONE_ID) selectedItemsState.clear()
                                    // TODO use removeIf once min sdk is 24
                                    else selectedItemsState.removeAll { it.id == NONE_ID }

                                    selectedItemsState.add(item.copy(isSelected = true))
                                } else {
                                    selectedItemsState.removeAll { it.id == item.id }
                                }
                            }
                        )
                        MediumBody(
                            text = item.name,
                            modifier = Modifier.padding(
                                horizontal = WeatherAppTheme.dimens.small,
                                vertical = WeatherAppTheme.dimens.medium
                            )
                        )
                    }
                }
            }
            MultiSelectSaveButtonSection(
                sheetState = sheetState,
                coroutineScope = scope,
                onSaveState = onSaveState,
                selectedItemsState = selectedItemsState,
            )
        }
    }
}

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun SingleSelectBottomSheet(
    title: String,
    items: List<BottomSheetItem>,
    selectedItem: BottomSheetItem,
    sheetState: SheetState,
    onSaveState: (BottomSheetItem) -> Unit,
    onDismiss: (() -> Unit)? = null,
) {
    val scope = rememberCoroutineScope()
    ModalBottomSheet(
        onDismissRequest = {
            scope.launch {
                sheetState.hide()
            }
            if (onDismiss != null) {
                onDismiss()
            }
        },
        sheetState = sheetState,
//        windowInsets = WindowInsets.navigationBars,
    ) {
        Column(
            modifier = Modifier.fillMaxWidth()
        ) {
            SmallHeadline(
                text = title,
                modifier = Modifier.padding(
                    vertical = WeatherAppTheme.dimens.small,
                    horizontal = WeatherAppTheme.dimens.medium
                )
            )

            val selectedItemsState = remember { mutableStateOf(selectedItem) }
            LazyColumn(Modifier.weight(1f, false)) {
                items(items) { item ->
                    Row {
                        RadioButton(
                            selected = selectedItemsState.value.id == item.id,
                            onClick = {
                                selectedItemsState.value = item.copy(isSelected = true)
                            }
                        )
                        MediumBody(
                            text = item.name,
                            modifier = Modifier.padding(
                                horizontal = WeatherAppTheme.dimens.small,
                                vertical = WeatherAppTheme.dimens.medium
                            )
                        )
                    }
                }
            }
            SingleSelectSaveButtonSection(
                sheetState = sheetState,
                coroutineScope = scope,
                onSaveState = onSaveState,
                selectedItemState = selectedItemsState,
            )
        }
    }
}

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun SingleSelectSaveButtonSection(
    sheetState: SheetState,
    coroutineScope: CoroutineScope,
    onSaveState: (BottomSheetItem) -> Unit,
    selectedItemState: MutableState<BottomSheetItem>,
) {
    SaveButton(
        sheetState = sheetState,
        coroutineScope = coroutineScope,
    ) {
        onSaveState(selectedItemState.value)
    }
}

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun MultiSelectSaveButtonSection(
    sheetState: SheetState,
    coroutineScope: CoroutineScope,
    onSaveState: (List<BottomSheetItem>) -> Unit,
    selectedItemsState: SnapshotStateList<BottomSheetItem>,
) {
    SaveButton(
        sheetState = sheetState,
        coroutineScope = coroutineScope,
    ) {
        onSaveState(selectedItemsState)
    }
}

@OptIn(ExperimentalMaterial3Api::class)
@Composable
private fun SaveButton(
    sheetState: SheetState,
    coroutineScope: CoroutineScope,
    onSaveState: () -> Unit,
) {
    Box(
        contentAlignment = Alignment.BottomEnd,
        modifier = Modifier
            .fillMaxWidth()
    ) {
        PositiveButton(
            text = stringResource(id = R.string.settings_save),
            modifier = Modifier
                .fillMaxWidth()
                .padding(WeatherAppTheme.dimens.medium)

        ) {
            coroutineScope.launch {
                sheetState.hide()
            }
            onSaveState()
        }
    }
}

data class BottomSheetItem(
    val name: String,
    val id: Int,
    val isSelected: Boolean = false,
)

const val NONE_ID = -1


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/designsystem/organism/Dialogs.kt
================================================
package com.github.odaridavid.weatherapp.designsystem.organism

import android.Manifest
import androidx.activity.result.ActivityResultLauncher
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.BasicAlertDialog
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.window.Dialog
import com.github.odaridavid.weatherapp.R
import com.github.odaridavid.weatherapp.designsystem.WeatherAppTheme
import com.github.odaridavid.weatherapp.designsystem.molecule.LargeLabel
import com.github.odaridavid.weatherapp.designsystem.molecule.MediumBody
import com.github.odaridavid.weatherapp.designsystem.molecule.NegativeButton
import com.github.odaridavid.weatherapp.designsystem.molecule.PositiveButton

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun PermissionRationaleDialog(
    isDialogShown: MutableState<Boolean>,
    activityPermissionResult: ActivityResultLauncher<String>,
    showWeatherUI: MutableState<Boolean>
) {
    BasicAlertDialog(
        onDismissRequest = { isDialogShown.value = false },
        modifier = Modifier
            .background(MaterialTheme.colorScheme.surface)
    ) {
        Column {
            LargeLabel(
                text = stringResource(R.string.location_rationale_title),
                modifier = Modifier.padding(
                    horizontal = WeatherAppTheme.dimens.medium,
                    vertical = WeatherAppTheme.dimens.small
                )
            )

            MediumBody(
                text = stringResource(R.string.location_rationale_description),
                modifier = Modifier.padding(WeatherAppTheme.dimens.medium)
            )

            Row(modifier = Modifier.padding(WeatherAppTheme.dimens.medium)) {
                PositiveButton(
                    text = stringResource(R.string.location_rationale_button_grant),
                    onClick = {
                        isDialogShown.value = false
                        activityPermissionResult.launch(Manifest.permission.ACCESS_COARSE_LOCATION)
                    }
                )
                Spacer(modifier = Modifier.weight(1f))
                NegativeButton(
                    text = stringResource(R.string.location_rationale_button_deny),
                    onClick = {
                        isDialogShown.value = false
                        showWeatherUI.value = false
                    }
                )
            }
        }
    }
}

@Composable
fun UpdateDialog(
    onDismiss: () -> Unit,
    onConfirm: () -> Unit,
) {
    Dialog(onDismissRequest = { onDismiss() }) {
        Box {
            MediumBody(text = stringResource(R.string.update_available))
            PositiveButton(
                text = stringResource(R.string.install_update),
                onClick = { onConfirm() }
            )
        }
    }
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/designsystem/organism/NavBars.kt
================================================
package com.github.odaridavid.weatherapp.designsystem.organism

import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import com.github.odaridavid.weatherapp.R
import com.github.odaridavid.weatherapp.designsystem.WeatherAppTheme
import com.github.odaridavid.weatherapp.designsystem.molecule.ActionIcon
import com.github.odaridavid.weatherapp.designsystem.molecule.MediumHeadline

// TODO Create a navbar factory when more screens are added
@Composable
fun HomeTopBar(cityName: String, onSettingClicked: () -> Unit) {
    Row(
        modifier = Modifier
            .padding(WeatherAppTheme.dimens.medium)
            .fillMaxWidth()
    ) {
        MediumHeadline(text = cityName)
        Spacer(modifier = Modifier.weight(WeatherAppTheme.weight.FULL))
        ActionIcon(
            painter = painterResource(id = R.drawable.ic_settings),
            contentDescription = stringResource(R.string.home_content_description_setting_icon),
            modifier = Modifier.padding(WeatherAppTheme.dimens.small),
            onClicked = { onSettingClicked() }
        )
    }
}

@Composable
fun TopNavigationBar(onBackButtonClicked: () -> Unit, title: String) {
    Row(modifier = Modifier.padding(WeatherAppTheme.dimens.medium)) {
        ActionIcon(
            painter = painterResource(id = R.drawable.ic_arrow_back),
            contentDescription = stringResource(R.string.back_button_content_description_icon),
            modifier = Modifier.padding(WeatherAppTheme.dimens.small),
            onClicked = { onBackButtonClicked() }
        )

        MediumHeadline(
            text = title,
            modifier = Modifier.align(Alignment.CenterVertically),
            textAlign = TextAlign.Center,
        )
    }
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/designsystem/organism/Row.kt
================================================
package com.github.odaridavid.weatherapp.designsystem.organism

import androidx.annotation.DrawableRes
import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import com.github.odaridavid.weatherapp.designsystem.WeatherAppTheme
import com.github.odaridavid.weatherapp.designsystem.molecule.LargeBody
import com.github.odaridavid.weatherapp.designsystem.molecule.LargeLabel

@Composable
fun SettingOptionRow(
    optionLabel: String,
    optionValue: String? = null,
    @DrawableRes optionIcon: Int,
    optionIconContentDescription: String,
    modifier: Modifier = Modifier,
    onOptionClicked: () -> Unit
) {
    Row(
        modifier = modifier
            .fillMaxWidth()
            .clickable { onOptionClicked() }
            .padding(WeatherAppTheme.dimens.medium)
    ) {
        Image(
            painter = painterResource(id = optionIcon),
            contentDescription = optionIconContentDescription,
            modifier = Modifier.padding(WeatherAppTheme.dimens.small)
        )

        LargeLabel(
            text = optionLabel,
            modifier = Modifier.padding(WeatherAppTheme.dimens.small),
            fontWeight = FontWeight.Bold
        )

        Spacer(modifier = Modifier.weight(WeatherAppTheme.weight.FULL))

        optionValue?.let {
            LargeBody(
                text = it,
                modifier = Modifier.padding(WeatherAppTheme.dimens.extraSmall)
            )
        }
    }
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/designsystem/organism/TextWidgets.kt
================================================
package com.github.odaridavid.weatherapp.designsystem.organism

import androidx.annotation.StringRes
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import com.github.odaridavid.weatherapp.R
import com.github.odaridavid.weatherapp.designsystem.WeatherAppTheme
import com.github.odaridavid.weatherapp.designsystem.molecule.LargeDisplay
import com.github.odaridavid.weatherapp.designsystem.molecule.MediumBody
import com.github.odaridavid.weatherapp.designsystem.molecule.MediumLabel
import com.github.odaridavid.weatherapp.designsystem.molecule.PositiveButton

// TODO These components still feel meh. They could be better or maybe they are too specfic
@Composable
fun Temperature(text: String) {
    MediumBody(
        text = text,
        modifier = Modifier.padding(WeatherAppTheme.dimens.extraSmall)
    )
}

@Composable
fun ForecastedTime(text: String, modifier: Modifier = Modifier) {
    MediumBody(
        text = text,
        modifier = modifier.padding(WeatherAppTheme.dimens.extraSmall)
    )
}

@Composable
fun VersionInfoText(versionInfo: String, modifier: Modifier) {
    MediumLabel(
        text = versionInfo,
        modifier = modifier
            .fillMaxWidth()
            .padding(WeatherAppTheme.dimens.medium),
        textAlign = TextAlign.Center
    )
}

@Composable
fun TemperatureHeadline(temperature: String, modifier: Modifier = Modifier) {
    LargeDisplay(
        text = temperature,
        modifier = modifier
            .padding(horizontal = WeatherAppTheme.dimens.medium)
            .padding(vertical = WeatherAppTheme.dimens.small)
    )
}

@Composable
fun ActionErrorMessage(
    @StringRes errorMessageId: Int,
    modifier: Modifier,
    onTryAgainClicked: () -> Unit,
) {
    Column(modifier = Modifier.fillMaxWidth()) {
        MediumBody(
            text = stringResource(id = errorMessageId),
            textAlign = TextAlign.Center,
            modifier = modifier.align(Alignment.CenterHorizontally),
        )
        PositiveButton(
            text = stringResource(id = R.string.home_error_try_again),
            onClick = { onTryAgainClicked() },
            modifier = Modifier
                .padding(WeatherAppTheme.dimens.medium)
                .align(Alignment.CenterHorizontally)
        )
    }
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/designsystem/templates/ErrorScreen.kt
================================================
package com.github.odaridavid.weatherapp.designsystem.templates

import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.github.odaridavid.weatherapp.designsystem.WeatherAppTheme
import com.github.odaridavid.weatherapp.designsystem.organism.ActionErrorMessage

@Composable
fun ColumnScope.ErrorScreen(errorMsgId: Int, onTryAgainClicked: () -> Unit) {
    Spacer(modifier = Modifier.weight(WeatherAppTheme.weight.HALF))
    ActionErrorMessage(
        errorMessageId = errorMsgId,
        modifier = Modifier.padding(WeatherAppTheme.dimens.medium)
    ) {
        onTryAgainClicked()
    }
    Spacer(modifier = Modifier.weight(WeatherAppTheme.weight.HALF))
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/designsystem/templates/InfoScreens.kt
================================================
package com.github.odaridavid.weatherapp.designsystem.templates

import androidx.annotation.StringRes
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import com.github.odaridavid.weatherapp.R
import com.github.odaridavid.weatherapp.designsystem.WeatherAppTheme
import com.github.odaridavid.weatherapp.designsystem.molecule.MediumBody

@Composable
fun InfoScreen(@StringRes message: Int) {
    Column(
        modifier = Modifier
            .fillMaxWidth()
            .padding(WeatherAppTheme.dimens.medium)
    ) {
        Spacer(modifier = Modifier.weight(WeatherAppTheme.weight.HALF))
        MediumBody(
            text = stringResource(message),
            modifier = Modifier
                .padding(WeatherAppTheme.dimens.medium)
                .align(Alignment.CenterHorizontally)
        )
        Spacer(modifier = Modifier.weight(WeatherAppTheme.weight.HALF))
    }
}

@Composable
fun RequiresPermissionsScreen() {
    InfoScreen(message = R.string.location_no_permission_screen_description)
}

@Composable
fun EnableLocationSettingScreen() {
    InfoScreen(message = R.string.location_settings_not_enabled)
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/designsystem/templates/ProgressScreens.kt
================================================
package com.github.odaridavid.weatherapp.designsystem.templates

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import com.github.odaridavid.weatherapp.designsystem.WeatherAppTheme

@Composable
fun LoadingScreen() {
    Column(modifier = Modifier.fillMaxSize()) {
        Spacer(modifier = Modifier.weight(WeatherAppTheme.weight.FULL))
        CircularProgressIndicator(
            modifier = Modifier
                .padding(WeatherAppTheme.dimens.medium)
                .align(Alignment.CenterHorizontally)
        )
        Spacer(modifier = Modifier.weight(WeatherAppTheme.weight.FULL))
    }
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/di/ClientModule.kt
================================================
package com.github.odaridavid.weatherapp.di

import android.content.Context
import com.chuckerteam.chucker.api.ChuckerCollector
import com.chuckerteam.chucker.api.ChuckerInterceptor
import com.github.odaridavid.weatherapp.BuildConfig
import com.github.odaridavid.weatherapp.data.weather.remote.OpenWeatherService
import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.json.Json
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import java.util.concurrent.TimeUnit
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object ClientModule {

    @OptIn(ExperimentalSerializationApi::class)
    @Provides
    @Singleton
    fun provideRetrofit(
        @ApplicationContext context: Context,
    ): Retrofit {
        val okHttpClient = provideOkhttpClient(context = context)
        val json = providesJson()
        val contentType = "application/json".toMediaType()
        return Retrofit.Builder()
            .baseUrl(BuildConfig.OPEN_WEATHER_BASE_URL)
            .client(okHttpClient)
            .addConverterFactory(json.asConverterFactory(contentType))
            .build()
    }

    @Provides
    @Singleton
    fun provideOpenWeatherService(retrofit: Retrofit): OpenWeatherService =
        retrofit.create(OpenWeatherService::class.java)

    private fun providesJson(): Json = Json { ignoreUnknownKeys = true }

    private fun provideOkhttpClient(
        context: Context
    ): OkHttpClient {
        val loggingInterceptor = provideLoggingInterceptor()
        val chuckerInterceptor = provideChuckerInterceptor(context)
        return OkHttpClient.Builder()
            .connectTimeout(60L, TimeUnit.SECONDS)
            .addInterceptor(loggingInterceptor)
            .addInterceptor(chuckerInterceptor)
            .build()
    }

    private fun provideLoggingInterceptor(): HttpLoggingInterceptor {
        val level = if (BuildConfig.DEBUG) {
            HttpLoggingInterceptor.Level.BODY
        } else HttpLoggingInterceptor.Level.NONE
        return HttpLoggingInterceptor().also {
            it.level = level
        }
    }

    private fun provideChuckerInterceptor(
        context: Context
    ): ChuckerInterceptor =
        ChuckerInterceptor.Builder(context = context)
            .collector(ChuckerCollector(context = context))
            .maxContentLength(length = 250000L)
            .redactHeaders(headerNames = emptySet())
            .alwaysReadResponseBody(enable = false)
            .build()

}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/di/RepositoryModule.kt
================================================
package com.github.odaridavid.weatherapp.di

import com.github.odaridavid.weatherapp.api.Logger
import com.github.odaridavid.weatherapp.api.SettingsRepository
import com.github.odaridavid.weatherapp.api.WeatherRepository
import com.github.odaridavid.weatherapp.data.settings.DefaultSettingsRepository
import com.github.odaridavid.weatherapp.data.weather.DefaultWeatherRepository
import com.github.odaridavid.weatherapp.data.weather.FirebaseLogger
import com.github.odaridavid.weatherapp.data.weather.remote.DefaultRemoteWeatherDataSource
import com.github.odaridavid.weatherapp.data.weather.remote.RemoteWeatherDataSource
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ViewModelComponent

@Module
@InstallIn(ViewModelComponent::class)
interface RepositoryModule {

    @Binds
    fun bindWeatherRepository(weatherRepository: DefaultWeatherRepository): WeatherRepository

    @Binds
    fun bindSettingsRepository(settingsRepository: DefaultSettingsRepository): SettingsRepository

    @Binds
    fun bindFirebaseLogger(logger: FirebaseLogger): Logger

    @Binds
    fun bindRemoteWeatherDataSource(remoteWeatherDataSource: DefaultRemoteWeatherDataSource): RemoteWeatherDataSource
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/ui/AppNavGraph.kt
================================================
package com.github.odaridavid.weatherapp.ui

import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import com.github.odaridavid.weatherapp.ui.about.AboutScreen
import com.github.odaridavid.weatherapp.ui.home.HomeScreen
import com.github.odaridavid.weatherapp.ui.home.HomeScreenIntent
import com.github.odaridavid.weatherapp.ui.home.HomeViewModel
import com.github.odaridavid.weatherapp.ui.settings.SettingsScreen
import com.github.odaridavid.weatherapp.ui.settings.SettingsScreenIntent
import com.github.odaridavid.weatherapp.ui.settings.SettingsScreenViewState
import com.github.odaridavid.weatherapp.ui.settings.SettingsViewModel

@Composable
fun WeatherAppScreensConfig(
    navController: NavHostController
) {
    NavHost(navController = navController, startDestination = Destinations.HOME.route) {
        composable(Destinations.HOME.route) {
            val homeViewModel = hiltViewModel<HomeViewModel>()
            val state = homeViewModel
                .state
                .collectAsState()
                .value

            HomeScreen(
                state = state,
                onSettingClicked = { navController.navigate(Destinations.SETTINGS.route) },
                onTryAgainClicked = { homeViewModel.processIntent(HomeScreenIntent.LoadWeatherData) },
                onCityNameReceived = { cityName ->
                    homeViewModel.processIntent(HomeScreenIntent.DisplayCityName(cityName = cityName))
                }
            )
        }
        composable(Destinations.SETTINGS.route) {
            val settingsViewModel = hiltViewModel<SettingsViewModel>()
            val state = settingsViewModel
                .state
                .collectAsState(initial = SettingsScreenViewState())
                .value

            settingsViewModel.processIntent(SettingsScreenIntent.LoadSettingScreenData)

            SettingsScreen(
                state = state,
                onBackButtonClicked = { navController.navigateUp() },
                onLanguageChanged = { selectedLanguage ->
                    settingsViewModel.processIntent(
                        SettingsScreenIntent.ChangeLanguage(
                            selectedLanguage
                        )
                    )
                },
                onUnitChanged = { selectedUnit ->
                    settingsViewModel.processIntent(SettingsScreenIntent.ChangeUnits(selectedUnit))
                },
                onTimeFormatChanged = { selectedFormat ->
                    settingsViewModel.processIntent(
                        SettingsScreenIntent.ChangeTimeFormat(selectedFormat)
                    )
                },
                onAboutClicked = {
                    navController.navigate(Destinations.ABOUT.route)
                },
                onExcludedDataChanged = { excludeData ->
                    settingsViewModel.processIntent(
                        SettingsScreenIntent.ChangeExcludedData(excludeData)
                    )
                }
            )
        }
        composable(Destinations.ABOUT.route) {
            AboutScreen {
                navController.navigateUp()
            }
        }
    }
}

enum class Destinations(val route: String) {
    HOME("home"),
    SETTINGS("settings"),
    ABOUT("about")
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/ui/MainActivity.kt
================================================
package com.github.odaridavid.weatherapp.ui

import android.annotation.SuppressLint
import android.location.Location
import android.os.Bundle
import android.util.Log
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.activity.result.contract.ActivityResultContracts
import androidx.activity.viewModels
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.safeDrawingPadding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.ui.Modifier
import androidx.navigation.compose.rememberNavController
import com.github.odaridavid.weatherapp.MainViewIntent
import com.github.odaridavid.weatherapp.MainViewModel
import com.github.odaridavid.weatherapp.MainViewState
import com.github.odaridavid.weatherapp.common.CheckForPermissions
import com.github.odaridavid.weatherapp.common.OnPermissionDenied
import com.github.odaridavid.weatherapp.common.createLocationRequest
import com.github.odaridavid.weatherapp.designsystem.WeatherAppTheme
import com.github.odaridavid.weatherapp.designsystem.organism.UpdateDialog
import com.github.odaridavid.weatherapp.designsystem.templates.EnableLocationSettingScreen
import com.github.odaridavid.weatherapp.designsystem.templates.LoadingScreen
import com.github.odaridavid.weatherapp.designsystem.templates.RequiresPermissionsScreen
import com.github.odaridavid.weatherapp.ui.update.UpdateManager
import com.google.android.gms.location.FusedLocationProviderClient
import com.google.android.gms.location.LocationServices
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject

@AndroidEntryPoint
class MainActivity : ComponentActivity() {

    private val mainViewModel: MainViewModel by viewModels()

    @Inject
    lateinit var updateManager: UpdateManager

    private val locationRequestLauncher =
        registerForActivityResult(ActivityResultContracts.StartIntentSenderForResult()) { result ->
            if (result.resultCode == RESULT_OK) {
                mainViewModel.processIntent(MainViewIntent.CheckLocationSettings(isEnabled = true))
            } else {
                mainViewModel.processIntent(MainViewIntent.CheckLocationSettings(isEnabled = false))
            }
        }
    private val permissionRequestLauncher =
        registerForActivityResult(ActivityResultContracts.RequestPermission()) { isGranted ->
            mainViewModel.processIntent(MainViewIntent.GrantPermission(isGranted = isGranted))
        }

    private val updateRequestLauncher =
        registerForActivityResult(ActivityResultContracts.StartIntentSenderForResult()) { result ->
            if (result.resultCode == RESULT_OK) {
                // TODO Trigger a UI event ,is this even necessary since we already have a listener?
                Log.d("MainActivity", "Update successful")
            } else {
                Log.e("MainActivity", "Update failed")
            }
        }

    private lateinit var fusedLocationProviderClient: FusedLocationProviderClient
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        enableEdgeToEdge()

        updateManager.checkForUpdates(
            activityResultLauncher = updateRequestLauncher,
            onUpdateDownloaded = {
                mainViewModel.processIntent(MainViewIntent.UpdateApp)
            },
            onUpdateFailure = { exception ->
                mainViewModel.processIntent(MainViewIntent.LogException(throwable = exception))
            }
        )

        createLocationRequest(
            activity = this@MainActivity,
            locationRequestLauncher = locationRequestLauncher
        ) {
            mainViewModel.processIntent(MainViewIntent.CheckLocationSettings(isEnabled = true))
        }

        fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this)

        setContent {

            WeatherAppTheme {
                Surface(
                    modifier = Modifier.fillMaxSize().safeDrawingPadding(),
                    color = MaterialTheme.colorScheme.background
                ) {
                    val state = mainViewModel.state.collectAsState().value

                    // TODO test this with internal testing track
                    mainViewModel.hasAppUpdate.collectAsState().value.let { hasAppUpdate ->
                        if (hasAppUpdate) {
                            UpdateDialog(
                                onDismiss = {
                                    // TODO dismiss it
                                },
                                onConfirm = {
                                    updateManager.completeUpdate()
                                }
                            )
                        }
                    }

                    CheckForPermissions(
                        onPermissionGranted = {
                            mainViewModel.processIntent(MainViewIntent.GrantPermission(isGranted = true))
                        },
                        onPermissionDenied = {
                            OnPermissionDenied(activityPermissionResult = permissionRequestLauncher)
                        }
                    )

                    InitMainScreen(state)
                }
            }
        }
    }

    @SuppressLint("MissingPermission")
    @Composable
    private fun InitMainScreen(state: MainViewState) {
        when {
            state.isLocationSettingEnabled && state.isPermissionGranted -> {
                fusedLocationProviderClient.lastLocation
                    .addOnSuccessListener { location: Location? ->
                        location?.run {
                            mainViewModel.processIntent(
                                MainViewIntent.ReceiveLocation(
                                    longitude = location.longitude,
                                    latitude = location.latitude
                                )
                            )
                        }
                    }.addOnFailureListener { exception ->
                        mainViewModel.processIntent(MainViewIntent.LogException(throwable = exception))
                    }
                WeatherAppScreensConfig(navController = rememberNavController())
            }

            state.isLocationSettingEnabled && !state.isPermissionGranted -> {
                RequiresPermissionsScreen()
            }

            !state.isLocationSettingEnabled && !state.isPermissionGranted -> {
                EnableLocationSettingScreen()
            }

            else -> LoadingScreen()
        }
    }

    override fun onDestroy() {
        super.onDestroy()
        updateManager.unregisterListeners()
    }
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/ui/about/AboutScreen.kt
================================================
package com.github.odaridavid.weatherapp.ui.about

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import com.github.odaridavid.weatherapp.R
import com.github.odaridavid.weatherapp.designsystem.organism.TopNavigationBar
import com.mikepenz.aboutlibraries.ui.compose.m3.LibrariesContainer

@Composable
fun AboutScreen(
    onBackButtonClicked: () -> Unit,
) {
    Column {
        TopNavigationBar(
            onBackButtonClicked = onBackButtonClicked,
            title = stringResource(R.string.about_screen_title),
        )

        LibrariesContainer(
            Modifier.fillMaxSize()
        )
    }
}

================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/ui/home/HomeScreen.kt
================================================
package com.github.odaridavid.weatherapp.ui.home

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.items
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import com.github.odaridavid.weatherapp.R
import com.github.odaridavid.weatherapp.common.getCityName
import com.github.odaridavid.weatherapp.designsystem.WeatherAppTheme
import com.github.odaridavid.weatherapp.designsystem.molecule.LargeLabel
import com.github.odaridavid.weatherapp.designsystem.molecule.MediumBody
import com.github.odaridavid.weatherapp.designsystem.molecule.RemoteImage
import com.github.odaridavid.weatherapp.designsystem.organism.ForecastedTime
import com.github.odaridavid.weatherapp.designsystem.organism.HomeTopBar
import com.github.odaridavid.weatherapp.designsystem.organism.Temperature
import com.github.odaridavid.weatherapp.designsystem.organism.TemperatureHeadline
import com.github.odaridavid.weatherapp.designsystem.templates.ErrorScreen
import com.github.odaridavid.weatherapp.designsystem.templates.LoadingScreen
import com.github.odaridavid.weatherapp.model.CurrentWeather
import com.github.odaridavid.weatherapp.model.DailyWeather
import com.github.odaridavid.weatherapp.model.HourlyWeather

@Composable
fun HomeScreen(
    state: HomeScreenViewState,
    onSettingClicked: () -> Unit,
    onTryAgainClicked: () -> Unit,
    onCityNameReceived: (String) -> Unit
) {
    Column(modifier = Modifier.fillMaxSize()) {

        LocalContext.current.getCityName(
            latitude = state.defaultLocation.latitude,
            longitude = state.defaultLocation.longitude
        ) { address ->
            val cityName = address.locality
            onCityNameReceived(cityName)
        }

        HomeTopBar(cityName = state.locationName, onSettingClicked)

        if (state.isLoading) {
            LoadingScreen()
        }

        if (state.errorMessageId != null) {
            ErrorScreen(state.errorMessageId, onTryAgainClicked)
        } else {
            state.weather?.current?.let { currentWeather ->
                CurrentWeatherWidget(currentWeather = currentWeather)
            } ?: run {
                EmptySectionWidget(
                    label = stringResource(id = R.string.home_title_currently),
                    weatherType = stringResource(id = R.string.home_weather_type_currently)
                )
            }

            state.weather?.hourly?.let { hourlyWeather ->
                HourlyWeatherWidget(hourlyWeatherList = hourlyWeather)
            } ?: run {
                EmptySectionWidget(
                    label = stringResource(id = R.string.home_today_forecast_title),
                    weatherType = stringResource(id = R.string.home_weather_type_hourly)
                )
            }

            state.weather?.daily?.let { dailyWeather ->
                DailyWeatherWidget(dailyWeatherList = dailyWeather)
            } ?: run {
                EmptySectionWidget(
                    label = stringResource(id = R.string.home_weekly_forecast_title),
                    weatherType = stringResource(id = R.string.home_weather_type_daily)
                )
            }
        }
    }
}

@Composable
private fun EmptySectionWidget(label: String, weatherType: String) {
    Column {
        LargeLabel(
            text = label,
            modifier = Modifier.padding(
                horizontal = WeatherAppTheme.dimens.medium,
                vertical = WeatherAppTheme.dimens.small
            )
        )
        MediumBody(
            text = stringResource(R.string.home_enable_weather_in_settings, weatherType),
            modifier = Modifier
                .fillMaxWidth()
                .padding(WeatherAppTheme.dimens.medium),
            textAlign = TextAlign.Center
        )
    }
}

@Composable
private fun CurrentWeatherWidget(currentWeather: CurrentWeather) {
    Column {
        LargeLabel(
            text = stringResource(id = R.string.home_title_currently),
            modifier = Modifier.padding(
                horizontal = WeatherAppTheme.dimens.medium,
                vertical = WeatherAppTheme.dimens.small
            )
        )

        TemperatureHeadline(temperature = currentWeather.temperature)

        LargeLabel(
            text = stringResource(
                id = R.string.home_feels_like_description,
                currentWeather.feelsLike
            ),
            color = MaterialTheme.colorScheme.secondary,
            modifier = Modifier.padding(
                horizontal = WeatherAppTheme.dimens.medium,
                vertical = WeatherAppTheme.dimens.small
            )
        )
    }
}

@OptIn(ExperimentalFoundationApi::class)
@Composable
private fun HourlyWeatherWidget(hourlyWeatherList: List<HourlyWeather>) {
    LargeLabel(
        text = stringResource(id = R.string.home_today_forecast_title),
        modifier = Modifier.padding(
            horizontal = WeatherAppTheme.dimens.medium,
            vertical = WeatherAppTheme.dimens.small
        )
    )

    LazyRow(modifier = Modifier.padding(WeatherAppTheme.dimens.medium)) {
        items(hourlyWeatherList) { hourlyWeather ->
            HourlyWeatherRow(
                hourlyWeather = hourlyWeather,
                modifier = Modifier.animateItemPlacement()
            )
        }
    }
}

@Composable
private fun HourlyWeatherRow(hourlyWeather: HourlyWeather, modifier: Modifier) {
    Row(modifier = modifier) {
        RemoteImage(
            url = hourlyWeather.weather.first().icon,
            contentDescription = hourlyWeather.weather.first().description,
            modifier = Modifier
                .padding(WeatherAppTheme.dimens.extraSmall)
                .align(Alignment.CenterVertically),
        )
        Column(
            modifier = Modifier
                .padding(WeatherAppTheme.dimens.extraSmall)
                .align(Alignment.CenterVertically)
        ) {
            Temperature(text = hourlyWeather.temperature)
            ForecastedTime(text = hourlyWeather.forecastedTime)
        }
    }
}

@OptIn(ExperimentalFoundationApi::class)
@Composable
private fun DailyWeatherWidget(dailyWeatherList: List<DailyWeather>) {
    LargeLabel(
        text = stringResource(id = R.string.home_weekly_forecast_title),
        modifier = Modifier.padding(
            horizontal = WeatherAppTheme.dimens.medium,
            vertical = WeatherAppTheme.dimens.small
        )
    )

    LazyColumn(modifier = Modifier.padding(WeatherAppTheme.dimens.medium)) {
        items(dailyWeatherList) { dailyWeather ->
            DailyWeatherRow(dailyWeather = dailyWeather, modifier = Modifier.animateItemPlacement())
        }
    }
}

@Composable
private fun DailyWeatherRow(dailyWeather: DailyWeather, modifier: Modifier) {
    Row(
        modifier = modifier
            .padding(WeatherAppTheme.dimens.small)
            .fillMaxWidth()
    ) {
        RemoteImage(
            url = dailyWeather.weather.first().icon,
            contentDescription = dailyWeather.weather.first().description,
            modifier = Modifier
                .padding(WeatherAppTheme.dimens.extraSmall)
                .align(Alignment.CenterVertically),
        )
        ForecastedTime(
            text = dailyWeather.forecastedTime,
            modifier = Modifier
                .align(Alignment.CenterVertically)
        )
        Spacer(modifier = Modifier.weight(WeatherAppTheme.weight.FULL))
        Column(modifier = Modifier.align(Alignment.CenterVertically)) {
            Temperature(
                text = stringResource(
                    id = R.string.home_max_temp,
                    dailyWeather.temperature.max
                )
            )
            Temperature(
                text = stringResource(
                    id = R.string.home_min_temp,
                    dailyWeather.temperature.min
                )
            )
        }
    }
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/ui/home/HomeScreenIntent.kt
================================================
package com.github.odaridavid.weatherapp.ui.home

sealed class HomeScreenIntent {
    data object LoadWeatherData : HomeScreenIntent()

    data class DisplayCityName(val cityName: String) : HomeScreenIntent()
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/ui/home/HomeViewModel.kt
================================================
package com.github.odaridavid.weatherapp.ui.home

import androidx.annotation.StringRes
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.github.odaridavid.weatherapp.api.SettingsRepository
import com.github.odaridavid.weatherapp.api.WeatherRepository
import com.github.odaridavid.weatherapp.model.DefaultLocation
import com.github.odaridavid.weatherapp.model.Result
import com.github.odaridavid.weatherapp.model.SupportedLanguage
import com.github.odaridavid.weatherapp.model.Units
import com.github.odaridavid.weatherapp.model.Weather
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.launch
import javax.inject.Inject

@HiltViewModel
class HomeViewModel @Inject constructor(
    private val weatherRepository: WeatherRepository,
    private val settingsRepository: SettingsRepository
) : ViewModel() {

    private val _state = MutableStateFlow(HomeScreenViewState(isLoading = true))
    val state: StateFlow<HomeScreenViewState> = _state.asStateFlow()

    init {
        viewModelScope.launch {
            combine(
                settingsRepository.getLanguage(),
                settingsRepository.getUnits(),
                settingsRepository.getDefaultLocation()
            ) { language, units, defaultLocation ->
                Triple(language, units, defaultLocation)
            }.collect { (language, units, defaultLocation) ->
                setState {
                    copy(
                        language = language,
                        units = units,
                        defaultLocation = defaultLocation
                    )
                }.also { processIntent(HomeScreenIntent.LoadWeatherData) }
            }
        }
    }

    fun processIntent(homeScreenIntent: HomeScreenIntent) {
        when (homeScreenIntent) {
            is HomeScreenIntent.LoadWeatherData -> {
                viewModelScope.launch {
                    val result = weatherRepository.fetchWeatherData(
                        language = state.value.language.languageValue,
                        defaultLocation = state.value.defaultLocation,
                        units = state.value.units.value
                    )
                    processResult(result)
                }
            }

            is HomeScreenIntent.DisplayCityName -> {
                setState { copy(locationName = homeScreenIntent.cityName) }
            }
        }
    }

    private fun processResult(result: Result<Weather>) {
        when (result) {
            is Result.Success -> {
                val weatherData = result.data
                setState {
                    copy(
                        weather = weatherData,
                        isLoading = false,
                        errorMessageId = null
                    )
                }
            }

            is Result.Error -> {
                setState {
                    copy(
                        isLoading = false,
                        errorMessageId = result.errorType.toResourceId()
                    )
                }
            }
        }
    }

    private fun setState(stateReducer: HomeScreenViewState.() -> HomeScreenViewState) {
        viewModelScope.launch {
            _state.emit(stateReducer(state.value))
        }
    }
}

data class HomeScreenViewState(
    val units: Units = Units.METRIC,
    val defaultLocation: DefaultLocation = DefaultLocation(0.0, 0.0),
    val locationName: String = "-",
    val language: SupportedLanguage = SupportedLanguage.ENGLISH,
    val weather: Weather? = null,
    val isLoading: Boolean = false,
    @StringRes val errorMessageId: Int? = null
)


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/ui/home/Mappers.kt
================================================
package com.github.odaridavid.weatherapp.ui.home

import androidx.annotation.StringRes
import com.github.odaridavid.weatherapp.R
import com.github.odaridavid.weatherapp.model.ErrorType

@StringRes
fun ErrorType.toResourceId(): Int = when (this) {
    ErrorType.SERVER -> R.string.error_server
    ErrorType.GENERIC -> R.string.error_generic
    ErrorType.IO_CONNECTION -> R.string.error_connection
    ErrorType.CLIENT -> R.string.error_client
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/ui/settings/SettingsScreen.kt
================================================
package com.github.odaridavid.weatherapp.ui.settings

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.SheetState
import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import com.github.odaridavid.weatherapp.R
import com.github.odaridavid.weatherapp.designsystem.WeatherAppTheme
import com.github.odaridavid.weatherapp.designsystem.organism.MultiSelectBottomSheet
import com.github.odaridavid.weatherapp.designsystem.organism.SettingOptionRow
import com.github.odaridavid.weatherapp.designsystem.organism.SingleSelectBottomSheet
import com.github.odaridavid.weatherapp.designsystem.organism.TopNavigationBar
import com.github.odaridavid.weatherapp.designsystem.organism.VersionInfoText
import com.github.odaridavid.weatherapp.model.ExcludedData
import com.github.odaridavid.weatherapp.model.SupportedLanguage
import com.github.odaridavid.weatherapp.model.TimeFormat
import com.github.odaridavid.weatherapp.model.Units
import kotlinx.coroutines.launch

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun SettingsScreen(
    state: SettingsScreenViewState,
    onBackButtonClicked: () -> Unit,
    onLanguageChanged: (SupportedLanguage) -> Unit,
    onUnitChanged: (Units) -> Unit,
    onTimeFormatChanged: (TimeFormat) -> Unit,
    onAboutClicked: () -> Unit,
    onExcludedDataChanged: (List<ExcludedData>) -> Unit,
) {
    Column {
        TopNavigationBar(
            onBackButtonClicked = onBackButtonClicked,
            title = stringResource(R.string.settings_screen_title),
        )

        val scope = rememberCoroutineScope()
        val languageSheetState = rememberModalBottomSheetState(
            skipPartiallyExpanded = true
        )
        SettingOptionRow(
            optionLabel = stringResource(R.string.settings_language_label),
            optionValue = state.selectedLanguage.languageName,
            optionIcon = R.drawable.ic_language,
            optionIconContentDescription = stringResource(R.string.settings_content_description_lang_icon)
        ) {
            scope.launch {
                languageSheetState.show()
            }
        }

        val unitsSheetState = rememberModalBottomSheetState()
        SettingOptionRow(
            optionLabel = stringResource(R.string.settings_unit_label),
            optionValue = state.selectedUnit.value,
            optionIcon = R.drawable.ic_units,
            optionIconContentDescription = stringResource(R.string.settings_content_description_unit_icon)
        ) {
            scope.launch {
                unitsSheetState.show()
            }
        }

        val timeFormatSheetState = rememberModalBottomSheetState()
        SettingOptionRow(
            optionLabel = stringResource(R.string.settings_time_format),
            optionValue = state.selectedTimeFormat.value,
            optionIcon = R.drawable.ic_time_24,
            optionIconContentDescription = stringResource(R.string.settings_content_description_time_icon)
        ) {
            scope.launch {
                timeFormatSheetState.show()
            }
        }

        val excludeSheetState = rememberModalBottomSheetState(
            skipPartiallyExpanded = true
        )
        SettingOptionRow(
            optionLabel = stringResource(id = R.string.settings_exclude_label),
            optionIcon = R.drawable.ic_exclude_24,
            optionValue = state.selectedExcludedDataDisplayValue,
            optionIconContentDescription = stringResource(R.string.settings_content_description_exclude_icon),
        ) {
            scope.launch {
                excludeSheetState.show()
            }
        }

        SettingOptionRow(
            optionLabel = stringResource(R.string.settings_about),
            optionIcon = R.drawable.ic_info_24,
            optionIconContentDescription = stringResource(R.string.settings_content_description_about_icon)
        ) {
            onAboutClicked()
        }

        SetupBottomSheets(
            state = state,
            onLanguageChanged = onLanguageChanged,
            onUnitChanged = onUnitChanged,
            onTimeFormatChanged = onTimeFormatChanged,
            onExcludedDataChanged = onExcludedDataChanged,
            languageSheetState = languageSheetState,
            unitsSheetState = unitsSheetState,
            timeFormatSheetState = timeFormatSheetState,
            excludeSheetState = excludeSheetState,
        )

        Spacer(modifier = Modifier.weight(WeatherAppTheme.weight.FULL))

        VersionInfoText(
            versionInfo = state.versionInfo,
            modifier = Modifier.align(Alignment.CenterHorizontally),
        )
    }
}

@OptIn(ExperimentalMaterial3Api::class)
@Composable
private fun SetupBottomSheets(
    state: SettingsScreenViewState,
    onLanguageChanged: (SupportedLanguage) -> Unit,
    onUnitChanged: (Units) -> Unit,
    onTimeFormatChanged: (TimeFormat) -> Unit,
    onExcludedDataChanged: (List<ExcludedData>) -> Unit,
    languageSheetState: SheetState,
    unitsSheetState: SheetState,
    timeFormatSheetState: SheetState,
    excludeSheetState: SheetState
) {

    if (languageSheetState.isVisible) {
        SingleSelectBottomSheet(
            title = stringResource(id = R.string.settings_language_label),
            sheetState = languageSheetState,
            selectedItem = state.selectedLanguage.toBottomSheetModel(isSelected = true),
            items = state.availableLanguages.map { it.toBottomSheetModel(isSelected = false) },
            onSaveState = { bottomSheet ->
                onLanguageChanged(bottomSheet.toSupportedLanguage())
            }
        )
    }

    if (unitsSheetState.isVisible) {
        SingleSelectBottomSheet(
            title = stringResource(id = R.string.settings_unit_label),
            sheetState = unitsSheetState,
            selectedItem = state.selectedUnit.toBottomSheetModel(isSelected = true),
            items = state.availableUnits.map { it.toBottomSheetModel(isSelected = false) },
            onSaveState = { bottomSheet ->
                onUnitChanged(bottomSheet.toUnits())
            }
        )
    }
    if (timeFormatSheetState.isVisible) {
        SingleSelectBottomSheet(
            title = stringResource(id = R.string.settings_time_format),
            sheetState = timeFormatSheetState,
            selectedItem = state.selectedTimeFormat.toBottomSheetModel(isSelected = true),
            items = state.availableFormats.map { it.toBottomSheetModel(isSelected = false) },
            onSaveState = { bottomSheet ->
                onTimeFormatChanged(bottomSheet.toTimeFormat())
            }
        )
    }
    if (excludeSheetState.isVisible) {
        MultiSelectBottomSheet(
            title = stringResource(id = R.string.settings_exclude_label),
            sheetState = excludeSheetState,
            selectedItems = state.selectedExcludedData.map { it.toBottomSheetModel(isSelected = true) },
            items = state.excludedData.map { it.toBottomSheetModel(isSelected = false) },
            onSaveState = { bottomSheet ->
                onExcludedDataChanged(bottomSheet.map { it.toExcludedData() })
            }
        )
    }
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/ui/settings/SettingsScreenIntent.kt
================================================
package com.github.odaridavid.weatherapp.ui.settings

import com.github.odaridavid.weatherapp.model.ExcludedData
import com.github.odaridavid.weatherapp.model.SupportedLanguage
import com.github.odaridavid.weatherapp.model.TimeFormat
import com.github.odaridavid.weatherapp.model.Units

sealed class SettingsScreenIntent {

    data object LoadSettingScreenData : SettingsScreenIntent()

    data class ChangeLanguage(val selectedLanguage: SupportedLanguage) : SettingsScreenIntent()

    data class ChangeUnits(val selectedUnits: Units) : SettingsScreenIntent()

    data class ChangeTimeFormat(val selectedTimeFormat: TimeFormat) : SettingsScreenIntent()

    data class ChangeExcludedData(val selectedExcludedData: List<ExcludedData>) :
        SettingsScreenIntent()
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/ui/settings/SettingsViewModel.kt
================================================
package com.github.odaridavid.weatherapp.ui.settings

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.github.odaridavid.weatherapp.api.Logger
import com.github.odaridavid.weatherapp.api.SettingsRepository
import com.github.odaridavid.weatherapp.model.ExcludedData
import com.github.odaridavid.weatherapp.model.SupportedLanguage
import com.github.odaridavid.weatherapp.model.TimeFormat
import com.github.odaridavid.weatherapp.model.Units
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.launch
import javax.inject.Inject

@HiltViewModel
class SettingsViewModel @Inject constructor(
    private val settingsRepository: SettingsRepository,
    private val logger: Logger,
) : ViewModel() {

    private val _state = MutableStateFlow(SettingsScreenViewState())
    val state: StateFlow<SettingsScreenViewState> = _state.asStateFlow()

    fun processIntent(settingsScreenIntent: SettingsScreenIntent) {
        when (settingsScreenIntent) {
            SettingsScreenIntent.LoadSettingScreenData -> {
                viewModelScope.launch {
                    combine(
                        settingsRepository.getLanguage(),
                        settingsRepository.getUnits(),
                        settingsRepository.getFormat(),
                        settingsRepository.getExcludedData()
                    ) { language, units, format, excludedData ->
                        SettingsScreenViewState(
                            selectedLanguage = language,
                            selectedUnit = units,
                            selectedTimeFormat = format,
                            selectedExcludedData = mapStringToExcludedData(excludedData),
                            selectedExcludedDataDisplayValue = excludedData,
                            versionInfo = settingsRepository.getAppVersion(),
                            availableLanguages = SupportedLanguage.entries,
                            availableUnits = Units.entries,
                            availableFormats = TimeFormat.entries,
                            excludedData = ExcludedData.entries,
                        )
                    }.collect { state ->
                        setState { state }
                    }
                }
            }

            is SettingsScreenIntent.ChangeLanguage -> {
                viewModelScope.launch {
                    settingsRepository.setLanguage(settingsScreenIntent.selectedLanguage)
                    setState { copy(selectedLanguage = settingsScreenIntent.selectedLanguage) }
                }
            }

            is SettingsScreenIntent.ChangeUnits -> {
                viewModelScope.launch {
                    settingsRepository.setUnits(settingsScreenIntent.selectedUnits)
                    setState { copy(selectedUnit = settingsScreenIntent.selectedUnits) }
                }
            }

            is SettingsScreenIntent.ChangeTimeFormat -> {
                viewModelScope.launch {
                    val format = settingsScreenIntent.selectedTimeFormat
                    settingsRepository.setFormat(format)
                    setState { copy(selectedTimeFormat = format) }
                }
            }

            is SettingsScreenIntent.ChangeExcludedData -> {
                viewModelScope.launch {
                    settingsRepository.setExcludedData(settingsScreenIntent.selectedExcludedData)
                    setState {
                        copy(
                            selectedExcludedData = settingsScreenIntent.selectedExcludedData,
                            selectedExcludedDataDisplayValue = mapExcludedDataToDisplayValue(
                                settingsScreenIntent.selectedExcludedData
                            ),
                        )
                    }
                }
            }
        }
    }

    private fun setState(stateReducer: SettingsScreenViewState.() -> SettingsScreenViewState) {
        viewModelScope.launch {
            _state.emit(stateReducer(state.value))
        }
    }

    private fun mapExcludedDataToDisplayValue(excludedData: List<ExcludedData>): String =
        excludedData.joinToString(separator = ",") { it.value.trim() }

    private fun mapStringToExcludedData(excludedData: String): List<ExcludedData> {
        return excludedData.split(",").map {
            when (it.trim()) {
                ExcludedData.CURRENT.value -> ExcludedData.CURRENT
                ExcludedData.HOURLY.value -> ExcludedData.HOURLY
                ExcludedData.DAILY.value -> ExcludedData.DAILY
                ExcludedData.MINUTELY.value -> ExcludedData.MINUTELY
                ExcludedData.ALERTS.value -> ExcludedData.ALERTS
                ExcludedData.NONE.value -> ExcludedData.NONE
                else -> {
                    logger.logException(IllegalArgumentException("Invalid excluded data"))
                    ExcludedData.NONE
                }
            }
        }
    }
}

data class SettingsScreenViewState(
    val selectedUnit: Units = Units.METRIC,
    val selectedLanguage: SupportedLanguage = SupportedLanguage.ENGLISH,
    val selectedTimeFormat: TimeFormat = TimeFormat.TWENTY_FOUR_HOUR,
    val selectedExcludedData: List<ExcludedData> = emptyList(),
    val selectedExcludedDataDisplayValue: String = "",
    val availableLanguages: List<SupportedLanguage> = emptyList(),
    val availableUnits: List<Units> = emptyList(),
    val availableFormats: List<TimeFormat> = emptyList(),
    val excludedData: List<ExcludedData> = emptyList(),
    val versionInfo: String = "",
    val error: Throwable? = null
)


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/ui/settings/UIMapper.kt
================================================
package com.github.odaridavid.weatherapp.ui.settings

import com.github.odaridavid.weatherapp.designsystem.organism.BottomSheetItem
import com.github.odaridavid.weatherapp.model.ExcludedData
import com.github.odaridavid.weatherapp.model.SupportedLanguage
import com.github.odaridavid.weatherapp.model.TimeFormat
import com.github.odaridavid.weatherapp.model.Units

// TODO Fix repetition of mapping
fun ExcludedData.toBottomSheetModel(isSelected: Boolean = false): BottomSheetItem {
    return BottomSheetItem(
        id = this.id,
        name = this.name,
        isSelected = isSelected
    )
}

fun BottomSheetItem.toExcludedData(): ExcludedData {
    return ExcludedData.entries.first { it.id == this.id }
}

fun TimeFormat.toBottomSheetModel(isSelected: Boolean = false): BottomSheetItem {
    return BottomSheetItem(
        id = this.ordinal,
        name = this.value,
        isSelected = isSelected
    )
}

fun BottomSheetItem.toTimeFormat(): TimeFormat {
    return TimeFormat.entries.first { it.ordinal == this.id }
}

fun Units.toBottomSheetModel(isSelected: Boolean = false): BottomSheetItem {
    return BottomSheetItem(
        id = this.ordinal,
        name = this.value,
        isSelected = isSelected
    )
}

fun BottomSheetItem.toUnits(): Units {
    return Units.entries.first { it.ordinal == this.id }
}

fun SupportedLanguage.toBottomSheetModel(isSelected: Boolean = false): BottomSheetItem {
    return BottomSheetItem(
        id = this.ordinal,
        name = this.languageName,
        isSelected = isSelected
    )
}

fun BottomSheetItem.toSupportedLanguage(): SupportedLanguage {
    return SupportedLanguage.entries.first { it.ordinal == this.id }
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/ui/update/UpdateAppException.kt
================================================
package com.github.odaridavid.weatherapp.ui.update

data class UpdateAppException(val throwable: Throwable) : Exception()


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/ui/update/UpdateManager.kt
================================================
package com.github.odaridavid.weatherapp.ui.update

import android.content.Context
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.IntentSenderRequest
import com.google.android.play.core.appupdate.AppUpdateInfo
import com.google.android.play.core.appupdate.AppUpdateManager
import com.google.android.play.core.appupdate.AppUpdateManagerFactory
import com.google.android.play.core.appupdate.AppUpdateOptions
import com.google.android.play.core.install.model.AppUpdateType
import com.google.android.play.core.install.model.UpdateAvailability
import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject

class UpdateManager @Inject constructor(
    @ApplicationContext private val context: Context,
    private val updateStateFactory: UpdateStateFactory,
) {

    private val appUpdateManager: AppUpdateManager by lazy {
        AppUpdateManagerFactory.create(context)
    }

    fun checkForUpdates(
        activityResultLauncher: ActivityResultLauncher<IntentSenderRequest>,
        onUpdateDownloaded: () -> Unit,
        onUpdateFailure: (Throwable) -> Unit,
    ) {
        val appUpdateInfoTask = appUpdateManager.appUpdateInfo

        appUpdateManager.registerListener(
            updateStateFactory.getUpdateStateListener(
                onDownloaded = {
                    onUpdateDownloaded()
                }
            )
        )

        appUpdateInfoTask.addOnSuccessListener { appUpdateInfo ->
            if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE &&
                appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE)
            ) {
                update(
                    appUpdateManager = appUpdateManager,
                    appUpdateInfo = appUpdateInfo,
                    activityResultLauncher = activityResultLauncher,
                )
            }
        }.addOnFailureListener { exception ->
            onUpdateFailure(UpdateAppException(exception))
        }
    }

    fun unregisterListeners() {
        appUpdateManager.unregisterListener(updateStateFactory.getUpdateStateListener())
    }

    fun completeUpdate() {
        appUpdateManager.completeUpdate()
    }

    private fun update(
        appUpdateManager: AppUpdateManager,
        appUpdateInfo: AppUpdateInfo,
        activityResultLauncher: ActivityResultLauncher<IntentSenderRequest>
    ) {
        appUpdateManager.startUpdateFlowForResult(
            appUpdateInfo,
            activityResultLauncher,
            AppUpdateOptions.newBuilder(AppUpdateType.FLEXIBLE).build()
        )
    }
}


================================================
FILE: app/src/main/java/com/github/odaridavid/weatherapp/ui/update/UpdateStateFactory.kt
================================================
package com.github.odaridavid.weatherapp.ui.update

import com.google.android.play.core.install.InstallStateUpdatedListener
import com.google.android.play.core.install.model.InstallStatus
import javax.inject.Inject

class UpdateStateFactory @Inject constructor() {

    fun getUpdateStateListener(
        onDownloading: ((bytesDownloaded: Long, totalBytesToDownload: Long) -> Unit)? = null,
        onDownloaded: (() -> Unit)? = null,
    ) = InstallStateUpdatedListener { state ->
        when (state.installStatus()) {
            InstallStatus.DOWNLOADING -> {
                val bytesDownloaded = state.bytesDownloaded()
                val totalBytesToDownload = state.totalBytesToDownload()
                if (onDownloading != null) {
                    onDownloading(bytesDownloaded, totalBytesToDownload)
                }
                // Show update progress bar.
            }
            InstallStatus.DOWNLOADED -> {
                // Notify the user that the update is ready to be installed.
                if (onDownloaded != null) {
                    onDownloaded()
                }

            }
            InstallStatus.INSTALLING,
            InstallStatus.INSTALLED,
            InstallStatus.FAILED,
            InstallStatus.CANCELED,
            InstallStatus.PENDING,
            InstallStatus.UNKNOWN -> {
                // No-op
            }
            else -> {
                // No-op
            }
        }
    }

}


================================================
FILE: app/src/main/res/drawable/ic_arrow_back.xml
================================================
<vector android:autoMirrored="true" android:height="24dp"
    android:tint="#000000" android:viewportHeight="24"
    android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="@android:color/white" android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>


================================================
FILE: app/src/main/res/drawable/ic_exclude_24.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
      
    <path android:fillColor="@android:color/white" android:pathData="M7,11v2h10v-2L7,11zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
    
</vector>


================================================
FILE: app/src/main/res/drawable/ic_info_24.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
      
    <path android:fillColor="@android:color/white" android:pathData="M11,7h2v2h-2V7zM11,11h2v6h-2V11zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10s10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8s8,3.59 8,8S16.41,20 12,20z"/>
    
</vector>


================================================
FILE: app/src/main/res/drawable/ic_language.xml
================================================
<vector android:height="24dp" android:tint="#000000"
    android:viewportHeight="24" android:viewportWidth="24"
    android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="@android:color/white" android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM18.92,8h-2.95c-0.32,-1.25 -0.78,-2.45 -1.38,-3.56 1.84,0.63 3.37,1.91 4.33,3.56zM12,4.04c0.83,1.2 1.48,2.53 1.91,3.96h-3.82c0.43,-1.43 1.08,-2.76 1.91,-3.96zM4.26,14C4.1,13.36 4,12.69 4,12s0.1,-1.36 0.26,-2h3.38c-0.08,0.66 -0.14,1.32 -0.14,2 0,0.68 0.06,1.34 0.14,2L4.26,14zM5.08,16h2.95c0.32,1.25 0.78,2.45 1.38,3.56 -1.84,-0.63 -3.37,-1.9 -4.33,-3.56zM8.03,8L5.08,8c0.96,-1.66 2.49,-2.93 4.33,-3.56C8.81,5.55 8.35,6.75 8.03,8zM12,19.96c-0.83,-1.2 -1.48,-2.53 -1.91,-3.96h3.82c-0.43,1.43 -1.08,2.76 -1.91,3.96zM14.34,14L9.66,14c-0.09,-0.66 -0.16,-1.32 -0.16,-2 0,-0.68 0.07,-1.35 0.16,-2h4.68c0.09,0.65 0.16,1.32 0.16,2 0,0.68 -0.07,1.34 -0.16,2zM14.59,19.56c0.6,-1.11 1.06,-2.31 1.38,-3.56h2.95c-0.96,1.65 -2.49,2.93 -4.33,3.56zM16.36,14c0.08,-0.66 0.14,-1.32 0.14,-2 0,-0.68 -0.06,-1.34 -0.14,-2h3.38c0.16,0.64 0.26,1.31 0.26,2s-0.1,1.36 -0.26,2h-3.38z"/>
</vector>


================================================
FILE: app/src/main/res/drawable/ic_launcher_background.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="108dp"
    android:height="108dp"
    android:viewportWidth="108"
    android:viewportHeight="108">
    <path
        android:fillColor="#3DDC84"
        android:pathData="M0,0h108v108h-108z" />
    <path
        android:fillColor="#00000000"
        android:pathData="M9,0L9,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,0L19,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M29,0L29,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M39,0L39,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M49,0L49,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M59,0L59,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M69,0L69,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M79,0L79,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M89,0L89,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M99,0L99,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,9L108,9"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,19L108,19"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,29L108,29"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,39L108,39"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,49L108,49"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,59L108,59"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,69L108,69"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,79L108,79"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,89L108,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,99L108,99"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,29L89,29"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,39L89,39"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,49L89,49"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,59L89,59"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,69L89,69"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,79L89,79"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M29,19L29,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M39,19L39,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M49,19L49,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M59,19L59,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M69,19L69,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M79,19L79,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
</vector>


================================================
FILE: app/src/main/res/drawable/ic_settings.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:tint="#000000"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z" />
</vector>


================================================
FILE: app/src/main/res/drawable/ic_time_24.xml
================================================
<vector android:height="24dp" android:tint="#000000"
    android:viewportHeight="24" android:viewportWidth="24"
    android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="@android:color/white" android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z"/>
    <path android:fillColor="@android:color/white" android:pathData="M12.5,7H11v6l5.25,3.15 0.75,-1.23 -4.5,-2.67z"/>
</vector>


================================================
FILE: app/src/main/res/drawable/ic_units.xml
================================================
<vector android:height="24dp" android:tint="#000000"
    android:viewportHeight="24" android:viewportWidth="24"
    android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="@android:color/white" android:pathData="M14.17,13.71l1.4,-2.42c0.09,-0.15 0.05,-0.34 -0.08,-0.45l-1.48,-1.16c0.03,-0.22 0.05,-0.45 0.05,-0.68s-0.02,-0.46 -0.05,-0.69l1.48,-1.16c0.13,-0.11 0.17,-0.3 0.08,-0.45l-1.4,-2.42c-0.09,-0.15 -0.27,-0.21 -0.43,-0.15L12,4.83c-0.36,-0.28 -0.75,-0.51 -1.18,-0.69l-0.26,-1.85C10.53,2.13 10.38,2 10.21,2h-2.8C7.24,2 7.09,2.13 7.06,2.3L6.8,4.15C6.38,4.33 5.98,4.56 5.62,4.84l-1.74,-0.7c-0.16,-0.06 -0.34,0 -0.43,0.15l-1.4,2.42C1.96,6.86 2,7.05 2.13,7.16l1.48,1.16C3.58,8.54 3.56,8.77 3.56,9s0.02,0.46 0.05,0.69l-1.48,1.16C2,10.96 1.96,11.15 2.05,11.3l1.4,2.42c0.09,0.15 0.27,0.21 0.43,0.15l1.74,-0.7c0.36,0.28 0.75,0.51 1.18,0.69l0.26,1.85C7.09,15.87 7.24,16 7.41,16h2.8c0.17,0 0.32,-0.13 0.35,-0.3l0.26,-1.85c0.42,-0.18 0.82,-0.41 1.18,-0.69l1.74,0.7C13.9,13.92 14.08,13.86 14.17,13.71zM8.81,11c-1.1,0 -2,-0.9 -2,-2c0,-1.1 0.9,-2 2,-2s2,0.9 2,2C10.81,10.1 9.91,11 8.81,11z"/>
    <path android:fillColor="@android:color/white" android:pathData="M21.92,18.67l-0.96,-0.74c0.02,-0.14 0.04,-0.29 0.04,-0.44c0,-0.15 -0.01,-0.3 -0.04,-0.44l0.95,-0.74c0.08,-0.07 0.11,-0.19 0.05,-0.29l-0.9,-1.55c-0.05,-0.1 -0.17,-0.13 -0.28,-0.1l-1.11,0.45c-0.23,-0.18 -0.48,-0.33 -0.76,-0.44l-0.17,-1.18C18.73,13.08 18.63,13 18.53,13h-1.79c-0.11,0 -0.21,0.08 -0.22,0.19l-0.17,1.18c-0.27,0.12 -0.53,0.26 -0.76,0.44l-1.11,-0.45c-0.1,-0.04 -0.22,0 -0.28,0.1l-0.9,1.55c-0.05,0.1 -0.04,0.22 0.05,0.29l0.95,0.74c-0.02,0.14 -0.03,0.29 -0.03,0.44c0,0.15 0.01,0.3 0.03,0.44l-0.95,0.74c-0.08,0.07 -0.11,0.19 -0.05,0.29l0.9,1.55c0.05,0.1 0.17,0.13 0.28,0.1l1.11,-0.45c0.23,0.18 0.48,0.33 0.76,0.44l0.17,1.18c0.02,0.11 0.11,0.19 0.22,0.19h1.79c0.11,0 0.21,-0.08 0.22,-0.19l0.17,-1.18c0.27,-0.12 0.53,-0.26 0.75,-0.44l1.12,0.45c0.1,0.04 0.22,0 0.28,-0.1l0.9,-1.55C22.03,18.86 22,18.74 21.92,18.67zM17.63,18.83c-0.74,0 -1.35,-0.6 -1.35,-1.35s0.6,-1.35 1.35,-1.35s1.35,0.6 1.35,1.35S18.37,18.83 17.63,18.83z"/>
</vector>


================================================
FILE: app/src/main/res/drawable-night/ic_arrow_back.xml
================================================
<vector android:autoMirrored="true" android:height="24dp"
    android:tint="#FFFFFF" android:viewportHeight="24"
    android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="@android:color/white" android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>


================================================
FILE: app/src/main/res/drawable-night/ic_exclude_24.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:tint="#FFFFFF"
    android:viewportWidth="24"
    android:viewportHeight="24">

    <path
        android:fillColor="@android:color/white"
        android:pathData="M7,11v2h10v-2L7,11zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z" />

</vector>


================================================
FILE: app/src/main/res/drawable-night/ic_info_24.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:tint="#FFFFFF"
    android:viewportWidth="24"
    android:viewportHeight="24">

    <path
        android:fillColor="@android:color/white"
        android:pathData="M11,7h2v2h-2V7zM11,11h2v6h-2V11zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10s10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8s8,3.59 8,8S16.41,20 12,20z" />

</vector>


================================================
FILE: app/src/main/res/drawable-night/ic_language.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:tint="#FFFFFF"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM18.92,8h-2.95c-0.32,-1.25 -0.78,-2.45 -1.38,-3.56 1.84,0.63 3.37,1.91 4.33,3.56zM12,4.04c0.83,1.2 1.48,2.53 1.91,3.96h-3.82c0.43,-1.43 1.08,-2.76 1.91,-3.96zM4.26,14C4.1,13.36 4,12.69 4,12s0.1,-1.36 0.26,-2h3.38c-0.08,0.66 -0.14,1.32 -0.14,2 0,0.68 0.06,1.34 0.14,2L4.26,14zM5.08,16h2.95c0.32,1.25 0.78,2.45 1.38,3.56 -1.84,-0.63 -3.37,-1.9 -4.33,-3.56zM8.03,8L5.08,8c0.96,-1.66 2.49,-2.93 4.33,-3.56C8.81,5.55 8.35,6.75 8.03,8zM12,19.96c-0.83,-1.2 -1.48,-2.53 -1.91,-3.96h3.82c-0.43,1.43 -1.08,2.76 -1.91,3.96zM14.34,14L9.66,14c-0.09,-0.66 -0.16,-1.32 -0.16,-2 0,-0.68 0.07,-1.35 0.16,-2h4.68c0.09,0.65 0.16,1.32 0.16,2 0,0.68 -0.07,1.34 -0.16,2zM14.59,19.56c0.6,-1.11 1.06,-2.31 1.38,-3.56h2.95c-0.96,1.65 -2.49,2.93 -4.33,3.56zM16.36,14c0.08,-0.66 0.14,-1.32 0.14,-2 0,-0.68 -0.06,-1.34 -0.14,-2h3.38c0.16,0.64 0.26,1.31 0.26,2s-0.1,1.36 -0.26,2h-3.38z" />
</vector>


================================================
FILE: app/src/main/res/drawable-night/ic_settings.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:tint="#FFFFFF"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <path
        android:fillColor="@android:color/black"
        android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z" />
</vector>


================================================
FILE: app/src/main/res/drawable-night/ic_time_24.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:tint="#FFFFFF"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z" />
    <path
        android:fillColor="@android:color/white"
        android:pathData="M12.5,7H11v6l5.25,3.15 0.75,-1.23 -4.5,-2.67z" />
</vector>


================================================
FILE: app/src/main/res/drawable-night/ic_units.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:tint="#FFFFFF"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M14.17,13.71l1.4,-2.42c0.09,-0.15 0.05,-0.34 -0.08,-0.45l-1.48,-1.16c0.03,-0.22 0.05,-0.45 0.05,-0.68s-0.02,-0.46 -0.05,-0.69l1.48,-1.16c0.13,-0.11 0.17,-0.3 0.08,-0.45l-1.4,-2.42c-0.09,-0.15 -0.27,-0.21 -0.43,-0.15L12,4.83c-0.36,-0.28 -0.75,-0.51 -1.18,-0.69l-0.26,-1.85C10.53,2.13 10.38,2 10.21,2h-2.8C7.24,2 7.09,2.13 7.06,2.3L6.8,4.15C6.38,4.33 5.98,4.56 5.62,4.84l-1.74,-0.7c-0.16,-0.06 -0.34,0 -0.43,0.15l-1.4,2.42C1.96,6.86 2,7.05 2.13,7.16l1.48,1.16C3.58,8.54 3.56,8.77 3.56,9s0.02,0.46 0.05,0.69l-1.48,1.16C2,10.96 1.96,11.15 2.05,11.3l1.4,2.42c0.09,0.15 0.27,0.21 0.43,0.15l1.74,-0.7c0.36,0.28 0.75,0.51 1.18,0.69l0.26,1.85C7.09,15.87 7.24,16 7.41,16h2.8c0.17,0 0.32,-0.13 0.35,-0.3l0.26,-1.85c0.42,-0.18 0.82,-0.41 1.18,-0.69l1.74,0.7C13.9,13.92 14.08,13.86 14.17,13.71zM8.81,11c-1.1,0 -2,-0.9 -2,-2c0,-1.1 0.9,-2 2,-2s2,0.9 2,2C10.81,10.1 9.91,11 8.81,11z" />
    <path
        android:fillColor="@android:color/white"
        android:pathData="M21.92,18.67l-0.96,-0.74c0.02,-0.14 0.04,-0.29 0.04,-0.44c0,-0.15 -0.01,-0.3 -0.04,-0.44l0.95,-0.74c0.08,-0.07 0.11,-0.19 0.05,-0.29l-0.9,-1.55c-0.05,-0.1 -0.17,-0.13 -0.28,-0.1l-1.11,0.45c-0.23,-0.18 -0.48,-0.33 -0.76,-0.44l-0.17,-1.18C18.73,13.08 18.63,13 18.53,13h-1.79c-0.11,0 -0.21,0.08 -0.22,0.19l-0.17,1.18c-0.27,0.12 -0.53,0.26 -0.76,0.44l-1.11,-0.45c-0.1,-0.04 -0.22,0 -0.28,0.1l-0.9,1.55c-0.05,0.1 -0.04,0.22 0.05,0.29l0.95,0.74c-0.02,0.14 -0.03,0.29 -0.03,0.44c0,0.15 0.01,0.3 0.03,0.44l-0.95,0.74c-0.08,0.07 -0.11,0.19 -0.05,0.29l0.9,1.55c0.05,0.1 0.17,0.13 0.28,0.1l1.11,-0.45c0.23,0.18 0.48,0.33 0.76,0.44l0.17,1.18c0.02,0.11 0.11,0.19 0.22,0.19h1.79c0.11,0 0.21,-0.08 0.22,-0.19l0.17,-1.18c0.27,-0.12 0.53,-0.26 0.75,-0.44l1.12,0.45c0.1,0.04 0.22,0 0.28,-0.1l0.9,-1.55C22.03,18.86 22,18.74 21.92,18.67zM17.63,18.83c-0.74,0 -1.35,-0.6 -1.35,-1.35s0.6,-1.35 1.35,-1.35s1.35,0.6 1.35,1.35S18.37,18.83 17.63,18.83z" />
</vector>


================================================
FILE: app/src/main/res/drawable-v24/ic_launcher_foreground.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:aapt="http://schemas.android.com/aapt"
    android:width="108dp"
    android:height="108dp"
    android:viewportWidth="108"
    android:viewportHeight="108">
    <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
        <aapt:attr name="android:fillColor">
            <gradient
                android:endX="85.84757"
                android:endY="92.4963"
                android:startX="42.9492"
                android:startY="49.59793"
                android:type="linear">
                <item
                    android:color="#44000000"
                    android:offset="0.0" />
                <item
                    android:color="#00000000"
                    android:offset="1.0" />
            </gradient>
        </aapt:attr>
    </path>
    <path
        android:fillColor="#FFFFFF"
        android:fillType="nonZero"
        android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
        android:strokeWidth="1"
        android:strokeColor="#00000000" />
</vector>


================================================
FILE: app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_launcher_background" />
    <foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>


================================================
FILE: app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_launcher_background" />
    <foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>


================================================
FILE: app/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="immersive_sys_ui">#33000000</color>
    <color name="nav_bar">@color/immersive_sys_ui</color>
</resources>


================================================
FILE: app/src/main/res/values/strings.xml
================================================
<resources>
    <string name="app_name" translatable="false">WeatherApp</string>

    <!--Home Screen-->
    <string name="home_content_description_setting_icon">Setting Icon</string>
    <string name="home_title_currently">Currently</string>
    <string name="home_feels_like_description">Feels like %1$s</string>
    <string name="home_today_forecast_title">Today\'s Forecast</string>
    <string name="home_weekly_forecast_title">Weekly Forecast</string>
    <string name="home_min_temp">Min %1$s</string>
    <string name="home_max_temp">Max %1$s</string>
    <string name="home_error_occured">An issue occurred</string>
    <string name="home_error_try_again">Try Again</string>
    <string name="home_enable_weather_in_settings">Enable %1$s weather in settings to see data.</string>
    <string name="home_weather_type_hourly">Hourly</string>
    <string name="home_weather_type_daily">Daily</string>
    <string name="home_weather_type_currently">Current</string>

    <!-- Settings Screen-->
    <string name="settings_screen_title">Settings</string>
    <string name="back_button_content_description_icon">Back Button</string>
    <string name="settings_language_label">Language</string>
    <string name="settings_unit_label">Units</string>
    <string name="settings_time_format">Time Format</string>
    <string name="settings_about">About</string>
    <string name="settings_exclude_label">Exclude</string>
    <string name="settings_content_description_lang_icon">Language Icon</string>
    <string name="settings_content_description_unit_icon">Units Icon</string>
    <string name="settings_content_description_time_icon">Time Icon</string>
    <string name="settings_content_description_about_icon">About Icon</string>
    <string name="settings_content_description_exclude_icon">Exclude icon</string>
    <string name="settings_confirm">Confirm</string>
    <string name="settings_save">Save</string>

    <!--    About Screen-->
    <string name="about_screen_title">About</string>

    <!--    Permissions-->
    <string name="location_rationale_title">Permission Request</string>
    <string name="location_rationale_description">Hey there, we need location permission to show you relevant / accurate weather information.</string>
    <string name="location_rationale_button_grant">Allow</string>
    <string name="location_rationale_button_deny">Deny</string>
    <string name="location_no_permission_screen_description">You need to grant location access to use the app</string>
    <string name="location_settings_not_enabled">Check your location settings and enable them</string>
    <string name="error_unauthorized">You may need to log in or sign up to see this :)</string>
    <string name="error_client">Oops,something fishy is up on your end :)</string>
    <string name="error_server">Oops! Something is wrong on our end :(</string>
    <string name="error_generic">Something is happening that\'s disturbing the force :(</string>
    <string name="error_connection">Check your internet connection and try again</string>

    <!--    Update-->
    <string name="update_available">Update is available for install</string>
    <string name="install_update">Install</string>

</resources>


================================================
FILE: app/src/main/res/values/themes.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <style name="Theme.WeatherApp" parent="@android:style/Theme.Material.Light.NoActionBar">
        <item name="android:colorPrimary">#ff00ff</item>
        <item name="android:colorAccent">#ff00ff</item>
        <item name="android:statusBarColor">@color/immersive_sys_ui</item>
        <item name="android:navigationBarColor">@color/nav_bar</item>
    </style>
</resources>


================================================
FILE: app/src/main/res/xml/backup_rules.xml
================================================
<?xml version="1.0" encoding="utf-8"?><!--
   Sample backup rules file; uncomment and customize as necessary.
   See https://developer.android.com/guide/topics/data/autobackup
   for details.
   Note: This file is ignored for devices older that API 31
   See https://developer.android.com/about/versions/12/backup-restore
-->
<full-backup-content>
    <!--
   <include domain="sharedpref" path="."/>
   <exclude domain="sharedpref" path="device.xml"/>
-->
</full-backup-content>


================================================
FILE: app/src/main/res/xml/data_extraction_rules.xml
================================================
<?xml version="1.0" encoding="utf-8"?><!--
   Sample data extraction rules file; uncomment and customize as necessary.
   See https://developer.android.com/about/versions/12/backup-restore#xml-changes
   for details.
-->
<data-extraction-rules>
    <cloud-backup>
        <!-- TODO: Use <include> and <exclude> to control what is backed up.
        <include .../>
        <exclude .../>
        -->
    </cloud-backup>
    <!--
    <device-transfer>
        <include .../>
        <exclude .../>
    </device-transfer>
    -->
</data-extraction-rules>


================================================
FILE: app/src/test/java/com/github/odaridavid/weatherapp/HomeViewModelTest.kt
================================================
package com.github.odaridavid.weatherapp

import app.cash.turbine.test
import com.github.odaridavid.weatherapp.api.Logger
import com.github.odaridavid.weatherapp.api.SettingsRepository
import com.github.odaridavid.weatherapp.api.WeatherRepository
import com.github.odaridavid.weatherapp.data.weather.DefaultWeatherRepository
import com.github.odaridavid.weatherapp.data.weather.remote.DefaultRemoteWeatherDataSource
import com.github.odaridavid.weatherapp.data.weather.remote.OpenWeatherService
import com.github.odaridavid.weatherapp.data.weather.remote.WeatherResponse
import com.github.odaridavid.weatherapp.fakes.FakeSettingsRepository
import com.github.odaridavid.weatherapp.fakes.fakeSuccessMappedWeatherResponse
import com.github.odaridavid.weatherapp.fakes.fakeSuccessWeatherResponse
import com.github.odaridavid.weatherapp.model.DefaultLocation
import com.github.odaridavid.weatherapp.model.SupportedLanguage
import com.github.odaridavid.weatherapp.model.TimeFormat
import com.github.odaridavid.weatherapp.model.Units
import com.github.odaridavid.weatherapp.rules.MainCoroutineRule
import com.github.odaridavid.weatherapp.ui.home.HomeScreenIntent
import com.github.odaridavid.weatherapp.ui.home.HomeScreenViewState
import com.github.odaridavid.weatherapp.ui.home.HomeViewModel
import com.google.common.truth.Truth
import io.mockk.coEvery
import io.mockk.impl.annotations.MockK
import io.mockk.mockk
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.runBlocking
import okhttp3.ResponseBody.Companion.toResponseBody
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import retrofit2.Response
import java.util.TimeZone

@OptIn(ExperimentalCoroutinesApi::class)
class HomeViewModelTest {

    @MockK
    val mockOpenWeatherService = mockk<OpenWeatherService>(relaxed = true)

    @MockK
    val mockLogger = mockk<Logger>(relaxed = true)

    private val settingsRepository: SettingsRepository by lazy {
        FakeSettingsRepository()
    }

    @get:Rule
    val coroutineRule = MainCoroutineRule()

    @Before
    fun setup() {
        TimeZone.setDefault(TimeZone.getTimeZone("UTC"))
    }

    @Test
    fun `when fetching weather data is successful, then display correct data`() = runBlocking {
        coEvery {
            mockOpenWeatherService.getWeatherData(
                any(), any(), any(), any(), any(), any()
            )
        } returns Response.su
Download .txt
gitextract_68o3_ggl/

├── .github/
│   └── workflows/
│       ├── code-analysis.yml
│       └── update-dependencies-action.yml
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── app/
│   ├── .gitignore
│   ├── build.gradle.kts
│   ├── google-services.json
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── kotlin/
│       │       └── com/
│       │           └── github/
│       │               └── odaridavid/
│       │                   └── weatherapp/
│       │                       └── SettingsRepositoryTest.kt
│       ├── debug/
│       │   └── res/
│       │       ├── drawable/
│       │       │   └── ic_launcher_background.xml
│       │       ├── drawable-v24/
│       │       │   └── ic_launcher_foreground.xml
│       │       └── mipmap-anydpi-v26/
│       │           ├── ic_launcher.xml
│       │           └── ic_launcher_round.xml
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── github/
│       │   │           └── odaridavid/
│       │   │               └── weatherapp/
│       │   │                   ├── MainViewModel.kt
│       │   │                   ├── WeatherApp.kt
│       │   │                   ├── common/
│       │   │                   │   ├── AndroidExtensions.kt
│       │   │                   │   └── LocationRequest.kt
│       │   │                   ├── data/
│       │   │                   │   ├── Extensions.kt
│       │   │                   │   ├── settings/
│       │   │                   │   │   └── DefaultSettingsRepository.kt
│       │   │                   │   └── weather/
│       │   │                   │       ├── DefaultWeatherRepository.kt
│       │   │                   │       ├── FirebaseLogger.kt
│       │   │                   │       └── remote/
│       │   │                   │           ├── DefaultRemoteWeatherDataSource.kt
│       │   │                   │           ├── Mappers.kt
│       │   │                   │           ├── OpenWeatherService.kt
│       │   │                   │           ├── RemoteWeatherDataSource.kt
│       │   │                   │           └── WeatherResponse.kt
│       │   │                   ├── designsystem/
│       │   │                   │   ├── Theme.kt
│       │   │                   │   ├── atom/
│       │   │                   │   │   ├── Color.kt
│       │   │                   │   │   ├── Dimensions.kt
│       │   │                   │   │   ├── Shape.kt
│       │   │                   │   │   └── Type.kt
│       │   │                   │   ├── molecule/
│       │   │                   │   │   ├── Buttons.kt
│       │   │                   │   │   ├── Image.kt
│       │   │                   │   │   └── Text.kt
│       │   │                   │   ├── organism/
│       │   │                   │   │   ├── BottomSheets.kt
│       │   │                   │   │   ├── Dialogs.kt
│       │   │                   │   │   ├── NavBars.kt
│       │   │                   │   │   ├── Row.kt
│       │   │                   │   │   └── TextWidgets.kt
│       │   │                   │   └── templates/
│       │   │                   │       ├── ErrorScreen.kt
│       │   │                   │       ├── InfoScreens.kt
│       │   │                   │       └── ProgressScreens.kt
│       │   │                   ├── di/
│       │   │                   │   ├── ClientModule.kt
│       │   │                   │   └── RepositoryModule.kt
│       │   │                   └── ui/
│       │   │                       ├── AppNavGraph.kt
│       │   │                       ├── MainActivity.kt
│       │   │                       ├── about/
│       │   │                       │   └── AboutScreen.kt
│       │   │                       ├── home/
│       │   │                       │   ├── HomeScreen.kt
│       │   │                       │   ├── HomeScreenIntent.kt
│       │   │                       │   ├── HomeViewModel.kt
│       │   │                       │   └── Mappers.kt
│       │   │                       ├── settings/
│       │   │                       │   ├── SettingsScreen.kt
│       │   │                       │   ├── SettingsScreenIntent.kt
│       │   │                       │   ├── SettingsViewModel.kt
│       │   │                       │   └── UIMapper.kt
│       │   │                       └── update/
│       │   │                           ├── UpdateAppException.kt
│       │   │                           ├── UpdateManager.kt
│       │   │                           └── UpdateStateFactory.kt
│       │   └── res/
│       │       ├── drawable/
│       │       │   ├── ic_arrow_back.xml
│       │       │   ├── ic_exclude_24.xml
│       │       │   ├── ic_info_24.xml
│       │       │   ├── ic_language.xml
│       │       │   ├── ic_launcher_background.xml
│       │       │   ├── ic_settings.xml
│       │       │   ├── ic_time_24.xml
│       │       │   └── ic_units.xml
│       │       ├── drawable-night/
│       │       │   ├── ic_arrow_back.xml
│       │       │   ├── ic_exclude_24.xml
│       │       │   ├── ic_info_24.xml
│       │       │   ├── ic_language.xml
│       │       │   ├── ic_settings.xml
│       │       │   ├── ic_time_24.xml
│       │       │   └── ic_units.xml
│       │       ├── drawable-v24/
│       │       │   └── ic_launcher_foreground.xml
│       │       ├── mipmap-anydpi-v26/
│       │       │   ├── ic_launcher.xml
│       │       │   └── ic_launcher_round.xml
│       │       ├── values/
│       │       │   ├── colors.xml
│       │       │   ├── strings.xml
│       │       │   └── themes.xml
│       │       └── xml/
│       │           ├── backup_rules.xml
│       │           └── data_extraction_rules.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── github/
│                       └── odaridavid/
│                           └── weatherapp/
│                               ├── HomeViewModelTest.kt
│                               ├── MainViewModelTest.kt
│                               ├── SettingsRepositoryTest.kt
│                               ├── SettingsViewModelTest.kt
│                               ├── UIMapperTest.kt
│                               ├── WeatherRepositoryTest.kt
│                               ├── fakes/
│                               │   ├── FakeSettingsRepository.kt
│                               │   └── Fakes.kt
│                               └── rules/
│                                   └── MainCoroutineRule.kt
├── build.gradle.kts
├── gradle/
│   ├── libs.versions.toml
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── iOSApp/
│   ├── iOSApp/
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   └── Contents.json
│   │   ├── ContentView.swift
│   │   ├── Preview Content/
│   │   │   └── Preview Assets.xcassets/
│   │   │       └── Contents.json
│   │   └── iOSAppApp.swift
│   ├── iOSApp.xcodeproj/
│   │   ├── project.pbxproj
│   │   ├── project.xcworkspace/
│   │   │   ├── contents.xcworkspacedata
│   │   │   ├── xcshareddata/
│   │   │   │   └── IDEWorkspaceChecks.plist
│   │   │   └── xcuserdata/
│   │   │       └── odari.xcuserdatad/
│   │   │           └── UserInterfaceState.xcuserstate
│   │   └── xcuserdata/
│   │       └── odari.xcuserdatad/
│   │           └── xcschemes/
│   │               └── xcschememanagement.plist
│   ├── iOSAppTests/
│   │   └── iOSAppTests.swift
│   └── iOSAppUITests/
│       ├── iOSAppUITests.swift
│       └── iOSAppUITestsLaunchTests.swift
├── pull_request_template.md
├── settings.gradle.kts
└── shared/
    ├── build.gradle.kts
    └── src/
        └── commonMain/
            └── kotlin/
                └── com/
                    └── github/
                        └── odaridavid/
                            └── weatherapp/
                                ├── api/
                                │   ├── Logger.kt
                                │   ├── SettingsRepository.kt
                                │   └── WeatherRepository.kt
                                └── model/
                                    ├── DefaultLocation.kt
                                    ├── ExcludedData.kt
                                    ├── Result.kt
                                    ├── SupportedLanguage.kt
                                    ├── Throwables.kt
                                    ├── TimeFormat.kt
                                    ├── Units.kt
                                    └── Weather.kt
Condensed preview — 128 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (304K chars).
[
  {
    "path": ".github/workflows/code-analysis.yml",
    "chars": 715,
    "preview": "name: Code Analysis\non:\n  pull_request:\n    branches:\n      - develop\njobs:\n  code-analysis:\n    runs-on: macos-latest\n "
  },
  {
    "path": ".github/workflows/update-dependencies-action.yml",
    "chars": 918,
    "preview": "name: Update Dependencies\non:\n  schedule:\n    - cron: '00 08 * * 4'\njobs:\n  version-update:\n    runs-on: macos-latest\n  "
  },
  {
    "path": ".gitignore",
    "chars": 233,
    "preview": "*.iml\n.gradle\n/local.properties\n/.idea/caches\n/.idea/libraries\n/.idea/modules.xml\n/.idea/workspace.xml\n/.idea/navEditor."
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 2628,
    "preview": "# Contributing to Weather App\n\n👍🎉 First off, thank you for taking the time to contribute! 🎉👍\n\nThe following is a set of "
  },
  {
    "path": "LICENSE",
    "chars": 11357,
    "preview": "                                 Apache License\n                           Version 2.0, January 2004\n                   "
  },
  {
    "path": "README.md",
    "chars": 11563,
    "preview": "### Weather App\n\n[![Build Status](https://app.bitrise.io/app/80f9b4627fc90757/status.svg?token=3KnRQl0WRfDT5UTzPDiRgA&br"
  },
  {
    "path": "app/.gitignore",
    "chars": 6,
    "preview": "/build"
  },
  {
    "path": "app/build.gradle.kts",
    "chars": 7414,
    "preview": "import com.google.firebase.perf.plugin.FirebasePerfExtension\n\nplugins {\n    alias(libs.plugins.com.android.application)\n"
  },
  {
    "path": "app/google-services.json",
    "chars": 2627,
    "preview": "{\n  \"project_info\": {\n    \"project_number\": \"610111461146\",\n    \"project_id\": \"weatherapp-e7fb4\",\n    \"storage_bucket\": "
  },
  {
    "path": "app/proguard-rules.pro",
    "chars": 755,
    "preview": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguar"
  },
  {
    "path": "app/src/androidTest/kotlin/com/github/odaridavid/weatherapp/SettingsRepositoryTest.kt",
    "chars": 2991,
    "preview": "package com.github.odaridavid.weatherapp\n\nimport android.content.Context\nimport androidx.test.core.app.ApplicationProvid"
  },
  {
    "path": "app/src/debug/res/drawable/ic_launcher_background.xml",
    "chars": 5606,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:wi"
  },
  {
    "path": "app/src/debug/res/drawable-v24/ic_launcher_foreground.xml",
    "chars": 1703,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:aapt=\"http://schemas.android.com/aapt\"\n    "
  },
  {
    "path": "app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml",
    "chars": 270,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <b"
  },
  {
    "path": "app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "chars": 270,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <b"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "chars": 1431,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:to"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/MainViewModel.kt",
    "chars": 2906,
    "preview": "package com.github.odaridavid.weatherapp\n\nimport androidx.lifecycle.ViewModel\nimport androidx.lifecycle.viewModelScope\ni"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/WeatherApp.kt",
    "chars": 223,
    "preview": "package com.github.odaridavid.weatherapp\n\nimport android.app.Application\nimport dagger.hilt.android.HiltAndroidApp\n\n@Hil"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/common/AndroidExtensions.kt",
    "chars": 2465,
    "preview": "package com.github.odaridavid.weatherapp.common\n\nimport android.Manifest\nimport android.app.Activity\nimport android.cont"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/common/LocationRequest.kt",
    "chars": 1930,
    "preview": "package com.github.odaridavid.weatherapp.common\n\nimport android.app.Activity\nimport androidx.activity.result.ActivityRes"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/data/Extensions.kt",
    "chars": 323,
    "preview": "package com.github.odaridavid.weatherapp.data\n\nimport android.content.Context\nimport androidx.datastore.core.DataStore\ni"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/data/settings/DefaultSettingsRepository.kt",
    "chars": 4194,
    "preview": "package com.github.odaridavid.weatherapp.data.settings\n\nimport android.content.Context\nimport androidx.datastore.prefere"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/data/weather/DefaultWeatherRepository.kt",
    "chars": 1843,
    "preview": "package com.github.odaridavid.weatherapp.data.weather\n\nimport com.github.odaridavid.weatherapp.api.Logger\nimport com.git"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/data/weather/FirebaseLogger.kt",
    "chars": 401,
    "preview": "package com.github.odaridavid.weatherapp.data.weather\n\nimport com.github.odaridavid.weatherapp.api.Logger\nimport com.goo"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/data/weather/remote/DefaultRemoteWeatherDataSource.kt",
    "chars": 1462,
    "preview": "package com.github.odaridavid.weatherapp.data.weather.remote\n\nimport com.github.odaridavid.weatherapp.BuildConfig\nimport"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/data/weather/remote/Mappers.kt",
    "chars": 4400,
    "preview": "package com.github.odaridavid.weatherapp.data.weather.remote\n\nimport com.github.odaridavid.weatherapp.BuildConfig\nimport"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/data/weather/remote/OpenWeatherService.kt",
    "chars": 520,
    "preview": "package com.github.odaridavid.weatherapp.data.weather.remote\n\nimport retrofit2.Response\nimport retrofit2.http.GET\nimport"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/data/weather/remote/RemoteWeatherDataSource.kt",
    "chars": 472,
    "preview": "package com.github.odaridavid.weatherapp.data.weather.remote\n\nimport com.github.odaridavid.weatherapp.model.DefaultLocat"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/data/weather/remote/WeatherResponse.kt",
    "chars": 1330,
    "preview": "package com.github.odaridavid.weatherapp.data.weather.remote\n\nimport kotlinx.serialization.SerialName\nimport kotlinx.ser"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/designsystem/Theme.kt",
    "chars": 1371,
    "preview": "package com.github.odaridavid.weatherapp.designsystem\n\nimport androidx.compose.foundation.isSystemInDarkTheme\nimport and"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/designsystem/atom/Color.kt",
    "chars": 1231,
    "preview": "package com.github.odaridavid.weatherapp.designsystem.atom\n\nimport androidx.compose.material3.darkColorScheme\nimport and"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/designsystem/atom/Dimensions.kt",
    "chars": 520,
    "preview": "package com.github.odaridavid.weatherapp.designsystem.atom\n\nimport androidx.compose.runtime.staticCompositionLocalOf\nimp"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/designsystem/atom/Shape.kt",
    "chars": 486,
    "preview": "package com.github.odaridavid.weatherapp.designsystem.atom\n\nimport androidx.compose.foundation.shape.RoundedCornerShape\n"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/designsystem/atom/Type.kt",
    "chars": 5975,
    "preview": "package com.github.odaridavid.weatherapp.designsystem.atom\n\nimport androidx.compose.material3.Typography\nimport androidx"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/designsystem/molecule/Buttons.kt",
    "chars": 1513,
    "preview": "package com.github.odaridavid.weatherapp.designsystem.molecule\n\nimport androidx.compose.foundation.background\nimport and"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/designsystem/molecule/Image.kt",
    "chars": 1046,
    "preview": "package com.github.odaridavid.weatherapp.designsystem.molecule\n\nimport androidx.compose.foundation.Image\nimport androidx"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/designsystem/molecule/Text.kt",
    "chars": 3020,
    "preview": "package com.github.odaridavid.weatherapp.designsystem.molecule\n\nimport androidx.compose.material3.MaterialTheme\nimport a"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/designsystem/organism/BottomSheets.kt",
    "chars": 7946,
    "preview": "package com.github.odaridavid.weatherapp.designsystem.organism\n\nimport androidx.compose.foundation.layout.Box\nimport and"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/designsystem/organism/Dialogs.kt",
    "chars": 3319,
    "preview": "package com.github.odaridavid.weatherapp.designsystem.organism\n\nimport android.Manifest\nimport androidx.activity.result."
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/designsystem/organism/NavBars.kt",
    "chars": 2127,
    "preview": "package com.github.odaridavid.weatherapp.designsystem.organism\n\nimport androidx.compose.foundation.layout.Row\nimport and"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/designsystem/organism/Row.kt",
    "chars": 1838,
    "preview": "package com.github.odaridavid.weatherapp.designsystem.organism\n\nimport androidx.annotation.DrawableRes\nimport androidx.c"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/designsystem/organism/TextWidgets.kt",
    "chars": 2581,
    "preview": "package com.github.odaridavid.weatherapp.designsystem.organism\n\nimport androidx.annotation.StringRes\nimport androidx.com"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/designsystem/templates/ErrorScreen.kt",
    "chars": 846,
    "preview": "package com.github.odaridavid.weatherapp.designsystem.templates\n\nimport androidx.compose.foundation.layout.ColumnScope\ni"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/designsystem/templates/InfoScreens.kt",
    "chars": 1443,
    "preview": "package com.github.odaridavid.weatherapp.designsystem.templates\n\nimport androidx.annotation.StringRes\nimport androidx.co"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/designsystem/templates/ProgressScreens.kt",
    "chars": 933,
    "preview": "package com.github.odaridavid.weatherapp.designsystem.templates\n\nimport androidx.compose.foundation.layout.Column\nimport"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/di/ClientModule.kt",
    "chars": 2857,
    "preview": "package com.github.odaridavid.weatherapp.di\n\nimport android.content.Context\nimport com.chuckerteam.chucker.api.ChuckerCo"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/di/RepositoryModule.kt",
    "chars": 1244,
    "preview": "package com.github.odaridavid.weatherapp.di\n\nimport com.github.odaridavid.weatherapp.api.Logger\nimport com.github.odarid"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/ui/AppNavGraph.kt",
    "chars": 3515,
    "preview": "package com.github.odaridavid.weatherapp.ui\n\nimport androidx.compose.runtime.Composable\nimport androidx.compose.runtime."
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/ui/MainActivity.kt",
    "chars": 6929,
    "preview": "package com.github.odaridavid.weatherapp.ui\n\nimport android.annotation.SuppressLint\nimport android.location.Location\nimp"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/ui/about/AboutScreen.kt",
    "chars": 789,
    "preview": "package com.github.odaridavid.weatherapp.ui.about\n\nimport androidx.compose.foundation.layout.Column\nimport androidx.comp"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/ui/home/HomeScreen.kt",
    "chars": 8584,
    "preview": "package com.github.odaridavid.weatherapp.ui.home\n\nimport androidx.compose.foundation.ExperimentalFoundationApi\nimport an"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/ui/home/HomeScreenIntent.kt",
    "chars": 212,
    "preview": "package com.github.odaridavid.weatherapp.ui.home\n\nsealed class HomeScreenIntent {\n    data object LoadWeatherData : Home"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/ui/home/HomeViewModel.kt",
    "chars": 3842,
    "preview": "package com.github.odaridavid.weatherapp.ui.home\n\nimport androidx.annotation.StringRes\nimport androidx.lifecycle.ViewMod"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/ui/home/Mappers.kt",
    "chars": 446,
    "preview": "package com.github.odaridavid.weatherapp.ui.home\n\nimport androidx.annotation.StringRes\nimport com.github.odaridavid.weat"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/ui/settings/SettingsScreen.kt",
    "chars": 7493,
    "preview": "package com.github.odaridavid.weatherapp.ui.settings\n\nimport androidx.compose.foundation.layout.Column\nimport androidx.c"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/ui/settings/SettingsScreenIntent.kt",
    "chars": 773,
    "preview": "package com.github.odaridavid.weatherapp.ui.settings\n\nimport com.github.odaridavid.weatherapp.model.ExcludedData\nimport "
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/ui/settings/SettingsViewModel.kt",
    "chars": 5839,
    "preview": "package com.github.odaridavid.weatherapp.ui.settings\n\nimport androidx.lifecycle.ViewModel\nimport androidx.lifecycle.view"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/ui/settings/UIMapper.kt",
    "chars": 1686,
    "preview": "package com.github.odaridavid.weatherapp.ui.settings\n\nimport com.github.odaridavid.weatherapp.designsystem.organism.Bott"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/ui/update/UpdateAppException.kt",
    "chars": 122,
    "preview": "package com.github.odaridavid.weatherapp.ui.update\n\ndata class UpdateAppException(val throwable: Throwable) : Exception("
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/ui/update/UpdateManager.kt",
    "chars": 2613,
    "preview": "package com.github.odaridavid.weatherapp.ui.update\n\nimport android.content.Context\nimport androidx.activity.result.Activ"
  },
  {
    "path": "app/src/main/java/com/github/odaridavid/weatherapp/ui/update/UpdateStateFactory.kt",
    "chars": 1463,
    "preview": "package com.github.odaridavid.weatherapp.ui.update\n\nimport com.google.android.play.core.install.InstallStateUpdatedListe"
  },
  {
    "path": "app/src/main/res/drawable/ic_arrow_back.xml",
    "chars": 370,
    "preview": "<vector android:autoMirrored=\"true\" android:height=\"24dp\"\n    android:tint=\"#000000\" android:viewportHeight=\"24\"\n    and"
  },
  {
    "path": "app/src/main/res/drawable/ic_exclude_24.xml",
    "chars": 438,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\" android:height=\"24dp\" android:tint=\"#000000\" android:"
  },
  {
    "path": "app/src/main/res/drawable/ic_info_24.xml",
    "chars": 453,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\" android:height=\"24dp\" android:tint=\"#000000\" android:"
  },
  {
    "path": "app/src/main/res/drawable/ic_language.xml",
    "chars": 1220,
    "preview": "<vector android:height=\"24dp\" android:tint=\"#000000\"\n    android:viewportHeight=\"24\" android:viewportWidth=\"24\"\n    andr"
  },
  {
    "path": "app/src/main/res/drawable/ic_launcher_background.xml",
    "chars": 5606,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:wi"
  },
  {
    "path": "app/src/main/res/drawable/ic_settings.xml",
    "chars": 1213,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n  "
  },
  {
    "path": "app/src/main/res/drawable/ic_time_24.xml",
    "chars": 549,
    "preview": "<vector android:height=\"24dp\" android:tint=\"#000000\"\n    android:viewportHeight=\"24\" android:viewportWidth=\"24\"\n    andr"
  },
  {
    "path": "app/src/main/res/drawable/ic_units.xml",
    "chars": 2145,
    "preview": "<vector android:height=\"24dp\" android:tint=\"#000000\"\n    android:viewportHeight=\"24\" android:viewportWidth=\"24\"\n    andr"
  },
  {
    "path": "app/src/main/res/drawable-night/ic_arrow_back.xml",
    "chars": 370,
    "preview": "<vector android:autoMirrored=\"true\" android:height=\"24dp\"\n    android:tint=\"#FFFFFF\" android:viewportHeight=\"24\"\n    and"
  },
  {
    "path": "app/src/main/res/drawable-night/ic_exclude_24.xml",
    "chars": 465,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n  "
  },
  {
    "path": "app/src/main/res/drawable-night/ic_info_24.xml",
    "chars": 480,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n  "
  },
  {
    "path": "app/src/main/res/drawable-night/ic_language.xml",
    "chars": 1249,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n  "
  },
  {
    "path": "app/src/main/res/drawable-night/ic_settings.xml",
    "chars": 1213,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n  "
  },
  {
    "path": "app/src/main/res/drawable-night/ic_time_24.xml",
    "chars": 595,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n  "
  },
  {
    "path": "app/src/main/res/drawable-night/ic_units.xml",
    "chars": 2191,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n  "
  },
  {
    "path": "app/src/main/res/drawable-v24/ic_launcher_foreground.xml",
    "chars": 1703,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:aapt=\"http://schemas.android.com/aapt\"\n    "
  },
  {
    "path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
    "chars": 273,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <b"
  },
  {
    "path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "chars": 273,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <b"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "chars": 175,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"immersive_sys_ui\">#33000000</color>\n    <color name="
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "chars": 3214,
    "preview": "<resources>\n    <string name=\"app_name\" translatable=\"false\">WeatherApp</string>\n\n    <!--Home Screen-->\n    <string nam"
  },
  {
    "path": "app/src/main/res/values/themes.xml",
    "chars": 429,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <style name=\"Theme.WeatherApp\" parent=\"@android:style/Theme.Mate"
  },
  {
    "path": "app/src/main/res/xml/backup_rules.xml",
    "chars": 479,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?><!--\n   Sample backup rules file; uncomment and customize as necessary.\n   See htt"
  },
  {
    "path": "app/src/main/res/xml/data_extraction_rules.xml",
    "chars": 552,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?><!--\n   Sample data extraction rules file; uncomment and customize as necessary.\n "
  },
  {
    "path": "app/src/test/java/com/github/odaridavid/weatherapp/HomeViewModelTest.kt",
    "chars": 8585,
    "preview": "package com.github.odaridavid.weatherapp\n\nimport app.cash.turbine.test\nimport com.github.odaridavid.weatherapp.api.Logge"
  },
  {
    "path": "app/src/test/java/com/github/odaridavid/weatherapp/MainViewModelTest.kt",
    "chars": 3223,
    "preview": "package com.github.odaridavid.weatherapp\n\nimport app.cash.turbine.test\nimport com.github.odaridavid.weatherapp.api.Logge"
  },
  {
    "path": "app/src/test/java/com/github/odaridavid/weatherapp/SettingsRepositoryTest.kt",
    "chars": 4217,
    "preview": "package com.github.odaridavid.weatherapp\n\nimport com.github.odaridavid.weatherapp.api.SettingsRepository\nimport com.gith"
  },
  {
    "path": "app/src/test/java/com/github/odaridavid/weatherapp/SettingsViewModelTest.kt",
    "chars": 4951,
    "preview": "package com.github.odaridavid.weatherapp\n\nimport app.cash.turbine.test\nimport com.github.odaridavid.weatherapp.api.Logge"
  },
  {
    "path": "app/src/test/java/com/github/odaridavid/weatherapp/UIMapperTest.kt",
    "chars": 6064,
    "preview": "package com.github.odaridavid.weatherapp\n\nimport com.github.odaridavid.weatherapp.designsystem.organism.BottomSheetItem\n"
  },
  {
    "path": "app/src/test/java/com/github/odaridavid/weatherapp/WeatherRepositoryTest.kt",
    "chars": 9913,
    "preview": "package com.github.odaridavid.weatherapp\n\nimport com.github.odaridavid.weatherapp.api.Logger\nimport com.github.odaridavi"
  },
  {
    "path": "app/src/test/java/com/github/odaridavid/weatherapp/fakes/FakeSettingsRepository.kt",
    "chars": 2879,
    "preview": "package com.github.odaridavid.weatherapp.fakes\n\nimport com.github.odaridavid.weatherapp.api.SettingsRepository\nimport co"
  },
  {
    "path": "app/src/test/java/com/github/odaridavid/weatherapp/fakes/Fakes.kt",
    "chars": 2013,
    "preview": "package com.github.odaridavid.weatherapp.fakes\n\nimport com.github.odaridavid.weatherapp.data.weather.remote.CurrentWeath"
  },
  {
    "path": "app/src/test/java/com/github/odaridavid/weatherapp/rules/MainCoroutineRule.kt",
    "chars": 740,
    "preview": "package com.github.odaridavid.weatherapp.rules\n\nimport kotlinx.coroutines.Dispatchers\nimport kotlinx.coroutines.Experime"
  },
  {
    "path": "build.gradle.kts",
    "chars": 1757,
    "preview": "import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask\n\nplugins {\n    alias(libs.plugins.com.android.a"
  },
  {
    "path": "gradle/libs.versions.toml",
    "chars": 7714,
    "preview": "[versions]\nabout-lib = \"12.0.0-a04\"\nactivity-compose = \"1.10.1\"\nandroid-gradle-plugin = \"8.9.0\"\nandroidx-test-rules = \"1"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "chars": 233,
    "preview": "#Tue Jan 14 09:55:22 CET 2025\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://"
  },
  {
    "path": "gradle.properties",
    "chars": 1436,
    "preview": "# Project-wide Gradle settings.\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will ov"
  },
  {
    "path": "gradlew",
    "chars": 5768,
    "preview": "#!/usr/bin/env bash\n\n#\n# Copyright 2015 the original author or authors.\n#\n# Licensed under the Apache License, Version 2"
  },
  {
    "path": "gradlew.bat",
    "chars": 2674,
    "preview": "@rem\n@rem Copyright 2015 the original author or authors.\n@rem\n@rem Licensed under the Apache License, Version 2.0 (the \""
  },
  {
    "path": "iOSApp/iOSApp/Assets.xcassets/AccentColor.colorset/Contents.json",
    "chars": 123,
    "preview": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }"
  },
  {
    "path": "iOSApp/iOSApp/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 177,
    "preview": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"i"
  },
  {
    "path": "iOSApp/iOSApp/Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "iOSApp/iOSApp/ContentView.swift",
    "chars": 367,
    "preview": "//\n//  ContentView.swift\n//  iOSApp\n//\n//  Created by David Odari Kiribwa on 07.03.24.\n//\n\nimport SwiftUI\nimport shared\n"
  },
  {
    "path": "iOSApp/iOSApp/Preview Content/Preview Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "iOSApp/iOSApp/iOSAppApp.swift",
    "chars": 228,
    "preview": "//\n//  iOSAppApp.swift\n//  iOSApp\n//\n//  Created by David Odari Kiribwa on 07.03.24.\n//\n\nimport SwiftUI\n\n@main\nstruct iO"
  },
  {
    "path": "iOSApp/iOSApp.xcodeproj/project.pbxproj",
    "chars": 23453,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 56;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "iOSApp/iOSApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "chars": 135,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:\">\n   </FileRef"
  },
  {
    "path": "iOSApp/iOSApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
    "chars": 238,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "iOSApp/iOSApp.xcodeproj/xcuserdata/odari.xcuserdatad/xcschemes/xcschememanagement.plist",
    "chars": 341,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "iOSApp/iOSAppTests/iOSAppTests.swift",
    "chars": 1224,
    "preview": "//\n//  iOSAppTests.swift\n//  iOSAppTests\n//\n//  Created by David Odari Kiribwa on 07.03.24.\n//\n\nimport XCTest\n@testable "
  },
  {
    "path": "iOSApp/iOSAppUITests/iOSAppUITests.swift",
    "chars": 1377,
    "preview": "//\n//  iOSAppUITests.swift\n//  iOSAppUITests\n//\n//  Created by David Odari Kiribwa on 07.03.24.\n//\n\nimport XCTest\n\nfinal"
  },
  {
    "path": "iOSApp/iOSAppUITests/iOSAppUITestsLaunchTests.swift",
    "chars": 807,
    "preview": "//\n//  iOSAppUITestsLaunchTests.swift\n//  iOSAppUITests\n//\n//  Created by David Odari Kiribwa on 07.03.24.\n//\n\nimport XC"
  },
  {
    "path": "pull_request_template.md",
    "chars": 174,
    "preview": "## Related Issue\n\n## Description\n\n## How Can It Be Tested\n\n## Screenshots (If Applicable)\n\n## Additional Comments\n\n## Ch"
  },
  {
    "path": "settings.gradle.kts",
    "chars": 282,
    "preview": "pluginManagement {\n    repositories {\n        gradlePluginPortal()\n        google()\n        mavenCentral()\n    }\n}\ndepen"
  },
  {
    "path": "shared/build.gradle.kts",
    "chars": 931,
    "preview": "plugins {\n    alias(libs.plugins.kotlinMultiplatform)\n    alias(libs.plugins.com.android.library)\n}\n\nkotlin {\n    androi"
  },
  {
    "path": "shared/src/commonMain/kotlin/com/github/odaridavid/weatherapp/api/Logger.kt",
    "chars": 110,
    "preview": "package com.github.odaridavid.weatherapp.api\n\ninterface Logger {\n    fun logException(throwable: Throwable)\n}\n"
  },
  {
    "path": "shared/src/commonMain/kotlin/com/github/odaridavid/weatherapp/api/SettingsRepository.kt",
    "chars": 978,
    "preview": "package com.github.odaridavid.weatherapp.api\n\nimport com.github.odaridavid.weatherapp.model.DefaultLocation\nimport com.g"
  },
  {
    "path": "shared/src/commonMain/kotlin/com/github/odaridavid/weatherapp/api/WeatherRepository.kt",
    "chars": 397,
    "preview": "package com.github.odaridavid.weatherapp.api\n\nimport com.github.odaridavid.weatherapp.model.DefaultLocation\nimport com.g"
  },
  {
    "path": "shared/src/commonMain/kotlin/com/github/odaridavid/weatherapp/model/DefaultLocation.kt",
    "chars": 120,
    "preview": "package com.github.odaridavid.weatherapp.model\n\ndata class DefaultLocation(val longitude: Double, val latitude: Double)\n"
  },
  {
    "path": "shared/src/commonMain/kotlin/com/github/odaridavid/weatherapp/model/ExcludedData.kt",
    "chars": 259,
    "preview": "package com.github.odaridavid.weatherapp.model\n\nenum class ExcludedData(val value: String, val id: Int) {\n    CURRENT(\"c"
  },
  {
    "path": "shared/src/commonMain/kotlin/com/github/odaridavid/weatherapp/model/Result.kt",
    "chars": 275,
    "preview": "package com.github.odaridavid.weatherapp.model\n\nsealed class Result<T> {\n    data class Success<T>(val data: T) : Result"
  },
  {
    "path": "shared/src/commonMain/kotlin/com/github/odaridavid/weatherapp/model/SupportedLanguage.kt",
    "chars": 1634,
    "preview": "package com.github.odaridavid.weatherapp.model\n\nenum class SupportedLanguage(val languageName: String, val languageValue"
  },
  {
    "path": "shared/src/commonMain/kotlin/com/github/odaridavid/weatherapp/model/Throwables.kt",
    "chars": 315,
    "preview": "package com.github.odaridavid.weatherapp.model\n\ndata class ClientException(override val message: String) : Throwable(mes"
  },
  {
    "path": "shared/src/commonMain/kotlin/com/github/odaridavid/weatherapp/model/TimeFormat.kt",
    "chars": 155,
    "preview": "package com.github.odaridavid.weatherapp.model\n\nenum class TimeFormat(val value: String) {\n    TWENTY_FOUR_HOUR(\"24 hour"
  },
  {
    "path": "shared/src/commonMain/kotlin/com/github/odaridavid/weatherapp/model/Units.kt",
    "chars": 200,
    "preview": "package com.github.odaridavid.weatherapp.model\n\nenum class Units(val value: String, val tempLabel: String) {\n    STANDAR"
  },
  {
    "path": "shared/src/commonMain/kotlin/com/github/odaridavid/weatherapp/model/Weather.kt",
    "chars": 737,
    "preview": "package com.github.odaridavid.weatherapp.model\n\ndata class Weather(\n    val current: CurrentWeather?,\n    val hourly: Li"
  }
]

// ... and 2 more files (download for full content)

About this extraction

This page contains the full source code of the odaridavid/WeatherApp GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 128 files (274.0 KB), approximately 74.5k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!