Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
8d67303
declare repository interface
shresthajibesh Dec 31, 2025
162a1c3
declare data source interfaces
shresthajibesh Dec 31, 2025
9673029
declare wrapper data source
shresthajibesh Dec 31, 2025
470f1b4
declare default repository implementation
shresthajibesh Dec 31, 2025
f710d8a
declare default data source implementation
shresthajibesh Dec 31, 2025
5d04d30
declare usecases
shresthajibesh Dec 31, 2025
25b53dc
move settings activity and fragment to new package
shresthajibesh Dec 31, 2025
bd23cc1
Rename .java to .kt
shresthajibesh Dec 31, 2025
4e4df33
migrate SettingsActivity to koltin
shresthajibesh Dec 31, 2025
467e256
remove unused lines
shresthajibesh Dec 31, 2025
584c3e8
declare a viewmodel
shresthajibesh Dec 31, 2025
48351d8
declare string uimodel
shresthajibesh Dec 31, 2025
e4ea853
move settings activity again
shresthajibesh Dec 31, 2025
706cf4f
define string resource UImodel
shresthajibesh Dec 31, 2025
1f9ac90
move things again
shresthajibesh Dec 31, 2025
08d6553
declare composables
shresthajibesh Dec 31, 2025
a9b4fb8
add skeleton loading extension
shresthajibesh Dec 31, 2025
a94e09e
Add LoremIpsumStringUIModel.kt
shresthajibesh Dec 31, 2025
1dff7b5
change package for TextStringUIModel.kt
shresthajibesh Dec 31, 2025
3660c9c
move items
shresthajibesh Dec 31, 2025
c29bfab
add preview providers
shresthajibesh Dec 31, 2025
b198618
update spacing
shresthajibesh Dec 31, 2025
9404912
add and comment out dynamic theme option in settings ui state
shresthajibesh Dec 31, 2025
ebbd761
handle back navigation
shresthajibesh Dec 31, 2025
69f51ec
reduce spacer
shresthajibesh Dec 31, 2025
87d1ee9
remove item wise padding in favour of universal settings content padding
shresthajibesh Dec 31, 2025
223844c
remove item wise padding in favour of universal settings content padding
shresthajibesh Dec 31, 2025
135da84
remove item wise padding in favour of universal settings content padding
shresthajibesh Dec 31, 2025
81375e9
pass events
shresthajibesh Dec 31, 2025
d329e99
address some lint issues
shresthajibesh Dec 31, 2025
44fc996
address some lint issues
shresthajibesh Dec 31, 2025
1be20fc
rename PreferenceItem.kt to ClickablePreferenceItem.kt
shresthajibesh Jan 1, 2026
bc100b5
create PreferenceItem.kt
shresthajibesh Jan 1, 2026
123310c
update ClickablePreferenceItem.kt
shresthajibesh Jan 1, 2026
c1df17a
update ClickablePreferenceItem.kt
shresthajibesh Jan 1, 2026
9e8a223
update default radius for skeleton extension
shresthajibesh Jan 1, 2026
d75cb19
add new summary item
shresthajibesh Jan 1, 2026
88f34e4
update seekbar preferenceitem
shresthajibesh Jan 1, 2026
21cac9b
update Switch Preference Item
shresthajibesh Jan 1, 2026
83380b3
update settings contnet to support new parameters in the composable
shresthajibesh Jan 1, 2026
023e59c
define segmented button preference item
shresthajibesh Jan 1, 2026
b014c60
remove unnused import
shresthajibesh Jan 1, 2026
71b31d9
add modifier parameter
shresthajibesh Jan 1, 2026
d71d6aa
update callback event
shresthajibesh Jan 1, 2026
7b36408
update callback event
shresthajibesh Jan 1, 2026
619626a
define new uimode class and update the type of uimodel
shresthajibesh Jan 1, 2026
3941176
update SettingsContent.kt
shresthajibesh Jan 1, 2026
6588345
preparing viewmodel
shresthajibesh Jan 1, 2026
c17b0f9
dummy viewmodel
shresthajibesh Jan 1, 2026
9186ab8
dummy viewmodel
shresthajibesh Jan 1, 2026
96efe1f
add logo
shresthajibesh Jan 1, 2026
6963d59
add logo to settings page
shresthajibesh Jan 1, 2026
353e79a
add logo to settings page
shresthajibesh Jan 1, 2026
7a35992
add interaction handlers in viewmodel
shresthajibesh Jan 2, 2026
bc76e6d
switch to MVI
shresthajibesh Jan 2, 2026
85b49b2
add ui events
shresthajibesh Jan 2, 2026
6e7b85c
declare usecases in viewmodel
shresthajibesh Jan 2, 2026
571b4b1
defining delegates
shresthajibesh Jan 2, 2026
d41a136
rename the setter usecases with update prefix
shresthajibesh Jan 3, 2026
ec3122d
rename ResourceState to UiResourceState.kt
shresthajibesh Jan 3, 2026
2cf0038
define delegates
shresthajibesh Jan 3, 2026
be6caf9
declare default delegate implementations
shresthajibesh Jan 3, 2026
0d94d59
declare default delegate implementations
shresthajibesh Jan 3, 2026
6661fa5
update ClickablePreferenceItem.kt
shresthajibesh Jan 3, 2026
4288715
move UiResourceState.kt extension
shresthajibesh Jan 3, 2026
50aa9b4
remove old delgates
shresthajibesh Jan 3, 2026
846ab7a
define uicomponent configs
shresthajibesh Jan 3, 2026
941d472
update the logic to have the delegates build the uimodels as well
shresthajibesh Jan 3, 2026
91e1ae4
define proxy enabled delegate
shresthajibesh Jan 3, 2026
6a1f214
define proxy enabled delegate
shresthajibesh Jan 3, 2026
1430f3c
define usecases for graph size
shresthajibesh Jan 3, 2026
2e080dc
get graph size range
shresthajibesh Jan 3, 2026
24df500
update delegates
shresthajibesh Jan 3, 2026
ebbee21
remove unused import from settings content composable
shresthajibesh Jan 3, 2026
dae9821
update app language delegate
shresthajibesh Jan 3, 2026
ee9b075
pass dummy data from app language observer
shresthajibesh Jan 3, 2026
232603b
rename parameter for appUiMode
shresthajibesh Jan 3, 2026
47cf931
update settings viewmodel to build SettingsUiStae
shresthajibesh Jan 3, 2026
ab8a2ec
expose the Language to display uimodel converter
shresthajibesh Jan 3, 2026
728965f
wire the delagates and usecases
shresthajibesh Jan 3, 2026
9933206
declare repository for all usecases
shresthajibesh Jan 3, 2026
73e5506
declare data source and repository functions
shresthajibesh Jan 3, 2026
d1fde83
cleanup
shresthajibesh Jan 3, 2026
416b548
add data layer implementaion
shresthajibesh Jan 3, 2026
c60e4a7
brind old settings activity back
shresthajibesh Jan 3, 2026
8aeea8e
fix di stuff
shresthajibesh Jan 3, 2026
37b5461
add way to access the new settings page
shresthajibesh Jan 3, 2026
c2d1bc0
renaming old settings to settings activity
shresthajibesh Jan 3, 2026
34d197e
map action to events
shresthajibesh Jan 3, 2026
9ba865b
removed unusable events and actions
shresthajibesh Jan 3, 2026
3d8c641
removed unusable events and actions
shresthajibesh Jan 3, 2026
2ee793c
implement UpdateAccessPortUseCase.kt
shresthajibesh Jan 9, 2026
332cefe
implement AccessPortDelegate
shresthajibesh Jan 9, 2026
3ed4044
simplify accessport delegate
shresthajibesh Jan 9, 2026
9eab588
implementing modal
shresthajibesh Jan 9, 2026
c59f2f4
implementing modal for access port
shresthajibesh Jan 9, 2026
4f93ad2
implement the access port bottom sheet
shresthajibesh Jan 10, 2026
3ecbbbf
validatin in bottomsheet
shresthajibesh Jan 10, 2026
7b9bd11
setting up language
shresthajibesh Jan 10, 2026
248c716
do some sorting
shresthajibesh Jan 10, 2026
d858e02
do some sorting
shresthajibesh Jan 10, 2026
e5ec2cc
identifier bug fix
shresthajibesh Jan 10, 2026
e09be45
identifier bug fix
shresthajibesh Jan 10, 2026
464bd57
skip partially expanded
shresthajibesh Jan 10, 2026
41f55d3
language delegate to observe user selection and set language
shresthajibesh Jan 11, 2026
2c6ff20
fix the wrong selection being displayed
shresthajibesh Jan 11, 2026
c5840ce
settings localized display name as primary
shresthajibesh Jan 11, 2026
596fcd9
app delegate
shresthajibesh Jan 11, 2026
b6f039c
change package structure
shresthajibesh Jan 11, 2026
da83c6d
update uimode event
shresthajibesh Jan 11, 2026
0fbf6bf
remove everything regarding the app uimode
shresthajibesh Jan 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.gradle.kotlin.dsl.support.kotlinCompilerOptions

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
Expand Down Expand Up @@ -211,6 +213,8 @@ dependencies {
debugImplementation(libs.androidx.compose.ui.test.manifest)
detektPlugins(libs.detekt.compose)

implementation(libs.androidx.datastore.preferences)

add("androidTestScreenshotImplementation", libs.junit)
add("androidTestScreenshotImplementation", libs.fastlane.screengrab)
add("androidTestScreenshotImplementation", libs.androidx.test.rules)
Expand Down
62 changes: 46 additions & 16 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android"
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto">

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
Expand All @@ -8,43 +9,58 @@
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28"/>
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28" />
<uses-permission
android:name="android.permission.BLUETOOTH"
android:maxSdkVersion="30" />
<uses-permission
android:name="android.permission.BLUETOOTH_ADMIN"
android:maxSdkVersion="30" />
<uses-permission
android:name="android.permission.BLUETOOTH_SCAN"
android:usesPermissionFlags="neverForLocation" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />

<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />


<application android:name="de.rwth_aachen.phyphox.App"
<application
android:name="de.rwth_aachen.phyphox.App"
android:allowBackup="true"
android:enableOnBackInvokedCallback="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Phyphox.DayNight"
android:enableOnBackInvokedCallback="true"
android:localeConfig="@xml/locales_config"
android:theme="@style/Theme.Phyphox.DayNight"
android:usesCleartextTraffic="true"><!-- While not recommended, there are plenty of use cases for phyphox on local networks where unencrypted communication is not unreasonable. -->

<activity
android:name="de.rwth_aachen.phyphox.ExperimentList.ExperimentListActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:exported="true"
android:theme="@style/splashTheme"
android:configChanges="keyboardHidden|orientation|screenSize">
android:theme="@style/splashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:host="*" />
<data android:scheme="file" />
<data android:scheme="content" />
Expand All @@ -62,14 +78,18 @@
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="phyphox" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:host="*" />
<data android:scheme="file" />
<data android:scheme="content" />
Expand All @@ -86,8 +106,8 @@
</activity>
<activity
android:name="de.rwth_aachen.phyphox.Experiment"
android:label="@string/title_activity_experiment"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/title_activity_experiment"
android:parentActivityName="de.rwth_aachen.phyphox.ExperimentList.ExperimentListActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
Expand All @@ -105,7 +125,13 @@
android:name="com.journeyapps.barcodescanner.CaptureActivity"
android:screenOrientation="unspecified"
tools:replace="screenOrientation" />
<uses-library android:name="org.apache.http.legacy" android:required="false" />
<activity
android:name="de.rwth_aachen.phyphox.features.settings.presentation.NewSettingsActivity"
android:label="@string/settings" />

<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="de.rwth_aachen.phyphox.exportProvider"
Expand Down Expand Up @@ -140,12 +166,16 @@
<!-- Youtube videos may be opened in the Youtube app -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" android:host="youtube.com" />
<data
android:host="youtube.com"
android:scheme="https" />
</intent>

<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" android:host="youtu.be" />
<data
android:host="youtu.be"
android:scheme="https" />
</intent>

<!-- Share states and screenshots -->
Expand Down
25 changes: 25 additions & 0 deletions app/src/main/java/de/rwth_aachen/phyphox/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,37 @@ package de.rwth_aachen.phyphox

import androidx.multidex.MultiDexApplication
import dagger.hilt.android.HiltAndroidApp
import de.rwth_aachen.phyphox.common.AppDelegate
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.SupervisorJob
import javax.inject.Inject

//This extension to application is only used to store measured data in memory as this may easily exceed the amount of data allowed on the transaction stack
@HiltAndroidApp
class App : MultiDexApplication() {

private val applicationScope = CoroutineScope(SupervisorJob())

@Inject
lateinit var appDelegates: Set<@JvmSuppressWildcards AppDelegate>



//Need to get rid off of this ASAP
@JvmField
var experiment: PhyphoxExperiment? = null

override fun onCreate() {
super.onCreate()

appDelegates.forEach { it.start(applicationScope) }
}

override fun onTerminate() {
appDelegates.forEach { it.stop() }
super.onTerminate()
}

}


Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import android.widget.TextView;
import android.widget.Toast;

import androidx.activity.EdgeToEdge;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AlertDialog;
Expand All @@ -57,9 +56,6 @@
import androidx.appcompat.widget.PopupMenu;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.preference.PreferenceManager;

import com.google.android.material.floatingactionbutton.FloatingActionButton;
Expand Down Expand Up @@ -87,6 +83,7 @@

import de.rwth_aachen.phyphox.Bluetooth.BluetoothExperimentLoader;
import de.rwth_aachen.phyphox.Bluetooth.BluetoothScanDialog;
import de.rwth_aachen.phyphox.BuildConfig;
import de.rwth_aachen.phyphox.Experiment;
import de.rwth_aachen.phyphox.ExperimentList.datasource.AssetExperimentLoader;
import de.rwth_aachen.phyphox.ExperimentList.handler.BluetoothScanner;
Expand All @@ -107,6 +104,7 @@
import de.rwth_aachen.phyphox.SettingsActivity.SettingsFragment;
import de.rwth_aachen.phyphox.camera.depth.DepthInput;
import de.rwth_aachen.phyphox.camera.helper.CameraHelper;
import de.rwth_aachen.phyphox.features.settings.presentation.NewSettingsActivity;

public class ExperimentListActivity extends AppCompatActivity {

Expand Down Expand Up @@ -282,6 +280,13 @@ public void onBluetoothScanError(String msg, Boolean isError, Boolean isFatal) {
}
});

