Skip to content

Commit

Permalink
Merge branch 'main' into subletting
Browse files Browse the repository at this point in the history
# Conflicts:
#	build.gradle
  • Loading branch information
vavali08 committed Dec 1, 2023
2 parents 354cb2e + 2f6ccd8 commit a36fa78
Show file tree
Hide file tree
Showing 40 changed files with 669 additions and 680 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/android-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ jobs:
uses: actions/checkout@v2

# Set up Java JDK
- name: Setup JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 1.8
java-version: '17'
distribution: 'temurin'

# Get the secrets from GitHub and add them to local.properties
# https://blog.jakelee.co.uk/accessing-android-app-secret-from-github-actions-using-gradle/
Expand Down Expand Up @@ -43,10 +44,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v1

- name: Setup JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 1.8
java-version: '17'
distribution: 'temurin'

# Get the secrets from GitHub and add them to local.properties
- name: Access PLATFORM_CLIENT_ID
Expand Down Expand Up @@ -89,10 +91,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v1

- name: Setup JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 1.8
java-version: '17'
distribution: 'temurin'

# Get the secrets from GitHub and add them to local.properties
- name: Access PLATFORM_CLIENT_ID
Expand Down
120 changes: 49 additions & 71 deletions PennMobile/build.gradle
Original file line number Diff line number Diff line change
@@ -1,42 +1,28 @@
buildscript {
repositories {
mavenCentral()
google()
maven { url "https://jitpack.io" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jacoco:org.jacoco.core:0.8.5"
}
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'com.google.gms.google-services'
id 'jacoco'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'idea'
apply plugin: 'com.google.gms.google-services' // Google Services plugin
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'jacoco' // Code Coverage


repositories {
mavenCentral()
google()
jcenter()
maven { url "https://jitpack.io" }
}
apply plugin: 'kotlin-android-extensions'

android {
namespace 'com.pennapps.labs.pennmobile'
buildFeatures {
buildConfig = true
}
buildTypes {
debug {
matchingFallbacks = ['qa', 'release']
testCoverageEnabled true
}
release {}
}
buildFeatures {
viewBinding true
}
compileSdkVersion 33
buildToolsVersion '29.0.3'
defaultConfig {
minSdkVersion 26
targetSdkVersion 33
Expand All @@ -49,70 +35,59 @@ android {
pickFirst 'META-INF/LICENSE.txt'
pickFirst 'META-INF/NOTICE.txt'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.firebase:firebase-analytics:17.4.1'
implementation 'com.google.firebase:firebase-crashlytics:17.0.0'
implementation(platform("com.google.firebase:firebase-bom:31.5.0"))

implementation 'com.google.firebase:firebase-analytics'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.google.maps:google-maps-services:0.13.0'
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'com.google.android.material:material:1.6.0'
implementation 'com.google.maps:google-maps-services:2.2.0'
implementation 'org.jsoup:jsoup:1.16.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.2.0'
implementation 'androidx.exifinterface:exifinterface:1.3.6'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'joda-time:joda-time:2.10.6'
implementation 'org.apache.commons:commons-lang3:3.10'
implementation 'com.jakewharton:butterknife:10.2.1'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'com.google.android.gms:play-services-maps:18.2.0'
implementation 'com.google.android.gms:play-services-location:21.0.1'
implementation 'joda-time:joda-time:2.12.5'
implementation 'org.apache.commons:commons-lang3:3.13.0'
implementation 'androidx.annotation:annotation:1.7.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'
implementation ("androidx.lifecycle:lifecycle-extensions:2.2.0@aar") {
transitive = true
}
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
implementation 'com.squareup.retrofit:retrofit:1.9.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.squareup.okhttp:okhttp:2.7.5'
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.browser:browser:1.5.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.daimajia.swipelayout:library:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'org.testng:testng:7.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'org.testng:testng:7.8.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.github.ahorn:android-rss:master-SNAPSHOT'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// official release is several years old and is not thread-safe
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'
implementation 'com.eightbitlab:supportrenderscriptblur:1.0.2'
implementation 'androidx.palette:palette-ktx:1.0.0'
implementation 'com.github.searchy2:CustomAlertViewDialogue:2.6.1'
implementation 'com.airbnb.android:lottie:4.2.0'
implementation 'com.github.bumptech.glide:glide:4.11.0' // Glide for gif loading
implementation 'com.airbnb.android:lottie:5.2.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'com.kaspersky.android-components:kaspresso:1.1.0'
implementation "com.squareup.retrofit2:retrofit:2.6.2"
implementation "com.squareup.retrofit2:converter-moshi:2.5.0"
implementation 'com.squareup.retrofit2:converter-scalars:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.11'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'com.kaspersky.android-components:kaspresso:1.5.3'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-moshi:2.9.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'

}

Expand All @@ -135,11 +110,13 @@ String getPlatformRedirectUri() {
// Code Coverage: https://www.raywenderlich.com/10562143-continuous-integration-for-android#toc-anchor-014

jacoco {
toolVersion = "0.8.5"
toolVersion = "0.8.11"
}

// https://stackoverflow.com/questions/68065743/cannot-run-gradle-test-tasks-because-of-java-lang-noclassdeffounderror-jdk-inte
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
}

// Files with such regex patterns are to be excluded
Expand All @@ -154,14 +131,15 @@ def debugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/debug",
def mainSrc = "$project.projectDir/src/main/java"

// Task declaration

task jacocoTestReport(type: JacocoReport) {
// Runs only after the dependencies are executed
dependsOn = ['testDebugUnitTest', 'createDebugCoverageReport']
// Export formats
reports {
/*reports {
xml.enabled = true
html.enabled = true
}
}*/

sourceDirectories.setFrom(files([mainSrc]))
classDirectories.setFrom(files([debugTree]))
Expand Down
1 change: 0 additions & 1 deletion PennMobile/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?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.pennapps.labs.pennmobile"
android:versionCode="70"
android:versionName="3.0.0">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@ import com.bumptech.glide.load.engine.GlideException
import com.bumptech.glide.load.resource.gif.GifDrawable
import com.bumptech.glide.request.RequestListener
import com.pennapps.labs.pennmobile.adapters.AboutAdapter
import kotlinx.android.synthetic.main.fragment_about.view.*
import com.pennapps.labs.pennmobile.databinding.FragmentAboutBinding

class AboutFragment : Fragment() {

private lateinit var mActivity: MainActivity
private lateinit var sharedPreferences: SharedPreferences

private var _binding: FragmentAboutBinding? = null
private val binding get() = _binding!!

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
mActivity = activity as MainActivity
Expand All @@ -35,9 +38,10 @@ class AboutFragment : Fragment() {
}

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view = inflater.inflate(R.layout.fragment_about, container, false)
_binding = FragmentAboutBinding.inflate(inflater, container, false)
val view = binding.root

val gif = view.logo_gif_iv?.drawable
val gif = binding.logoGifIv
if (gif is AnimatedVectorDrawable) {
gif.start()
} else {
Expand All @@ -49,28 +53,28 @@ class AboutFragment : Fragment() {
resource.setLoopCount(1)
return false
}
}).into(view.logo_gif_iv)
}).into(binding.logoGifIv)
}

view.our_team_rv?.layoutManager = GridLayoutManager(context, 3)
view.alumni_rv?.layoutManager = GridLayoutManager(context, 3)
binding.ourTeamRv.layoutManager = GridLayoutManager(context, 3)
binding.alumniRv.layoutManager = GridLayoutManager(context, 3)
val members = arrayListOf("Rohan Chhaya", "Julius Snipes", "Aaron Mei", "Trini Feng", "Vedha Avali")
val alumni = arrayListOf("Marta García Ferreiro", "Varun Ramakrishnan", "Sahit Penmatcha",
"Anna Wang", "Sophia Ye", "Awad Irfan", "Liz Powell", "Davies Lumumba", "Anna Jiang", "Ali Krema")
view.our_team_rv?.adapter = AboutAdapter(members)
view.alumni_rv?.adapter = AboutAdapter(alumni)
binding.ourTeamRv.adapter = AboutAdapter(members)
binding.alumniRv.adapter = AboutAdapter(alumni)

ViewCompat.setNestedScrollingEnabled(view.our_team_rv, false)
ViewCompat.setNestedScrollingEnabled(binding.ourTeamRv, false)

view.learn_more_btn?.setOnClickListener {
binding.learnMoreBtn.setOnClickListener {
val i = Intent(Intent.ACTION_VIEW, Uri.parse("https://pennlabs.org"))
startActivity(i)
}

view.licenses_btn?.setOnClickListener {
binding.licensesBtn.setOnClickListener {
val webView = LayoutInflater.from(mActivity).inflate(R.layout.dialog_licenses, null) as WebView
webView.loadUrl("file:///android_asset/open_source_licenses.html")
AlertDialog.Builder(mActivity, R.style.Theme_AppCompat_Light_Dialog_Alert)
AlertDialog.Builder(mActivity, R.style.AppTheme_AppBarOverlay_Light)
.setTitle(getString(R.string.action_licenses))
.setView(webView)
.setPositiveButton(android.R.string.ok, null)
Expand All @@ -84,6 +88,11 @@ class AboutFragment : Fragment() {
return view
}

override fun onDestroyView() {
super.onDestroyView()
_binding = null
}

override fun onResume() {
super.onResume()
val mActivity : MainActivity = activity as MainActivity
Expand Down
Loading

0 comments on commit a36fa78

Please sign in to comment.