Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 2 deletions android-versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
# Since properties strings are not quoted, we unquote the values in Gradle.
cmdLineToolsVersion = "16.0-rc01"
platformToolsVersion = "35.0.2"
buildToolsVersions = "35.0.0-rc4"
platformVersions = "35"
buildToolsVersions = "36.0.0"
platformVersions = "36"
15 changes: 9 additions & 6 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@ android {
compileSdk = versions.getProperty("platformVersions").toInt()
applicationId = "be.ugent.zeus.hydra"
minSdk = 21
targetSdk = 35
targetSdk = 36
versionCode = 37400
versionName = "3.7.4"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
resourceConfigurations += listOf("nl", "en")

// For a description of what these do, see the config.properties file.
buildConfigField("boolean", "DEBUG_HOME_STREAM_PRIORITY", props.getProperty("hydra.debug.home.stream.priority"))
Expand All @@ -67,6 +66,12 @@ android {
}
}
}

androidResources {
// Typical for Android, the old way is deprecated and the new way not stable yet.
@Suppress("UnstableApiUsage")
localeFilters += listOf("nl", "en")
}


if (props.getProperty("signing").toBoolean()) {
Expand Down Expand Up @@ -167,7 +172,7 @@ android {

lint {
disable += listOf(
"RtlSymmetry", "VectorPath", "Overdraw", "GradleDependency", "NotificationPermission", "OldTargetApi", "AndroidGradlePluginVersion"
"RtlSymmetry", "VectorPath", "Overdraw", "GradleDependency", "NotificationPermission", "AndroidGradlePluginVersion"
)
showAll = true
warningsAsErrors = true
Expand Down Expand Up @@ -198,10 +203,8 @@ dependencies {
implementation(libs.picasso)
implementation(libs.cachapa)
implementation(project(":material-intro"))
implementation(project(":ipcam-view"))
implementation(libs.once)
implementation(libs.materialvalues)
implementation(libs.insetter)
implementation(libs.ipcam)

annotationProcessor(libs.recordbuilder.processor)
compileOnly(libs.recordbuilder.core)
Expand Down
11 changes: 7 additions & 4 deletions app/src/main/java/be/ugent/zeus/hydra/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
import com.google.android.material.navigation.NavigationView;
import com.google.android.material.shape.MaterialShapeDrawable;
import com.google.android.material.tabs.TabLayout;
import dev.chrisbanes.insetter.Insetter;
import androidx.core.view.ViewCompat;
import jonathanfinerty.once.Once;
import org.jetbrains.annotations.NotNull;

Expand Down Expand Up @@ -233,9 +233,12 @@ protected void onCreate(Bundle savedInstanceState) {
// Prevent navigation drawer from extending behind the notification bar.
// It doesn't work to just set fitsSystemWindows=true, since this adds the padding
// for the navigation bar to the header, which is not what you want.
Insetter.builder()
.padding(WindowInsetsCompat.Type.statusBars())
.applyToView(this.binding.navigationView.getHeaderView(0));
ViewCompat.setOnApplyWindowInsetsListener(this.binding.navigationView.getHeaderView(0), (v, insets) -> {
androidx.core.graphics.Insets statusInsets = insets.getInsets(WindowInsetsCompat.Type.statusBars());
v.setPadding(statusInsets.left, statusInsets.top, statusInsets.right, statusInsets.bottom);
return insets;
});
ViewCompat.requestApplyInsets(this.binding.navigationView.getHeaderView(0));

if (savedInstanceState != null) {
isOnboardingOpen = savedInstanceState.getBoolean(STATE_IS_ONBOARDING_OPEN, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import be.ugent.zeus.hydra.databinding.ActivityWebviewBinding;

Expand All @@ -47,6 +49,12 @@ public class WebViewActivity extends BaseActivity<ActivityWebviewBinding> {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(ActivityWebviewBinding::inflate);
ViewCompat.setOnApplyWindowInsetsListener(binding.webContainer, (v, insets) -> {
int bottom = insets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom;
v.setPadding(v.getPaddingLeft(), v.getPaddingTop(), v.getPaddingRight(), bottom);
return insets;
});
ViewCompat.requestApplyInsets(binding.webContainer);

binding.webView.getSettings().setJavaScriptEnabled(true);
binding.webView.setWebViewClient(new ProgressClient(binding.progressBar.progressBar));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
Expand Down Expand Up @@ -103,7 +104,11 @@ private void init(Context context, @Nullable AttributeSet attrs) {
*/
private void createText(String text, boolean isTitle, boolean isHtml) {

final int rowPadding = getContext().getResources().getDimensionPixelSize(R.dimen.material_baseline_grid_1x);
final int rowPadding = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP,
8f,
getContext().getResources().getDisplayMetrics()
);

TableRow tr = new TableRow(getContext());
TableRow.LayoutParams lp = new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import android.content.Context;
import android.content.Intent;
import android.util.Pair;
import android.util.TypedValue;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TableRow;
Expand Down Expand Up @@ -62,7 +63,11 @@ public LibraryViewHolder(View itemView, HomeFeedAdapter adapter) {
Context c = itemView.getContext();
styleName = ViewUtils.getAttr(c, R.attr.textAppearanceBodyMedium);
styleHours = ViewUtils.getAttr(c, R.attr.textAppearanceCaption);
rowPadding = c.getResources().getDimensionPixelSize(R.dimen.material_baseline_grid_1x);
rowPadding = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP,
8f,
c.getResources().getDisplayMetrics()
);

itemView.setOnClickListener(v -> {
Intent intent = new Intent(v.getContext(), MainActivity.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.lifecycle.ViewModelProvider;

import be.ugent.zeus.hydra.R;
Expand Down Expand Up @@ -54,6 +56,12 @@ public class SaladActivity extends BaseActivity<ActivityRestoSaladBinding> {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(ActivityRestoSaladBinding::inflate);
ViewCompat.setOnApplyWindowInsetsListener(binding.recyclerView, (v, insets) -> {
int bottom = insets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom;
v.setPadding(v.getPaddingLeft(), v.getPaddingTop(), v.getPaddingRight(), bottom);
return insets;
});
ViewCompat.requestApplyInsets(binding.recyclerView);

final ViewModelProvider provider = new ViewModelProvider(this);
viewModel = provider.get(SaladViewModel.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import android.media.AudioManager;
import android.support.v4.media.session.MediaControllerCompat;
import android.support.v4.media.session.MediaSessionCompat;
import androidx.core.content.ContextCompat;

/**
* Helper class for listening for when headphones are unplugged (or the audio
Expand All @@ -46,7 +47,7 @@ class BecomingNoisyReceiver extends BroadcastReceiver {

void register() {
if (!registered) {
context.registerReceiver(this, noisyIntentFilter);
ContextCompat.registerReceiver(context, this, noisyIntentFilter, ContextCompat.RECEIVER_NOT_EXPORTED);
registered = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import android.text.Editable;
import android.text.TextWatcher;
import androidx.annotation.Nullable;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import java.util.Objects;

Expand All @@ -47,7 +49,13 @@ public class ApiKeyManagementActivity extends BaseActivity<ActivityWpiApiKeyMana
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(ActivityWpiApiKeyManagementBinding::inflate);

ViewCompat.setOnApplyWindowInsetsListener(binding.scroll, (v, insets) -> {
int bottom = insets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom;
v.setPadding(v.getPaddingLeft(), v.getPaddingTop(), v.getPaddingRight(), bottom);
return insets;
});
ViewCompat.requestApplyInsets(binding.scroll);

binding.apiTab.setText(AccountManager.getTabKey(this));
binding.apiTap.setText(AccountManager.getTapKey(this));
binding.apiUsername.setText(AccountManager.getUsername(this));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import be.ugent.zeus.hydra.common.network.NetworkState;
import be.ugent.zeus.hydra.common.ui.BaseActivity;
import be.ugent.zeus.hydra.databinding.ActivityWpiCammieBinding;
import com.github.niqdev.mjpeg.DisplayMode;
import com.github.niqdev.mjpeg.Mjpeg;

/**
Expand Down Expand Up @@ -118,7 +117,6 @@ private void loadMjpeg() {
.open(Endpoints.CAMMIE, 5)
.subscribe(inputStream -> {
binding.cammieViewer.setSource(inputStream);
binding.cammieViewer.setDisplayMode(DisplayMode.BEST_FIT);
binding.cammieViewer.showFps(true);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import be.ugent.zeus.hydra.common.network.Endpoints;
import be.ugent.zeus.hydra.common.ui.BaseActivity;
import be.ugent.zeus.hydra.databinding.ActivityWpiFullScreenCammieBinding;
import com.github.niqdev.mjpeg.DisplayMode;
import com.github.niqdev.mjpeg.Mjpeg;

/**
Expand Down Expand Up @@ -94,7 +93,6 @@ private void loadMjpeg() {
.open(Endpoints.CAMMIE, 5)
.subscribe(inputStream -> {
binding.cammieViewer.setSource(inputStream);
binding.cammieViewer.setDisplayMode(DisplayMode.BEST_FIT);
binding.cammieViewer.showFps(true);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.os.BundleCompat;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.lifecycle.ViewModelProvider;

import java.math.BigDecimal;
Expand Down Expand Up @@ -65,6 +67,12 @@ public class FormActivity extends BaseActivity<ActivityWpiTabTransactionFormBind
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(ActivityWpiTabTransactionFormBinding::inflate);
ViewCompat.setOnApplyWindowInsetsListener(binding.scroll, (v, insets) -> {
int bottom = insets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom;
v.setPadding(v.getPaddingLeft(), v.getPaddingTop(), v.getPaddingRight(), bottom);
return insets;
});
ViewCompat.requestApplyInsets(binding.scroll);

if (savedInstanceState != null && savedInstanceState.containsKey(KEY_FORM_OBJECT)) {
formObject = BundleCompat.getParcelable(savedInstanceState, KEY_FORM_OBJECT, TransactionForm.class);
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/layout-land/activity_wpi_cammie.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
app:layout_constraintDimensionRatio="H,20:11"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_percent="0.5"
stream:type="stream_default" />
app:layout_constraintWidth_percent="0.5" />

<GridLayout
android:id="@+id/grid_layout"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_extra_food.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".resto.extrafood.ExtraFoodActivity">

<com.google.android.material.appbar.AppBarLayout
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_info_sub_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".info.InfoSubItemActivity">

<com.google.android.material.appbar.AppBarLayout
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".info.InfoSubItemActivity">

<com.google.android.material.appbar.AppBarLayout
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_preferences_homefeed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
android:id="@+id/coordinator"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".feed.preferences.HomeFeedPrefActivity">

<com.google.android.material.appbar.AppBarLayout
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_resto_history.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
android:id="@+id/coordinator"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".resto.history.HistoryActivity"
tools:menu="@menu/menu_resto">

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/layout/activity_resto_salad.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".resto.salad.SaladActivity">

<com.google.android.material.appbar.AppBarLayout
Expand All @@ -53,6 +54,7 @@
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:scrollbars="none"
app:layoutManager="@string/app_layout_manager_linear"
tools:listitem="@layout/item_salad_bowl" />
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/layout/activity_webview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".common.ui.WebViewActivity">

<com.google.android.material.appbar.AppBarLayout
Expand All @@ -38,6 +39,7 @@
</com.google.android.material.appbar.AppBarLayout>

<FrameLayout
android:id="@+id/web_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
android:id="@+id/coordinator"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".wpi.account.ApiKeyManagementActivity"
tools:menu="@menu/menu_resto">

Expand Down
7 changes: 3 additions & 4 deletions app/src/main/res/layout/activity_wpi_cammie.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@

<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:stream="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/coordinator"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".wpi.cammie.CammieActivity">
tools:context=".wpi.cammie.CammieActivity"
android:fitsSystemWindows="true">

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar_layout"
Expand All @@ -53,8 +53,7 @@
app:layout_constraintDimensionRatio="H,20:11"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
stream:type="stream_default" />
app:layout_constraintTop_toTopOf="parent" />

<GridLayout
android:id="@+id/grid_layout"
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/res/layout/activity_wpi_full_screen_cammie.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:stream="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:id="@+id/coordinator"
Expand All @@ -36,8 +35,7 @@
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:id="@+id/cammie_viewer"
android:layout_width="match_parent"
android:layout_height="match_parent"
stream:type="stream_default" />
android:layout_height="match_parent" />

<com.google.android.material.appbar.AppBarLayout
android:animateLayoutChanges="true"
Expand Down
Loading
Loading