Skip to content

Commit d0289f4

Browse files
committed
Manually merging the other branch
1 parent 422a959 commit d0289f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2189
-0
lines changed

.idea/modules/app/FitAppA.app.iml

+97
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
plugins {
2+
id 'com.android.application'
3+
}
4+
5+
android {
6+
compileSdkVersion 30
7+
buildToolsVersion '30.0.3'
8+
9+
defaultConfig {
10+
applicationId "com.example.fitappa"
11+
minSdkVersion 16
12+
targetSdkVersion 31
13+
versionCode 1
14+
versionName "1.0"
15+
16+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17+
}
18+
19+
buildTypes {
20+
release {
21+
minifyEnabled false
22+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23+
}
24+
}
25+
compileOptions {
26+
sourceCompatibility JavaVersion.VERSION_1_8
27+
targetCompatibility JavaVersion.VERSION_1_8
28+
}
29+
}
30+
31+
dependencies {
32+
33+
implementation 'androidx.appcompat:appcompat:1.3.1'
34+
implementation 'com.google.android.material:material:1.4.0'
35+
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
36+
testImplementation 'junit:junit:4.+'
37+
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
38+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
39+
}

app/proguard-rules.pro

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.example.fitappa;
2+
3+
import android.content.Context;
4+
import androidx.test.platform.app.InstrumentationRegistry;
5+
import androidx.test.ext.junit.runners.AndroidJUnit4;
6+
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
10+
import static org.junit.Assert.*;
11+
12+
/**
13+
* Instrumented test, which will execute on an Android device.
14+
*
15+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
16+
*/
17+
@RunWith(AndroidJUnit4.class)
18+
public class ExampleInstrumentedTest {
19+
@Test
20+
public void useAppContext() {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
23+
assertEquals("com.example.fitappa", appContext.getPackageName());
24+
}
25+
}

app/src/main/AndroidManifest.xml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.example.fitappa">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:supportsRtl="true"
11+
android:theme="@style/Theme.FitAppA">
12+
<activity android:name=".Interactor"
13+
android:exported="true">
14+
<intent-filter>
15+
<action android:name="android.intent.action.MAIN"/>
16+
17+
<category android:name="android.intent.category.LAUNCHER"/>
18+
</intent-filter>
19+
</activity>
20+
<activity
21+
android:name=".InteractorCreateAccount"
22+
android:exported="true">
23+
</activity>
24+
<activity
25+
android:name=".InteractorProfile"
26+
android:exported="true">
27+
</activity>
28+
29+
</application>
30+
31+
32+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package com.example.fitappa;
2+
3+
import android.content.Intent;
4+
import android.os.Bundle;
5+
import android.view.View;
6+
import android.widget.ImageView;
7+
import android.widget.TextView;
8+
import androidx.appcompat.app.AppCompatActivity;
9+
10+
public class Interactor extends AppCompatActivity {
11+
private TextView messageCreate;
12+
private TextView messageLog;
13+
14+
@Override
15+
protected void onCreate(Bundle savedInstanceState) {
16+
super.onCreate(savedInstanceState);
17+
setContentView(R.layout.activity_main);
18+
19+
messageCreate = findViewById(R.id.createATitle);
20+
messageLog = findViewById(R.id.logIn);
21+
22+
//Define and attach click listener
23+
messageCreate.setOnClickListener(new View.OnClickListener() {
24+
@Override
25+
public void onClick(View v) {
26+
createA();
27+
}
28+
});
29+
30+
messageLog.setOnClickListener(new View.OnClickListener() {
31+
@Override
32+
public void onClick(View v) {
33+
logIn();
34+
}
35+
});
36+
}
37+
38+
private void createA() {
39+
Intent intent = new Intent(this, InteractorCreateAccount.class);
40+
startActivity(intent);
41+
}
42+
43+
private void logIn() {
44+
Intent intent = new Intent(this, InteractorProfile.class);
45+
46+
startActivity(intent);
47+
}
48+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package com.example.fitappa;
2+
3+
import android.content.Intent;
4+
import android.os.Bundle;
5+
import android.view.View;
6+
import android.widget.TextView;
7+
import androidx.appcompat.app.AppCompatActivity;
8+
import com.google.android.material.textfield.TextInputEditText;
9+
import fitappfiles.Profiles;
10+
11+
import java.util.Observable;
12+
import java.util.Observer;
13+
14+
15+
public class InteractorCreateAccount extends AppCompatActivity {
16+
private TextInputEditText user;
17+
private TextInputEditText pass;
18+
private TextInputEditText mail;
19+
private TextView enter;
20+
private Profiles profiles;
21+
private ModelProfile Mprofile;
22+
23+
@Override
24+
protected void onCreate(Bundle savedInstanceState) {
25+
super.onCreate(savedInstanceState);
26+
setContentView(R.layout.create_account);
27+
this.profiles = new Profiles();
28+
this.Mprofile = new ModelProfile();
29+
30+
31+
user = findViewById(R.id.userName);
32+
pass = findViewById(R.id.password);
33+
mail = findViewById(R.id.email);
34+
enter = findViewById(R.id.submit);
35+
36+
enter.setOnClickListener(new View.OnClickListener() {
37+
@Override
38+
public void onClick(View v) {
39+
createA(user.getText().toString(),pass.getText().toString(),mail.getText().toString());
40+
}
41+
});
42+
43+
}
44+
45+
private void createA(String username, String password, String email) {
46+
System.out.println(this.profiles.signUp(username,password,email));
47+
48+
Intent intent = new Intent(this, InteractorProfile.class);
49+
startActivity(intent);
50+
}
51+
52+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package com.example.fitappa;
2+
3+
import android.content.Intent;
4+
import android.os.Bundle;
5+
import android.view.View;
6+
import android.widget.TextView;
7+
import androidx.appcompat.app.AppCompatActivity;
8+
import fitappfiles.Profile;
9+
10+
import java.util.Observable;
11+
import java.util.Observer;
12+
13+
public class InteractorProfile extends AppCompatActivity implements Observer {
14+
private TextView user;
15+
private TextView b;
16+
private Profile profile;
17+
private ModelProfile modelProfile;
18+
19+
@Override
20+
protected void onCreate(Bundle savedInstanceState) {
21+
super.onCreate(savedInstanceState);
22+
23+
setContentView(R.layout.main_profile);
24+
25+
System.out.println("heleleoeoeoeoeoeo");
26+
27+
modelProfile = new ModelProfile();
28+
modelProfile.addObserver(this);
29+
user = findViewById(R.id.userName);
30+
b = findViewById(R.id.back);
31+
32+
b.setOnClickListener(new View.OnClickListener() {
33+
@Override
34+
public void onClick(View v) {
35+
mainMenu();
36+
}
37+
});
38+
39+
}
40+
41+
private void mainMenu() {
42+
43+
Intent intent = new Intent(this, Interactor.class);
44+
startActivity(intent);
45+
}
46+
47+
48+
@Override
49+
public void update(Observable o, Object arg) {
50+
this.profile = modelProfile.getProfile();
51+
user.setText(profile.getUser().getUsername());
52+
}
53+
}

0 commit comments

Comments
 (0)