From 32a055716ae03983bba7047186b17ed751f8d74e Mon Sep 17 00:00:00 2001 From: Rohan Gupta <120ee0686@nitrkl.ac.in> Date: Sun, 10 Oct 2021 22:58:25 +0530 Subject: [PATCH 1/2] Added UI_Components_and_Layout Assignment --- .../Rohan Gupta_NITR/IntentsA/.gitignore | 15 ++ .../IntentsA/.idea/.gitignore | 3 + .../IntentsA/.idea/compiler.xml | 6 + .../IntentsA/.idea/gradle.xml | 22 +++ .../IntentsA/.idea/jarRepositories.xml | 30 +++ .../Rohan Gupta_NITR/IntentsA/.idea/misc.xml | 4 + .../phone/phoneSettingConfig_1655475786.json | 25 +++ .../.idea/previewer/previewConfig.json | 9 + .../tabletSettingConfig_1655475786.json | 25 +++ .../tv/tvSettingConfig_1655475786.json | 25 +++ .../Rohan Gupta_NITR/IntentsA/build.gradle | 38 ++++ .../IntentsA/entry/.gitignore | 1 + .../IntentsA/entry/build.gradle | 27 +++ .../IntentsA/entry/proguard-rules.pro | 1 + .../IntentsA/entry/src/main/config.json | 48 +++++ .../com/example/intentsa/MainAbility.java | 13 ++ .../com/example/intentsa/MyApplication.java | 10 + .../com/example/intentsa/NextAbility.java | 36 ++++ .../java/com/example/intentsa/Student.java | 49 +++++ .../intentsa/slice/MainAbilitySlice.java | 94 +++++++++ .../intentsa/slice/NextAbilitySlice.java | 23 +++ .../main/resources/base/element/string.json | 28 +++ .../base/graphic/background_ability_main.xml | 6 + .../base/graphic/background_ability_next.xml | 6 + .../resources/base/graphic/button_element.xml | 8 + .../base/graphic/dir_layout_card.xml | 9 + .../graphic/register_background_textfield.xml | 7 + .../resources/base/layout/ability_file.xml | 144 ++++++++++++++ .../resources/base/layout/ability_main.xml | 19 ++ .../resources/base/layout/ability_next.xml | 19 ++ .../base/layout/ability_student_card.xml | 131 +++++++++++++ .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../src/main/resources/base/media/user.png | Bin 0 -> 8750 bytes .../src/main/resources/en/element/string.json | 16 ++ .../src/main/resources/zh/element/string.json | 16 ++ .../com/example/intentsa/ExampleOhosTest.java | 14 ++ .../com/example/intentsa/ExampleTest.java | 9 + .../IntentsA/gradle.properties | 13 ++ .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 58694 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 + .../Rohan Gupta_NITR/IntentsA/gradlew | 183 ++++++++++++++++++ .../Rohan Gupta_NITR/IntentsA/gradlew.bat | 103 ++++++++++ .../Rohan Gupta_NITR/IntentsA/settings.gradle | 1 + 43 files changed, 1241 insertions(+) create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.gitignore create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/.gitignore create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/compiler.xml create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/gradle.xml create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/jarRepositories.xml create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/misc.xml create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/previewer/phone/phoneSettingConfig_1655475786.json create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/previewer/previewConfig.json create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/previewer/tablet/tabletSettingConfig_1655475786.json create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/previewer/tv/tvSettingConfig_1655475786.json create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/build.gradle create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/.gitignore create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/build.gradle create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/proguard-rules.pro create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/config.json create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/MainAbility.java create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/MyApplication.java create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/NextAbility.java create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/Student.java create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/slice/MainAbilitySlice.java create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/slice/NextAbilitySlice.java create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/element/string.json create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/background_ability_main.xml create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/background_ability_next.xml create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/button_element.xml create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/dir_layout_card.xml create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/register_background_textfield.xml create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/layout/ability_file.xml create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/layout/ability_main.xml create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/layout/ability_next.xml create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/layout/ability_student_card.xml create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/media/icon.png create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/media/user.png create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/en/element/string.json create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/zh/element/string.json create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/ohosTest/java/com/example/intentsa/ExampleOhosTest.java create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/test/java/com/example/intentsa/ExampleTest.java create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/gradle.properties create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/gradle/wrapper/gradle-wrapper.jar create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/gradle/wrapper/gradle-wrapper.properties create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/gradlew create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/gradlew.bat create mode 100644 UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/settings.gradle diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.gitignore b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.gitignore new file mode 100644 index 0000000..37a4eb8 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +/entry/.preview +.cxx diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/.gitignore b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/compiler.xml b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/compiler.xml new file mode 100644 index 0000000..61a9130 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/gradle.xml b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/gradle.xml new file mode 100644 index 0000000..82c453f --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + + \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/jarRepositories.xml b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/jarRepositories.xml new file mode 100644 index 0000000..1dfcd02 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/jarRepositories.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/misc.xml b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/misc.xml new file mode 100644 index 0000000..58918f5 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/previewer/phone/phoneSettingConfig_1655475786.json b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/previewer/phone/phoneSettingConfig_1655475786.json new file mode 100644 index 0000000..69beee7 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/previewer/phone/phoneSettingConfig_1655475786.json @@ -0,0 +1,25 @@ +{ + "setting": { + "1.0.1": { + "Language": { + "args": { + "Language": "zh_CN" + } + } + } + }, + "frontend": { + "1.0.0": { + "Resolution": { + "args": { + "Resolution": "360*780" + } + }, + "DeviceType": { + "args": { + "DeviceType": "phone" + } + } + } + } +} \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/previewer/previewConfig.json b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/previewer/previewConfig.json new file mode 100644 index 0000000..916a121 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/previewer/previewConfig.json @@ -0,0 +1,9 @@ +{ + "1.0.0": { + "LastPreviewDevice": { + "C:\\Users\\Admin\\DevEcoStudioProjects\\IntentsA\\entry": [ + "phone" + ] + } + } +} \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/previewer/tablet/tabletSettingConfig_1655475786.json b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/previewer/tablet/tabletSettingConfig_1655475786.json new file mode 100644 index 0000000..e241bd4 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/previewer/tablet/tabletSettingConfig_1655475786.json @@ -0,0 +1,25 @@ +{ + "setting": { + "1.0.1": { + "Language": { + "args": { + "Language": "zh-CN" + } + } + } + }, + "frontend": { + "1.0.0": { + "Resolution": { + "args": { + "Resolution": "1024*640" + } + }, + "DeviceType": { + "args": { + "DeviceType": "tablet" + } + } + } + } +} \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/previewer/tv/tvSettingConfig_1655475786.json b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/previewer/tv/tvSettingConfig_1655475786.json new file mode 100644 index 0000000..735b784 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/.idea/previewer/tv/tvSettingConfig_1655475786.json @@ -0,0 +1,25 @@ +{ + "setting": { + "1.0.1": { + "Language": { + "args": { + "Language": "zh-CN" + } + } + } + }, + "frontend": { + "1.0.0": { + "Resolution": { + "args": { + "Resolution": "960*540" + } + }, + "DeviceType": { + "args": { + "DeviceType": "tv" + } + } + } + } +} \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/build.gradle b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/build.gradle new file mode 100644 index 0000000..29cfcd9 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/build.gradle @@ -0,0 +1,38 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +apply plugin: 'com.huawei.ohos.app' + +//For instructions on signature configuration, see https://developer.harmonyos.com/en/docs/documentation/doc-guides/ide_debug_device-0000001053822404#EN-US_TOPIC_0000001154985555__section1112183053510 +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } +} + +buildscript { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } + dependencies { + classpath 'com.huawei.ohos:hap:2.4.4.2' + classpath 'com.huawei.ohos:decctest:1.2.4.0' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/.gitignore b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/.gitignore @@ -0,0 +1 @@ +/build diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/build.gradle b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/build.gradle new file mode 100644 index 0000000..b34f366 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/build.gradle @@ -0,0 +1,27 @@ +apply plugin: 'com.huawei.ohos.hap' +apply plugin: 'com.huawei.ohos.decctest' +//For instructions on signature configuration, see https://developer.harmonyos.com/en/docs/documentation/doc-guides/ide_debug_device-0000001053822404#EN-US_TOPIC_0000001154985555__section1112183053510 +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } + +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) + testImplementation 'junit:junit:4.13' + ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100' +} +decc { + supportType = ['html','xml'] +} diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/proguard-rules.pro b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/proguard-rules.pro new file mode 100644 index 0000000..f7666e4 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/proguard-rules.pro @@ -0,0 +1 @@ +# config module specific ProGuard rules here. \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/config.json b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/config.json new file mode 100644 index 0000000..21bbfe2 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/config.json @@ -0,0 +1,48 @@ +{ + "app": { + "bundleName": "com.example.intentsa", + "vendor": "example", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.intentsa", + "name": ".MyApplication", + "mainAbility": "com.example.intentsa.MainAbility", + "deviceType": [ + "phone", + "tablet", + "tv" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": true + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "name": "com.example.intentsa.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ] + } +} \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/MainAbility.java b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/MainAbility.java new file mode 100644 index 0000000..9455731 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/MainAbility.java @@ -0,0 +1,13 @@ +package com.example.intentsa; + +import com.example.intentsa.slice.MainAbilitySlice; +import ohos.aafwk.ability.Ability; +import ohos.aafwk.content.Intent; + +public class MainAbility extends Ability { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + super.setMainRoute(MainAbilitySlice.class.getName()); + } +} \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/MyApplication.java b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/MyApplication.java new file mode 100644 index 0000000..c070892 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/MyApplication.java @@ -0,0 +1,10 @@ +package com.example.intentsa; + +import ohos.aafwk.ability.AbilityPackage; + +public class MyApplication extends AbilityPackage { + @Override + public void onInitialize() { + super.onInitialize(); + } +} diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/NextAbility.java b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/NextAbility.java new file mode 100644 index 0000000..5db9b70 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/NextAbility.java @@ -0,0 +1,36 @@ +package com.example.intentsa; + +import ohos.aafwk.ability.Ability; +import ohos.aafwk.content.Intent; +import ohos.agp.components.Text; + +public class NextAbility extends Ability { + Text studentInfoName; + Text studentInfoRollNo; + Text studentInfoDept; + Text studentInfoUniversity; + + @Override + protected void onStart(Intent intent) { + super.onStart(intent); + super.setUIContent(ResourceTable.Layout_ability_student_card); + initViews(intent); + + } + + private void initViews(Intent intent) { + + studentInfoName = (Text) findComponentById(ResourceTable.Id_student_info_name); + studentInfoRollNo = (Text) findComponentById(ResourceTable.Id_student_info_rollno); + studentInfoDept = (Text) findComponentById(ResourceTable.Id_student_info_dept); + studentInfoUniversity = (Text) findComponentById(ResourceTable.Id_student_info_university); + + if (intent != null) { + studentInfoName.setText(intent.getStringParam("student_info_name")); + studentInfoRollNo.setText(intent.getStringParam("student_info_roll")); + studentInfoDept.setText(intent.getStringParam("student_info_dept")); + studentInfoUniversity.setText(intent.getStringParam("student_info_university")); + } + } +} + diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/Student.java b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/Student.java new file mode 100644 index 0000000..b2ddf0b --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/Student.java @@ -0,0 +1,49 @@ +package com.example.intentsa; + +public class Student { + private String name; + private String rollno; + private String dept; + private String collegename; + private String universityname; + + public String getName() { + return name; + } + + public void setname(String name) { + this.name = name; + } + + public String getRollno() { + return rollno; + } + + public void setRollno(String rollno) { + this.rollno = rollno; + } + + public String getDept() { + return dept; + } + + public void setDept(String dept) { + this.dept = dept; + } + + public String getCollegename() { + return collegename; + } + + public void setCollegename(String collegename) { + this.collegename = collegename; + } + + public String getUniversityname() { + return universityname; + } + + public void setUniversityname(String universityname) { + this.universityname = universityname; + } +} diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/slice/MainAbilitySlice.java b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/slice/MainAbilitySlice.java new file mode 100644 index 0000000..fdcff41 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/slice/MainAbilitySlice.java @@ -0,0 +1,94 @@ + +package com.example.intentsa.slice; + +import com.example.intentsa.ResourceTable; +import com.example.intentsa.NextAbility; +import com.example.intentsa.Student; +import ohos.aafwk.ability.AbilitySlice; +import ohos.aafwk.content.Intent; +import ohos.agp.components.Button; +import ohos.agp.components.Component; +import ohos.agp.components.TextField; + +public class MainAbilitySlice extends AbilitySlice { + + private TextField name; + private TextField rollno; + private TextField dept; + private TextField collegename; + private TextField universityname; + private Button submit; + + + @Override + public void onStart(Intent intent) { + super.onStart(intent); + super.setUIContent(ResourceTable.Layout_ability_file); + initViews(); + + initListeners(); + } + + private void initViews() { + + name= (TextField) findComponentById(ResourceTable.Id_name); + rollno = (TextField) findComponentById(ResourceTable. Id_rollno); + dept= (TextField) findComponentById(ResourceTable. Id_dept); + collegename = (TextField) findComponentById(ResourceTable. Id_collegename); + universityname = (TextField) findComponentById(ResourceTable.Id_universityname); + submit= (Button) findComponentById(ResourceTable. Id_button); + + + } + private void initListeners() { + submit.setClickedListener(component ->handleSubmitClick(component)); + + } + + public void handleSubmitClick(Component component) { + + Student student = new Student(); + + student.setname(name.getText()); + + student.setRollno(rollno.getText()); + + student.setDept(dept.getText()); + + student.setCollegename(collegename.getText()); + + student.setUniversityname(universityname.getText()); + + Intent intent = new Intent(); + + intent.setParam("student_info_name", student.getName()); + + intent.setParam("student_info_rollno", student.getRollno()); + + intent.setParam("student_info_department", student.getDept()); + + intent.setParam("student_info_college", student.getCollegename()); + + intent.setParam("student_info_university", student.getUniversityname()); + + Intent.OperationBuilder operationBuilder = new Intent.OperationBuilder(); + operationBuilder.withDeviceId("") + .withAbilityName(NextAbility.class.getName()) + .withBundleName(getBundleName()); + intent.setOperation(operationBuilder.build()); + startAbility(intent); + + } + + + + @Override + public void onActive() { + super.onActive(); + } + + @Override + public void onForeground(Intent intent) { + super.onForeground(intent); + } +} \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/slice/NextAbilitySlice.java b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/slice/NextAbilitySlice.java new file mode 100644 index 0000000..adaa0e7 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/java/com/example/intentsa/slice/NextAbilitySlice.java @@ -0,0 +1,23 @@ +package com.example.intentsa.slice; + +import com.example.intentsa.ResourceTable; +import ohos.aafwk.ability.AbilitySlice; +import ohos.aafwk.content.Intent; + +public class NextAbilitySlice extends AbilitySlice { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + super.setUIContent(ResourceTable.Layout_ability_next); + } + + @Override + public void onActive() { + super.onActive(); + } + + @Override + public void onForeground(Intent intent) { + super.onForeground(intent); + } +} \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/element/string.json b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000..a638c01 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/element/string.json @@ -0,0 +1,28 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "mainability_description", + "value": "Java_Empty Ability" + }, + { + "name": "mainability_HelloWorld", + "value": "Hello World" + }, + { + "name": "next_ability_description", + "value": "Java_Empty Ability" + }, + { + "name": "next_ability_HelloWorld", + "value": "Hello World" + }, + { + "name": "entry_NextAbility", + "value": "entry_NextAbility" + } + ] +} \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/background_ability_main.xml b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/background_ability_main.xml new file mode 100644 index 0000000..c0c0a3d --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/background_ability_main.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/background_ability_next.xml b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/background_ability_next.xml new file mode 100644 index 0000000..260b0b1 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/background_ability_next.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/button_element.xml b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/button_element.xml new file mode 100644 index 0000000..7810610 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/button_element.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/dir_layout_card.xml b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/dir_layout_card.xml new file mode 100644 index 0000000..59be1fe --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/dir_layout_card.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/register_background_textfield.xml b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/register_background_textfield.xml new file mode 100644 index 0000000..cee6914 --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/graphic/register_background_textfield.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/layout/ability_file.xml b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/layout/ability_file.xml new file mode 100644 index 0000000..790e18b --- /dev/null +++ b/UI_Components_and_Layouts/Rohan Gupta_NITR/IntentsA/entry/src/main/resources/base/layout/ability_file.xml @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + +