Skip to content

Commit

Permalink
design
Browse files Browse the repository at this point in the history
  • Loading branch information
DerGoogler committed Feb 29, 2024
1 parent 661e915 commit 12fda14
Show file tree
Hide file tree
Showing 18 changed files with 117 additions and 297 deletions.
4 changes: 2 additions & 2 deletions Website/src/activitys/MainApplication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import { useLocalModules } from "@Hooks/useLocalModules";
import { Shell } from "@Native/Shell";
import { SearchActivity } from "./SearchActivity";
import ListItemButton from "@mui/material/ListItemButton";
import { StyledListItemText } from "@Components/StyledListItemText";
import VerifiedIcon from "@mui/icons-material/Verified";
import ListItemAvatar from "@mui/material/ListItemAvatar";
import Avatar from "@mui/material/Avatar";
import Stack from "@mui/material/Stack";
import Chip from "@mui/material/Chip";
import { ModConfView } from "@Components/ModConfView";
import ListItemText from "@mui/material/ListItemText";

const MainApplication = () => {
const { strings } = useStrings();
Expand Down Expand Up @@ -181,7 +181,7 @@ const MainApplication = () => {
{item.name.charAt(0).toUpperCase()}
</Avatar>
</ListItemAvatar>
<StyledListItemText
<ListItemText
primary={
<Stack direction="row" justifyContent="flex-start" alignItems="center" spacing={0.5}>
<Typography>{item.name}</Typography>
Expand Down
5 changes: 2 additions & 3 deletions Website/src/activitys/ModFSActivity.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Alert, Box, Button, Divider, List, ListSubheader, Stack, Typography } from "@mui/material";
import { Alert, Box, Button, Divider, List, ListItemText, ListSubheader, Stack, Typography } from "@mui/material";
import AvatarGroup from "@mui/material/AvatarGroup";
import Avatar from "@mui/material/Avatar";
import { Toolbar } from "@Components/onsenui/Toolbar";
import { Page } from "@Components/onsenui/Page";
import { useActivity } from "@Hooks/useActivity";
import { ModFS, useModFS } from "@Hooks/useModFS";
import { StyledListItemText } from "@Components/StyledListItemText";
import { Shell } from "@Native/Shell";
import { DialogEditTextListItem } from "@Components/DialogEditTextListItem";
import React from "react";
Expand Down Expand Up @@ -304,7 +303,7 @@ function ModFSActivity() {
multiline={item.multiline}
maxRows={item.maxRows}
>
<StyledListItemText
<ListItemText
primary={
<Stack direction="column" justifyContent="center" alignItems="flex-start" spacing={0}>
<Typography variant="caption">{`<${item.confKey}>`}</Typography>
Expand Down
21 changes: 8 additions & 13 deletions Website/src/activitys/ModuleViewActivity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ import ImageListItem from "@mui/material/ImageListItem";
import { Verified } from "@mui/icons-material";
import Stack from "@mui/material/Stack";
import { useActivity } from "@Hooks/useActivity";
import { StyledListItemText } from "@Components/StyledListItemText";
import { parseAndroidVersion } from "@Util/parseAndroidVersion";
import { Magisk } from "@Native/Magisk";
import ListItemText from "@mui/material/ListItemText";
import { useTheme } from "@Hooks/useTheme";
import { os } from "@Native/Os";
import Alert from "@mui/material/Alert";
Expand Down Expand Up @@ -497,16 +495,13 @@ const ModuleViewActivity = () => {
});
}}
>
<StyledListItemText
primary={findRequire.name}
secondary={`${findRequire.version} (${findRequire.versionCode})`}
/>
<ListItemText primary={findRequire.name} secondary={`${findRequire.version} (${findRequire.versionCode})`} />
</ListItemButton>
);
} else {
return (
<ListItem>
<StyledListItemText primary={req} />
<ListItemText primary={req} />
</ListItem>
);
}
Expand Down Expand Up @@ -564,7 +559,7 @@ const ModuleViewActivity = () => {
<ListItemIcon>
<VerifiedIcon />
</ListItemIcon>
<StyledListItemText primary={strings("verified_module")} secondary={strings("verified_module_desc")} />
<ListItemText primary={strings("verified_module")} secondary={strings("verified_module_desc")} />
</ListItem>
)}

Expand Down Expand Up @@ -595,7 +590,7 @@ const ModuleViewActivity = () => {
<ListItemIcon>
<FormatAlignLeftIcon />
</ListItemIcon>
<StyledListItemText primary={strings("license")} secondary={track.license} />
<ListItemText primary={strings("license")} secondary={track.license} />
</ListItemButton>
)}

Expand All @@ -613,7 +608,7 @@ const ModuleViewActivity = () => {
<ListItemIcon>
<BugReportIcon />
</ListItemIcon>
<StyledListItemText primary="Issues" secondary={track.support} />
<ListItemText primary="Issues" secondary={track.support} />
</ListItemButton>
)}

