Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e66ff2c
Direct launch
Nov 25, 2025
5305eca
Better, faster app start
Nov 26, 2025
ce30b12
Lazy loading of webview
harshad1 Nov 27, 2025
d57b9a1
Reverted to trampoline
harshad1 Nov 27, 2025
2d11e1d
Fixed widget
harshad1 Nov 29, 2025
7f94958
Scheme
harshad1 Nov 29, 2025
f81e780
Merge branch 'tried_reverting_to_trampoline' into faster_start_times
harshad1 Nov 29, 2025
b5ba7de
Removed function
harshad1 Nov 29, 2025
6c9d6c6
Use deep links rather than a trampoline
harshad1 Nov 30, 2025
fa517ad
Revert "Use deep links rather than a trampoline"
harshad1 Nov 30, 2025
940af0d
Removed scheme
harshad1 Nov 30, 2025
3143d6a
Before changing dialog
harshad1 Dec 1, 2025
1480857
More changes to match material
harshad1 Dec 1, 2025
819e616
Added new files
harshad1 Dec 1, 2025
51fae2c
More tweaks to colors
harshad1 Dec 1, 2025
c2ddc3f
Cleanups
harshad1 Dec 1, 2025
d9a47f9
Handling spaces and %20
harshad1 Dec 2, 2025
5e58763
Merge branch 'faster_start_times' into more_modern_ui
harshad1 Dec 2, 2025
9584150
Conditional animation
harshad1 Dec 2, 2025
4483ecb
Merge branch 'faster_start_times' into more_modern_ui
harshad1 Dec 2, 2025
1892739
More conservative preview setting
harshad1 Dec 6, 2025
a27b4d4
Added toast
harshad1 Dec 6, 2025
c7937d6
Merge branch 'faster_start_times' into more_modern_ui
harshad1 Dec 6, 2025
cb67476
Properly clearing
harshad1 Dec 6, 2025
f8d3248
Merge branch 'faster_start_times' into more_modern_ui
harshad1 Dec 6, 2025
8abbebf
Revert "Conditional animation"
harshad1 Dec 6, 2025
d925805
Reverted approach change
harshad1 Dec 6, 2025
a98468f
Merge branch 'faster_start_times' into more_modern_ui
harshad1 Dec 6, 2025
3090da6
Before shadow
harshad1 Dec 7, 2025
056f559
Many tweaks to make default colors nicer
harshad1 Dec 7, 2025
13052f1
Primary color in light mode
harshad1 Dec 13, 2025
d21c751
Better black
harshad1 Dec 14, 2025
01cfc22
Towards black
harshad1 Dec 14, 2025
87f3445
Everything working
harshad1 Dec 14, 2025
457fcde
More cleanups to black
harshad1 Dec 14, 2025
cca4382
Before simplifying
harshad1 Dec 15, 2025
82f6121
Cleanups
harshad1 Dec 17, 2025
2c89b91
Pulled in change to fix removing priority
harshad1 Dec 17, 2025
53d6c9f
Merge branch 'faster_start_times' into more_modern_ui
harshad1 Dec 17, 2025
4e8637d
Fixed issue with webview being null
harshad1 Dec 27, 2025
cc5551c
Merge branch 'faster_start_times' into more_modern_ui
harshad1 Dec 27, 2025
bda3773
Merge remote-tracking branch 'upstream/master' into more_modern_ui
harshad1 Dec 28, 2025
3f8f675
Updating action order activity display
harshad1 Dec 28, 2025
9c64e5c
Revert to previous, not default
harshad1 Dec 28, 2025
967dd1e
Merge branch 'master' into more_modern_ui
gsantner Jan 8, 2026
32163be
Merge branch 'master' into more_modern_ui
gsantner Jan 8, 2026
90ab947
reformat code
gsantner Jan 8, 2026
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 @@ -9,7 +9,6 @@

import static androidx.recyclerview.widget.ItemTouchHelper.ACTION_STATE_DRAG;

import android.graphics.Color;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
Expand All @@ -22,7 +21,7 @@

