Skip to content

Nils #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,22 +1,45 @@
package com.example.sweat4success.workout
import android.os.Bundle
import android.widget.Button
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.ViewModelProvider
import com.example.sweat4success.R
import com.example.sweat4success.controller.WorkoutController
import com.example.sweat4success.controller.DataController
import com.example.sweat4success.database.UserDb
import com.example.sweat4success.controller.FriendController
import com.example.sweat4success.modell.Account
import com.example.sweat4success.modell.Workouts
import com.example.sweat4success.modell.viewModel.UserViewModel
import com.example.sweat4success.modell.viewModel.WorkoutViewModel
import kotlinx.android.synthetic.main.shareworkout.view.*

class ShareWorkout:AppCompatActivity() {
private var account: Account = Account()
private var account: Account = Account();
private lateinit var userViewModel: UserViewModel
private lateinit var workoutViewModel: WorkoutViewModel
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
userViewModel = ViewModelProvider(this).get(UserViewModel::class.java)
workoutViewModel = ViewModelProvider(this).get(WorkoutViewModel::class.java)
setContentView(R.layout.shareworkout)
}

fun setUI() {
val dc: WorkoutController = WorkoutController()
var userList = account.getUserList()
var username = ""
var user = userList.find { it.username == username } as UserDb
var userList = account.getUserList();
var username = "";
var user = userList.find { it.username == username } as UserDb;

}
private fun Button.setOnClickListener() {
val fc: FriendController = FriendController()
var friendname = friendtosharewith.text;
var users = userViewModel.getAll();
var user = users.find{x->x.username==friendname} as UserDb
var workoutModel=Workouts();
var workout=workoutViewModel.findByName(workoutModel.getWorkoutname())
if (fc.isFriend(user,userViewModel)){
fc.sendWorkout(workout,user.uid,userViewModel,workoutViewModel)
}
}

}
30 changes: 15 additions & 15 deletions app/src/main/res/layout/shareworkout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,31 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="140dp"
android:text="Select Friend"
android:text="Choose a friend to share workout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView19" />

<EditText
android:id="@+id/editTextTextPersonName"
<Button
android:id="@+id/shareWorkoutButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:ems="10"
android:inputType="textPersonName"
android:padding="16dp"
android:layout_marginBottom="352dp"
android:text="Share Workout"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView20" />
app:layout_constraintHorizontal_bias="0.492"
app:layout_constraintStart_toStartOf="parent" />

<Button
android:id="@+id/button2"
<TextView
android:id="@+id/friendtosharewith"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="29dp"
android:text="TextView"
app:layout_constraintBottom_toTopOf="@+id/shareWorkoutButton"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editTextTextPersonName"
app:layout_constraintVertical_bias="0.172" />
app:layout_constraintTop_toBottomOf="@+id/textView20"
app:layout_constraintVertical_bias="0.107" />
</androidx.constraintlayout.widget.ConstraintLayout>
115 changes: 115 additions & 0 deletions documents/SAD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Software Architecture Document

