Commit e1d5b9ec authored by Yassine Marzouki's avatar Yassine Marzouki

Initial commit

parents
*.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
.cxx
local.properties
# Default ignored files
/shelf/
/workspace.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="1.8" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DBNavigator.Project.DataEditorManager">
<record-view-column-sorting-type value="BY_INDEX" />
<value-preview-text-wrapping value="true" />
<value-preview-pinned value="false" />
</component>
<component name="DBNavigator.Project.DataExportManager">
<export-instructions>
<create-header value="true" />
<friendly-headers value="false" />
<quote-values-containing-separator value="true" />
<quote-all-values value="false" />
<value-separator value="" />
<file-name value="" />
<file-location value="" />
<scope value="GLOBAL" />
<destination value="FILE" />
<format value="EXCEL" />
<charset value="UTF-8" />
</export-instructions>
</component>
<component name="DBNavigator.Project.DatabaseBrowserManager">
<autoscroll-to-editor value="false" />
<autoscroll-from-editor value="true" />
<show-object-properties value="true" />
<loaded-nodes />
</component>
<component name="DBNavigator.Project.DatabaseFileManager">
<open-files />
</component>
<component name="DBNavigator.Project.EditorStateManager">
<last-used-providers />
</component>
<component name="DBNavigator.Project.ExecutionManager">
<retain-sticky-names value="false" />
</component>
<component name="DBNavigator.Project.MethodExecutionManager">
<method-browser />
<execution-history>
<group-entries value="true" />
<execution-inputs />
</execution-history>
<argument-values-cache />
</component>
<component name="DBNavigator.Project.ObjectDependencyManager">
<last-used-dependency-type value="INCOMING" />
</component>
<component name="DBNavigator.Project.ObjectQuickFilterManager">
<last-used-operator value="EQUAL" />
<filters />
</component>
<component name="DBNavigator.Project.ScriptExecutionManager" clear-outputs="true">
<recently-used-interfaces />
</component>
<component name="DBNavigator.Project.Settings">
<connections />
<browser-settings>
<general>
<display-mode value="TABBED" />
<navigation-history-size value="100" />
<show-object-details value="false" />
</general>
<filters>
<object-type-filter>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="true" />
<object-type name="ROLE" enabled="true" />
<object-type name="PRIVILEGE" enabled="true" />
<object-type name="CHARSET" enabled="true" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED_VIEW" enabled="true" />
<object-type name="NESTED_TABLE" enabled="true" />
<object-type name="COLUMN" enabled="true" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET_TRIGGER" enabled="true" />
<object-type name="DATABASE_TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="true" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="TYPE_ATTRIBUTE" enabled="true" />
<object-type name="ARGUMENT" enabled="true" />
<object-type name="DIMENSION" enabled="true" />
<object-type name="CLUSTER" enabled="true" />
<object-type name="DBLINK" enabled="true" />
</object-type-filter>
</filters>
<sorting>
<object-type name="COLUMN" sorting-type="NAME" />
<object-type name="FUNCTION" sorting-type="NAME" />
<object-type name="PROCEDURE" sorting-type="NAME" />
<object-type name="ARGUMENT" sorting-type="POSITION" />
</sorting>
<default-editors>
<object-type name="VIEW" editor-type="SELECTION" />
<object-type name="PACKAGE" editor-type="SELECTION" />
<object-type name="TYPE" editor-type="SELECTION" />
</default-editors>
</browser-settings>
<navigation-settings>
<lookup-filters>
<lookup-objects>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="false" />
<object-type name="ROLE" enabled="false" />
<object-type name="PRIVILEGE" enabled="false" />
<object-type name="CHARSET" enabled="false" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED VIEW" enabled="true" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET TRIGGER" enabled="true" />
<object-type name="DATABASE TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="false" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="DIMENSION" enabled="false" />
<object-type name="CLUSTER" enabled="false" />
<object-type name="DBLINK" enabled="true" />
</lookup-objects>
<force-database-load value="false" />
<prompt-connection-selection value="true" />
<prompt-schema-selection value="true" />
</lookup-filters>
</navigation-settings>
<dataset-grid-settings>
<general>
<enable-zooming value="true" />
<enable-column-tooltip value="true" />
</general>
<sorting>
<nulls-first value="true" />
<max-sorting-columns value="4" />
</sorting>
<tracking-columns>
<columnNames value="" />
<visible value="true" />
<editable value="false" />
</tracking-columns>
</dataset-grid-settings>
<dataset-editor-settings>
<text-editor-popup>
<active value="false" />
<active-if-empty value="false" />
<data-length-threshold value="100" />
<popup-delay value="1000" />
</text-editor-popup>
<values-actions-popup>
<show-popup-button value="true" />
<element-count-threshold value="1000" />
<data-length-threshold value="250" />
</values-actions-popup>
<general>
<fetch-block-size value="100" />
<fetch-timeout value="30" />
<trim-whitespaces value="true" />
<convert-empty-strings-to-null value="true" />
<select-content-on-cell-edit value="true" />
<large-value-preview-active value="true" />
</general>
<filters>
<prompt-filter-dialog value="true" />
<default-filter-type value="BASIC" />
</filters>
<qualified-text-editor text-length-threshold="300">
<content-types>
<content-type name="Text" enabled="true" />
<content-type name="Properties" enabled="true" />
<content-type name="XML" enabled="true" />
<content-type name="DTD" enabled="true" />
<content-type name="HTML" enabled="true" />
<content-type name="XHTML" enabled="true" />
<content-type name="Java" enabled="true" />
<content-type name="SQL" enabled="true" />
<content-type name="PL/SQL" enabled="true" />
<content-type name="JSON" enabled="true" />
<content-type name="JSON5" enabled="true" />
<content-type name="Groovy" enabled="true" />
<content-type name="AIDL" enabled="true" />
<content-type name="YAML" enabled="true" />
<content-type name="Manifest" enabled="true" />
</content-types>
</qualified-text-editor>
<record-navigation>
<navigation-target value="VIEWER" />
</record-navigation>
</dataset-editor-settings>
<code-editor-settings>
<general>
<show-object-navigation-gutter value="false" />
<show-spec-declaration-navigation-gutter value="true" />
<enable-spellchecking value="true" />
<enable-reference-spellchecking value="false" />
</general>
<confirmations>
<save-changes value="false" />
<revert-changes value="true" />
</confirmations>
</code-editor-settings>
<code-completion-settings>
<filters>
<basic-filter>
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
<filter-element type="RESERVED_WORD" id="function" selected="true" />
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
<filter-element type="OBJECT" id="schema" selected="true" />
<filter-element type="OBJECT" id="role" selected="true" />
<filter-element type="OBJECT" id="user" selected="true" />
<filter-element type="OBJECT" id="privilege" selected="true" />
<user-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="false" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</user-schema>
<public-schema>
<filter-element type="OBJECT" id="table" selected="false" />
<filter-element type="OBJECT" id="view" selected="false" />
<filter-element type="OBJECT" id="materialized view" selected="false" />
<filter-element type="OBJECT" id="index" selected="false" />
<filter-element type="OBJECT" id="constraint" selected="false" />
<filter-element type="OBJECT" id="trigger" selected="false" />
<filter-element type="OBJECT" id="synonym" selected="false" />
<filter-element type="OBJECT" id="sequence" selected="false" />
<filter-element type="OBJECT" id="procedure" selected="false" />
<filter-element type="OBJECT" id="function" selected="false" />
<filter-element type="OBJECT" id="package" selected="false" />
<filter-element type="OBJECT" id="type" selected="false" />
<filter-element type="OBJECT" id="dimension" selected="false" />
<filter-element type="OBJECT" id="cluster" selected="false" />
<filter-element type="OBJECT" id="dblink" selected="false" />
</public-schema>
<any-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</any-schema>
</basic-filter>
<extended-filter>
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
<filter-element type="RESERVED_WORD" id="function" selected="true" />
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
<filter-element type="OBJECT" id="schema" selected="true" />
<filter-element type="OBJECT" id="user" selected="true" />
<filter-element type="OBJECT" id="role" selected="true" />
<filter-element type="OBJECT" id="privilege" selected="true" />
<user-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</user-schema>
<public-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</public-schema>
<any-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</any-schema>
</extended-filter>
</filters>
<sorting enabled="true">
<sorting-element type="RESERVED_WORD" id="keyword" />
<sorting-element type="RESERVED_WORD" id="datatype" />
<sorting-element type="OBJECT" id="column" />
<sorting-element type="OBJECT" id="table" />
<sorting-element type="OBJECT" id="view" />
<sorting-element type="OBJECT" id="materialized view" />
<sorting-element type="OBJECT" id="index" />
<sorting-element type="OBJECT" id="constraint" />
<sorting-element type="OBJECT" id="trigger" />
<sorting-element type="OBJECT" id="synonym" />
<sorting-element type="OBJECT" id="sequence" />
<sorting-element type="OBJECT" id="procedure" />
<sorting-element type="OBJECT" id="function" />
<sorting-element type="OBJECT" id="package" />
<sorting-element type="OBJECT" id="type" />
<sorting-element type="OBJECT" id="dimension" />
<sorting-element type="OBJECT" id="cluster" />
<sorting-element type="OBJECT" id="dblink" />
<sorting-element type="OBJECT" id="schema" />
<sorting-element type="OBJECT" id="role" />
<sorting-element type="OBJECT" id="user" />
<sorting-element type="RESERVED_WORD" id="function" />
<sorting-element type="RESERVED_WORD" id="parameter" />
</sorting>
<format>
<enforce-code-style-case value="true" />
</format>
</code-completion-settings>
<execution-engine-settings>
<statement-execution>
<fetch-block-size value="100" />
<execution-timeout value="20" />
<debug-execution-timeout value="600" />
<focus-result value="false" />
<prompt-execution value="false" />
</statement-execution>
<script-execution>
<command-line-interfaces />
<execution-timeout value="300" />
</script-execution>
<method-execution>
<execution-timeout value="30" />
<debug-execution-timeout value="600" />
<parameter-history-size value="10" />
</method-execution>
</execution-engine-settings>
<operation-settings>
<transactions>
<uncommitted-changes>
<on-project-close value="ASK" />
<on-disconnect value="ASK" />
<on-autocommit-toggle value="ASK" />
</uncommitted-changes>
<multiple-uncommitted-changes>
<on-commit value="ASK" />
<on-rollback value="ASK" />
</multiple-uncommitted-changes>
</transactions>
<session-browser>
<disconnect-session value="ASK" />
<kill-session value="ASK" />
<reload-on-filter-change value="false" />
</session-browser>
<compiler>
<compile-type value="KEEP" />
<compile-dependencies value="ASK" />
<always-show-controls value="false" />
</compiler>
<debugger>
<debugger-type value="ASK" />
<use-generic-runners value="true" />
</debugger>
</operation-settings>
<ddl-file-settings>
<extensions>
<mapping file-type-id="VIEW" extensions="vw" />
<mapping file-type-id="TRIGGER" extensions="trg" />
<mapping file-type-id="PROCEDURE" extensions="prc" />
<mapping file-type-id="FUNCTION" extensions="fnc" />
<mapping file-type-id="PACKAGE" extensions="pkg" />
<mapping file-type-id="PACKAGE_SPEC" extensions="pks" />
<mapping file-type-id="PACKAGE_BODY" extensions="pkb" />
<mapping file-type-id="TYPE" extensions="tpe" />
<mapping file-type-id="TYPE_SPEC" extensions="tps" />
<mapping file-type-id="TYPE_BODY" extensions="tpb" />
</extensions>
<general>
<lookup-ddl-files value="true" />
<create-ddl-files value="false" />
<synchronize-ddl-files value="true" />
<use-qualified-names value="false" />
<make-scripts-rerunnable value="true" />
</general>
</ddl-file-settings>
<general-settings>
<regional-settings>
<date-format value="MEDIUM" />
<number-format value="UNGROUPED" />
<locale value="SYSTEM_DEFAULT" />
<use-custom-formats value="false" />
</regional-settings>
<environment>
<environment-types>
<environment-type id="development" name="Development" description="Development environment" color="-2430209/-12296320" readonly-code="false" readonly-data="false" />
<environment-type id="integration" name="Integration" description="Integration environment" color="-2621494/-12163514" readonly-code="true" readonly-data="false" />
<environment-type id="production" name="Production" description="Productive environment" color="-11574/-10271420" readonly-code="true" readonly-data="true" />
<environment-type id="other" name="Other" description="" color="-1576/-10724543" readonly-code="false" readonly-data="false" />
</environment-types>
<visibility-settings>
<connection-tabs value="true" />
<dialog-headers value="true" />
<object-editor-tabs value="true" />
<script-editor-tabs value="false" />
<execution-result-tabs value="true" />
</visibility-settings>
</environment>
</general-settings>
</component>
<component name="DBNavigator.Project.StatementExecutionManager">
<execution-variables />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="PLATFORM" />
<option name="disableWrapperSourceDistributionNotification" value="true" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="1.8" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="BintrayJCenter" />
<option name="name" value="BintrayJCenter" />
<option name="url" value="https://jcenter.bintray.com/" />
</remote-repository>
<remote-repository>
<option name="id" value="Google" />
<option name="name" value="Google" />
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
</remote-repository>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
/build
\ No newline at end of file
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.museum_assessment"
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha01'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.navigation:navigation-ui:2.3.5'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
package com.example.museum_assessment;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.museum_assessment", appContext.getPackageName());
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.museum_assessment">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Museum_assessment">
<activity android:name=".Receipt"></activity>
<activity android:name=".ss_view" />
<meta-data
android:name="com.google.android.actions"
android:resource="@xml/styles" />
<activity android:name=".museum_view" />
<activity
android:name=".ui.home.HomeFragment"
tools:ignore="Instantiatable" />
<activity
android:name=".ui.cafe.CafeFragment"
tools:ignore="Instantiatable" />
<activity
android:name=".ui.souvenirs.SouvenirsFragment"
tools:ignore="Instantiatable" />
<activity android:name=".registery_page" />
<activity
android:name=".MuseumActivity"
android:label="@string/title_activity_museum"
android:theme="@style/Theme.Museum_assessment.NoActionBar" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
package com.example.museum_assessment;
import android.content.Intent;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import java.util.ArrayList;
public class Basket extends Fragment {
static int payment_amount;
static int Order_total = 0;
static int change = 0;
String Order_text;
String cafe_text ="";
String souvenirs_text ="";
String museum_text ="";
private TextView order;
private EditText pay;
private Button add;
private Button minus;
private TextView total;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_basket, container, false);
order = root.findViewById(R.id.order);
pay = root.findViewById(R.id.pay);
add = root.findViewById(R.id.add);
minus = root.findViewById(R.id.minus);
total = root.findViewById(R.id.total);
museum_management museum_management = new museum_management();
ArrayList<Mdata> cafe = museum_management.getList();
ArrayList<Mdata> souvenirs = museum_management.getList2();
ArrayList<Mdata> museum = museum_management.getList3();
int index1 = 0;
for (Mdata i : cafe) {
if(index1 == 0){
cafe_text = "Cafe Order:\n";
}
cafe_text = cafe_text +i.getName() + " quantity x" + String.valueOf(i.getQuantity()) + "\n";
Order_total = Order_total + (i.getPrice() * i.getQuantity());
index1++;
}
int index2 = 0;
for (Mdata i : souvenirs) {
if(index2 == 0){
souvenirs_text = "\nSouvenir Order:\n";
}
souvenirs_text = souvenirs_text + i.getName() + " quantity x" + String.valueOf(i.getQuantity()) + "\n";
Order_total = Order_total + (i.getPrice() * i.getQuantity());
index2++;
}
int index3 = 0;
for (Mdata i : museum) {
if (index3==0){
museum_text = "\nMuseum Order:\n";
}
museum_text = museum_text + "museum = " + i.getName() + "\ndate = "+ i.getDate() + " tickets x" + String.valueOf(i.getQuantity()) + "\n";
Order_total = Order_total + (i.getPrice() * i.getQuantity());
index3++;
}
Order_text = cafe_text + souvenirs_text + museum_text;
if(Order_text == ""){
order.setText("(Nothing in Basket!)");
total.setText("Total Cost = £0");
}else{
order.setText(cafe_text + souvenirs_text + museum_text);
total.setText("Total Cost = £" + Order_total);
}
add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(pay.getText().toString() != "" && Order_total != 0){
String sText = pay.getText().toString();
int sInt= new Integer(sText).intValue();
if(sInt >= Order_total){
payment_amount = sInt;//sets how much is payed
change = (sInt - Order_total);//sets change amount
Intent intent = new Intent(v.getContext(), Receipt.class);
startActivity(intent);
}else{
total.setText("Total Cost = £" + Order_total + "\nPlease Enter a Correct Amount");
}
}
}
});
minus.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
cafe.clear();
souvenirs.clear();
museum.clear();
order.setText("(Nothing in Basket!)");
total.setText("Total Cost = £0");
Order_total = 0;
}
});
return root;
}
}
\ No newline at end of file
package com.example.museum_assessment;
public class Data {
private int id;
private String name;
private String small_desc;
private String big_desc;
private String city;
private String country;
private int price;
//Default Constructor
public Data(int i, String s, String s1, String s2, String s3,String s4,String s5, int i1) {
}
//Constructor with parameter
public Data(int id, String name, String small_desc, String big_desc ,String city, String country ,int price) {
this.id = id;
this.name = name;
this.small_desc = small_desc;
this.big_desc = big_desc;
this.city = city;
this.country = country;
this.price = price;
}
//Getters and Setters
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSmall_desc() {
return small_desc;
}
public void setSmall_desc(String small_desc){
this.small_desc = small_desc;
}
public String getBig_desc() {
return big_desc;
}
public void setBig_desc(String big_desc) {
this.big_desc = big_desc;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
@Override
public String toString() {
return "Data{" +
"id=" + id +
", name='" + name + '\'' +
", small_desc ='" + small_desc + '\'' +
", city ='" + city + '\'' +
", country ='" + country + '\'' +
", price ='" + price + '\'' +
'}';
}
}
package com.example.museum_assessment;
public class Data_ss {
private int id;
private String name;
private int price;
private int shop_code;
//Default Constructor
public Data_ss(int i, String s, int i2) {
}
//Constructor with parameter
public Data_ss(int id, String name, int price, int shop_code) {
this.id = id;
this.name = name;
this.price = price;
this.shop_code = shop_code;
}
//Getters and Setters
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public int getShop_code() {
return shop_code;
}
public void setShop_code(int shop_code) {
this.shop_code = shop_code;
}
@Override
public String toString() {
return "Data{" +
"id =" + id +
", name ='" + name + '\'' +
", price ='" + price + '\'' +
", shop_CODE ='" + shop_code + '\'' +
'}';
}
}
package com.example.museum_assessment;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import androidx.annotation.Nullable;
public class Db_management extends SQLiteOpenHelper {
static String Name = "";
// structure of db - columns of the table
private static final int DB_VERSION = 1;
private static final String DB_NAME = "Museum.db";
private static final String TABLE_Users = "Users";
private static final String COLUMN_ID = "UsersID";
private static final String COLUMN_FirstName = "FirstName";
private static final String COLUMN_LastName = "LastName";
private static final String COLUMN_UserName = "UserName";
private static final String COLUMN_Password = "Password";
//constructor for creating db
public Db_management(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
super(context, DB_NAME, factory, DB_VERSION);
}
//creates table
@Override
public void onCreate(SQLiteDatabase db) {
//query to create the table
String CREATE_table = "CREATE TABLE "+
TABLE_Users + "(" +
COLUMN_ID + " INTEGER PRIMARY KEY," +
COLUMN_FirstName + " TEXT," +
COLUMN_LastName + " TEXT," +
COLUMN_UserName + " TEXT," +
COLUMN_Password + " TEXT" + ")";
//executing the query
db.execSQL(CREATE_table);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
//method for adding new users
public void addNewUser(String firstname, String lastname, String username, String password){
ContentValues values = new ContentValues();//creates object for new row
//add values to table names
values.put(COLUMN_FirstName, firstname);
values.put(COLUMN_LastName, lastname);
values.put(COLUMN_UserName, username);
values.put(COLUMN_Password, password);
//accesses the database (writable)
SQLiteDatabase db = this.getReadableDatabase();
//stores user details in db
db.insert(TABLE_Users, null, values);
//closes the db
db.close();
}
//method to check details on sign in
public boolean checkLogin(String username, String password){
boolean result = false;
String check_query = "SELECT * FROM " + TABLE_Users + " WHERE " + COLUMN_UserName + " = \"" + username + "\"" ;
//accesses the database (writable)
SQLiteDatabase db = this.getWritableDatabase();
//executes query
Cursor cursor = db.rawQuery(check_query, null,null);
while(cursor.moveToNext()) {
if(cursor.getString(cursor.getColumnIndex("Password")).equals(password)){
result = true;
Name = cursor.getString(cursor.getColumnIndex("FirstName")) +" "+ cursor.getString(cursor.getColumnIndex("LastName"));
}
}
//closes database
cursor.close();
db.close();
return result;
}
//method to check username availability
public boolean findUser(String username){
boolean result = false;
String query = "SELECT * FROM " + TABLE_Users + " WHERE " + COLUMN_UserName + " = \"" + username + "\"" ;
//accesses the database (writable)
SQLiteDatabase db = this.getReadableDatabase();
//executes query
Cursor cursor = db.rawQuery(query, null);
if(cursor.getCount()>=1){
System.out.println(cursor.getCount());
result = true;
}
//closes database
cursor.close();
db.close();
return result;
}
}
package com.example.museum_assessment;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import org.w3c.dom.Text;
public class MainActivity extends AppCompatActivity {
static String Name ="";
private Button register_btn;
private Button login_btn;
private EditText username_login;
private EditText password_login;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
username_login = findViewById(R.id.username);
password_login = findViewById(R.id.password);
register_btn = findViewById(R.id.register_btn);
register_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this, registery_page.class);
startActivity(intent);
}
});
login_btn = findViewById(R.id.login_btn);
login_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
login();
}
});
}
public void login(){
Db_management manage = new Db_management(this,null,null,1);
String username = username_login.getText().toString();
String password = password_login.getText().toString();
if(manage.checkLogin(username,password)){
Intent intent = new Intent(MainActivity.this, MuseumActivity.class);
Name = manage.Name;
startActivity(intent);
}else{
Toast.makeText(getApplicationContext(), "Incorrect Username or Password", Toast.LENGTH_LONG).show();
}
}
}
package com.example.museum_assessment;
public class Mdata {
private String name;
private int price;
private int quantity;
private StringBuilder date;
private String time;
public Mdata(String name, int price , int quantity) {
this.name = name;
this.price = price;
this.quantity = quantity;
}
public Mdata(String name, int price , int quantity, StringBuilder date, String time) {
this.name = name;
this.price = price;
this.quantity = quantity;
this.date = date;
this.time = time;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public StringBuilder getDate() {
return date;
}
public void setDate(StringBuilder date) {
this.date = date;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
// @Override
public String toString() {
return "name = " + name + "; price = " + price + "; quantity = " + quantity;
}
}
package com.example.museum_assessment;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.view.Menu;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.navigation.NavigationView;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
public class MuseumActivity extends AppCompatActivity {
private AppBarConfiguration mAppBarConfiguration;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_museum);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
DrawerLayout drawer = findViewById(R.id.drawer_layout);
NavigationView navigationView = findViewById(R.id.nav_view);
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
mAppBarConfiguration = new AppBarConfiguration.Builder(
R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow, R.id.basket)
.setDrawerLayout(drawer)
.build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
NavigationUI.setupWithNavController(navigationView, navController);
}
@Override
public boolean onSupportNavigateUp() {
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
return NavigationUI.navigateUp(navController, mAppBarConfiguration)
|| super.onSupportNavigateUp();
}
}
\ No newline at end of file
package com.example.museum_assessment;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.Random;
public class Receipt extends AppCompatActivity {
private String Order_text;
private String cafe_text="";
private String souvenirs_text="";
private String museum_text="";
private TextView txt;
private TextView order;
private TextView total;
private Button add;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_receipt);
order = findViewById(R.id.order);
txt = findViewById(R.id.txt);
add = findViewById(R.id.add);
total = findViewById(R.id.total);
museum_management museum_management = new museum_management();
ArrayList<Mdata> cafe = museum_management.getList();
ArrayList<Mdata> souvenirs = museum_management.getList2();
ArrayList<Mdata> museum = museum_management.getList3();
int index1 = 0;
for (Mdata i : cafe) {
if(index1 == 0){
cafe_text = "\nCafe Order:\n";
}
cafe_text = cafe_text +i.getName() + " quantity x" + String.valueOf(i.getQuantity()) + "\n";
index1++;
}
int index2 = 0;
for (Mdata i : souvenirs) {
if(index2 == 0){
souvenirs_text = "\nSouvenir Order:\n";
}
souvenirs_text = souvenirs_text + i.getName() + " quantity x" + String.valueOf(i.getQuantity()) + "\n";
index2++;
}
int index3 = 0;
for (Mdata i : museum) {
if (index3==0){
museum_text = "Museum Order:\n";
}
museum_text = museum_text + "museum = " + i.getName() + "\ndate = "+ i.getDate() +" time = "+ i.getTime() + "\ntickets x" + String.valueOf(i.getQuantity()) + "\n";
index3++;
}
//gets money values from basket
Basket basket = new Basket();
int payment_amount = basket.payment_amount;
int order_total = basket.Order_total;
int change = basket.change;
///gets users full name
MainActivity main = new MainActivity();
String name = main.Name;
Order_text = museum_text + cafe_text + souvenirs_text ;
order.setText("Full name: "+name +"\n"+Order_text+"\n");
total.setText("Total Cost: £" + order_total+"\nAmount Paid: £"+payment_amount+"\nChange Due: £"+change);
add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String random = Random();
txt.setText("Your Confirmation code:\n"+random);
add.setVisibility(View.GONE);
}
});
}
public static String Random() {
Random rnd = new Random();
int number = rnd.nextInt(999999);
if(number == 0){
number = rnd.nextInt(999999);
}
return String.format("%06d", number);
}
}
package com.example.museum_assessment;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
public class RecycleViewAdapter extends RecyclerView.Adapter<RecycleViewAdapter.RecyclerViewHolder> {
private List<Data> dataList;
// declare view holder inner class
class RecyclerViewHolder extends RecyclerView.ViewHolder {
TextView ID;
TextView Price;
TextView Name;
TextView City;
TextView Country;
TextView Small_desc;
LinearLayout llItemView;
public RecyclerViewHolder(View itemView) {
super(itemView);
llItemView = itemView.findViewById(R.id.llItemView);
ID = itemView.findViewById(R.id.ID);
Price = itemView.findViewById(R.id.Price);
Name = itemView.findViewById(R.id.Name);
City = itemView.findViewById(R.id.City);
Country = itemView.findViewById(R.id.Country);
Small_desc = itemView.findViewById(R.id.Small_desc);
}
}
//create constructor with list
public RecycleViewAdapter(List<Data> dataList) {
this.dataList = dataList;
}
@NonNull
@Override
public RecyclerViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
RecyclerViewHolder viewHolder;
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_item, parent, false);
viewHolder = new RecyclerViewHolder(view);
return viewHolder;
}
@Override
public void onBindViewHolder(@NonNull RecyclerViewHolder holder, int position) {
holder.ID.setText(String.valueOf(dataList.get(position).getId()));
holder.Name.setText(dataList.get(position).getName());
holder.Price.setText("£ " + String.valueOf(dataList.get(position).getPrice()) + " Per Person");
holder.City.setText(dataList.get(position).getCity());
holder.Country.setText(dataList.get(position).getCountry());
holder.Small_desc.setText(dataList.get(position).getSmall_desc());
holder.llItemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(v.getContext(),museum_view.class);
museum_view museum_view;
intent.putExtra("selected_museum", dataList.get(position).getId());
v.getContext().startActivity(intent);
}
});
}
@Override
public long getItemId(int position) {
return super.getItemId(position);
}
@Override
public int getItemCount() {
return dataList.size();
}
}
package com.example.museum_assessment;
import android.content.Intent;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.recyclerview.widget.RecyclerView;
import com.example.museum_assessment.ui.cafe.CafeFragment;
import com.example.museum_assessment.ui.home.HomeFragment;
import com.example.museum_assessment.ui.souvenirs.SouvenirsFragment;
import org.w3c.dom.Text;
import java.util.List;
public class RecycleViewAdapter_ss extends RecyclerView.Adapter<RecycleViewAdapter_ss.RecyclerViewHolder_ss> {
private List<Data_ss> dataList2;
private int full_total = 0;
// declare view holder inner class
class RecyclerViewHolder_ss extends RecyclerView.ViewHolder {
TextView ID;
TextView Price;
TextView Name;
TextView Total;
ImageView Plus;
ImageView Minus;
LinearLayout llItemView;
public RecyclerViewHolder_ss(View itemView) {
super(itemView);
llItemView = itemView.findViewById(R.id.llItemView2);
ID = itemView.findViewById(R.id.id);
Price = itemView.findViewById(R.id.price);
Name = itemView.findViewById(R.id.name);
}
}
//create constructor with list
public RecycleViewAdapter_ss(List<Data_ss> dataList2) {
this.dataList2 = dataList2;
}
@NonNull
@Override
public RecyclerViewHolder_ss onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
RecyclerViewHolder_ss viewHolder;
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_item_cs, parent, false);
viewHolder = new RecyclerViewHolder_ss(view);
return viewHolder;
}
@Override
public void onBindViewHolder(@NonNull RecyclerViewHolder_ss holder, int position) {
int shopcode = dataList2.get(position).getShop_code();
holder.ID.setText(String.valueOf(dataList2.get(position).getId()));
holder.Name.setText(dataList2.get(position).getName());
holder.Price.setText("£ " + String.valueOf(dataList2.get(position).getPrice()));
holder.llItemView.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
Intent intent = new Intent(v.getContext(),ss_view.class);
museum_view museum_view;
System.out.println("hi" + dataList2.get(position).getId());
intent.putExtra("selected_item", new int[]{dataList2.get(position).getId(), shopcode});
v.getContext().startActivity(intent);
}
});
}
@Override
public long getItemId(int position) {
return super.getItemId(position);
}
@Override
public int getItemCount() {
return dataList2.size();
}
}
package com.example.museum_assessment;
import java.util.ArrayList;
public class museum_management {
static ArrayList<Mdata> cafe = new ArrayList<Mdata>();
static ArrayList<Mdata> museum = new ArrayList<Mdata>();
static ArrayList<Mdata> souvenirs = new ArrayList<Mdata>();
//initialising array of objects
//static Object[][] cafe = new Object[5][3];
//static Object[][] museum = new Object[5][5];
//static Object[][] souvenirs = new Object[5][3];
public void add_to_array(String name, int price, int quantity, String array){
if(array == "cafe"){
cafe.add(new Mdata(name,price,quantity));
}else if(array == "souvenirs"){
souvenirs.add(new Mdata(name, price,quantity));
}
}
public void add_to_museum_basket(String name, int price, int quantity, StringBuilder date, String time){
museum.add(new Mdata(name, price, quantity, date,time));
}
public ArrayList<Mdata> getList() {
return cafe;
}
public ArrayList<Mdata> getList2() {
return souvenirs;
}
public ArrayList<Mdata> getList3() {
return museum;
}
}
package com.example.museum_assessment;
import androidx.appcompat.app.AppCompatActivity;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.text.method.PasswordTransformationMethod;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.example.museum_assessment.ui.cafe.CafeFragment;
import com.example.museum_assessment.ui.home.HomeFragment;
import com.example.museum_assessment.ui.souvenirs.SouvenirsFragment;
import java.util.Calendar;
import java.util.List;
public class museum_view extends AppCompatActivity {
private List<Data> dataList;
private ImageButton back;
private ImageView museum_pic;
private TextView Name;
private TextView City;
private TextView Country;
private TextView Big_desc;
private TextView Price;
private Spinner spinner;
private TextView date;
private Button date_add;
private Button Add;
private EditText tickets;
private TextView cost;
private int Year;
private int Month;
private int Day;
private String time;
static final int DATE_DIALOG_ID = 0;
private int TotalCost;
@Override
protected void onCreate(Bundle savedInstanceState) {
//times in drop down menu
String[] times = new String[]{"9-11 am", "11-1 pm", "1-3 pm", "3-5 pm"};
//gets intent info from home fragment
Intent intent = getIntent();
int selected_museum = intent.getIntExtra("selected_museum",0);
//gets museum list from home fragment
HomeFragment obj = new HomeFragment();
//creates instance of view
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_museum_view);
//sets id's
museum_pic = findViewById(R.id.museum_pic);
spinner = findViewById(R.id.dropdown_menu);
date = findViewById(R.id.date);
date_add = findViewById(R.id.date_add);
Name = findViewById(R.id.Name);
City = findViewById(R.id.City);
Country = findViewById(R.id.Country);
Big_desc= findViewById(R.id.Big_desc);
Price = findViewById(R.id.Price);
back = findViewById(R.id.back);
tickets = findViewById(R.id.tickets);
cost = findViewById(R.id.cost);
Add = findViewById(R.id.add);
//checks to see if value entered into ticket amount and if has then updates cost amount
tickets.addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence c, int start, int before, int count) {
try{
String sText = tickets.getText().toString();
int sInt= new Integer(sText).intValue();
sInt = sInt * obj.getList().get(selected_museum -1).getPrice();
cost.setText("Total Cost £ " + sInt);
} catch(NumberFormatException ex){
cost.setText("Total Cost £ 0");
}
}
public void beforeTextChanged(CharSequence c, int start, int count, int after) {
}
public void afterTextChanged(Editable c) {
}
});
Add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
museum_management museum_management = new museum_management();
String sText = tickets.getText().toString();
int sInt= new Integer(sText).intValue();
String name = obj.getList().get(selected_museum -1).getName();
int price = obj.getList().get(selected_museum -1).getPrice();
StringBuilder date_final = new StringBuilder()
.append(Day).append("-")
.append(Month + 1).append("-")
.append(Year).append(" ");
museum_management.add_to_museum_basket(name,price,sInt,date_final,time);
Toast.makeText(getApplicationContext(), "Added to Basket", Toast.LENGTH_SHORT).show();
}
});
date_add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showDialog(DATE_DIALOG_ID);
}
});
//checks to see if back button is pressed
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(museum_view.this, MuseumActivity.class);
startActivity(intent);
}
});
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
time = times[arg2];
}
@Override
public void onNothingSelected(AdapterView<?> arg0) {
}
});
//sets spinner value
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, times);
spinner.setAdapter(adapter);
//gets current date
final Calendar c = Calendar.getInstance();
Year = c.get(Calendar.YEAR);
Month = c.get(Calendar.MONTH);
Day = c.get(Calendar.DAY_OF_MONTH);
// display the current date
updateDisplay();
//sets text from list
Name.setText(obj.getList().get(selected_museum -1).getName());
City.setText(obj.getList().get(selected_museum -1).getCity());
Country.setText(obj.getList().get(selected_museum -1).getCountry());
Big_desc.setText(obj.getList().get(selected_museum -1).getBig_desc());
Price.setText("£ " + String.valueOf(obj.getList().get(selected_museum -1).getPrice()) + " Per Person");
tickets.setTransformationMethod(new NumericKeyBoardTransformationMethod());
setPicture(selected_museum);
}
private void updateDisplay(){
this.date.setText("Current Date for Booking: \n"+
new StringBuilder()
.append(Day).append("-")
.append(Month + 1).append("-")
.append(Year).append(" "));
}
private DatePickerDialog.OnDateSetListener mDateSetListener =
new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year,
int monthOfYear, int dayOfMonth) {
Year = year;
Month = monthOfYear;
Day = dayOfMonth;
updateDisplay();
}
};
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case DATE_DIALOG_ID:
return new DatePickerDialog(this,
mDateSetListener,
Year, Month, Day);
}
return null;
}
void setPicture(int selected_museum){
switch (selected_museum){
case 1:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum1);
break;
case 2:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum2);
break;
case 3:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum3);
break;
case 4:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum4);
break;
case 5:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum5);
break;
case 6:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum6);
break;
case 7:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum7);
break;
case 8:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum8);
break;
case 9:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum9);
break;
case 10:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum10);
break;
}
}
//number keyboard for number of tickets entry
static class NumericKeyBoardTransformationMethod extends PasswordTransformationMethod {
@Override
public CharSequence getTransformation(CharSequence source, View view) {
return source;
}
}
}
\ No newline at end of file
package com.example.museum_assessment;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Toast;
import com.example.museum_assessment.ui.home.HomeFragment;
public class registery_page extends AppCompatActivity {
private ImageButton back;
private Button register_btn2;
private EditText firstname_register;
private EditText lastname_register;
private EditText username_register;
private EditText password_register;
private EditText password_register2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registery_page);
back = findViewById(R.id.back);
register_btn2 = findViewById(R.id.register_btn2);
firstname_register = findViewById(R.id.firstname_register);
lastname_register = findViewById(R.id.lastname_register);
username_register = findViewById(R.id.username_register);
password_register = findViewById(R.id.password_register);
password_register2 = findViewById(R.id.password_register2);
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(registery_page.this, HomeFragment.class);
startActivity(intent);
}
});
register_btn2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
addNewUser();
}
});
}
public void addNewUser(){
Boolean dontSaveUser = false;
String firstname = null;
String lastname = null;
String username = null;
String password = null;
String password2 = null;
Db_management manage = new Db_management(this,null,null,1);
//getting the variables and turning them to strings and validating them
firstname = firstname_register.getText().toString();
if(firstname.length() > 10 || firstname.length() < 3){
Toast.makeText(getApplicationContext(), "use a first name between 3 and 10 letters", Toast.LENGTH_SHORT).show();
dontSaveUser = true;
}else{
lastname = lastname_register.getText().toString();
if(lastname .length() > 10 || lastname .length() < 3){
Toast.makeText(getApplicationContext(), "use a last name between 3 and 10 letters", Toast.LENGTH_SHORT).show();
dontSaveUser = true;
}else{
username = username_register.getText().toString();
if(username.length() > 10 || username.length() < 3){
Toast.makeText(getApplicationContext(), "use a username between 3 and 10 letters", Toast.LENGTH_SHORT).show();
dontSaveUser = true;
}else{
password = password_register.getText().toString();
if(password.length() > 10 || password.length() < 3){
Toast.makeText(getApplicationContext(), "use a password between 3 and 10 letters", Toast.LENGTH_SHORT).show();
dontSaveUser = true;
}else{
password = password_register.getText().toString();
password2 = password_register2.getText().toString();
if(!password.equals(password2)){
Toast.makeText(getApplicationContext(), "Match your passwords", Toast.LENGTH_SHORT).show();
dontSaveUser = true;
}
}
}
}
}
if(!dontSaveUser){
if(!manage.findUser(username)){
manage.addNewUser(firstname,lastname,username,password);
Toast.makeText(getApplicationContext(), "Successful Sign Up", Toast.LENGTH_LONG).show();
}else{
Toast.makeText(getApplicationContext(), "Sign Up Failed", Toast.LENGTH_SHORT).show();
}
}
}
}
package com.example.museum_assessment;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.navigation.NavController;
import androidx.navigation.NavDirections;
import androidx.navigation.Navigation;
import android.app.Activity;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.text.method.PasswordTransformationMethod;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.example.museum_assessment.ui.cafe.CafeFragment;
import com.example.museum_assessment.ui.home.HomeFragment;
import com.example.museum_assessment.ui.souvenirs.SouvenirsFragment;
public class ss_view extends AppCompatActivity {
private ImageButton back;
private Button Add;
private ImageView ss_pic;
private TextView Name;
private TextView Price;
private EditText quantity;
private TextView cost;
@Override
protected void onCreate(Bundle savedInstanceState) {
Intent intent = getIntent();
int[] selected_item = intent.getIntArrayExtra("selected_item");
//gets correct fragment
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ss_view);
//sets id's
ss_pic = findViewById(R.id.ss_pic);
Name = findViewById(R.id.Name);
Price = findViewById(R.id.Price);
back = findViewById(R.id.back);
quantity = findViewById(R.id.quantity);
cost = findViewById(R.id.cost);
Add = findViewById(R.id.add);
quantity.addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence c, int start, int before, int count) {
try{
String sText = quantity.getText().toString();
if(selected_item[1] == 1){
SouvenirsFragment obj = new SouvenirsFragment();
int sInt= new Integer(sText).intValue();
sInt = sInt * obj.getList().get(selected_item[0] - 1).getPrice();
cost.setText("Total Cost £ " + sInt);
}else if(selected_item[1] == 2){
CafeFragment obj = new CafeFragment();
int sInt= new Integer(sText).intValue();
sInt = sInt * obj.getList().get(selected_item[0] -1).getPrice();
cost.setText("Total Cost £ " + sInt);
}
}catch(NumberFormatException ex){
cost.setText("Total Cost £ 0");
}
}
public void beforeTextChanged(CharSequence c, int start, int count, int after) {
}
public void afterTextChanged(Editable c) {
}
});
Add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
museum_management museum_management = new museum_management();
String sText = quantity.getText().toString();
int sInt= new Integer(sText).intValue();
if(selected_item[1] == 1){
SouvenirsFragment obj = new SouvenirsFragment();
String name = obj.getList().get(selected_item[0] -1).getName();
int price = obj.getList().get(selected_item[0] -1).getPrice();
museum_management.add_to_array(name,price,sInt,"souvenirs");
Toast.makeText(getApplicationContext(), "Added to Basket", Toast.LENGTH_SHORT).show();
}else if(selected_item[1] == 2){
CafeFragment obj = new CafeFragment();
String name = obj.getList().get(selected_item[0] -1).getName();
int price = obj.getList().get(selected_item[0] -1).getPrice();
museum_management.add_to_array(name,price,sInt,"cafe");
Toast.makeText(getApplicationContext(), "Added to Basket", Toast.LENGTH_SHORT).show();
}
}
});
//checks to see if back button is pressed
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
if(selected_item[1] == 1){
SouvenirsFragment obj = new SouvenirsFragment();
Name.setText(obj.getList().get(selected_item[0] -1).getName());
Price.setText("£ " + String.valueOf(obj.getList().get(selected_item[0] -1).getPrice()));
setPicture1(selected_item[0]);
}else if(selected_item[1] == 2){
CafeFragment obj = new CafeFragment();
Name.setText(obj.getList().get(selected_item[0] -1).getName());
Price.setText("£ " + String.valueOf(obj.getList().get(selected_item[0] -1).getPrice()));
setPicture2(selected_item[0]);
}
}
void setPicture1(int selected_item){
switch (selected_item){
case 1:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.souvenirs1);
break;
case 2:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.souvenirs2);
break;
case 3:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.souvenirs3);
break;
case 4:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.souvenirs4);
break;
case 5:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.souvenirs5);
break;
case 6:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.souvenirs6);
break;
case 7:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.souvenirs7);
break;
}
}
void setPicture2(int selected_item){
switch (selected_item){
case 1:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.cafe1);
break;
case 2:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.cafe2);
break;
case 3:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.cafe3);
break;
case 4:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.cafe4);
break;
case 5:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.cafe5);
break;
case 6:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.cafe6);
break;
case 7:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.cafe7);
break;
}
}
}
package com.example.museum_assessment.ui.cafe;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.museum_assessment.Data_ss;
import com.example.museum_assessment.R;
import com.example.museum_assessment.RecycleViewAdapter_ss;
import java.util.ArrayList;
import java.util.List;
import java.util.Observable;
import java.util.Observer;
public class CafeFragment extends Fragment {
private static List<Data_ss> dataList2;
//returns list
public List<Data_ss> getList() {
return dataList2;
}
private static void setData_ss() {
dataList2 = new ArrayList<>();
dataList2.add(new Data_ss(1,"Tea",1,2));
dataList2.add(new Data_ss(2,"Water",1,2));
dataList2.add(new Data_ss(3,"Coffee",2,2));
dataList2.add(new Data_ss(4,"Flatbread",2,2));
dataList2.add(new Data_ss(5,"Sandwich",2,2));
dataList2.add(new Data_ss(6,"Sweet roll",2,2));
dataList2.add(new Data_ss(7,"Salad",2,2));
}
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_cafe, container, false);
final RecyclerView recyclerView = root.findViewById(R.id.recyclerView2);
recyclerView.setLayoutManager(new LinearLayoutManager(CafeFragment.this.getActivity(), LinearLayoutManager.VERTICAL, false));
recyclerView.setFocusable(false);
setData_ss();
RecycleViewAdapter_ss adapter = new RecycleViewAdapter_ss(dataList2);
recyclerView.setAdapter(adapter);
return root;
}
}
\ No newline at end of file
package com.example.museum_assessment.ui.home;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.museum_assessment.Data;
import com.example.museum_assessment.R;
import com.example.museum_assessment.RecycleViewAdapter;
import java.util.ArrayList;
import java.util.List;
public class HomeFragment extends Fragment {
private static List<Data> dataList;
//returns list
public List<Data> getList() {
return dataList;
}
private static void setData() {
dataList = new ArrayList<>();
dataList.add(new Data(1, "Louvre", "The Louvre is the world's largest art museum and a historic monument in Paris, France, and is best known for being the home of the Mona Lisa. ",
"The museum is housed in the Louvre Palace, originally built as the Louvre castle in the late 12th to 13th century under Philip II. Remnants of the fortress are visible in the basement of the museum. Due to urban expansion, the fortress eventually lost its defensive function, and in 1546 Francis I converted it into the primary residence of the French Kings. The building was extended many times to form the present Louvre Palace. ",
"Paris", "France",10));
dataList.add(new Data(2, "National Museum of china", "The National Museum of China flanks the eastern side of Tiananmen Square in Beijing, China. The museum's mission is to educate about the arts and history of China. It is directed by the Ministry of Culture of the People's Republic of China.",
"The museum was established in 2003 by the merging of the two separate museums that had occupied the same building since 1959: the Museum of the Chinese Revolution in the northern wing and the National Museum of Chinese History in the southern wing. The building was completed in 1959 as one of the Ten Great Buildings celebrating the ten-year anniversary of the founding of the People's Republic of China. It complements the opposing Great Hall of the People that was built at the same time. ",
"Beijing","China", 10));
dataList.add(new Data(3, "Vatican museum", "The Vatican Museums are the public art and sculpture museums in the Vatican City. They display works from the immense collection amassed by the Catholic Church and the papacy throughout the centuries including several of the most renowned Roman sculptures and most important masterpieces of Renaissance art in the world.",
"The museums contain roughly 70,000 works, of which 20,000 are on display, and currently employ 640 people who work in 40 different administrative, scholarly, and restoration departments. Pope Julius II founded the museums in the early 16th century. The Sistine Chapel with its ceiling decorated by Michelangelo and the Stanze di Raffaellodecorated by Raphael are on the visitor route through the Vatican Museums. In 2020 they were visited by 1,300,00 persons, a drop of 81 percent from the number of visitors in 2019, but enough to rank them fourth among the most visited art museums in the world. ",
"Vatican City","Vatican", 10));
dataList.add(new Data(4, "Metropolitan museum of art", "The Metropolitan Museum of Art of New York City, colloquially the Met, is the largest art museum in the United States. Its permanent collection contains over 2 million works, divided among 17 curatorial departments.",
"The main building at 1000 Fifth Avenue, along the Museum Mile on the eastern edge of Central Park in Manhattan's Upper East Side, is by area one of the world's largest art galleries. A much smaller second location, The Cloisters at Fort Tryon Park in Upper Manhattan, contains an extensive collection of art, architecture, and artifacts from medieval Europe. ",
"New York City","US", 10));
dataList.add(new Data(5, "British Museum", "The British Museum, in the Bloomsbury area of London, England, is a public institution dedicated to human history, art and culture. Its permanent collection of some eight million works is among the largest and most comprehensive in existence, having been widely collected during the era of the British Empire.",
"The British Museum documents the story of human culture from its beginnings to the present. It was the first public national museum in the world. The Museum was established in 1753, largely based on the collections of the Irish physician and scientist Sir Hans Sloane. It first opened to the public in 1759, in Montagu House, on the site of the current building. Its expansion over the following 250 years was largely a result of expanding British colonisation and has resulted in the creation of several branch institutions, the first being the Natural History Museum in 1881.",
"London","UK", 10));
dataList.add(new Data(6, "Tate Modern", "Tate Modern is an art gallery located in London. It houses the United Kingdom's national collection of international modern and contemporary art, and forms part of the Tate group together with Tate Britain, Tate Liverpool and Tate St Ives.",
"Tate Modern is one of the largest museums of modern and contemporary art in the world. As with the UK's other national galleries and museums, there is no admission charge for access to the collection displays, which take up the majority of the gallery space, whereas tickets must be purchased for the major temporary exhibitions. Due to the COVID-19 pandemic the museum was closed for 173 days in 2020, and attendance plunged by 77 percent to 1,432,991 in 2020. ",
"London","UK", 5));
dataList.add(new Data(7, "National Gallery", "The National Gallery is an art museum in Trafalgar Square in the City of Westminster, in Central London. Founded in 1824, it houses a collection of over 2,300 paintings dating from the mid-13th century to 1900.",
"The Gallery is an exempt charity, and a non-departmental public body of the Department for Digital, Culture, Media and Sport. Its collection belongs to the government on behalf of the British public, and entry to the main collection is free of charge. In 2020, due to the COVID-19 pandemic it attracted only 1,197,143 visitors, a drop of 50 percent from 2019, but it still ranked eighth on the list of most-visited art museums in the world.",
"London","UK", 5));
dataList.add(new Data(8, "Natural History Museum", "Natural History Museum is one of three major museums on Exhibition Road in South Kensington, the others being the Science Museum and the Victoria and Albert Museum. The Natural History Museum's main frontage, however, is on Cromwell Road.",
"The museum is home to life and earth science specimens comprising some 80 million items within five main collections: botany, entomology, mineralogy, palaeontology and zoology. The museum is a centre of research specialising in taxonomy, identification and conservation. Given the age of the institution, many of the collections have great historical as well as scientific value, such as specimens collected by Charles Darwin. The museum is particularly famous for its exhibition of the skeleton of a blue whale hanging from the ceiling.",
"London","UK", 5));
dataList.add(new Data(9, "American Museum of Natural History", "The American Museum of Natural History (abbreviated as AMNH) is a natural history museum on the Upper West Side of Manhattan, New York City. ",
"In Theodore Roosevelt Park, across the street from Central Park, the museum complex comprises 26 interconnected buildings housing 45 permanent exhibition halls, in addition to a planetarium and a library. The museum collections contain over 34 million specimens of plants, animals, fossils, minerals, rocks, meteorites, human remains, and human cultural artifacts, as well as specialized collections for frozen tissue and genomic and astrophysical data, of which only a small fraction can be displayed at any given time. The museum occupies more than 2 million square feet (190,000 m2). ",
"New York City","US", 5));
dataList.add(new Data(10, "State Hermitage Museum", "The State Hermitage Museum is a museum of art and culture in Saint Petersburg, Russia. The second-largest art museum in the world, it was founded in 1764 when Empress Catherine the Great acquired an impressive collection of paintings from the Berlin merchant Johann Ernst Gotzkowsky.",
"The museum celebrates the anniversary of its founding each year on 7 December, Saint Catherine's Day. It has been open to the public since 1852. It attracted 968,604 visitors in 2020, a drop of eighty percent from 2019, due to the Covid-19 pandemic. In 2020 it ranked eleventh on the List of most visited art museums in the world. Its collections, of which only a small part is on permanent display, comprise over three million items (the numismatic collection accounts for about one-third of them), including the largest collection of paintings in the world.",
"Saint Petersburg","Russia", 5));
}
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_home, container, false);
final RecyclerView recyclerView = root.findViewById(R.id.recyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(HomeFragment.this.getActivity(), LinearLayoutManager.VERTICAL, false));
recyclerView.setFocusable(false);
setData();
RecycleViewAdapter adapter = new RecycleViewAdapter(dataList);
recyclerView.setAdapter(adapter);
return root;
}
}
package com.example.museum_assessment.ui.souvenirs;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.museum_assessment.Data_ss;
import com.example.museum_assessment.R;
import com.example.museum_assessment.RecycleViewAdapter;
import com.example.museum_assessment.RecycleViewAdapter_ss;
import com.example.museum_assessment.ui.home.HomeFragment;
import java.util.ArrayList;
import java.util.List;
public class SouvenirsFragment extends Fragment {
private static List<Data_ss> dataList2;
//returns list
public List<Data_ss> getList() {
return dataList2;
}
private static void setData_ss() {
dataList2 = new ArrayList<>();
dataList2.add(new Data_ss(1,"Shirt",10,1));
dataList2.add(new Data_ss(2,"Hat",5,1));
dataList2.add(new Data_ss(3,"Snow globe",5,1));
dataList2.add(new Data_ss(4,"Key chain",5,1));
dataList2.add(new Data_ss(5,"Bottle",5,1));
dataList2.add(new Data_ss(6,"Mug",5,1));
dataList2.add(new Data_ss(7,"Coaster",2,1));
}
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_souvenirs, container, false);
final RecyclerView recyclerView = root.findViewById(R.id.recyclerView2);
recyclerView.setLayoutManager(new LinearLayoutManager(SouvenirsFragment.this.getActivity(), LinearLayoutManager.VERTICAL, false));
recyclerView.setFocusable(false);
setData_ss();
RecycleViewAdapter_ss adapter = new RecycleViewAdapter_ss(dataList2);
recyclerView.setAdapter(adapter);
return root;
}
}
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0" />
<path
android:fillColor="#FF000000"
android:pathData="M9,2L7.17,4H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2H9zm3,15c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M22,16V4c0,-1.1 -0.9,-2 -2,-2H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2zm-11,-4l2.03,2.71L16,11l4,5H8l3,-4zM2,6v14c0,1.1 0.9,2 2,2h14v-2H4V6H2z" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6zm16,-4H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4c0,-1.1 -0.9,-2 -2,-2zm-8,12.5v-9l6,4.5 -6,4.5z" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="135"
android:centerColor="#009688"
android:endColor="#00695C"
android:startColor="#4DB6AC"
android:type="linear" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<ImageView
android:id="@+id/background"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@drawable/background" />
<TextView
android:id="@+id/museum_text"
android:text="The Museum Booking App"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="50dp"
android:gravity="center_horizontal" />
<TextView
android:id="@+id/login_text"
android:text="Login Below"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="25dp"
android:layout_marginTop="50dp"
android:layout_below="@+id/museum_text"
android:gravity="center_horizontal" />
<EditText
android:id="@+id/username"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="Username"
android:textColorHint="@color/white"
android:textSize="25dp"
android:layout_marginTop="25dp"
android:textColor="@color/white"
android:layout_centerHorizontal="true"
android:layout_below="@+id/login_text"
/>
<EditText
android:id="@+id/password"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="Password"
android:textColorHint="@color/white"
android:textSize="25dp"
android:layout_marginTop="50dp"
android:textColor="@color/white"
android:layout_centerHorizontal="true"
android:layout_below="@+id/username"
/>
<Button
android:id="@+id/login_btn"
android:layout_width="150dp"
android:layout_height="50dp"
android:text="Login"
android:layout_below="@+id/password"
android:layout_marginTop="50dp"
android:layout_centerHorizontal="true" />
<Button
android:id="@+id/register_btn"
android:layout_width="150dp"
android:layout_height="50dp"
android:text="Register"
android:layout_below="@+id/login_btn"
android:layout_marginTop="50dp"
android:layout_centerHorizontal="true" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />
</androidx.drawerlayout.widget.DrawerLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:gravity="center"
android:orientation="vertical"
android:padding="8dp">
<ImageButton
android:id="@+id/back"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="5dp"
android:layout_gravity="left"
android:background="@drawable/back2"
android:layout_alignParentTop="true"
/>
<ImageView
android:id="@+id/museum_pic"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:scaleType="fitXY"
/>
<TextView
android:id="@+id/Name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_marginTop="20dp"
android:textSize="18sp"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/City"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textSize="12sp" />
<TextView
android:id="@+id/Country"
android:layout_marginHorizontal="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textSize="12sp" />
<TextView
android:id="@+id/Price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:layout_marginTop="2dp"
android:gravity="right"
android:textSize="16sp" />
</LinearLayout>
<TextView
android:id="@+id/Big_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="@color/black"
android:textSize="16sp"/>
<TextView
android:id="@+id/date"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="20dp"
android:textColor="@color/black"
android:textSize="16sp"/>
<Button
android:id="@+id/date_add"
android:layout_width="150dp"
android:layout_height="60dp"
android:text="Change Date"
android:layout_marginTop="20dp"
android:layout_centerHorizontal="true" />
<TextView
android:text="Pick the time slot for the booking:"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="@color/black"
android:textSize="16sp"/>
<Spinner
android:id="@+id/dropdown_menu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:background="@android:drawable/btn_dropdown"
android:spinnerMode="dropdown"/>
<TextView
android:text="Enter the amount of tickets you want below:"
android:layout_width="match_parent"
android:textStyle="bold"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="@color/black"
android:textSize="16sp"/>
<EditText
android:id="@+id/tickets"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:textSize="25dp"
android:layout_marginTop="25dp"
android:textColor="@color/black"
android:layout_centerHorizontal="true"
android:inputType = "numberPassword"
android:maxLength="2"
/>
<TextView
android:id="@+id/cost"
android:text="Total Cost £ 0"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="@color/black"
android:textSize="16sp"/>
<Button
android:id="@+id/add"
android:layout_width="150dp"
android:layout_height="60dp"
android:text="Add to Basket"
android:layout_marginTop="30dp"
android:layout_centerHorizontal="true" />
</LinearLayout>
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Receipt">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/txt"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textStyle="bold"
android:textColor="@color/black"
android:textSize="16sp"/>
<TextView
android:id="@+id/order"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="@color/black"
android:layout_below="@+id/txt"
android:textSize="16sp"/>
<TextView
android:id="@+id/total"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_below="@+id/order"
android:textColor="@color/black"
android:textStyle="bold"
android:textSize="16sp"/>
<Button
android:id="@+id/add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Confirm Order Details"
android:layout_below="@+id/total"
android:layout_marginTop="30dp"
android:layout_centerHorizontal="true" />
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".registery_page">
<ImageView
android:id="@+id/background"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@drawable/background"
/>
<ImageButton
android:id="@+id/back"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="15dp"
android:background="@drawable/back2"
/>
<TextView
android:id="@+id/register_view"
android:text="Register Now"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="50dp"
android:gravity="center_horizontal" />
<EditText
android:id="@+id/firstname_register"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="First Name"
android:textColorHint="@color/white"
android:textSize="25dp"
android:layout_marginTop="50dp"
android:textColor="@color/white"
android:layout_centerHorizontal="true"
android:layout_below="@+id/register_view"
/>
<EditText
android:id="@+id/lastname_register"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="Last Name"
android:textColorHint="@color/white"
android:textSize="25dp"
android:layout_marginTop="25dp"
android:textColor="@color/white"
android:layout_centerHorizontal="true"
android:layout_below="@+id/firstname_register"
/>
<EditText
android:id="@+id/username_register"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="Username"
android:textColorHint="@color/white"
android:textSize="25dp"
android:layout_marginTop="25dp"
android:textColor="@color/white"
android:layout_centerHorizontal="true"
android:layout_below="@+id/lastname_register"
/>
<EditText
android:id="@+id/password_register"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="Password"
android:textColorHint="@color/white"
android:textSize="25dp"
android:layout_marginTop="25dp"
android:textColor="@color/white"
android:layout_centerHorizontal="true"
android:layout_below="@+id/username_register"
/>
<EditText
android:id="@+id/password_register2"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="Confirm Password"
android:textColorHint="@color/white"
android:textSize="25dp"
android:layout_marginTop="25dp"
android:textColor="@color/white"
android:layout_centerHorizontal="true"
android:layout_below="@+id/password_register"
/>
<Button
android:id="@+id/register_btn2"
android:layout_width="150dp"
android:layout_height="50dp"
android:text="Register"
android:layout_below="@+id/password_register2"
android:layout_marginTop="50dp"
android:layout_centerHorizontal="true" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ss_view">
<ImageView
android:id="@+id/ss_pic"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:scaleType="fitXY"
/>
<ImageButton
android:id="@+id/back"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="15dp"
android:background="@drawable/back2"
/>
<TextView
android:id="@+id/Name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:gravity="center"
android:textColor="@color/black"
android:layout_marginTop="20dp"
android:layout_below="@+id/ss_pic"
android:textSize="18sp"
/>
<TextView
android:id="@+id/Price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:gravity="center"
android:textColor="@color/black"
android:layout_below="@+id/Name"
android:layout_marginTop="20dp"
android:textSize="18sp"
/>
<TextView
android:id="@+id/text"
android:text="Enter the amount of you want below:"
android:layout_width="match_parent"
android:textStyle="bold"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:layout_below="@+id/Price"
android:textColor="@color/black"
android:textSize="16sp"/>
<EditText
android:id="@+id/quantity"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:textSize="25dp"
android:layout_marginTop="25dp"
android:textColor="@color/black"
android:layout_centerHorizontal="true"
android:layout_below="@+id/text"
android:inputType = "numberPassword"
android:maxLength="2"
/>
<TextView
android:id="@+id/cost"
android:text="Total Cost £ 0"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="@color/black"
android:layout_below="@+id/quantity"
android:textSize="16sp"/>
<Button
android:id="@+id/add"
android:layout_width="150dp"
android:layout_height="60dp"
android:text="Add to Basket"
android:layout_marginTop="30dp"
android:layout_below="@+id/cost"
android:layout_centerHorizontal="true" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MuseumActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Theme.Museum_assessment.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/Theme.Museum_assessment.PopupOverlay" />
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_main" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/app_bar_main">
<fragment
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/mobile_navigation" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Basket">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/txt"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:text="Order Details Below:"
android:layout_marginTop="20dp"
android:textStyle="bold"
android:textColor="@color/black"
android:textSize="16sp"/>
<TextView
android:id="@+id/order"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="@color/black"
android:layout_below="@+id/txt"
android:textSize="16sp"/>
<TextView
android:id="@+id/total"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_below="@+id/order"
android:textColor="@color/black"
android:textSize="16sp"/>
<TextView
android:id="@+id/pay_text"
android:text="Enter the amount you wish to pay with below:"
android:layout_width="match_parent"
android:textStyle="bold"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_below="@+id/total"
android:textColor="@color/black"
android:textSize="16sp"/>
<EditText
android:id="@+id/pay"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:textSize="25dp"
android:layout_marginTop="25dp"
android:layout_below="@+id/pay_text"
android:textColor="@color/black"
android:layout_centerHorizontal="true"
android:inputType = "numberDecimal"
android:maxLength="3"
/>
<Button
android:id="@+id/minus"
android:layout_width="150dp"
android:layout_height="60dp"
android:text="Empty Basket"
android:layout_below="@+id/pay"
android:layout_marginTop="20dp"
android:layout_centerHorizontal="true" />
<Button
android:id="@+id/add"
android:layout_width="150dp"
android:layout_height="60dp"
android:text="Complete Order"
android:layout_below="@+id/minus"
android:layout_marginTop="10dp"
android:layout_centerHorizontal="true" />
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.cafe.CafeFragment">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/background_light">
</androidx.recyclerview.widget.RecyclerView>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.home.HomeFragment">
<TextView
android:id="@+id/text_home"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/background_light">
</androidx.recyclerview.widget.RecyclerView>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.souvenirs.SouvenirsFragment">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/background_light">
</androidx.recyclerview.widget.RecyclerView>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="@dimen/nav_header_height"
android:background="@drawable/side_nav_bar"
android:gravity="bottom"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/nav_header_desc"
android:paddingTop="@dimen/nav_header_vertical_spacing"
app:srcCompat="@mipmap/ic_launcher_round" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/nav_header_vertical_spacing"
android:text="@string/nav_header_title"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/nav_header_subtitle" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/llItemView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/ID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:gravity="center"
android:textColor="@color/black"
android:textSize="18sp"
android:layout_marginLeft="16dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:gravity="center"
android:orientation="vertical"
android:padding="8dp">
<TextView
android:id="@+id/Name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@color/black"
android:textSize="18sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/City"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textSize="12sp" />
<TextView
android:id="@+id/Country"
android:layout_marginHorizontal="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:id="@+id/Small_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textSize="16sp" />
<TextView
android:id="@+id/Price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:layout_marginTop="2dp"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/llItemView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:textColor="@color/black"
android:layout_marginLeft="10dp"
android:textSize="20sp" />
<TextView
android:id="@+id/name"
android:textColor="@color/black"
android:textStyle="bold"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:layout_marginLeft="50dp"
android:textSize="25sp" />
<TextView
android:id="@+id/price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:layout_marginLeft="50dp"
android:textColor="@color/black"
android:textSize="25sp" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_home"
android:icon="@drawable/ic_menu_camera"
android:title="@string/menu_home" />
<item
android:id="@+id/nav_gallery"
android:icon="@drawable/ic_menu_gallery"
android:title="@string/menu_gallery" />
<item
android:id="@+id/nav_slideshow"
android:icon="@drawable/ic_menu_slideshow"
android:title="@string/menu_slideshow" />
<item
android:id="@+id/basket"
android:icon="@drawable/ic_menu_slideshow"
android:title="Basket" />
</group>
</menu>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
android:visible="false"
app:showAsAction="never" />
</menu>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mobile_navigation"
app:startDestination="@+id/nav_home">
<fragment
android:id="@+id/nav_home"
android:name="com.example.museum_assessment.ui.home.HomeFragment"
android:label="@string/menu_home"
tools:layout="@layout/fragment_home" />
<fragment
android:id="@+id/nav_gallery"
android:name="com.example.museum_assessment.ui.cafe.CafeFragment"
android:label="@string/menu_gallery"
tools:layout="@layout/fragment_cafe" />
<fragment
android:id="@+id/nav_slideshow"
android:name="com.example.museum_assessment.ui.souvenirs.SouvenirsFragment"
android:label="@string/menu_slideshow"
tools:layout="@layout/fragment_souvenirs" />
<fragment
android:id="@+id/basket"
android:name="com.example.museum_assessment.Basket"
android:label="Basket"
tools:layout="@layout/fragment_basket" />
</navigation>
\ No newline at end of file
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.Museum_assessment" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>
\ No newline at end of file
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="nav_header_vertical_spacing">8dp</dimen>
<dimen name="nav_header_height">176dp</dimen>
<dimen name="fab_margin">16dp</dimen>
</resources>
\ No newline at end of file
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<item name="ic_menu_camera" type="drawable">@android:drawable/ic_menu_camera</item>
<item name="ic_menu_gallery" type="drawable">@android:drawable/ic_menu_gallery</item>
<item name="ic_menu_slideshow" type="drawable">@android:drawable/ic_menu_slideshow</item>
<item name="ic_menu_manage" type="drawable">@android:drawable/ic_menu_manage</item>
<item name="ic_menu_share" type="drawable">@android:drawable/ic_menu_share</item>
<item name="ic_menu_send" type="drawable">@android:drawable/ic_menu_send</item>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">The Museum Booking App</string>
<string name="title_activity_museum">MuseumActivity</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
<string name="nav_header_title">Android Studio</string>
<string name="nav_header_subtitle">android.studio@android.com</string>
<string name="nav_header_desc">Navigation header</string>
<string name="menu_home">Museums</string>
<string name="menu_gallery">Cafe</string>
<string name="menu_slideshow">Souvenirs</string>
<string name="action_settings">action_settings</string>
<string name="menu_settings">menu_settings</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>
\ No newline at end of file
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.Museum_assessment" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
<style name="Theme.Museum_assessment.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="Theme.Museum_assessment.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="Theme.Museum_assessment.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
\ No newline at end of file
<?xml version ="1.0" encoding ="utf-8"?><!-- Learn More about how to use App Actions: https://developer.android.com/guide/actions/index.html -->
<actions>
<!-- Example Action -->
<!-- <action intentName="Intent name (actions.intent.*)"> -->
<!-- <action-display -->
<!-- icon="@mipmap/..." -->
<!-- labelTemplate="@array/..." /> -->
<!-- <fulfillment urlTemplate="Action content URI or URL"> -->
<!-- <parameter-mapping -->
<!-- intentParameter="Parameter name in Intent URI" -->
<!-- urlParameter="Parameter name in URL" /> -->
<!-- </fulfillment> -->
<!-- </action> -->
</actions>
\ No newline at end of file
<?xml version ="1.0" encoding ="utf-8"?><!-- Learn More about how to use App Actions: https://developer.android.com/guide/actions/index.html -->
<style name="AppTheme" parent="Theme.Museum_assessment.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
\ No newline at end of file
package com.example.museum_assessment;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
\ No newline at end of file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.2"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
\ No newline at end of file
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
\ No newline at end of file
#Sun Apr 25 13:03:33 BST 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
include ':app'
rootProject.name = "Museum_assessment"
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment