2024-05-20 12:31:12 +02:00
30 changed files with 659 additions and 40 deletions

View File

@@ -0,0 +1,35 @@
# Creating Styles in android
Styles and themes on Android make it possible for you to separate the details of our app design from the UI structure and behavior, identical to stylesheets in web design. We will use this in our project to maintain a consistent style, so that we won't have to hardcode it to each element. A style is a set of attributes that determine the appearance of a single View. A style can define features like font color, font size, background color, and a lot more.
To make a style you want to navigate to res/values/styles.xml in this file you can make styles. Fot this example we will make a buttonstyle that we can implement across multiple buttons. To make a style you need to add this code to your style.xml file
```xml
<resources>
<style name="ButtonStyle">
</style>
</resources>
```
After that, you may add your styling items in the code.
```xml
<style name="ButtonStyle">
<item name="android:textSize">24sp</item>
<item name="android:textColor">#000000</item>
<item name="android:background">#F0F0F0</item>
<item name= "android:textStyle">bold</item>
<item name="android:padding">16dp</item>
<item name="android:layout_margin">8dp</item>
</style>
```
If you have done this, return to your activity.xml file and add the style element to your object. You will need to connect your style to the element.
```xml
<Button
android:id="@+id/homeButton"
style="@style/ButtonStyle"/>
```
You can now add this to multiple buttons to keep the same style and avoid copying and pasting the same feature

View File

@@ -15,8 +15,9 @@ public class MyClass {
Then in a class you can have Methods or Atributes where the actual code is.
```mermaid
flowchart
a[Access Modifiers] --> b[class] --> c[Class name]
flowchart LR
0[~] --> a([Access Modifiers]) --> b([class]) --> c([Class name])
0 --> b
```
## Constructor
@@ -29,8 +30,11 @@ A method is a block of code which only runs when it is called. You can pass data
Methods are build like this
```mermaid
flowchart
A[Access Modifiers] --> B[Method Modifier] --> C[Return Type] --> D[Method Name] --> E[Parameters] --> F[Method Body]
flowchart LR
0([~]) --> A([Access Modifiers]) --> B([Method Modifier]) --> C([Return Type]) --> D([Method Name]) --> E([Parameters]) --> F([Method Body])
A --> C
0 --> C
D --> F
```

View File

@@ -3,11 +3,11 @@
Which sensor are we gonna use for this project and why?
### What do we wanna measure?
### What do we want to measure?
We wanna measure the movement of the people doing our exercises. We want to know how many times they have done the exercise and how many times they have done it correctly.
### What sensor are we gonna use?
### What sensor are we going to use?
To measure these movements we are gonna use gyroscopes. With gyroscopes we can measure the rotation of the body. With some math we can also measure the speed of the rotation. So we know how fast the person is doing the exercise.
### Which gyroscopes are there?