From 9050025d1764b8f24bd827337806aaae201484f2 Mon Sep 17 00:00:00 2001 From: Der_Googler <54764558+DerGoogler@users.noreply.github.com> Date: Wed, 12 Jul 2023 11:13:32 +0200 Subject: [PATCH 1/6] Fix D-API Tester --- Android/app/release/output-metadata.json | 4 ++-- Website/src/activitys/DAPITestActivity.tsx | 3 ++- www/index.html | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Android/app/release/output-metadata.json b/Android/app/release/output-metadata.json index 7363a7bf..9657204e 100644 --- a/Android/app/release/output-metadata.json +++ b/Android/app/release/output-metadata.json @@ -11,8 +11,8 @@ "type": "SINGLE", "filters": [], "attributes": [], - "versionCode": 160, - "versionName": "1.6.0", + "versionCode": 161, + "versionName": "1.6.1", "outputFile": "app-release.apk" } ], diff --git a/Website/src/activitys/DAPITestActivity.tsx b/Website/src/activitys/DAPITestActivity.tsx index 7658ee6f..73136312 100644 --- a/Website/src/activitys/DAPITestActivity.tsx +++ b/Website/src/activitys/DAPITestActivity.tsx @@ -191,7 +191,7 @@ const DAPITestActivity = () => { /> {!os.isAndroid && isDesktop && ( - + )} @@ -225,6 +225,7 @@ const Preview = styled("div")(({ theme }) => ({ borderStyle: "solid", borderWidth: "1px", minWidth: "0%", + overflow: "auto", borderColor: "rgba(0, 0, 0, 0.23)", article: { position: "absolute", diff --git a/www/index.html b/www/index.html index d54c26eb..d87b3ef4 100644 --- a/www/index.html +++ b/www/index.html @@ -13,14 +13,14 @@ - + - + From 55dbc128400238553bbdf1591c649ce4b3ef9112 Mon Sep 17 00:00:00 2001 From: Der_Googler <54764558+DerGoogler@users.noreply.github.com> Date: Wed, 12 Jul 2023 12:08:45 +0200 Subject: [PATCH 2/6] Added low quality modules check --- Website/src/activitys/DescriptonActivity.tsx | 65 +++----------------- Website/src/activitys/SettingsActivity.tsx | 21 ++++++- Website/src/components/ExploreModule.tsx | 13 +++- Website/src/components/StyledIconButton.tsx | 56 +++++++++++++++-- Website/src/hooks/useLowQualityModule.ts | 15 +++++ Website/src/hooks/useSettings.tsx | 2 + 6 files changed, 108 insertions(+), 64 deletions(-) create mode 100644 Website/src/hooks/useLowQualityModule.ts diff --git a/Website/src/activitys/DescriptonActivity.tsx b/Website/src/activitys/DescriptonActivity.tsx index d47dbdad..935cebf7 100644 --- a/Website/src/activitys/DescriptonActivity.tsx +++ b/Website/src/activitys/DescriptonActivity.tsx @@ -26,6 +26,7 @@ import DataUsageIcon from "@mui/icons-material/DataUsage"; import ModuleSpecsActivity from "./ModuleSpecsActivity"; import { parseAndroidVersion } from "@Util/parseAndroidVersion"; import { useTheme } from "@Hooks/useTheme"; +import { StyledIconButtonWithText } from "@Components/StyledIconButton"; type Extra = { title: string; @@ -158,7 +159,7 @@ function DescriptonActivity() { {!(prop_url.mmrlNoComments === "true") && ( - { context.pushPage({ @@ -175,19 +176,19 @@ function DescriptonActivity() { - + )} {isVerified && ( - + {strings.verified} - + )} - { context.pushPage({ component: ModuleSpecsActivity, @@ -204,10 +205,10 @@ function DescriptonActivity() { Specs - + {prop_url.support && ( - { os.open(prop_url.support, { target: "_blank", @@ -221,7 +222,7 @@ function DescriptonActivity() { Support - + )} @@ -273,52 +274,4 @@ function DescriptonActivity() { ); } -const ViewModuleOptionsButton = styled("span")(({ theme }) => { - const { settings, setSettings } = useSettings(); - const { scheme } = useTheme(); - const shade = useShadeColor(); - - return { - height: 39, - - // fontSize: "inherit", - display: "flex", - alignItems: "center", - - MozBoxAlign: "center", - // alignItems: "center", - MozBoxPack: "center", - justifyContent: "center", - position: "relative", - boxSizing: "border-box", - backgroundColor: "transparent", - outline: "currentcolor none 0px", - margin: "0px", - cursor: "pointer", - userSelect: "none", - verticalAlign: "middle", - appearance: "none", - textDecoration: "none", - textAlign: "center", - flex: "0 0 auto", - fontSize: "1.5rem", - padding: "8px", - overflow: "visible", - transition: "background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms", - border: `1px solid ${theme.palette.divider}`, - // borderTopColor: theme.palette.divider, - // borderRightColor: theme.palette.divider, - // borderBottomColor: theme.palette.divider, - // borderLeftColor: theme.palette.divider, - color: !settings.darkmode ? "rgb(66, 66, 66)" : shade(scheme[700], -61), - borderRadius: theme.shape.borderRadius, - alignSelf: "flex-start", - ":hover": { - borderColor: theme.palette.primary.main, - color: theme.palette.primary.main, - backgroundColor: "rgba(0, 0, 0, 0.04)", - }, - }; -}); - export default DescriptonActivity; diff --git a/Website/src/activitys/SettingsActivity.tsx b/Website/src/activitys/SettingsActivity.tsx index a2d942d4..adbc2fa3 100644 --- a/Website/src/activitys/SettingsActivity.tsx +++ b/Website/src/activitys/SettingsActivity.tsx @@ -59,12 +59,29 @@ function SettingsActivity() { - ({ bgcolor: theme.palette.background.default })}>Experimental}> + ({ bgcolor: theme.palette.background.default })}>Module}> + + + { + setSettings("_low_quality_module", e.target.checked); + }} + checked={settings._low_quality_module} + inputProps={{ + "aria-labelledby": "switch-list-_low_quality_module", + }} + /> + { const { context } = useActivity(); const { strings } = useStrings(); + const { settings } = useSettings(); const { moduleOptions, index } = props; const { id, notes_url, zip_url, last_update, prop_url } = props.moduleProps; @@ -23,6 +26,8 @@ export const ExploreModule = (props: Props) => { const isVerified = moduleOptions[id]?.verified; const _display = moduleOptions[id]?.display; + const isLowQuality = useLowQualityModule(prop_url); + const formatDate = (date: Date) => { var hours = date.getHours(); var minutes = date.getMinutes(); @@ -95,6 +100,12 @@ export const ExploreModule = (props: Props) => { )} + {settings._low_quality_module && isLowQuality && ( + + Low Quality + Module meets not the requirements of its props + + )} ); }; diff --git a/Website/src/components/StyledIconButton.tsx b/Website/src/components/StyledIconButton.tsx index e74138a5..52e2954d 100644 --- a/Website/src/components/StyledIconButton.tsx +++ b/Website/src/components/StyledIconButton.tsx @@ -4,12 +4,12 @@ import { useTheme } from "@Hooks/useTheme"; import { styled } from "@mui/material"; import IconButton, { IconButtonProps } from "@mui/material/IconButton"; -export const StyledIconButton = (props: IconButtonProps) => { +export const StyledIconButton = styled(IconButton)(({ theme }) => { const { settings, setSettings } = useSettings(); const { scheme } = useTheme(); const shade = useShadeColor(); - const C = styled(IconButton)(({ theme }) => ({ + return { display: "inline-flex", MozBoxAlign: "center", alignItems: "center", @@ -44,7 +44,53 @@ export const StyledIconButton = (props: IconButtonProps) => { color: theme.palette.primary.main, backgroundColor: "rgba(0, 0, 0, 0.04)", }, - })); + }; +}); - return ; -}; +export const StyledIconButtonWithText = styled("span")(({ theme }) => { + const { settings, setSettings } = useSettings(); + const { scheme } = useTheme(); + const shade = useShadeColor(); + + return { + height: 39, + + // fontSize: "inherit", + display: "flex", + alignItems: "center", + + MozBoxAlign: "center", + // alignItems: "center", + MozBoxPack: "center", + justifyContent: "center", + position: "relative", + boxSizing: "border-box", + backgroundColor: "transparent", + outline: "currentcolor none 0px", + margin: "0px", + cursor: "pointer", + userSelect: "none", + verticalAlign: "middle", + appearance: "none", + textDecoration: "none", + textAlign: "center", + flex: "0 0 auto", + fontSize: "1.5rem", + padding: "8px", + overflow: "visible", + transition: "background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms", + border: `1px solid ${theme.palette.divider}`, + // borderTopColor: theme.palette.divider, + // borderRightColor: theme.palette.divider, + // borderBottomColor: theme.palette.divider, + // borderLeftColor: theme.palette.divider, + color: !settings.darkmode ? "rgb(66, 66, 66)" : shade(scheme[700], -61), + borderRadius: theme.shape.borderRadius, + alignSelf: "flex-start", + ":hover": { + borderColor: theme.palette.primary.main, + color: theme.palette.primary.main, + backgroundColor: "rgba(0, 0, 0, 0.04)", + }, + }; +}); diff --git a/Website/src/hooks/useLowQualityModule.ts b/Website/src/hooks/useLowQualityModule.ts new file mode 100644 index 00000000..4e8522b4 --- /dev/null +++ b/Website/src/hooks/useLowQualityModule.ts @@ -0,0 +1,15 @@ +import { useMemo } from "react"; + +export const useLowQualityModule = (props: ModuleProps) => { + const requiredProp = ["id", "name", "version", "versionCode", "author", "description"]; + + const res = useMemo( + () => + requiredProp.reduce(function (i, j) { + return i && props[j] && j in props; + }, true), + [props] + ); + + return !res; +}; diff --git a/Website/src/hooks/useSettings.tsx b/Website/src/hooks/useSettings.tsx index d24619ba..7576c5bf 100644 --- a/Website/src/hooks/useSettings.tsx +++ b/Website/src/hooks/useSettings.tsx @@ -139,6 +139,7 @@ export interface StorageDeclaration { accent_scheme: Picker; eruda_console_enabled: boolean; disabled_repos: string[]; + _low_quality_module: boolean; __experimental_local_install: boolean; repos: StoredRepo[]; test: any; @@ -150,6 +151,7 @@ export const INITIAL_SETTINGS: StorageDeclaration = { accent_scheme: accent_colors[0], eruda_console_enabled: false, disabled_repos: [], + _low_quality_module: true, __experimental_local_install: false, repos: [], test: [], From 133afe4cd30133ea684db5abab78b5afa8fead21 Mon Sep 17 00:00:00 2001 From: Der_Googler <54764558+DerGoogler@users.noreply.github.com> Date: Wed, 12 Jul 2023 12:09:48 +0200 Subject: [PATCH 3/6] Some Android check stuff --- Website/src/activitys/SettingsActivity.tsx | 36 ++++++++++++---------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/Website/src/activitys/SettingsActivity.tsx b/Website/src/activitys/SettingsActivity.tsx index adbc2fa3..519d7cc8 100644 --- a/Website/src/activitys/SettingsActivity.tsx +++ b/Website/src/activitys/SettingsActivity.tsx @@ -77,23 +77,25 @@ function SettingsActivity() { }} /> - - - { - setSettings("__experimental_local_install", e.target.checked); - }} - checked={settings.__experimental_local_install} - inputProps={{ - "aria-labelledby": "switch-list-__experimental_local_install", - }} - /> - + {os.isAndroid && ( + + + { + setSettings("__experimental_local_install", e.target.checked); + }} + checked={settings.__experimental_local_install} + inputProps={{ + "aria-labelledby": "switch-list-__experimental_local_install", + }} + /> + + )} From 8c7b127d2f6a0845fdf83c9eee61e387385e2cb6 Mon Sep 17 00:00:00 2001 From: Der_Googler <54764558+DerGoogler@users.noreply.github.com> Date: Wed, 12 Jul 2023 13:13:11 +0200 Subject: [PATCH 4/6] Improved D-API --- Website/src/activitys/DAPITestActivity.tsx | 2 +- Website/src/components/Markdown/index.tsx | 28 +++++++++++++++++++-- Website/src/components/icons/Checkmark.tsx | 2 +- Website/src/components/icons/Dangermark.tsx | 2 +- Website/src/components/icons/Warnmark.tsx | 2 +- 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Website/src/activitys/DAPITestActivity.tsx b/Website/src/activitys/DAPITestActivity.tsx index 73136312..46edc601 100644 --- a/Website/src/activitys/DAPITestActivity.tsx +++ b/Website/src/activitys/DAPITestActivity.tsx @@ -39,7 +39,7 @@ const DAPITestActivity = () => { const { context, extra } = useActivity(); const { strings } = useStrings(); - const [description, setDescription] = React.useState("# Hello, world!"); + const [description, setDescription] = React.useState("# Extended D-API\n\nThere are more components, try it out!\n\n## Alerts within a box\n\n\n \n This is an error alert — check it out!\n This is a warning alert — check it out!\n This is an info alert — check it out!\n This is a success alert — check it out!\n \n\n\n### Code\n\n```html\n\n \n This is an error alert — check it out!\n This is a warning alert — check it out!\n This is an info alert — check it out!\n This is a success alert — check it out!\n \n\n```"); const markdownRef = React.useRef(null); const markdownRefAdvanced = React.useRef(null); diff --git a/Website/src/components/Markdown/index.tsx b/Website/src/components/Markdown/index.tsx index 141f6724..a3c6fc10 100644 --- a/Website/src/components/Markdown/index.tsx +++ b/Website/src/components/Markdown/index.tsx @@ -7,7 +7,22 @@ import Warnmark from "../icons/Warnmark"; import Icon from "@mui/material/Icon"; import Typography from "@mui/material/Typography"; import React from "react"; -import { Box, Chip, Container, Divider, Grid, Paper, Stack } from "@mui/material"; +import { + Alert, + Box, + Button, + Card, + CardActionArea, + CardActions, + CardContent, + CardMedia, + Chip, + Container, + Divider, + Grid, + Paper, + Stack, +} from "@mui/material"; import styled from "@emotion/styled"; import hljs from "highlight.js"; import { doc } from "googlers-tools"; @@ -28,6 +43,15 @@ const StyledDivider = styled(Divider)({ }); export const MarkdownOverrides: MarkdownToJSX.Overrides | undefined = { + alert: { + component: (props) => { + return ( + + {props.children} + + ); + }, + }, a: { component: Anchor, }, @@ -66,7 +90,7 @@ export const MarkdownOverrides: MarkdownToJSX.Overrides | undefined = { return {props.i}; }, }, - typography: { + p: { component: Typography, }, checkmark: { diff --git a/Website/src/components/icons/Checkmark.tsx b/Website/src/components/icons/Checkmark.tsx index 0a6b4d65..e5ee2851 100644 --- a/Website/src/components/icons/Checkmark.tsx +++ b/Website/src/components/icons/Checkmark.tsx @@ -29,7 +29,7 @@ const Checkmark = ({ color, size, className }: Props) => { }; Checkmark.defaultProps = { - size: "14", + size: "16", color: "#1a7f37", }; diff --git a/Website/src/components/icons/Dangermark.tsx b/Website/src/components/icons/Dangermark.tsx index 982184d6..07276fc0 100644 --- a/Website/src/components/icons/Dangermark.tsx +++ b/Website/src/components/icons/Dangermark.tsx @@ -29,7 +29,7 @@ const Dangermark = ({ color, size, className }: Props) => { }; Dangermark.defaultProps = { - size: "14", + size: "16", color: "#cf222e", }; diff --git a/Website/src/components/icons/Warnmark.tsx b/Website/src/components/icons/Warnmark.tsx index cfc60c55..14555e09 100644 --- a/Website/src/components/icons/Warnmark.tsx +++ b/Website/src/components/icons/Warnmark.tsx @@ -30,7 +30,7 @@ const Warnmark = ({ color, size, className }: Props) => { }; Warnmark.defaultProps = { - size: "14", + size: "16", color: "#d29922", }; From 6d030d488b177447a2f01a3ab9d3d483eaec95ac Mon Sep 17 00:00:00 2001 From: Der_Googler <54764558+DerGoogler@users.noreply.github.com> Date: Wed, 12 Jul 2023 13:34:00 +0200 Subject: [PATCH 5/6] Added module covers --- README.md | 1 + Website/src/activitys/SettingsActivity.tsx | 17 +++++++++++++++++ Website/src/components/ExploreModule.tsx | 13 ++++++++++++- Website/src/hooks/useSettings.tsx | 2 ++ Website/src/typings/global.d.ts | 2 +- 5 files changed, 33 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9f59f53b..3f997337 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ description= # MMRL supported properties mmrlConfig= mmrlNoComments= +mmrlCover= # Fox's Mmm supported properties minApi= diff --git a/Website/src/activitys/SettingsActivity.tsx b/Website/src/activitys/SettingsActivity.tsx index 519d7cc8..25b59a71 100644 --- a/Website/src/activitys/SettingsActivity.tsx +++ b/Website/src/activitys/SettingsActivity.tsx @@ -77,6 +77,23 @@ function SettingsActivity() { }} /> + + + { + setSettings("_disable_module_covers", e.target.checked); + }} + checked={settings._disable_module_covers} + inputProps={{ + "aria-labelledby": "switch-list-_disable_module_covers", + }} + /> + {os.isAndroid && ( { return ( + {!settings._disable_module_covers && prop_url.mmrlCover && ( + // @ts-ignore + + )} diff --git a/Website/src/hooks/useSettings.tsx b/Website/src/hooks/useSettings.tsx index 7576c5bf..55e6f06f 100644 --- a/Website/src/hooks/useSettings.tsx +++ b/Website/src/hooks/useSettings.tsx @@ -140,6 +140,7 @@ export interface StorageDeclaration { eruda_console_enabled: boolean; disabled_repos: string[]; _low_quality_module: boolean; + _disable_module_covers: boolean; __experimental_local_install: boolean; repos: StoredRepo[]; test: any; @@ -152,6 +153,7 @@ export const INITIAL_SETTINGS: StorageDeclaration = { eruda_console_enabled: false, disabled_repos: [], _low_quality_module: true, + _disable_module_covers: false, __experimental_local_install: false, repos: [], test: [], diff --git a/Website/src/typings/global.d.ts b/Website/src/typings/global.d.ts index 7633e9a3..3755e72b 100644 --- a/Website/src/typings/global.d.ts +++ b/Website/src/typings/global.d.ts @@ -187,8 +187,8 @@ declare global { // MMRL supported properties mmrlConfig?: string; - mmrlChangelog?: string; mmrlNoComments?: string; + mmrlCover?: string; // Fox's Mmm supported properties minApi?: string; From f067125f79c7a682268e45f6cafd6630019a4a47 Mon Sep 17 00:00:00 2001 From: Der_Googler <54764558+DerGoogler@users.noreply.github.com> Date: Wed, 12 Jul 2023 13:36:06 +0200 Subject: [PATCH 6/6] Bump version --- Android/app/build.gradle | 4 ++-- Website/package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Android/app/build.gradle b/Android/app/build.gradle index f599f96e..88cd58a4 100755 --- a/Android/app/build.gradle +++ b/Android/app/build.gradle @@ -14,8 +14,8 @@ android { applicationId 'com.dergoogler.mmrl' minSdk 26 targetSdk 33 - versionName '1.6.1' - versionCode 161 + versionName '1.6.2' + versionCode 162 externalNativeBuild { cmake { cppFlags "-llog" diff --git a/Website/package.json b/Website/package.json index d766400a..a85b6afa 100644 --- a/Website/package.json +++ b/Website/package.json @@ -3,8 +3,8 @@ "description": "", "config": { "application_id": "com.dergoogler.mmrl", - "version_name": "1.6.1", - "version_code": 161 + "version_name": "1.6.2", + "version_code": 162 }, "main": "index.tsx", "keywords": [],