Skip to content

Commit

Permalink
Merge pull request #23 from DennisBauer/development
Browse files Browse the repository at this point in the history
Remove OSS Licences Plugin as it contains proprietary code
  • Loading branch information
DennisBauer authored Oct 3, 2023
2 parents 888c7dc + 05255cf commit 35ca043
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 52 deletions.
2 changes: 0 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {
alias(libs.plugins.org.jetbrains.kotlin.android)
alias(libs.plugins.com.google.devtools.ksp)
alias(libs.plugins.org.jlleitschuh.gradle.ktlint)
id("com.google.android.gms.oss-licenses-plugin")
}

android {
Expand Down Expand Up @@ -89,7 +88,6 @@ dependencies {
implementation(libs.ui)
implementation(libs.ui.graphics)
implementation(libs.ui.tooling.preview)
implementation(libs.oss.licenses.services)
implementation(platform(libs.compose.bom))

annotationProcessor(libs.room.compiler)
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.google.android.gms.oss.licenses.OssLicensesMenuActivity"
android:theme="@style/Theme.OSSActivities"/>
<activity android:name="com.google.android.gms.oss.licenses.OssLicensesActivity"
android:theme="@style/Theme.OSSActivities" />
</application>

</manifest>
11 changes: 1 addition & 10 deletions app/src/main/java/de/dbauer/expensetracker/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package de.dbauer.expensetracker

import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
Expand Down Expand Up @@ -39,7 +38,6 @@ import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.rememberNavController
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity
import de.dbauer.expensetracker.data.BottomNavigation
import de.dbauer.expensetracker.data.Recurrence
import de.dbauer.expensetracker.data.RecurringExpenseData
Expand Down Expand Up @@ -76,9 +74,6 @@ class MainActivity : ComponentActivity() {
onRecurringExpenseDeleted = {
viewModel.deleteRecurringExpense(it)
},
onLicensesClicked = {
startActivity(Intent(this, OssLicensesMenuActivity::class.java))
},
)
}
}
Expand All @@ -94,7 +89,6 @@ fun MainActivityContent(
onRecurringExpenseAdded: (RecurringExpenseData) -> Unit,
onRecurringExpenseEdited: (RecurringExpenseData) -> Unit,
onRecurringExpenseDeleted: (RecurringExpenseData) -> Unit,
onLicensesClicked: () -> Unit,
modifier: Modifier = Modifier,
) {
val navController = rememberNavController()
Expand Down Expand Up @@ -213,9 +207,7 @@ fun MainActivityContent(
)
}
composable(BottomNavigation.Settings.route) {
SettingsScreen(
onLicensesClicked = onLicensesClicked,
)
SettingsScreen()
}
}
if (addRecurringExpenseVisible) {
Expand Down Expand Up @@ -287,6 +279,5 @@ private fun MainActivityContentPreview() {
onRecurringExpenseAdded = {},
onRecurringExpenseEdited = {},
onRecurringExpenseDeleted = {},
onLicensesClicked = {},
)
}
20 changes: 12 additions & 8 deletions app/src/main/java/de/dbauer/expensetracker/ui/SettingsScreen.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.dbauer.expensetracker.ui

import androidx.annotation.StringRes
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -11,26 +12,29 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import de.dbauer.expensetracker.R
import de.dbauer.expensetracker.ui.theme.ExpenseTrackerTheme

@Composable
fun SettingsScreen(
onLicensesClicked: () -> Unit,
modifier: Modifier = Modifier,
) {
fun SettingsScreen(modifier: Modifier = Modifier) {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
modifier =
modifier
.verticalScroll(rememberScrollState()),
.verticalScroll(rememberScrollState())
.fillMaxSize(),
) {
SettingsClickableElement(name = R.string.settings_licenses, onClick = onLicensesClicked)
Text(
text = "More to come soon",
modifier = Modifier.padding(16.dp),
)
}
}

Expand Down Expand Up @@ -63,7 +67,7 @@ private fun SettingsClickableElement(
private fun SettingsScreenPreview() {
ExpenseTrackerTheme {
Surface(modifier = Modifier.fillMaxSize()) {
SettingsScreen(onLicensesClicked = {})
SettingsScreen()
}
}
}
1 change: 0 additions & 1 deletion app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@
<string name="edit_expense_recurrence_year">Jahr(e)</string>

<string name="settings_title">Einstellungen</string>
<string name="settings_licenses">Lizenzen</string>
</resources>
5 changes: 0 additions & 5 deletions app/src/main/res/values-night/themes.xml

This file was deleted.

1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,5 @@
<string name="edit_expense_recurrence_year">Year(s)</string>

<string name="settings_title">Settings</string>
<string name="settings_licenses">Licenses</string>

</resources>
5 changes: 0 additions & 5 deletions app/src/main/res/values/themes.xml

This file was deleted.

13 changes: 1 addition & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,4 @@ plugins {
alias(libs.plugins.com.google.devtools.ksp) apply false
alias(libs.plugins.org.jlleitschuh.gradle.ktlint) apply false
}

// Unfortunately the oss-licenses plugin doesn't support the new plugin mechanism
buildscript {
repositories {
google()
}
dependencies {
classpath(libs.oss.licenses.plugin)
}
}

true // Needed to make the Suppress annotation work for the plugins block
true // Needed to make the Suppress annotation work for the plugins block
4 changes: 0 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ ktlint-version = "1.0.0"
lifecycle-runtime-ktx = "2.6.2"
material = "1.9.0"
navigation-compose = "2.7.2"
oss-licenses-plugin = "0.10.6"
oss-licenses-services = "17.0.1"
room = "2.5.2"

[libraries]
Expand All @@ -35,8 +33,6 @@ material = { group = "com.google.android.material", name = "material", version.r
material-icons-extended = { group = "androidx.compose.material", name = "material-icons-extended" }
material3 = { group = "androidx.compose.material3", name = "material3" }
navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigation-compose" }
oss-licenses-plugin = { group = "com.google.android.gms", name = "oss-licenses-plugin", version.ref = "oss-licenses-plugin" }
oss-licenses-services = { group = "com.google.android.gms", name = "play-services-oss-licenses", version.ref = "oss-licenses-services" }
room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" }
room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" }
room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" }
Expand Down

0 comments on commit 35ca043

Please sign in to comment.