Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,26 @@
/captures
.externalNativeBuild
.cxx
local.properties
local.properties

#amplify-do-not-edit-begin
amplify/\#current-cloud-backend
amplify/.config/local-*
amplify/logs
amplify/mock-data
amplify/backend/amplify-meta.json
amplify/backend/awscloudformation
amplify/backend/.temp
build/
dist/
node_modules/
aws-exports.js
awsconfiguration.json
amplifyconfiguration.json
amplifyconfiguration.dart
amplify-build-config.json
amplify-gradle-config.json
amplifytools.xcconfig
.secret-*
**.sample
#amplify-do-not-edit-end
15 changes: 15 additions & 0 deletions .graphqlconfig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
projects:
taskmaster:
schemaPath: app/src/main/graphql/schema.json
includes:
- app/src/main/graphql/**/*.graphql
excludes:
- ./amplify/**
extensions:
amplify:
codeGenTarget: ''
generatedFileName: ''
docsFilePath: app/src/main/graphql/com/amazonaws/amplify/generated/graphql
extensions:
amplify:
version: 3
2 changes: 1 addition & 1 deletion .idea/deploymentTargetDropDown.xml

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

6 changes: 3 additions & 3 deletions .idea/misc.xml

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

38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,42 @@
![test](screenshots/Test31.png)


## **Lab32**

* Tasks Are Cloudy
Using the amplify add api command, create a Task resource that replicates our existing Task schema. Update all references to the Task data to instead use AWS Amplify to access your data in DynamoDB instead of in Room.

* Add Task Form
Modify your Add Task form to save the data entered in as a Task to DynamoDB.

* Homepage
Refactor your homepage’s RecyclerView to display all Task entities in DynamoDB.

![lab32](screenshots/lab32.png)


## **Lab33**

* Settings Page

In addition to a username, allow the user to choose their team on the Settings page. Use that Team to display only that team’s tasks on the homepage.

![lab33](screenshots/setting33.png)


* Homepage

Refactor your homepage’s RecyclerView to display all Task entities in DynamoDB.

![lab33](screenshots/homepage33.png)


* Add Task Form

Modify your Add Task form to include either a Spinner or Radio Buttons for which team that task belongs to.

![lab33](screenshots/AddTask33.png)




13 changes: 13 additions & 0 deletions amplify/.config/project-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"projectName": "TaskMaster",
"version": "3.1",
"frontend": "android",
"android": {
"config": {
"ResDir": "app/src/main/res"
}
},
"providers": [
"awscloudformation"
]
}
8 changes: 8 additions & 0 deletions amplify/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Getting Started with Amplify CLI
This directory was generated by [Amplify CLI](https://docs.amplify.aws/cli).

Helpful resources:
- Amplify documentation: https://docs.amplify.aws
- Amplify CLI documentation: https://docs.amplify.aws/cli
- More details on this folder & generated files: https://docs.amplify.aws/cli/reference/files
- Join Amplify's community: https://amplify.aws/community/
5 changes: 5 additions & 0 deletions amplify/backend/api/taskmaster/parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"AppSyncApiName": "taskmaster",
"DynamoDBBillingMode": "PAY_PER_REQUEST",
"DynamoDBEnableServerSideEncryption": false
}
2 changes: 2 additions & 0 deletions amplify/backend/api/taskmaster/resolvers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Any resolvers that you add in this directory will override the ones automatically generated by Amplify CLI and will be directly copied to the cloud.
For more information, visit [https://docs.amplify.aws/cli/graphql-transformer/resolvers](https://docs.amplify.aws/cli/graphql-transformer/resolvers)
15 changes: 15 additions & 0 deletions amplify/backend/api/taskmaster/schema.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
type Task @model @key(name: "byTeam", fields: ["teamID"]) {
id: ID!
title: String!
body: String
state: String
teamID: ID!
team: Team @connection(fields: ["teamID"])
}

type Team @model {
id: ID!
name: String
task: [Task] @connection(keyName: "byTeam", fields: ["id"])
}

58 changes: 58 additions & 0 deletions amplify/backend/api/taskmaster/stacks/CustomResources.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "An auto-generated nested stack.",
"Metadata": {},
"Parameters": {
"AppSyncApiId": {
"Type": "String",
"Description": "The id of the AppSync API associated with this project."
},
"AppSyncApiName": {
"Type": "String",
"Description": "The name of the AppSync API",
"Default": "AppSyncSimpleTransform"
},
"env": {
"Type": "String",
"Description": "The environment name. e.g. Dev, Test, or Production",
"Default": "NONE"
},
"S3DeploymentBucket": {
"Type": "String",
"Description": "The S3 bucket containing all deployment assets for the project."
},
"S3DeploymentRootKey": {
"Type": "String",
"Description": "An S3 key relative to the S3DeploymentBucket that points to the root\nof the deployment directory."
}
},
"Resources": {
"EmptyResource": {
"Type": "Custom::EmptyResource",
"Condition": "AlwaysFalse"
}
},
"Conditions": {
"HasEnvironmentParameter": {
"Fn::Not": [
{
"Fn::Equals": [
{
"Ref": "env"
},
"NONE"
]
}
]
},
"AlwaysFalse": {
"Fn::Equals": ["true", "false"]
}
},
"Outputs": {
"EmptyOutput": {
"Description": "An empty output. You may delete this if you have at least one resource above.",
"Value": ""
}
}
}
10 changes: 10 additions & 0 deletions amplify/backend/api/taskmaster/transform.conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"Version": 5,
"ElasticsearchWarning": true,
"ResolverConfig": {
"project": {
"ConflictHandler": "AUTOMERGE",
"ConflictDetection": "VERSION"
}
}
}
20 changes: 20 additions & 0 deletions amplify/backend/backend-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"api": {
"taskmaster": {
"service": "AppSync",
"providerPlugin": "awscloudformation",
"output": {
"authConfig": {
"defaultAuthentication": {
"authenticationType": "API_KEY",
"apiKeyConfig": {
"apiKeyExpirationDays": 35,
"description": "Heba key"
}
},
"additionalAuthenticationProviders": []
}
}
}
}
}
10 changes: 10 additions & 0 deletions amplify/backend/tags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"Key": "user:Stack",
"Value": "{project-env}"
},
{
"Key": "user:Application",
"Value": "{project-name}"
}
]
45 changes: 45 additions & 0 deletions amplify/cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"features": {
"graphqltransformer": {
"addmissingownerfields": true,
"improvepluralization": false,
"validatetypenamereservedwords": true,
"useexperimentalpipelinedtransformer": false,
"enableiterativegsiupdates": true,
"secondarykeyasgsi": true,
"skipoverridemutationinputtypes": true
},
"frontend-ios": {
"enablexcodeintegration": true
},
"auth": {
"enablecaseinsensitivity": true,
"useinclusiveterminology": true,
"breakcirculardependency": true,
"forcealiasattributes": false
},
"codegen": {
"useappsyncmodelgenplugin": true,
"usedocsgeneratorplugin": true,
"usetypesgeneratorplugin": true,
"cleangeneratedmodelsdirectory": true,
"retaincasestyle": true,
"addtimestampfields": true,
"handlelistnullabilitytransparently": true,
"emitauthprovider": true,
"generateindexrules": true,
"enabledartnullsafety": true
},
"appsync": {
"generategraphqlpermissions": true
},
"latestregionsupport": {
"pinpoint": 1,
"translate": 1,
"transcribe": 1,
"rekognition": 1,
"textract": 1,
"comprehend": 1
}
}
}
7 changes: 7 additions & 0 deletions amplify/hooks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Command Hooks

Command hooks can be used to run custom scripts upon Amplify CLI lifecycle events like pre-push, post-add-function, etc.

To get started, add your script files based on the expected naming convention in this directory.

Learn more about the script file naming convention, hook parameters, third party dependencies, and advanced configurations at https://docs.amplify.aws/cli/usage/command-hooks
15 changes: 15 additions & 0 deletions amplify/team-provider-info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"dev": {
"awscloudformation": {
"AuthRoleName": "amplify-taskmaster-dev-195815-authRole",
"UnauthRoleArn": "arn:aws:iam::420812806768:role/amplify-taskmaster-dev-195815-unauthRole",
"AuthRoleArn": "arn:aws:iam::420812806768:role/amplify-taskmaster-dev-195815-authRole",
"Region": "eu-central-1",
"DeploymentBucketName": "amplify-taskmaster-dev-195815-deployment",
"UnauthRoleName": "amplify-taskmaster-dev-195815-unauthRole",
"StackName": "amplify-taskmaster-dev-195815",
"StackId": "arn:aws:cloudformation:eu-central-1:420812806768:stack/amplify-taskmaster-dev-195815/79c987d0-40bd-11ec-87f0-02bc731afc30",
"AmplifyAppId": "d2y63djc1sd750"
}
}
}
11 changes: 11 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ android {
}

dependencies {

implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.+'
Expand All @@ -51,6 +52,16 @@ dependencies {



// // lab32

implementation 'com.amplifyframework:aws-api:1.28.3'
implementation 'com.amplifyframework:aws-datastore:1.28.3'


// lab 33

implementation "com.squareup.okhttp3:okhttp:4.2.1"
implementation "com.squareup.okhttp3:logging-interceptor:4.2.1"
implementation "com.squareup.okhttp3:okhttp-urlconnection:4.2.1"

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumented test, which will execute on an Android device.
*
Expand Down Expand Up @@ -59,9 +57,10 @@ public void AllTasksTest() {
@Test
public void RecyclerViewTest(){
onView(withId(R.id.recycleViewId)).perform(click());
onView(withId(R.id.title)).check(matches(isDisplayed()));
// onView(withId(R.id.title1)).check(matches(isDisplayed()));
onView(withId(R.id.body)).check(matches(isDisplayed()));
onView(withId(R.id.state)).check(matches(isDisplayed()));
onView(withId(R.id.title1)).check(matches(isDisplayed()));
}


Expand Down
3 changes: 3 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.taskmaster">

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

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
Expand Down
Loading