import androidx.annotation.NonNull;
import androidx.appcompat.widget.SwitchCompat;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
Expand Down Expand Up @@ -68,7 +67,6 @@ protected void onCreate(Bundle savedInstanceState) {
// Set up recyclerview
final RecyclerView recycler = findViewById(R.id.action_order_activity_recycler);
recycler.setLayoutManager(new LinearLayoutManager(this));
recycler.addItemDecoration(new DividerItemDecoration(recycler.getContext(), DividerItemDecoration.VERTICAL));

extractActionData();
_adapter = new OrderAdapter(_actions, _keys, _disabled);
Expand All @@ -86,7 +84,7 @@ public boolean onCreateOptionsMenu(Menu menu) {
final MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.action_order__menu, menu);

_cu.tintMenuItems(menu, true, Color.WHITE);
_cu.tintMenuItems(menu, true, ContextCompat.getColor(this, R.color.action_bar_content));
return true;
}

Expand All @@ -99,11 +97,18 @@ public boolean onOptionsItemSelected(MenuItem item) {
}

case R.id.action_reorder_reset: {
final List<String> activeKeys = _textActions.getActiveActionKeys();
for (int i = 0; i < activeKeys.size(); i++) {
String key = activeKeys.get(i);
_adapter.order.set(i, _keys.indexOf(key));
final List<String> savedOrder = _textActions.getActionOrder();
final List<String> savedDisabled = _textActions.getDisabledActions();

_adapter.order.clear();
for (final String key : savedOrder) {
final int index = _keys.indexOf(key);
if (index >= 0) {
_adapter.order.add(index);
}
}
_adapter._disabled.clear();
_adapter._disabled.addAll(savedDisabled);
_adapter.notifyDataSetChanged();
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.SearchView;
import androidx.core.content.ContextCompat;

import net.gsantner.markor.ApplicationObject;
import net.gsantner.markor.BuildConfig;
Expand Down Expand Up @@ -300,7 +301,7 @@ public void onSaveInstanceState(@NonNull Bundle outState) {
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
inflater.inflate(R.menu.document__edit__menu, menu);
_cu.tintMenuItems(menu, true, Color.WHITE);
_cu.tintMenuItems(menu, true, ContextCompat.getColor(requireContext(), R.color.action_bar_content));
_cu.setSubMenuIconsVisibility(menu, true);

final boolean isExperimentalFeaturesEnabled = _appSettings.isExperimentalFeaturesEnabled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public static class ShareIntoImportOptionsFragment extends GsPreferenceFragmentB

@Override
public boolean isDividerVisible() {
return true;
return false;
}

public ShareIntoImportOptionsFragment setAttachment(File file) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import android.app.Activity;
import android.app.ActivityManager;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
Expand All @@ -24,6 +23,7 @@
import android.view.WindowManager;

import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.RecyclerView;
Expand Down Expand Up @@ -265,7 +265,7 @@ public boolean onCreateOptionsMenu(final Menu menu) {
getMenuInflater().inflate(R.menu.main__menu, menu);
menu.findItem(R.id.action_settings).setVisible(_appSettings.isShowSettingsOptionInMainToolbar());

_cu.tintMenuItems(menu, true, Color.WHITE);
_cu.tintMenuItems(menu, true, ContextCompat.getColor(this, R.color.action_bar_content));
_cu.setSubMenuIconsVisibility(menu, true);
return true;
}
Expand Down
104 changes: 101 additions & 3 deletions app/src/main/java/net/gsantner/markor/activity/MarkorBaseActivity.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
package net.gsantner.markor.activity;

import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.View;
import android.view.WindowManager;

import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;

import com.google.android.material.bottomnavigation.BottomNavigationView;

import net.gsantner.markor.R;
import net.gsantner.markor.model.AppSettings;
import net.gsantner.markor.util.MarkorContextUtils;
import net.gsantner.opoc.frontend.base.GsActivityBase;
import net.gsantner.opoc.frontend.base.GsFragmentBase;

public abstract class MarkorBaseActivity extends GsActivityBase<AppSettings, MarkorContextUtils> {

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

_appSettings.applyAppTheme();
applyThemedBars();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().setEnterTransition(null);
getWindow().setExitTransition(null);
Expand All @@ -30,18 +39,24 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
}
}

@Override
public boolean onPrepareOptionsMenu(Menu menu) {
_cu.tintMenuItems(menu, true, getActionBarContentColor());
return super.onPrepareOptionsMenu(menu);
}

protected boolean onReceiveKeyPress(GsFragmentBase fragment, int keyCode, KeyEvent event) {
return fragment.onReceiveKeyPress(keyCode, event);
}

@Override
public Integer getNewNavigationBarColor() {
return _appSettings.getAppThemeName().contains("black") ? Color.BLACK : null;
return getThemedBarBackgroundColor();
}

@Override
public Integer getNewActivityBackgroundColor() {
return _appSettings.getAppThemeName().contains("black") ? Color.BLACK : null;
return getThemedBarBackgroundColor();
}

@Override
Expand All @@ -58,4 +73,87 @@ protected MarkorContextUtils createContextUtilsInstance() {
public Boolean isFlagSecure() {
return _appSettings.isDisallowScreenshots();
}

@Override
protected void onStart() {
super.onStart();
applyThemedBars();
}

private void applyThemedBars() {
final int barBackground = getThemedBarBackgroundColor();
final int actionBarBackground = getActionBarBackgroundColor();

final Toolbar toolbar = findViewById(R.id.toolbar);
if (toolbar != null) {
toolbar.setBackgroundColor(actionBarBackground);
toolbar.setPopupTheme(getPopupTheme());
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().setStatusBarColor(actionBarBackground);
getWindow().setNavigationBarColor(barBackground);
}

final BottomNavigationView bottomNav = findViewById(R.id.bottom_navigation_bar);
if (bottomNav != null) {
bottomNav.setBackgroundColor(barBackground);
bottomNav.setItemBackground(new ColorDrawable(barBackground));
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
final View decorView = getWindow().getDecorView();
int flags = decorView.getSystemUiVisibility();
flags = applyLightBarFlag(flags, actionBarBackground, View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
flags = applyLightBarFlag(flags, barBackground, View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
}
decorView.setSystemUiVisibility(flags);
}
}

private int getThemedBarBackgroundColor() {
if (_appSettings.isBlackTheme()) {
return Color.BLACK;
}
return resolveThemeColor(android.R.attr.colorBackground, R.color.bar_background);
}

private int getActionBarBackgroundColor() {
if (_appSettings.isBlackTheme()) {
return Color.BLACK;
}
return resolveThemeColor(R.attr.colorPrimary, R.color.action_bar_background);
}

private int getActionBarContentColor() {
return ContextCompat.getColor(this, R.color.action_bar_content);
}

private int getPopupTheme() {
final boolean isBlack = _appSettings.isBlackTheme();
final boolean isDark = _cu.isDarkModeEnabled(this);
if (isBlack) {
return R.style.ToolbarPopupOverlayBlack;
}
return isDark ? R.style.ToolbarPopupOverlayDark : R.style.ToolbarPopupOverlay;
}

private int applyLightBarFlag(int flags, int backgroundColor, int lightFlag) {
final boolean needsDarkIcons = !_cu.shouldColorOnTopBeLight(backgroundColor);
if (needsDarkIcons) {
flags |= lightFlag;
} else {
flags &= ~lightFlag;
}
return flags;
}

private int resolveThemeColor(int attrResId, int fallbackColorResId) {
final TypedValue typedValue = new TypedValue();
if (getTheme().resolveAttribute(attrResId, typedValue, true)) {
return typedValue.data;
}
return ContextCompat.getColor(this, fallbackColorResId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected AppSettings getAppSettings(Context context) {

@Override
public boolean isDividerVisible() {
return true;
return false;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@
import android.text.TextUtils;
import android.widget.Toast;

import androidx.annotation.StringRes;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceScreen;

import com.rarepebble.colorpicker.ColorPreference;

import net.gsantner.markor.R;
import net.gsantner.markor.frontend.MarkorDialogFactory;
import net.gsantner.markor.frontend.filebrowser.MarkorFileBrowserFactory;
Expand Down Expand Up @@ -195,6 +198,8 @@ public void doUpdatePreferences() {
for (final int keyId : experimentalKeys) {
setPreferenceVisible(keyId, _appSettings.isExperimentalFeaturesEnabled());
}

refreshEditorColorPreferences();
}

@SuppressLint("ApplySharedPref")
Expand All @@ -211,7 +216,10 @@ protected void onPreferenceChanged(final SharedPreferences prefs, final String k
_appSettings.setRecreateMainRequired(true);
} else if (eq(key, R.string.pref_key__app_theme)) {
_appSettings.applyAppTheme();
getActivity().finish();
_appSettings.setRecreateMainRequired(true);
if (getActivity() != null) {
getActivity().recreate();
}
} else if (eq(key, R.string.pref_key__theming_hide_system_statusbar)) {
activityRetVal = RESULT.RESTART_REQ;
_appSettings.setRecreateMainRequired(true);
Expand Down Expand Up @@ -313,38 +321,46 @@ public void onFsViewerConfig(GsFileBrowserOptions.Options dopt) {
return true;
}
case R.string.pref_key__basic_color_scheme_markor: {
_appSettings.setEditorBasicColor(true, R.color.white, R.color.dark_grey);
_appSettings.setEditorBasicColor(false, R.color.dark_grey, R.color.light__background);
// Material-aligned: fixed light/dark values so app theme doesn't alter editor colors
_appSettings.setEditorBasicColor(true, R.color.dark__primary_text, R.color.dark__background);
_appSettings.setEditorBasicColor(false, R.color.light__primary_text, R.color.light__background);
_appSettings.setRecreateMainRequired(true);
break;
}
case R.string.pref_key__basic_color_scheme_blackorwhite: {
_appSettings.setEditorBasicColor(true, R.color.white, R.color.black);
_appSettings.setEditorBasicColor(false, R.color.black, R.color.white);
_appSettings.setRecreateMainRequired(true);
break;
}
case R.string.pref_key__basic_color_scheme_solarized: {
_appSettings.setEditorBasicColor(true, R.color.solarized_fg, R.color.solarized_bg_dark);
_appSettings.setEditorBasicColor(false, R.color.solarized_fg, R.color.solarized_bg_light);
_appSettings.setRecreateMainRequired(true);
break;
}
case R.string.pref_key__basic_color_scheme_gruvbox: {
_appSettings.setEditorBasicColor(true, R.color.gruvbox_fg_dark, R.color.gruvbox_bg_dark);
_appSettings.setEditorBasicColor(false, R.color.gruvbox_fg_light, R.color.gruvbox_bg_light);
_appSettings.setRecreateMainRequired(true);
break;
}
case R.string.pref_key__basic_color_scheme_nord: {
_appSettings.setEditorBasicColor(true, R.color.nord_fg_dark, R.color.nord_bg_dark);
_appSettings.setEditorBasicColor(false, R.color.nord_fg_light, R.color.nord_bg_light);
_appSettings.setRecreateMainRequired(true);
break;
}
case R.string.pref_key__basic_color_scheme_greenscale: {
_appSettings.setEditorBasicColor(true, R.color.green_dark, R.color.black);
_appSettings.setEditorBasicColor(false, R.color.green_light, R.color.white);
_appSettings.setRecreateMainRequired(true);
break;
}
case R.string.pref_key__basic_color_scheme_sepia: {
_appSettings.setEditorBasicColor(true, R.color.sepia_bg_light__fg_dark, R.color.sepia_fg_light__bg_dark);
_appSettings.setEditorBasicColor(false, R.color.sepia_fg_light__bg_dark, R.color.sepia_bg_light__fg_dark);
_appSettings.setRecreateMainRequired(true);
break;
}
case R.string.pref_key__plaintext__reorder_actions:
Expand Down Expand Up @@ -372,14 +388,31 @@ public void onFsViewerConfig(GsFileBrowserOptions.Options dopt) {

if (key.startsWith("pref_key__editor_basic_color_scheme") && !key.contains("_fg_") && !key.contains("_bg_")) {
_appSettings.setRecreateMainRequired(true);
restartActivity();
doUpdatePreferences();
}
return null;
}

@Override
public boolean isDividerVisible() {
return true;
return false;
}

private void refreshEditorColorPreferences() {
updateColorPreference(R.string.pref_key__basic_color_scheme__bg_light, _appSettings.getInt(R.string.pref_key__basic_color_scheme__bg_light, _cu.rcolor(getContext(), R.color.background)));
updateColorPreference(R.string.pref_key__basic_color_scheme__fg_light, _appSettings.getInt(R.string.pref_key__basic_color_scheme__fg_light, _cu.rcolor(getContext(), R.color.primary_text)));
updateColorPreference(R.string.pref_key__basic_color_scheme__bg_dark, _appSettings.getInt(R.string.pref_key__basic_color_scheme__bg_dark, _cu.rcolor(getContext(), R.color.background)));
updateColorPreference(R.string.pref_key__basic_color_scheme__fg_dark, _appSettings.getInt(R.string.pref_key__basic_color_scheme__fg_dark, _cu.rcolor(getContext(), R.color.primary_text)));
}

private void updateColorPreference(@StringRes int key, int color) {
Preference pref = findPreference(key);
if (pref instanceof ColorPreference) {
try {
((ColorPreference) pref).setColor(color);
} catch (Exception ignored) {
}
}
}
}
}
Loading