diff --git a/.gitignore b/.gitignore index 3270997..1ed6cb0 100644 --- a/.gitignore +++ b/.gitignore @@ -36,17 +36,7 @@ captures/ # IntelliJ *.iml -.idea/workspace.xml -.idea/tasks.xml -.idea/gradle.xml -.idea/assetWizardSettings.xml -.idea/dictionaries -.idea/libraries -# Android Studio 3 in .gitignore file. -.idea/caches -.idea/modules.xml -# Comment next line if keeping position of elements in Navigation Editor is relevant for you -.idea/navEditor.xml +.idea # Keystore files # Uncomment the following lines if you do not want to check your keystore files in. @@ -80,4 +70,3 @@ lint/generated/ lint/outputs/ lint/tmp/ # lint/reports/ -app/google-services.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 26f9482..5d85fdd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,40 +1,68 @@ image: openjdk:8-jdk variables: - ANDROID_COMPILE_SDK: "28" - ANDROID_BUILD_TOOLS: "28.0.2" - ANDROID_SDK_TOOLS: "4333796" + ANDROID_COMPILE_SDK: "29" + ANDROID_BUILD_TOOLS: "29.0.1" + ANDROID_SDK_TOOLS: "6514223" before_script: - apt-get --quiet update --yes - apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1 - - wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip - - unzip -d android-sdk-linux android-sdk.zip - - echo y | android-sdk-linux/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null - - echo y | android-sdk-linux/tools/bin/sdkmanager "platform-tools" >/dev/null - - echo y | android-sdk-linux/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null - - export ANDROID_HOME=$PWD/android-sdk-linux - - export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/ + # Setup path as android_home for moving/exporting the downloaded sdk into it + - export ANDROID_HOME="${PWD}/android-home" + - install -d $ANDROID_HOME + + - wget --output-document=$ANDROID_HOME/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS}_latest.zip + + # Move to ANDROID_HOME + - pushd $ANDROID_HOME + - unzip -d cmdline-tools cmdline-tools.zip + - popd + - export PATH=$PATH:${ANDROID_HOME}/cmdline-tools/tools/bin/ + + # Nothing fancy here, just checking sdkManager version + - sdkmanager --version + + # Accept all licenses + - yes | sdkmanager --sdk_root=${ANDROID_HOME} --licenses || true + - sdkmanager --sdk_root=${ANDROID_HOME} "platforms;android-${ANDROID_COMPILE_SDK}" + - sdkmanager --sdk_root=${ANDROID_HOME} "platform-tools" + - sdkmanager --sdk_root=${ANDROID_HOME} "build-tools;${ANDROID_BUILD_TOOLS}" + + # Not necessary, but just for surity - chmod +x ./gradlew - # temporarily disable checking for EPIPE error and use yes to accept all licenses - - set +o pipefail - - yes | android-sdk-linux/tools/bin/sdkmanager --licenses - - set -o pipefail +# Check linting lintDebug: + interruptible: true stage: build script: - ./gradlew -Pci --console=plain :app:lintDebug -PbuildDir=lint +# Make Project assembleDebug: + interruptible: true stage: build script: - ./gradlew assembleDebug + - 'touch req.json && echo {\"url\":\"$CI_JOB_URL/artifacts/raw/app/build/outputs/apk/debug/app-debug.apk\",\"platform\": \"android\" } > req.json' artifacts: paths: - app/build/outputs/ + - req.json +# Run all tests, if any fails, interrupt the pipeline(fail it) debugTests: + interruptible: true stage: test script: - - ./gradlew -Pci --console=plain :app:testDebug + - ./gradlew -Pci --console=plain :app:testDebugUnitTest + +# Deployment to appetize.io, go through readme for more info +deploy: + interruptible: true + stage: deploy + dependencies: + - assembleDebug + script: + - 'curl -s -X POST -H "Content-Type: application/json" -d @req.json https://$APPETIZE_API@api.appetize.io/v1/apps/$APPETIZE_KEY > response.json' diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 681f41a..0000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - -
- - - - xmlns:android - - ^$ - - - -
-
- - - - xmlns:.* - - ^$ - - - BY_NAME - -
-
- - - - .*:id - - http://schemas.android.com/apk/res/android - - - -
-
- - - - .*:name - - http://schemas.android.com/apk/res/android - - - -
-
- - - - name - - ^$ - - - -
-
- - - - style - - ^$ - - - -
-
- - - - .* - - ^$ - - - BY_NAME - -
-
- - - - .* - - http://schemas.android.com/apk/res/android - - - ANDROID_ATTRIBUTE_ORDER - -
-
- - - - .* - - .* - - - BY_NAME - -
-
-
-
-
-
\ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 15a15b2..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 5763267..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/render.experimental.xml b/.idea/render.experimental.xml deleted file mode 100644 index 8ec256a..0000000 --- a/.idea/render.experimental.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 7f68460..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..0179234 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# CelestaAndroid2k19 +Android app for Annual technical fest of IIT Patna, Celesta diff --git a/app/google-services.json b/app/google-services.json new file mode 100644 index 0000000..5c50cd5 --- /dev/null +++ b/app/google-services.json @@ -0,0 +1,51 @@ +{ + "project_info": { + "project_number": "", + "project_id": "" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:123456789012:android:1234567890123456", + "android_client_info": { + "package_name": "in.org.celesta.iitp" + } + }, + "oauth_client": [ + { + "client_id": "", + "client_type": 3 + }, + { + "client_id": "", + "client_type": 1, + "android_info": { + "package_name": "in.org.celesta.iitp", + "certificate_hash": "" + } + } + ], + "api_key": [ + { + "current_key": "" + } + ], + "services": { + "analytics_service": { + "status": 2, + "analytics_property": { + "tracking_id": "" + } + }, + "appinvite_service": { + "status": 1, + "other_platform_oauth_client": [] + }, + "ads_service": { + "status": 1 + } + } + } + ], + "configuration_version": "1" +} diff --git a/app/src/main/java/in/org/celesta/iitp/events/EventsFragment.java b/app/src/main/java/in/org/celesta/iitp/events/EventsFragment.java index bc569ff..9a298de 100644 --- a/app/src/main/java/in/org/celesta/iitp/events/EventsFragment.java +++ b/app/src/main/java/in/org/celesta/iitp/events/EventsFragment.java @@ -84,7 +84,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat } private void observeAll() { - viewModel.loadAllEvents().observe(this, eventItems -> { + viewModel.loadAllEvents().observe(getViewLifecycleOwner(), eventItems -> { List newList = new ArrayList<>(); for (EventItem n : eventItems) { if (n.getEvClub().equals(club)) newList.add(n); diff --git a/app/src/main/java/in/org/celesta/iitp/home/EventCategoryFragment.java b/app/src/main/java/in/org/celesta/iitp/home/EventCategoryFragment.java index 89c639e..91abc1e 100644 --- a/app/src/main/java/in/org/celesta/iitp/home/EventCategoryFragment.java +++ b/app/src/main/java/in/org/celesta/iitp/home/EventCategoryFragment.java @@ -89,7 +89,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat } private void observeAll() { - viewModel.loadAllClubs().observe(this, strings -> { + viewModel.loadAllClubs().observe(getViewLifecycleOwner(), strings -> { List temp = new ArrayList<>(); diff --git a/app/src/main/java/in/org/celesta/iitp/special/SpecialEventsFragment.java b/app/src/main/java/in/org/celesta/iitp/special/SpecialEventsFragment.java index 3c41cd8..2a73963 100644 --- a/app/src/main/java/in/org/celesta/iitp/special/SpecialEventsFragment.java +++ b/app/src/main/java/in/org/celesta/iitp/special/SpecialEventsFragment.java @@ -88,27 +88,27 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat private void observeAll() { if ("Exhibitions".equals(type)) { - viewModel.loadAllExhibitions().observe(this, eventItems -> { + viewModel.loadAllExhibitions().observe(getViewLifecycleOwner(), eventItems -> { adapter.setEventItemList(eventItems); }); } else if ("Schoolevents".equals(type)) { - viewModel.loadAllSchoolEvents().observe(this, eventItems -> { + viewModel.loadAllSchoolEvents().observe(getViewLifecycleOwner(), eventItems -> { adapter.setEventItemList(eventItems); }); } else if ("Ozone".equals(type)) { - viewModel.loadAllOzoneEvents().observe(this, eventItems -> { + viewModel.loadAllOzoneEvents().observe(getViewLifecycleOwner(), eventItems -> { adapter.setEventItemList(eventItems); }); } else if ("Workshops".equals(type)) { - viewModel.loadAllWorkshops().observe(this, eventItems -> { + viewModel.loadAllWorkshops().observe(getViewLifecycleOwner(), eventItems -> { adapter.setEventItemList(eventItems); }); } else if ("Guesttalks".equals(type)) { - viewModel.loadAllGuestLectures().observe(this, eventItems -> { + viewModel.loadAllGuestLectures().observe(getViewLifecycleOwner(), eventItems -> { adapter.setEventItemList(eventItems); }); }