Expand All @@ -630,7 +625,7 @@ const ModuleViewActivity = () => {
<ListItemIcon>
<GitHubIcon />
</ListItemIcon>
<StyledListItemText primary={strings("source")} secondary={track.source} />
<ListItemText primary={strings("source")} secondary={track.source} />
</ListItemButton>
</List>
</CustomTabPanel>
Expand Down Expand Up @@ -701,7 +696,7 @@ const VersionItem = React.memo<VersionItemProps>(({ id, version }) => {
</Stack>
}
>
<StyledListItemText primary={versionName} secondary={ts} />
<ListItemText primary={versionName} secondary={ts} />
</ListItem>
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import React from "react";
import ExpandLess from "@mui/icons-material/ExpandLess";
import ExpandMore from "@mui/icons-material/ExpandMore";
import Collapse from "@mui/material/Collapse";
import { StyledListItemText } from "@Components/StyledListItemText";
import { useRepos } from "@Hooks/useRepos";
import { useSettings } from "@Hooks/useSettings";
import { useStrings } from "@Hooks/useStrings";
import { IconButton, List, ListItem, ListItemButton, ListItemIcon } from "@mui/material";
import { IconButton, List, ListItem, ListItemButton, ListItemIcon, ListItemText, Switch } from "@mui/material";
import { OverridableComponent } from "@mui/material/OverridableComponent";
import { SvgIconTypeMap } from "@mui/material/SvgIcon/SvgIcon";
import { DeleteRounded, LanguageRounded, SupportRounded, UploadFileRounded, VolunteerActivismRounded } from "@mui/icons-material";
import { Android12Switch } from "@Components/Android12Switch";
import { os } from "@Native/Os";
import { useFormatDate } from "@Hooks/useFormatDate";
import { useConfirm } from "material-ui-confirm";
Expand All @@ -34,7 +32,7 @@ const MListItem = React.memo<ListItemProps>((props) => {
<ListItemIcon>
<props.icon />
</ListItemIcon>
<StyledListItemText primary={props.text} />
<ListItemText primary={props.text} />
</ListItemButton>
) : null;
});
Expand Down Expand Up @@ -75,7 +73,7 @@ export const LocalRepository = React.memo<LocalRepositoryProps>((props) => {
</IconButton>
}
>
<StyledListItemText primary="Loading..." />
<ListItemText primary="Loading..." />
</ListItem>
);
}
Expand All @@ -88,9 +86,9 @@ export const LocalRepository = React.memo<LocalRepositoryProps>((props) => {
<>
<ListItem>
<ListItemIcon onClick={handleClick}>{open ? <ExpandLess /> : <ExpandMore />}</ListItemIcon>
<StyledListItemText primary={repo.name} secondary={formatLastUpdate} />
<ListItemText primary={repo.name} secondary={formatLastUpdate} />

<Android12Switch
<Switch
edge="end"
onChange={(e: React.ChangeEvent<HTMLInputElement>, checked: boolean) => {
actions.setRepoEnabled({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import IconButton from "@mui/material/IconButton";
import AddIcon from "@mui/icons-material/Add";
import { useRepos } from "@Hooks/useRepos";
import { os } from "@Native/Os";
import { ListItem } from "@mui/material";
import { StyledListItemText } from "@Components/StyledListItemText";
import { ListItem, ListItemText } from "@mui/material";

interface RecommendedRepoProps {
name: string;
Expand Down Expand Up @@ -33,7 +32,7 @@ export const RecommendedRepo = (props: RecommendedRepoProps) => {
</IconButton>
}
>
<StyledListItemText primary={props.name} secondary={props.link} />
<ListItemText primary={props.name} secondary={props.link} />
</ListItem>
);
};
};
57 changes: 19 additions & 38 deletions Website/src/activitys/SettingsActivity.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import { Divider, InputAdornment, List, ListItem, ListItemButton, ListSubheader } from "@mui/material";
import { Divider, List, ListItem, ListItemButton, ListItemText, ListSubheader, Switch } from "@mui/material";
import { BuildConfig } from "@Native/BuildConfig";
import { Toolbar } from "@Components/onsenui/Toolbar";
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
import { Page } from "@Components/onsenui/Page";
import { useStrings } from "@Hooks/useStrings";
import { useActivity } from "@Hooks/useActivity";
import { accent_colors, termScrollBehaviors, useSettings } from "@Hooks/useSettings";
import { StyledListItemText } from "@Components/StyledListItemText";
import { termScrollBehaviors, useSettings } from "@Hooks/useSettings";
import { ListPickerItem } from "@Components/ListPickerItem";
import { os } from "@Native/Os";
import { Android12Switch } from "@Components/Android12Switch";
import { useTheme } from "@Hooks/useTheme";
import { useRepos } from "@Hooks/useRepos";
import { Shell } from "@Native/Shell";
import { DialogEditTextListItem } from "@Components/DialogEditTextListItem";
import { Properties } from "@Native/Properties";
import { useLanguageMap } from "./../locales/declaration";
import { useModFS } from "@Hooks/useModFS";
Expand Down Expand Up @@ -48,9 +45,7 @@ function SettingsActivity() {
return (
<Page renderToolbar={renderToolbar}>
<Page.RelativeContent zeroMargin>
<List
subheader={<ListSubheader sx={(theme) => ({ bgcolor: theme.palette.background.default })}>{strings("appearance")}</ListSubheader>}
>
<List subheader={<ListSubheader>{strings("appearance")}</ListSubheader>}>
{/* <ListItem>
<StyledListItemText id="switch-list-label-wifi" primary={strings("dark_theme")} />
<Android12Switch
Expand Down Expand Up @@ -86,12 +81,10 @@ function SettingsActivity() {
</List>

<Divider />
<List
subheader={<ListSubheader sx={(theme) => ({ bgcolor: theme.palette.background.default })}>{strings("module")}</ListSubheader>}
>
<List subheader={<ListSubheader>{strings("module")}</ListSubheader>}>
<ListItem>
<StyledListItemText primary={strings("low_quality_modules")} secondary={strings("low_quality_modules_subtitle")} />
<Android12Switch
<ListItemText primary={strings("low_quality_modules")} secondary={strings("low_quality_modules_subtitle")} />
<Switch
edge="end"
onChange={(e: any) => {
setSettings("_low_quality_module", e.target.checked);
Expand All @@ -100,8 +93,8 @@ function SettingsActivity() {
/>
</ListItem>
<ListItem>
<StyledListItemText primary={strings("invaild_modules")} secondary={strings("invaild_modules_subtitle")} />
<Android12Switch
<ListItemText primary={strings("invaild_modules")} secondary={strings("invaild_modules_subtitle")} />
<Switch
edge="end"
onChange={(e: any) => {
setSettings("_invald_module", e.target.checked);
Expand All @@ -114,14 +107,10 @@ function SettingsActivity() {
{os.isAndroid && (
<>
<Divider />
<List
subheader={
<ListSubheader sx={(theme) => ({ bgcolor: theme.palette.background.default })}>{strings("terminal")}</ListSubheader>
}
>
<List subheader={<ListSubheader>{strings("terminal")}</ListSubheader>}>
<ListItem>
<StyledListItemText primary={strings("scroll_to_bottom")} secondary={strings("scroll_to_bottom_subtitle")} />
<Android12Switch
<ListItemText primary={strings("scroll_to_bottom")} secondary={strings("scroll_to_bottom_subtitle")} />
<Switch
edge="end"
onChange={(e: any) => {
setSettings("term_scroll_bottom", e.target.checked);
Expand All @@ -141,18 +130,10 @@ function SettingsActivity() {

<Divider />

<List
subheader={
<ListSubheader sx={(theme) => ({ bgcolor: theme.palette.background.default })}>{strings("development")}</ListSubheader>
}
>
<List subheader={<ListSubheader>{strings("development")}</ListSubheader>}>
<ListItem>
<StyledListItemText
id="switch-list-label-eruda"
primary={strings("eruda_console")}
secondary={strings("eruda_console_subtitle")}
/>
<Android12Switch
<ListItemText id="switch-list-label-eruda" primary={strings("eruda_console")} secondary={strings("eruda_console_subtitle")} />
<Switch
edge="end"
onChange={(e: any) => {
setSettings("eruda_console_enabled", e.target.checked);
Expand All @@ -173,7 +154,7 @@ function SettingsActivity() {
});
}}
>
<StyledListItemText id="switch-list-label-wifi" primary="Issues" secondary="Track our issues" />
<ListItemText id="switch-list-label-wifi" primary="Issues" secondary="Track our issues" />
</ListItemButton>
<ListItemButton
onClick={() => {
Expand Down Expand Up @@ -206,7 +187,7 @@ function SettingsActivity() {
);
}}
>
<StyledListItemText primary={strings("share_device_infos")} secondary={strings("share_device_infos_subtilte")} />
<ListItemText primary={strings("share_device_infos")} secondary={strings("share_device_infos_subtilte")} />
</ListItemButton>
</List>

Expand All @@ -220,21 +201,21 @@ function SettingsActivity() {
setRepos([]);
}}
>
<StyledListItemText primary={strings("clear_repos")} />
<ListItemText primary={strings("clear_repos")} />
</ListItemButton>{" "}
<ListItemButton
onClick={() => {
patchSettings();
}}
>
<StyledListItemText primary={strings("patch_settings")} secondary={strings("patch_settings_subtitle")} />
<ListItemText primary={strings("patch_settings")} secondary={strings("patch_settings_subtitle")} />
</ListItemButton>
</List>

<Divider />

<ListItem>
<StyledListItemText
<ListItemText
primary={
<span>
{BuildConfig.APPLICATION_ID} v{BuildConfig.VERSION_NAME} ({BuildConfig.VERSION_CODE})<br />
Expand Down
Loading

0 comments on commit 12fda14

Please sign in to comment.