Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor/viewer: Side margin improvements, closes #2111 #2118

Merged
merged 2 commits into from
Oct 7, 2023
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 @@ -83,6 +83,7 @@ public class MarkdownTextConverter extends TextConverterBase {
//########################
//## Injected CSS / JS / HTML
//########################
public static final String CSS_BODY = CSS_S + "body{margin:0;padding:2vw}" + CSS_E;
public static final String CSS_HEADER_UNDERLINE = CSS_S + " .header_no_underline { text-decoration: none; color: " + TOKEN_BW_INVERSE_OF_THEME + "; } h1 < a.header_no_underline { border-bottom: 2px solid #eaecef; } " + CSS_E;
public static final String CSS_H1_H2_UNDERLINE = CSS_S + " h1,h2 { border-bottom: 2px solid " + TOKEN_BW_INVERSE_OF_THEME_HEADER_UNDERLINE + "; } " + CSS_E;
public static final String CSS_BLOCKQUOTE_VERTICAL_LINE = CSS_S + "blockquote{padding:0px 14px;border-" + TOKEN_TEXT_DIRECTION + ":3.5px solid #dddddd;margin:4px 0}" + CSS_E;
Expand Down Expand Up @@ -194,6 +195,7 @@ public String convertMarkup(String markup, Context context, boolean lightMode, b
.set(AnchorLinkExtension.ANCHORLINKS_SET_ID, false)
.set(AnchorLinkExtension.ANCHORLINKS_ANCHOR_CLASS, "header_no_underline");

head += CSS_BODY;
// Prepare head and javascript calls
head += CSS_HEADER_UNDERLINE + CSS_H1_H2_UNDERLINE + CSS_BLOCKQUOTE_VERTICAL_LINE + CSS_GITLAB_VIDEO_CAPTION + CSS_LIST_TASK_NO_BULLET + CSS_LINK_SOFT_WRAP_AUTOBREAK_LINES;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ static class LineNumbersDrawer {
private final Paint _paint = new Paint();

private final int _defaultPaddingLeft;
private static final int LINE_NUMBER_PADDING_LEFT = 14;
private static final int LINE_NUMBER_PADDING_LEFT = 12;
private static final int LINE_NUMBER_PADDING_RIGHT = 10;

private final Rect _visibleArea = new Rect();
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="activity_horizontal_margin">12dp</dimen>
<dimen name="activity_vertical_margin">12dp</dimen>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This affects everything. All activities. Not just editor/viewer.

But let's try. It can be reverted if it is bad.

Copy link
Contributor Author

@guanglinn guanglinn Oct 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may have set the margins too small. 😬

<dimen name="editor_bottom_margin">32dp</dimen>
<dimen name="appbar_padding_top">8dp</dimen>
<dimen name="textactions_bar_height">46dp</dimen>
Expand Down
Loading