Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ooni/probe-android into issues/2524
Browse files Browse the repository at this point in the history
  • Loading branch information
aanorbel committed Oct 13, 2023
2 parents 4978665 + f952115 commit 5876adf
Show file tree
Hide file tree
Showing 13 changed files with 1,302 additions and 94 deletions.
124 changes: 64 additions & 60 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
apply plugin: 'com.android.application'
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
apply from: 'jacoco.gradle'

android {
compileSdk 34
compileSdk libs.versions.compileSdk.get().toInteger()
ndkVersion '22.0.7026061'

defaultConfig {
applicationId 'org.openobservatory.ooniprobe'
minSdk 21
targetSdk 34
defaultConfig {
applicationId 'org.openobservatory.ooniprobe'
minSdk libs.versions.minSdk.get().toInteger()
targetSdk libs.versions.targetSdk.get().toInteger()
versionName '3.8.3'
versionCode 102
testInstrumentationRunner "org.openobservatory.ooniprobe.TestAndroidJUnitRunner"
Expand Down Expand Up @@ -95,74 +98,75 @@ dependencies {
implementation project(path: ':engine')

// AndroidX
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.lifecycle:lifecycle-process:2.5.1'
implementation 'androidx.preference:preference:1.2.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
implementation 'com.google.guava:guava:30.1.1-android'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation libs.androidx.appcompat
implementation libs.androidx.constraintlayout
implementation libs.androidx.lifecycle.process
implementation libs.androidx.preference
implementation libs.androidx.localbroadcastmanager
implementation libs.androidx.legacy.support.v4

// Google
implementation libs.google.material
implementation libs.google.guava
implementation libs.google.gson

// Third-party
annotationProcessor 'com.github.Raizlabs.DBFlow:dbflow-processor:4.2.4'
implementation 'com.github.Raizlabs.DBFlow:dbflow-core:4.2.4'
implementation 'com.github.Raizlabs.DBFlow:dbflow:4.2.4'
annotationProcessor libs.dbflow.processor
implementation libs.dbflow.core
implementation libs.dbflow.lib

implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1'
implementation libs.retrofit.lib
implementation libs.retrofit.converter.gson
implementation libs.retrofit.logging.interceptor


implementation 'com.github.xanscale.LocalhostToolkit:app:19.05.01'
implementation 'com.airbnb.android:lottie:3.0.7'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'ru.noties:markwon:2.0.1'
implementation 'commons-io:commons-io:2.6'
//arcview to fragment_dashboard
implementation 'com.github.florent37:shapeofview:1.3.2'
implementation libs.xanscale.localhost.toolkit
implementation libs.lottie
implementation libs.markwon
implementation libs.commons.io
//arcview to fragment_dashboard
implementation libs.shapeofview

// Flavor
fullImplementation platform('com.google.firebase:firebase-bom:26.3.0')
fullImplementation 'com.google.firebase:firebase-messaging'
fullImplementation 'ly.count.android:sdk:21.11.0'
fullImplementation 'io.sentry:sentry-android:6.3.0'
fullImplementation 'com.google.android.play:core:1.10.3'
fullImplementation platform(libs.google.firebase.bom)
fullImplementation libs.google.firebase.messaging
fullImplementation libs.countly.sdk
fullImplementation libs.sentry.android
fullImplementation libs.google.play.core

// Dependency Injection
implementation 'com.google.dagger:dagger:2.36'
annotationProcessor 'com.google.dagger:dagger-compiler:2.36'
implementation libs.google.dagger
annotationProcessor libs.google.dagger.compiler

// Logger
implementation project(':applogger')

// Testing
// Unit Testing
testImplementation project(':shared-test')
testImplementation 'junit:junit:4.13.2'
testImplementation 'androidx.test:core:1.5.0'
testImplementation 'androidx.test:runner:1.5.2'
testImplementation 'androidx.test:rules:1.5.0'
testImplementation 'org.mockito:mockito-core:5.3.1'
testImplementation 'org.mockito:mockito-inline:4.6.1'
testImplementation 'org.robolectric:robolectric:4.10.3'
testImplementation 'com.github.blocoio:faker:1.2.8'
testImplementation 'org.ooni:oonimkall:2023.10.11-213148'
testAnnotationProcessor 'com.google.dagger:dagger-compiler:2.36'

// Instrumentation Testing
androidTestImplementation project(':shared-test')
androidTestImplementation 'tools.fastlane:screengrab:2.0.0'
androidTestImplementation 'com.github.blocoio:faker:1.2.8'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.5.1'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.5.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'com.schibsted.spain:barista:3.9.0'
androidTestAnnotationProcessor "com.google.dagger:dagger-compiler:2.36"

// Unit Testing
testImplementation project(':shared-test')
testImplementation libs.junit4
testImplementation libs.androidx.core
testImplementation libs.androidx.runner
testImplementation libs.androidx.rules
testImplementation libs.mockito.core
testImplementation libs.mockito.inline
testImplementation libs.robolectric
testImplementation libs.faker
testImplementation libs.ooni.oonimkall
testAnnotationProcessor libs.google.dagger.compiler

// Instrumentation Testing
androidTestImplementation project(':shared-test')
androidTestImplementation libs.fastlane.screengrab
androidTestImplementation libs.faker
androidTestImplementation libs.androidx.runner
androidTestImplementation libs.androidx.rules
androidTestImplementation libs.androidx.junit
androidTestImplementation libs.androidx.espresso.intents
androidTestImplementation libs.androidx.espresso.contrib
androidTestImplementation libs.androidx.espresso.core
androidTestImplementation libs.barista
androidTestAnnotationProcessor libs.google.dagger.compiler
}

static def versionCodeDate() {
Expand Down
2 changes: 1 addition & 1 deletion app/jacoco.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'jacoco'

jacoco {
toolVersion '0.8.5'
toolVersion libs.versions.jacoco.get().toString()
}

task jacocoAndroidTestReport(type: JacocoReport) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public ExperimentalItem(Result extra, View.OnClickListener onClickListener, View
viewHolder.itemView.setOnClickListener(onClickListener);
viewHolder.itemView.setOnLongClickListener(onLongClickListener);
viewHolder.itemView.setBackgroundColor(ContextCompat.getColor(viewHolder.itemView.getContext(), extra.is_viewed ? android.R.color.transparent : R.color.color_yellow0));
viewHolder.binding.totalMeasurements.setText(String.format("%d measured", extra.countTotalMeasurements()));
viewHolder.binding.asnName.setText(Network.toString(viewHolder.binding.asnName.getContext(), extra.network));
viewHolder.binding.startTime.setText(DateFormat.format(DateFormat.getBestDateTimePattern(Locale.getDefault(), "yMdHm"), extra.start_time));
boolean allUploaded = true;
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/layout/fragment_result_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<FrameLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

Expand All @@ -160,7 +160,7 @@
android:entries="@array/filterTests"
android:paddingVertical="8dp"
android:textAlignment="center" />
</FrameLayout>
</LinearLayout>

<TextView
android:id="@+id/emptyState"
Expand All @@ -181,4 +181,4 @@
android:clipToPadding="false"
android:paddingBottom="66dp" />
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout> <!-- app:layout_scrollFlags="scroll|exitUntilCollapsed|snap" -->
</androidx.coordinatorlayout.widget.CoordinatorLayout> <!-- app:layout_scrollFlags="scroll|exitUntilCollapsed|snap" -->
15 changes: 15 additions & 0 deletions app/src/main/res/layout/item_experimental.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,19 @@
android:textColor="@color/color_gray7" />
</LinearLayout>

<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_weight="2"
android:orientation="vertical">

<TextView
android:id="@+id/totalMeasurements"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableStart="@drawable/tab_test_results"
android:drawablePadding="8dp"
android:gravity="center_vertical"/>
</LinearLayout>
</LinearLayout>
Loading

0 comments on commit 5876adf

Please sign in to comment.