Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,14 @@

package org.comixedproject.variant.android.view

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.AccountCircle
import androidx.compose.material.icons.rounded.Home
import androidx.compose.material.icons.rounded.Settings
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import org.comixedproject.variant.android.R
Expand All @@ -49,21 +46,21 @@ fun VariantTopAppBar(
actions = {
IconButton(onClick = { onBrowseComics() }) {
Icon(
imageVector = Icons.Rounded.Home,
painterResource(R.drawable.ic_comic_library),
contentDescription = stringResource(R.string.browseServerDestinationLabel)
)
}

IconButton(onClick = { onBrowseServer() }) {
Icon(
imageVector = Icons.Rounded.AccountCircle,
painterResource(R.drawable.ic_browse_library),
contentDescription = stringResource(R.string.browseServerDestinationLabel)
)
}

IconButton(onClick = { onUpdateSettings() }) {
Icon(
imageVector = Icons.Rounded.Settings,
painterResource(R.drawable.ic_settings),
contentDescription = stringResource(R.string.settingsDestinationLabel)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.staggeredgrid.LazyVerticalStaggeredGrid
import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridCells
import androidx.compose.foundation.lazy.staggeredgrid.items
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand All @@ -46,6 +48,13 @@ fun ComicBookListView(
modifier: Modifier = Modifier
) {
Scaffold(
topBar = {
Text(
pluralStringResource(R.plurals.comicBookListTitle, comicBookList.size,
comicBookList.size),
style = MaterialTheme.typography.headlineMedium
)
},
content = { padding ->
if (comicBookList.isEmpty()) {
Log.debug(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
package org.comixedproject.variant.android.view.comics

import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Delete
import androidx.compose.material3.BottomAppBar
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
Expand Down Expand Up @@ -81,7 +79,7 @@ fun ComicBookView(
onDeleteComics()
}) {
Icon(
Icons.Filled.Delete,
painterResource(R.drawable.ic_delete_comics),
contentDescription = stringResource(R.string.deleteSelectionsLabel)
)
}
Expand Down
13 changes: 13 additions & 0 deletions androidVariant/src/main/res/drawable-anydpi/ic_browse_library.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#333333"
android:alpha="0.6">
<group android:translateY="-0.5">
<path
android:fillColor="#FF000000"
android:pathData="M17.5,21H7A7,7 0,0 1,5.276 7.223a6,6 0,0 1,11.645 0.8A6.5,6.5 0,1 1,17.5 21ZM11,5A4,4 0,0 0,7.076 8.26l-0.131,0.7 -0.7,0.106A5,5 0,0 0,7 19H17.5a4.5,4.5 0,1 0,-1.246 -8.821l-1.339,0.385L15,8.979A4,4 0,0 0,11 5Z"/>
</group>
</vector>
16 changes: 16 additions & 0 deletions androidVariant/src/main/res/drawable-anydpi/ic_comic_library.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#333333"
android:alpha="0.6">
<group android:scaleX="1.2"
android:scaleY="1.2"
android:translateX="-2.4"
android:translateY="-1.8">
<path
android:fillColor="#FF000000"
android:pathData="M21.515,5.143A9.218,9.218 0,0 0,12 4.82a9.223,9.223 0,0 0,-9.515 0.323L2,5.434V19.766l1.515,-0.909A7.19,7.19 0,0 1,11.4 18.8l0.6,0.442 0.6,-0.439a7.194,7.194 0,0 1,7.889 0.054L22,19.766V5.434ZM7.559,15.656A9.3,9.3 0,0 0,4 16.378V6.585a7.2,7.2 0,0 1,7 -0.035v9.792A9.086,9.086 0,0 0,7.559 15.656ZM20,16.378a9.057,9.057 0,0 0,-7 -0.038V6.55a7.2,7.2 0,0 1,7 0.035Z"/>
</group>
</vector>
20 changes: 20 additions & 0 deletions androidVariant/src/main/res/drawable-anydpi/ic_delete_comics.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="32"
android:viewportHeight="32"
android:tint="#333333"
android:alpha="0.6">
<path
android:fillColor="#FF000000"
android:pathData="M29.89,6.55l-1,-2A1,1 0,0 0,28 4H21V2a2,2 0,0 0,-2 -2H13a2,2 0,0 0,-2 2V4H4a1,1 0,0 0,-0.89 0.55l-1,2A1,1 0,0 0,3 8H5V30a2,2 0,0 0,0.47 1.41A2,2 0,0 0,7 32H25a2,2 0,0 0,2 -2V8h2a1,1 0,0 0,0.89 -1.45ZM13,2h6V4H13ZM25,30H7V8H25Z"/>
<path
android:fillColor="#FF000000"
android:pathData="M17,26V10a2,2 0,0 0,-2 2l0.06,14H15v2A2,2 0,0 0,17 26Z"/>
<path
android:fillColor="#FF000000"
android:pathData="M22,26V10a2,2 0,0 0,-2 2l0.06,14H20v2A2,2 0,0 0,22 26Z"/>
<path
android:fillColor="#FF000000"
android:pathData="M12,26V10a2,2 0,0 0,-2 2l0.06,14H10v2A2,2 0,0 0,12 26Z"/>
</vector>
19 changes: 19 additions & 0 deletions androidVariant/src/main/res/drawable-anydpi/ic_settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="32"
android:viewportHeight="32"
android:tint="#333333"
android:alpha="0.6">
<group android:scaleX="1.0909091"
android:scaleY="1.0909091"
android:translateX="-1.4545455"
android:translateY="-1.4545455">
<path
android:pathData="M27.92,18.46l-1.14,-0.92a0.86,0.86 0,0 1,-0.31 -0.65V15.2a0.83,0.83 0,0 1,0.31 -0.65l1.11,-0.89A2.86,2.86 0,0 0,28.54 10L27.42,8.12A2.76,2.76 0,0 0,24.21 6.9l-1.82,0.58a0.73,0.73 0,0 1,-0.64 -0.09l-1.23,-0.81A0.8,0.8 0,0 1,20.16 6L19.92,4.4A2.77,2.77 0,0 0,17.18 2H14.93a2.79,2.79 0,0 0,-2.77 2.51L12,6a0.8,0.8 0,0 1,-0.41 0.63L10,7.48a0.79,0.79 0,0 1,-0.67 0L8.08,7A2.75,2.75 0,0 0,4.62 8.1L3.48,10a2.84,2.84 0,0 0,0.57 3.64L5.4,14.75a0.87,0.87 0,0 1,0.29 0.62l0,1.27a0.87,0.87 0,0 1,-0.28 0.65L4,18.61a2.85,2.85 0,0 0,-0.57 3.52l1,1.84a2.77,2.77 0,0 0,3.42 1.22l1.62,-0.63a0.73,0.73 0,0 1,0.66 0.05l1.4,0.84a0.76,0.76 0,0 1,0.38 0.55l0.32,1.66A2.81,2.81 0,0 0,15 29.94h2.15a2.79,2.79 0,0 0,2.75 -2.39l0.26,-1.65a0.85,0.85 0,0 1,0.4 -0.6l1.3,-0.74a0.78,0.78 0,0 1,0.65 0l1.64,0.63a2.76,2.76 0,0 0,3.37 -1.2l1.08,-1.83A2.86,2.86 0,0 0,27.92 18.46ZM26.85,21.1l-1.08,1.83a0.78,0.78 0,0 1,-0.94 0.34l-1.64,-0.63a2.77,2.77 0,0 0,-2.35 0.19l-1.3,0.74a2.81,2.81 0,0 0,-1.39 2l-0.26,1.66a0.78,0.78 0,0 1,-0.77 0.69H15a0.79,0.79 0,0 1,-0.77 -0.66l-0.32,-1.66a2.81,2.81 0,0 0,-1.33 -1.89l-1.4,-0.84a2.73,2.73 0,0 0,-1.41 -0.39,2.91 2.91,0 0,0 -1,0.19l-1.62,0.64a0.77,0.77 0,0 1,-1 -0.35l-1,-1.84a0.84,0.84 0,0 1,0.16 -1l1.48,-1.32a2.87,2.87 0,0 0,0.94 -2.17l0,-1.27a2.9,2.9 0,0 0,-1 -2.11L5.36,12.08A0.85,0.85 0,0 1,5.19 11L6.33,9.14a0.76,0.76 0,0 1,1 -0.32l1.25,0.53A2.72,2.72 0,0 0,11 9.23l1.61,-0.89A2.81,2.81 0,0 0,14 6.17l0.16,-1.46A0.79,0.79 0,0 1,14.93 4h2.24a0.79,0.79 0,0 1,0.78 0.7l0.23,1.61a2.85,2.85 0,0 0,1.24 2l1.23,0.8A2.72,2.72 0,0 0,23 9.38l1.82,-0.57a0.76,0.76 0,0 1,0.89 0.34L26.83,11a0.86,0.86 0,0 1,-0.19 1.09L25.53,13a2.84,2.84 0,0 0,-1.06 2.22v1.69a2.81,2.81 0,0 0,1.05 2.2l1.14,0.92A0.86,0.86 0,0 1,26.85 21.1Z"
android:fillColor="#231f20"/>
<path
android:pathData="M16,11a5,5 0,1 0,5 5A5,5 0,0 0,16 11ZM16,19a3,3 0,1 1,3 -3A3,3 0,0 1,16 19.07Z"
android:fillColor="#231f20"/>
</group>
</vector>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions androidVariant/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@
<string name="markReadLabel">Mark selected comics as read.</string>
<string name="markUnreadLabel">Mark selected comics as unread.</string>
<string name="deleteSelectionsLabel">Delete selected comics from device.</string>
<plurals name="comicBookListTitle">
<item quantity="one">%d Comic Book</item>
<item quantity="other">%d Comic Books</item>
</plurals>
</resources>
28 changes: 28 additions & 0 deletions iosVariant/Translations.xcstrings
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"sourceLanguage" : "en",
"strings" : {
"%lld Comic Books" : {
"localizations" : {
"en" : {
"variations" : {
"plural" : {
"one" : {
"stringUnit" : {
"state" : "translated",
"value" : "%lld Comic Book"
}
},
"other" : {
"stringUnit" : {
"state" : "new",
"value" : "%lld Comic Books"
}
}
}
}
}
}
}
},
"version" : "1.0"
}
9 changes: 6 additions & 3 deletions iosVariant/Variant.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557BA273AAA24004C7B11 /* Assets.xcassets */; };
058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */; };
2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; };
6A1EDFD12E294F7D00429CEF /* Translations.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 6A1EDFD02E294F7D00429CEF /* Translations.xcstrings */; };
6A4D18062E14191D00FF9EA2 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A4D18052E14191D00FF9EA2 /* Constants.swift */; };
6AA598492DE72E910078CC9F /* ServerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AA598482DE72E910078CC9F /* ServerView.swift */; };
6AA5984C2DE72EF40078CC9F /* Fixtures.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AA5984B2DE72EF40078CC9F /* Fixtures.swift */; };
Expand Down Expand Up @@ -50,6 +51,7 @@
058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = "<group>"; };
6A1EDFD02E294F7D00429CEF /* Translations.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Translations.xcstrings; sourceTree = "<group>"; };
6A4D18052E14191D00FF9EA2 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
6AA598482DE72E910078CC9F /* ServerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServerView.swift; sourceTree = "<group>"; };
6AA5984B2DE72EF40078CC9F /* Fixtures.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Fixtures.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -114,6 +116,7 @@
7555FF72242A565900829871 = {
isa = PBXGroup;
children = (
6A1EDFD02E294F7D00429CEF /* Translations.xcstrings */,
7555FF7D242A565900829871 /* iosVariant */,
7555FF7C242A565900829871 /* Products */,
7555FFB0242A642200829871 /* Frameworks */,
Expand Down Expand Up @@ -256,9 +259,6 @@
knownRegions = (
en,
Base,
es,
fr,
"pt-BR",
);
mainGroup = 7555FF72242A565900829871;
packageReferences = (
Expand All @@ -279,6 +279,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6A1EDFD12E294F7D00429CEF /* Translations.xcstrings in Resources */,
058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */,
058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */,
);
Expand Down Expand Up @@ -394,6 +395,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
Expand Down Expand Up @@ -448,6 +450,7 @@
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
Expand Down
6 changes: 4 additions & 2 deletions iosVariant/iosVariant/Views/Comics/ComicBookListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ struct ComicBookListView: View {

var onClick: (ComicBook) -> Void

var comicBookCount: Int { return comicBookList.count }

var body: some View {
NavigationStack {
ScrollView {
Expand All @@ -48,8 +50,8 @@ struct ComicBookListView: View {
}
.navigationTitle(
String(
localized: "comic-book-list.title",
defaultValue: "Comic List"
localized: "\(comicBookCount) Comic Books",
table: "Translations"
)
)
}
Expand Down