# Table of Contents
- [Introduction](#1-introduction)
- [Purpose](#11-purpose)
- [Scope](#12-scope)
- [Definitions, Acronyms and Abbreviations](#13-definitions-acronyms-and-abbreviations)
- [References](#14-references)
- [Overview](#15-overview)
- [Architectural Representation](#2-architectural-representation)
- [Architectural Goals and Constraints](#3-architectural-goals-and-constraints)
- [Use-Case View](#4-use-case-view)
- [Logical View](#5-logical-view)
- [Overview](#51-overview)
- [Architecturally Significant Design Packages](#52-architecturally-significant-design-packages)
- [Process View](#6-process-view)
- [Deployment View](#7-deployment-view)
- [Implementation View](#8-implementation-view)
- [Data View](#9-data-view)
- [Size and Performance](#10-size-and-performance)
- [Quality](#11-quality)

## 1. Introduction

### 1.1 Purpose
This document provides a comprehensive architectural overview of our system, using a number of different architectural views to depict different aspects of the system. It is intended to capture and convey the significant architectural decisions which have been made on the system.

### 1.2 Scope
This document describes the technical architecture of the SweatForSuccess project and includes class structure, modules and dependencies.

### 1.3 Definitions, Acronyms and Abbreviations

| Abbrevation | Description |
| ----------- | -------------------------------------- |
| MVC | Model View Controller |
| SRS | Software Requirements Specification |
| UC | Use Case |
| VCS | Version Control System |
| n/a | not applicable |

### 1.4 References
<table>
<thead>
<tr>
<th>Title</th>
<th>Date</th>
<th>Publishing Organization</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://sweatforsuccess689030981.wordpress.com">Blog</a></td>
<td>18.05.2021</td>
<td>SweatForSuccess</td>
</tr>
<tr>
<td><a href="https://github.com/ThSilv3r/Sweat4Success/blob/master/documents/SRS.md">SRS</a></td>
<td>29.06.2021</td>
<td>SweatForSuccess </td>
</tr>
</tbody>
</table>

### 1.5 Overview
This project is based on the MVC pattern.

## 2. Architectural Representation
We are trying to implement according to the MVC pattern

## 3. Architectural Goals and Constraints
The application uses MVC as architectural pattern to separate the backend logic form the user interface. Purpose of the controller is to enable communication between components. This includes updating the model and change view based on user interaction.

## 4. Use-Case View
Here you can find our Use Case Diagram:

<img src="https://github.com/ThSilv3r/Sweat4Success/blob/master/documents/pictures/Use%20Case%20Diagram%20aktuell.jpeg" alt="Alt-Text" title="" />

### Following is a list of our Use Case realizations
<ol>
<li><a href="https://github.com/ThSilv3r/Sweat4Success/blob/master/UC/UCCreateAcount.md">UC Create Account</a></li>
<li><a href="https://github.com/ThSilv3r/Sweat4Success/blob/master/UC/UCCreateWorkout.md">UC Create Workout</a></li>
<li><a href="https://github.com/ThSilv3r/Sweat4Success/blob/master/UC/UCProfil.md">UC Profil</a></li>
<li><a href="https://github.com/ThSilv3r/Sweat4Success/blob/master/UC/pictures/UCcommentWorkout.md">UC Comment Workout</a></li>
<li><a href="https://github.com/ThSilv3r/Sweat4Success/blob/master/UC/pictures/UC%20searchWorkout.png">UC Search Workout</a></li>
<li><a href="https://github.com/ThSilv3r/Sweat4Success/blob/master/UC/UCShowWorkoutList.md>UC Show List of Workout</a></li>
<li><a href="https://github.com/ThSilv3r/Sweat4Success/blob/master/UC/pictures/UCshowListOfWorkouts.md">UC Show Workout</a></li>
<li><a href="https://github.com/ThSilv3r/Sweat4Success/blob/master/UC/UCLogIn.md">UC Login</a></li>
</ol>

## 5. Logical View

### 5.1 Overview
<img src="https://github.com/ThSilv3r/Sweat4Success/blob/master/documents/Screenshot%20(289).png" alt="Alt-Text" title="" />


### 5.2 Architecturally Significant Design Packages
n/a

## 6. Process View
n/a

## 7. Deployment View
Our app runs on the user's device and the data is provided by an external data base. We frequently test our app on physical devices.

## 8. Implementation View
n/a

## 9. Data View
Because we use Android Room as our Database the diffrent Objects are stored in diffrent Tables. <a href="https://sweatforsuccess689030981.wordpress.com/2020/11/15/w7-class-diagram/">Here</a> you can find infos how our Database is build.

## 10. Size and Performance
The app should be fairly small, very fast and easy to access. Any interaction with the app should be prompt so that the user does not have to wait for the app to start a workout.
## 11. Quality/Metrics
Since we are a unity project our metrics are a little bit more complicated and special.
We are explaining everything on our blog: https://sweatforsuccess689030981.wordpress.com/2021/05/30/s2-w7-metrics/