if(BuildConfig.DEBUG){
creditsV.setOnLongClickListener(v -> {
startActivity(new Intent(this, NewSettingsActivity.class));
return true;
});
}

}

private void showPopupMenu(View v) {
Expand Down
8 changes: 0 additions & 8 deletions app/src/main/java/de/rwth_aachen/phyphox/Helper/Helper.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package de.rwth_aachen.phyphox.Helper;

import static android.content.Context.BATTERY_SERVICE;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;

import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
Expand All @@ -28,20 +26,15 @@
import android.os.Build;
import android.os.Handler;
import android.util.Base64;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.PixelCopy;
import android.view.Surface;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;

import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.preference.PreferenceManager;

import org.w3c.dom.Document;
Expand All @@ -55,7 +48,6 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Locale;
import java.util.Map;
import java.util.Vector;
import java.util.zip.CRC32;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,14 @@
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import android.os.Bundle;
import android.view.ViewGroup;


import dagger.hilt.android.AndroidEntryPoint;
import de.rwth_aachen.phyphox.Helper.Helper;
import de.rwth_aachen.phyphox.Helper.WindowInsetHelper;
import de.rwth_aachen.phyphox.R;

@AndroidEntryPoint

public class SettingsActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package de.rwth_aachen.phyphox.common

import kotlinx.coroutines.CoroutineScope

interface AppDelegate {
fun start(coroutineScope: CoroutineScope)
fun stop()
}
3 changes: 2 additions & 1 deletion app/src/main/java/de/rwth_aachen/phyphox/di/AppModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package de.rwth_aachen.phyphox.di
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import de.rwth_aachen.phyphox.features.settings.di.SettingsModule

@Module(includes = [])
@Module(includes = [SettingsModule::class])
@InstallIn(SingletonComponent::class)
abstract class AppModule {}

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package de.rwth_aachen.phyphox.di

import javax.inject.Qualifier

@Qualifier
@Retention(AnnotationRetention.RUNTIME)
annotation class ApplicationScope
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package de.rwth_aachen.phyphox.di

import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object CoroutineScopesModule {

@Provides
@Singleton
@ApplicationScope
fun provideApplicationScope(): CoroutineScope =
CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate)
}
Loading