Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,2 @@
|
||||
#Wed Jan 28 16:05:26 CST 2026
|
||||
gradle.version=9.2.0
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<!-- Material style colors - Dark theme -->
|
||||
<color name="material_card_background">#1E1E1E</color>
|
||||
<color name="material_card_elevation_color">#000000</color>
|
||||
<color name="material_text_primary">#FFFFFF</color>
|
||||
<color name="material_text_secondary">#B0B0B0</color>
|
||||
<color name="material_accent_bar">#64B5F6</color>
|
||||
|
||||
<!-- Minimal style colors - Dark theme -->
|
||||
<color name="minimal_background">#121212</color>
|
||||
<color name="minimal_divider">#333333</color>
|
||||
<color name="minimal_text_primary">#FFFFFF</color>
|
||||
<color name="minimal_text_secondary">#AAAAAA</color>
|
||||
|
||||
<!-- Common colors - Dark theme -->
|
||||
<color name="note_item_background_light">#1E1E1E</color>
|
||||
<color name="note_item_text_primary_light">#FFFFFF</color>
|
||||
<color name="note_item_text_secondary_light">#CCCCCC</color>
|
||||
</resources>
|
||||
@ -1,7 +0,0 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.Notesmaster" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Customize your dark theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
|
||||
</style>
|
||||
</resources>
|
||||
@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<style name="NoteTheme" parent="@android:style/Theme.Material.Light">
|
||||
<item name="android:actionBarStyle">@android:style/Widget.Material.Light.ActionBar</item>
|
||||
<item name="android:displayOptions">showHome|showTitle|useLogo</item>
|
||||
<item name="android:windowActionBar">true</item>
|
||||
<item name="android:windowNoTitle">false</item>
|
||||
<item name="android:windowSoftInputMode">adjustResize</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
</style>
|
||||
</resources>
|
||||
@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string-array name="menu_share_ways">
|
||||
<item>短信</item>
|
||||
<item>邮件</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string-array name="menu_share_ways">
|
||||
<item>短信</item>
|
||||
<item>郵件</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<!-- Backup format -->
|
||||
<string-array name="format_for_exported_note">
|
||||
<item>-%s</item> <!-- format_folder_name -->
|
||||
<item>--%s</item> <!-- format_folder_note_date -->
|
||||
<item>--%s</item> <!-- format_note_date -->
|
||||
<item>--%s</item> <!-- format_note_content -->
|
||||
</string-array>
|
||||
|
||||
<string-array name="menu_share_ways">
|
||||
<item>Messaging</item>
|
||||
<item>Email</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<dimen name="text_font_size_super">33sp</dimen>
|
||||
<dimen name="text_font_size_large">26sp</dimen>
|
||||
<dimen name="text_font_size_medium">20sp</dimen>
|
||||
<dimen name="text_font_size_normal">17sp</dimen>
|
||||
<dimen name="text_font_size_small">14sp</dimen>
|
||||
</resources>
|
||||
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- 定义退出搜索菜单项的ID -->
|
||||
<item name="menu_exit_search" type="id" />
|
||||
</resources>
|
||||
@ -1,74 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<style name="TextAppearanceSuper">
|
||||
<item name="android:textSize">@dimen/text_font_size_super</item>
|
||||
<item name="android:textColorLink">#0000ff</item>
|
||||
</style>
|
||||
<style name="TextAppearanceLarge">
|
||||
<item name="android:textSize">@dimen/text_font_size_large</item>
|
||||
<item name="android:textColorLink">#0000ff</item>
|
||||
</style>
|
||||
<style name="TextAppearanceMedium">
|
||||
<item name="android:textSize">@dimen/text_font_size_medium</item>
|
||||
<item name="android:textColorLink">#0000ff</item>
|
||||
</style>
|
||||
<style name="TextAppearanceNormal">
|
||||
<item name="android:textSize">@dimen/text_font_size_normal</item>
|
||||
<item name="android:textColorLink">#0000ff</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearancePrimaryItem">
|
||||
<item name="android:textSize">@dimen/text_font_size_normal</item>
|
||||
<item name="android:textColor">@color/primary_text_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearanceSecondaryItem">
|
||||
<item name="android:textSize">@dimen/text_font_size_small</item>
|
||||
<item name="android:textColor">@color/secondary_text_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearanceUnderMenuIcon">
|
||||
<item name="android:textSize">@dimen/text_font_size_normal</item>
|
||||
<item name="android:textColor">@android:color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="HighlightTextAppearancePrimary">
|
||||
<item name="android:textSize">@dimen/text_font_size_normal</item>
|
||||
<item name="android:textColor">@color/primary_text_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="HighlightTextAppearanceSecondary">
|
||||
<item name="android:textSize">@dimen/text_font_size_small</item>
|
||||
<item name="android:textColor">@color/secondary_text_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="NoteTheme" parent="@android:style/Theme.Holo.Light">
|
||||
<item name="android:actionBarStyle">@android:style/Widget.Holo.Light.ActionBar</item>
|
||||
<item name="android:displayOptions">showHome|showTitle|useLogo</item>
|
||||
<item name="android:windowActionBar">true</item>
|
||||
<item name="android:windowNoTitle">false</item>
|
||||
<item name="android:windowSoftInputMode">adjustResize</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
</style>
|
||||
|
||||
<style name="NoteActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">
|
||||
<item name="android:displayOptions" />
|
||||
<item name="android:visibility">gone</item>
|
||||
</style>
|
||||
</resources>
|
||||
@ -1,9 +0,0 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.Notesmaster" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Customize your light theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
|
||||
</style>
|
||||
|
||||
<style name="Theme.Notesmaster" parent="Base.Theme.Notesmaster" />
|
||||
</resources>
|
||||
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.micode.notes.ui;
|
||||
|
||||
import android.os.Bundle;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
|
||||
/**
|
||||
* 基础Activity类
|
||||
* 所有Activity应继承此类以统一应用UI主题
|
||||
*/
|
||||
public abstract class BaseActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
// 在super.onCreate()之前应用主题和夜间模式
|
||||
ThemeUtils.applyTheme(this);
|
||||
applyNightMode();
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用夜间模式设置
|
||||
*/
|
||||
private void applyNightMode() {
|
||||
boolean nightMode = NotesPreferenceActivity.getNightMode(this);
|
||||
int mode = nightMode ? AppCompatDelegate.MODE_NIGHT_YES : AppCompatDelegate.MODE_NIGHT_NO;
|
||||
AppCompatDelegate.setDefaultNightMode(mode);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.micode.notes.ui;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceActivity;
|
||||
|
||||
/**
|
||||
* 基础PreferenceActivity类
|
||||
* PreferenceActivity应继承此类以统一应用UI主题
|
||||
*/
|
||||
public abstract class BasePreferenceActivity extends PreferenceActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
// 在super.onCreate()之前应用主题
|
||||
ThemeUtils.applyTheme(this);
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.micode.notes.ui;
|
||||
|
||||
import android.app.Activity;
|
||||
import net.micode.notes.R;
|
||||
|
||||
/**
|
||||
* 主题工具类
|
||||
* 用于根据UI样式设置应用主题
|
||||
*/
|
||||
public class ThemeUtils {
|
||||
/**
|
||||
* 根据当前UI样式设置应用主题
|
||||
* @param activity 要设置主题的Activity
|
||||
*/
|
||||
public static void applyTheme(Activity activity) {
|
||||
UiStyle style = NotesPreferenceActivity.getUiStyle(activity);
|
||||
int themeResId = getThemeResourceId(style);
|
||||
activity.setTheme(themeResId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据UI样式获取对应的主题资源ID
|
||||
* @param style UI样式枚举
|
||||
* @return 主题资源ID
|
||||
*/
|
||||
private static int getThemeResourceId(UiStyle style) {
|
||||
switch (style) {
|
||||
case CLASSIC:
|
||||
return R.style.Theme_Notes_Classic;
|
||||
case MATERIAL:
|
||||
return R.style.Theme_Notes_Material;
|
||||
case MINIMAL:
|
||||
return R.style.Theme_Notes_Minimal;
|
||||
default:
|
||||
return R.style.Theme_Notes_Classic;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.micode.notes.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import net.micode.notes.R;
|
||||
|
||||
/**
|
||||
* UI布局解析器
|
||||
* 根据当前UI样式返回对应的布局资源ID
|
||||
*/
|
||||
public class UiLayoutResolver {
|
||||
/**
|
||||
* 获取笔记列表项布局资源ID
|
||||
* @param context 上下文
|
||||
* @return 布局资源ID
|
||||
*/
|
||||
public static int getNoteListItemLayout(Context context) {
|
||||
UiStyle style = NotesPreferenceActivity.getUiStyle(context);
|
||||
switch (style) {
|
||||
case CLASSIC:
|
||||
return R.layout.note_item;
|
||||
case MATERIAL:
|
||||
return R.layout.note_item_material;
|
||||
case MINIMAL:
|
||||
return R.layout.note_item_minimal;
|
||||
default:
|
||||
return R.layout.note_item;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.micode.notes.ui;
|
||||
|
||||
/**
|
||||
* UI样式枚举
|
||||
* 定义应用支持的UI样式类型
|
||||
*/
|
||||
public enum UiStyle {
|
||||
/**
|
||||
* 经典样式
|
||||
*/
|
||||
CLASSIC,
|
||||
|
||||
/**
|
||||
* Material样式
|
||||
*/
|
||||
MATERIAL,
|
||||
|
||||
/**
|
||||
* 极简样式
|
||||
*/
|
||||
MINIMAL
|
||||
}
|
||||
Loading…
Reference in new issue