{"id":32042835,"url":"https://github.com/martinmd79/instrumentborrowingapp","last_synced_at":"2026-04-19T03:02:00.776Z","repository":{"id":310596782,"uuid":"1040477251","full_name":"Martinmd79/InstrumentBorrowingApp","owner":"Martinmd79","description":"Two-screen Android app where users browse instruments, pick a color, enter a rental duration, and confirm borrowing. Data moves between screens with intents, Parcelable, and UI feedback","archived":false,"fork":false,"pushed_at":"2025-08-19T03:36:42.000Z","size":951,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-29T15:52:09.430Z","etag":null,"topics":["android-application","intents","kotlin","material-design","parcelable","ui-navigation"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Martinmd79.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-19T03:34:01.000Z","updated_at":"2025-08-19T04:37:55.000Z","dependencies_parsed_at":"2025-08-19T05:35:40.611Z","dependency_job_id":"66a7881c-bb61-4f45-b1df-71384d436624","html_url":"https://github.com/Martinmd79/InstrumentBorrowingApp","commit_stats":null,"previous_names":["martinmd79/instrumentborrowingapp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Martinmd79/InstrumentBorrowingApp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Martinmd79%2FInstrumentBorrowingApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Martinmd79%2FInstrumentBorrowingApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Martinmd79%2FInstrumentBorrowingApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Martinmd79%2FInstrumentBorrowingApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Martinmd79","download_url":"https://codeload.github.com/Martinmd79/InstrumentBorrowingApp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Martinmd79%2FInstrumentBorrowingApp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31992822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android-application","intents","kotlin","material-design","parcelable","ui-navigation"],"created_at":"2025-10-17T17:00:08.698Z","updated_at":"2026-04-19T03:02:00.760Z","avatar_url":"https://github.com/Martinmd79.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Instrument Rental — Android App (Kotlin)\n\n[![Android](https://img.shields.io/badge/Platform-Android-3DDC84)](https://developer.android.com/)\n[![Language](https://img.shields.io/badge/Language-Kotlin-7F52FF)](https://kotlinlang.org/)\n[![UI](https://img.shields.io/badge/UI-Material%20Design-1f6feb)](https://m3.material.io/)\n[![Tests](https://img.shields.io/badge/Tests-Espresso-informational)](https://developer.android.com/training/testing/espresso)\n[![Status](https://img.shields.io/badge/Status-Active-success)](#)\n\nA clean, two-screen Android app for **renting musical instruments**. Users browse instruments, pick a color, select a rental duration, and confirm the borrow. The app follows Material Design, passes data between screens using **Intents + Parcelable**, returns results with **onActivityResult**, and surfaces feedback with **Snackbar/Toast**. Automated UI checks are written with **Espresso**.\n\n## Table of Contents\n- [Features](#features)\n- [Screens](#screens)\n- [Architecture](#architecture)\n- [Data Flow](#data-flow)\n- [UI/UX Choices](#uiux-choices)\n- [Validation \u0026 Error Handling](#validation--error-handling)\n- [Testing](#testing)\n- [Project Structure](#project-structure)\n- [Requirements](#requirements)\n- [Quick Start](#quick-start)\n- [Usage](#usage)\n- [Roadmap](#roadmap)\n- [Credits](#credits)\n- [License](#license)\n\n## Features\n- **Browse instruments** with image, name, description, rating, and **credits per month**.\n- **Select options**: color via `RadioGroup` + `RadioButton`; rating via `RatingBar`.\n- **Borrow flow**: enter duration (months), validate inputs, and confirm.\n- **Credit tracking**: show current credit; block actions when credits are insufficient.\n- **Responsive feedback**:\n  - **Snackbar** for actionable errors near the source control.\n  - **Toast** for quick confirmations/cancellations.\n- **Data passing**: `Parcelable` model moves instrument data between activities.\n- **Round-trip result**: return updated credit to the browser screen with `onActivityResult`.\n- **Automated UI tests** with Espresso: navigation, browsing, validation, and credit updates.\n\n## Screens\n- **Welcome / Get Started** → CTA that launches browsing.\n- **Instrument Browser** → Next/Prev browsing; shows details, rating, and color options; “Borrow”.\n- **Borrow Details** → Selected instrument recap, duration input, **Confirm** / **Cancel**.\n\n\u003e Add your screenshots here once you export them from the report:\n\u003e - `images/welcome.png`\n\u003e - `images/browse.png`\n\u003e - `images/borrow.png`\n\n## Architecture\nA simple two-activity flow with clear responsibilities.\n\n| Layer | Responsibility | Key Pieces |\n|------:|:--------------|:-----------|\n| UI | Material components, layout XML | ConstraintLayout, LinearLayout, ImageView, TextView, Button, RatingBar, RadioGroup |\n| Data Model | Parcelable instrument payload | `data class Instrument(...): Parcelable` |\n| Navigation | Screen-to-screen and result return | `Intent`, `putExtra`, `startActivityForResult`, `onActivityResult` |\n| Feedback | User messages | `Snackbar` (errors, validation), `Toast` (confirm/info) |\n| Tests | UI automation | Espresso test cases (navigation/browse/validate/credit) |\n\n## Data Flow\n```mermaid\nflowchart LR\n  A[Welcome\u003cbr/\u003eGet Started] --\u003e B[Browser\u003cbr/\u003eInstrument details]\n  B --\u003e|Borrow| C[Borrow Details\u003cbr/\u003eDuration + Confirm]\n  C --\u003e|Confirm OK| D{Enough credits?}\n  D --\u003e|No| E[Snackbar: Not enough credit]\n  D --\u003e|Yes| F[Update credit\u003cbr/\u003eToast confirm]\n  F --\u003e G[Return result to Browser]\n  G --\u003e B\n  C --\u003e|Cancel| H[Toast cancel] --\u003e B\n```\n\n### Parcelable Model (example)\n```kotlin\n@Parcelize\ndata class Instrument(\n  val name: String,\n  val description: String,\n  val price: Int,          // credits per month\n  val rating: Float,\n  val colorOptions: List\u003cString\u003e,\n  val imageRes: Int\n) : Parcelable\n```\n\n### Passing Data and Returning Results (example)\n```kotlin\n// Browser → Borrow Details\nval intent = Intent(this, BorrowDetailsActivity::class.java).apply {\n  putExtra(\"instrument\", currentInstrument)\n  putExtra(\"currentCredit\", currentCredit)\n  putExtra(\"selectedColor\", selectedColor)\n}\nstartActivityForResult(intent, REQUEST_BORROW)\n\n// Borrow Details → Browser (after confirm)\nval result = Intent().putExtra(\"updatedCredit\", newCredit)\nsetResult(Activity.RESULT_OK, result)\nfinish()\n\n// Browser receives result\noverride fun onActivityResult(req: Int, res: Int, data: Intent?) {\n  super.onActivityResult(req, res, data)\n  if (req == REQUEST_BORROW \u0026\u0026 res == Activity.RESULT_OK) {\n    currentCredit = data?.getIntExtra(\"updatedCredit\", currentCredit) ?: currentCredit\n    creditView.text = \"Credit: $currentCredit\"\n  }\n}\n```\n\n## UI/UX Choices\n- **Material Design** styling for buttons, text, spacing, and consistent theming.\n- **ConstraintLayout** as the default for flexible responsive positioning.\n- **LinearLayout** for simple vertical/horizontal sections where appropriate.\n- **Contextual messaging**: use Snackbar for input/validation issues placed near the control; Toast for short success info.\n\n## Validation \u0026 Error Handling\n- **Duration checks**: required, positive integer.\n- **Color required**: block proceed if no color is chosen (Snackbar prompt).\n- **Credit guard**: compare `duration * price` against `currentCredit`; show Snackbar when insufficient.\n- **Success \u0026 cancel**: confirm with Toast.\n\n## Testing\nAutomated UI tests with **Espresso** cover:\n- **Navigation**: welcome → browser → borrow → back with result.\n- **Browsing**: “Next” updates instrument name/description/image/price correctly.\n- **Validation**: empty/invalid duration and missing color show Snackbar.\n- **Credit handling**: confirming a borrow deducts credits and returns updated value.\n\nExample navigation test (sketch):\n```kotlin\n@Test fun navigationWorks() {\n  onView(withId(R.id.getStarted)).perform(click())\n  onView(withId(R.id.instrumentDetailsLayout)).check(matches(isDisplayed()))\n  onView(withId(R.id.nextButton)).perform(click())\n  onView(withId(R.id.borrowButton)).perform(click())\n  onView(withId(R.id.borrowDetailsLayout)).check(matches(isDisplayed()))\n}\n```\n\n## Project Structure\n```text\n/app\n  src/main/java/...\n    ui/\n      MainActivity        # Welcome / Get Started\n      BrowserActivity     # Browse instruments (a.k.a. MainActivity2 in report)\n      BorrowDetailsActivity\n    model/\n      Instrument.kt       # Parcelable data class\n    util/\n      Extensions.kt       # (optional helpers)\n  src/androidTest/java/... # Espresso tests\n  src/main/res/\n    layout/               # XML layouts (ConstraintLayout/LinearLayout)\n    drawable/             # icons / images\n    values/               # colors, styles (Material theme), strings\n```\n\n## Requirements\n- Android Studio (latest stable)\n- Kotlin plugin (bundled)\n- Android SDK + emulator/device\n\n## Quick Start\n```bash\n# Clone\ngit clone https://github.com/your-username/instrument-rental-android.git\ncd instrument-rental-android\n\n# Open with Android Studio\n# Build → Run on emulator or device\n```\n\n## Usage\n1. Launch app and tap **Get Started**.\n2. Browse instruments with **Next**; pick a **Color**.\n3. Tap **Borrow**, enter **Duration (months)**, **Confirm**.\n4. If credits are enough → success Toast; credit is deducted and shown back on the browser screen.  \n   If not enough → Snackbar explains what’s missing.\n\n## Roadmap\n- Login/profile to persist credit and history.\n- Animated transitions and richer UI states.\n- Instrument search/filter and favorites.\n- Local persistence (Room) or remote backend (Firebase) for real data.\n\n## Credits\n- Built with **Kotlin**, **Android Studio**, **Material Design**, and **Espresso**.\n- Wireframes created in **Figma**.\n- Report, sketches, and code screenshots informed this README.\n\n## License\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinmd79%2Finstrumentborrowingapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartinmd79%2Finstrumentborrowingapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinmd79%2Finstrumentborrowingapp/lists"}