Fix compilation/runtime errors

The app is still in a horribly barely-usable state but it's at least usable now
This commit is contained in:
William Brawner 2022-06-15 20:53:16 -06:00
parent 16b4823450
commit 316949a6b5
6 changed files with 22 additions and 23 deletions

View file

@ -55,7 +55,6 @@ dependencies {
implementation 'androidx.media:media:1.4.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.emoji:emoji-bundled:1.1.0'
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
// Dagger
implementation "com.google.dagger:hilt-android:$dagger"

View file

@ -22,9 +22,9 @@ import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.emoji.text.EmojiCompat
import androidx.lifecycle.lifecycleScope
import androidx.navigation.NavController
import androidx.navigation.compose.rememberNavController
import androidx.navigation.findNavController
import androidx.navigation.ui.setupWithNavController
import com.google.android.material.navigation.NavigationView
@ -150,7 +150,6 @@ fun TwigsDrawer(navController: NavController, budgets: List<Budget>) {
)
}
val currentBudget = navController.currentBackStackEntry?.arguments?.getString("id")
navController.currentDestination?.arguments?.get()
}
}
@ -175,7 +174,7 @@ fun DrawerItem(@DrawableRes image: Int, text: String, selected: Boolean) {
@Preview
fun DrawerItem_Preview() {
TwigsApp {
DrawerItem(R.drawable.ic_folder_open)
DrawerItem(R.drawable.ic_folder_open, "Budget", false)
}
}
@ -183,10 +182,11 @@ fun DrawerItem_Preview() {
@Preview
fun TwigsDrawer_Preview() {
val scaffoldState = rememberScaffoldState(rememberDrawerState(initialValue = DrawerValue.Open))
val navController = rememberNavController()
TwigsApp {
Scaffold(
scaffoldState = scaffoldState,
drawerContent = { TwigsDrawer() }
drawerContent = { TwigsDrawer(navController, emptyList()) }
) {
}

View file

@ -28,21 +28,21 @@ val darkColors = darkColors(
fun TwigsTheme(darkMode: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) {
MaterialTheme(
colors = if (darkMode) darkColors else lightColors,
typography = MaterialTheme.typography.copy(
h1 = MaterialTheme.typography.h1.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
h2 = MaterialTheme.typography.h2.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
h3 = MaterialTheme.typography.h3.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
h4 = MaterialTheme.typography.h4.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
h5 = MaterialTheme.typography.h5.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
h6 = MaterialTheme.typography.h6.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
subtitle1 = MaterialTheme.typography.subtitle1.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
subtitle2 = MaterialTheme.typography.subtitle2.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
body1 = MaterialTheme.typography.body1.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
body2 = MaterialTheme.typography.body2.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
button = MaterialTheme.typography.button.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
caption = MaterialTheme.typography.caption.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
overline = MaterialTheme.typography.overline.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
),
// typography = MaterialTheme.typography.copy(
// h1 = MaterialTheme.typography.h1.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
// h2 = MaterialTheme.typography.h2.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
// h3 = MaterialTheme.typography.h3.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
// h4 = MaterialTheme.typography.h4.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
// h5 = MaterialTheme.typography.h5.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
// h6 = MaterialTheme.typography.h6.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
// subtitle1 = MaterialTheme.typography.subtitle1.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
// subtitle2 = MaterialTheme.typography.subtitle2.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
// body1 = MaterialTheme.typography.body1.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
// body2 = MaterialTheme.typography.body2.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
// button = MaterialTheme.typography.button.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
// caption = MaterialTheme.typography.caption.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
// overline = MaterialTheme.typography.overline.copy(fontFamily = FontFamily(Font(R.font.ubuntu))),
// ),
content = content
)
}

View file

@ -30,7 +30,7 @@
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<androidx.emoji.widget.EmojiTextView
<TextView
android:id="@+id/noItemsTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View file

@ -27,7 +27,7 @@
</LinearLayout>
<androidx.emoji.widget.EmojiTextView
<TextView
android:id="@+id/noData"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View file

@ -11,7 +11,7 @@
android:layout_height="wrap_content"
android:layout_gravity="fill_vertical|center_horizontal" />
<androidx.emoji.widget.EmojiTextView
<TextView
android:id="@+id/transaction_list_no_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"