master
liuyx 2 years ago
commit f71b5d2de0

13
.gitignore vendored

@ -0,0 +1,13 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild

@ -0,0 +1,52 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<DBN-PSQL>
<case-options enabled="true">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false" />
</DBN-PSQL>
<DBN-SQL>
<case-options enabled="true">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false">
<option name="STATEMENT_SPACING" value="one_line" />
<option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" />
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings>
</DBN-SQL>
<DBN-PSQL>
<case-options enabled="true">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false" />
</DBN-PSQL>
<DBN-SQL>
<case-options enabled="true">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false">
<option name="STATEMENT_SPACING" value="one_line" />
<option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" />
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings>
</DBN-SQL>
</code_scheme>
</component>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="11" />
</component>
</project>

@ -0,0 +1,554 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DBNavigator.Project.DataEditorManager">
<record-view-column-sorting-type value="BY_INDEX" />
<value-preview-text-wrapping value="false" />
<value-preview-pinned value="false" />
</component>
<component name="DBNavigator.Project.DataExportManager">
<export-instructions>
<create-header value="true" />
<quote-values-containing-separator value="true" />
<quote-all-values value="false" />
<value-separator value="" />
<file-name value="" />
<file-location value="" />
<scope value="GLOBAL" />
<destination value="FILE" />
<format value="EXCEL" />
<charset value="GBK" />
</export-instructions>
</component>
<component name="DBNavigator.Project.DatabaseBrowserManager">
<autoscroll-to-editor value="false" />
<autoscroll-from-editor value="true" />
<show-object-properties value="false" />
<loaded-nodes />
</component>
<component name="DBNavigator.Project.DatabaseConsoleManager">
<connection id="f1b3c634-3f7d-4ad0-b409-c0a3065b31f8">
<console name="Connection" type="STANDARD" schema="main" session="Main"><![CDATA[select * from notes]]></console>
</connection>
</component>
<component name="DBNavigator.Project.DatabaseEditorStateManager">
<last-used-providers />
</component>
<component name="DBNavigator.Project.DatabaseFileManager">
<open-files />
</component>
<component name="DBNavigator.Project.DatabaseSessionManager">
<connection id="f1b3c634-3f7d-4ad0-b409-c0a3065b31f8" />
</component>
<component name="DBNavigator.Project.EditorStateManager">
<last-used-providers />
</component>
<component name="DBNavigator.Project.MethodExecutionManager">
<method-browser />
<execution-history>
<group-entries value="true" />
<execution-inputs />
</execution-history>
<argument-values-cache />
</component>
<component name="DBNavigator.Project.ObjectDependencyManager">
<last-used-dependency-type value="INCOMING" />
</component>
<component name="DBNavigator.Project.ObjectQuickFilterManager">
<last-used-operator value="EQUAL" />
<filters />
</component>
<component name="DBNavigator.Project.ScriptExecutionManager" clear-outputs="true">
<recently-used-interfaces />
</component>
<component name="DBNavigator.Project.Settings">
<connections>
<connection id="f1b3c634-3f7d-4ad0-b409-c0a3065b31f8" active="true" signed="true">
<database>
<name value="Connection" />
<description value="" />
<database-type value="SQLITE" />
<config-type value="BASIC" />
<database-version value="3.21" />
<driver-source value="BUILTIN" />
<driver-library value="" />
<driver value="" />
<url-type value="FILE" />
<host value="localhost" />
<port value="1234" />
<database value="database" />
<files>
<file path="C:\Users\Sungod\Desktop\notes" schema="main" />
</files>
<type value="NONE" />
<user value="" />
<deprecated-pwd value="" />
</database>
<properties>
<auto-commit value="false" />
</properties>
<ssh-settings>
<active value="false" />
<proxy-host value="" />
<proxy-port value="22" />
<proxy-user value="" />
<deprecated-proxy-pwd value="" />
<auth-type value="PASSWORD" />
<key-file value="" />
<key-passphrase value="" />
</ssh-settings>
<ssl-settings>
<active value="false" />
<certificate-authority-file value="" />
<client-certificate-file value="" />
<client-key-file value="" />
</ssl-settings>
<details>
<charset value="UTF-8" />
<session-management value="true" />
<ddl-file-binding value="true" />
<database-logging value="false" />
<connect-automatically value="true" />
<restore-workspace value="true" />
<restore-workspace-deep value="true" />
<environment-type value="default" />
<connectivity-timeout value="10" />
<idle-time-to-disconnect value="30" />
<idle-time-to-disconnect-pool value="5" />
<credential-expiry-time value="10" />
<max-connection-pool-size value="7" />
<alternative-statement-delimiter value="" />
</details>
<object-filters hide-empty-schemas="false" hide-pseudo-columns="false">
<object-type-filter>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="true" />
<object-type name="ROLE" enabled="true" />
<object-type name="PRIVILEGE" enabled="true" />
<object-type name="CHARSET" enabled="true" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED_VIEW" enabled="true" />
<object-type name="NESTED_TABLE" enabled="true" />
<object-type name="COLUMN" enabled="true" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET_TRIGGER" enabled="true" />
<object-type name="DATABASE_TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="true" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="TYPE_ATTRIBUTE" enabled="true" />
<object-type name="ARGUMENT" enabled="true" />
<object-type name="DIMENSION" enabled="true" />
<object-type name="CLUSTER" enabled="true" />
<object-type name="DBLINK" enabled="true" />
</object-type-filter>
<object-name-filters />
</object-filters>
</connection>
</connections>
<browser-settings>
<general>
<display-mode value="TABBED" />
<navigation-history-size value="100" />
<show-object-details value="false" />
</general>
<filters>
<object-type-filter>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="true" />
<object-type name="ROLE" enabled="true" />
<object-type name="PRIVILEGE" enabled="true" />
<object-type name="CHARSET" enabled="true" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED_VIEW" enabled="true" />
<object-type name="NESTED_TABLE" enabled="true" />
<object-type name="COLUMN" enabled="true" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET_TRIGGER" enabled="true" />
<object-type name="DATABASE_TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="true" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="TYPE_ATTRIBUTE" enabled="true" />
<object-type name="ARGUMENT" enabled="true" />
<object-type name="DIMENSION" enabled="true" />
<object-type name="CLUSTER" enabled="true" />
<object-type name="DBLINK" enabled="true" />
</object-type-filter>
</filters>
<sorting>
<object-type name="COLUMN" sorting-type="NAME" />
<object-type name="FUNCTION" sorting-type="NAME" />
<object-type name="PROCEDURE" sorting-type="NAME" />
<object-type name="ARGUMENT" sorting-type="POSITION" />
<object-type name="TYPE ATTRIBUTE" sorting-type="POSITION" />
</sorting>
<default-editors>
<object-type name="VIEW" editor-type="SELECTION" />
<object-type name="PACKAGE" editor-type="SELECTION" />
<object-type name="TYPE" editor-type="SELECTION" />
</default-editors>
</browser-settings>
<navigation-settings>
<lookup-filters>
<lookup-objects>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="false" />
<object-type name="ROLE" enabled="false" />
<object-type name="PRIVILEGE" enabled="false" />
<object-type name="CHARSET" enabled="false" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED VIEW" enabled="true" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET TRIGGER" enabled="true" />
<object-type name="DATABASE TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="false" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="DIMENSION" enabled="false" />
<object-type name="CLUSTER" enabled="false" />
<object-type name="DBLINK" enabled="true" />
</lookup-objects>
<force-database-load value="false" />
<prompt-connection-selection value="true" />
<prompt-schema-selection value="true" />
</lookup-filters>
</navigation-settings>
<dataset-grid-settings>
<general>
<enable-zooming value="true" />
<enable-column-tooltip value="true" />
</general>
<sorting>
<nulls-first value="true" />
<max-sorting-columns value="4" />
</sorting>
<audit-columns>
<column-names value="" />
<visible value="true" />
<editable value="false" />
</audit-columns>
</dataset-grid-settings>
<dataset-editor-settings>
<text-editor-popup>
<active value="false" />
<active-if-empty value="false" />
<data-length-threshold value="100" />
<popup-delay value="1000" />
</text-editor-popup>
<values-actions-popup>
<show-popup-button value="true" />
<element-count-threshold value="1000" />
<data-length-threshold value="250" />
</values-actions-popup>
<general>
<fetch-block-size value="100" />
<fetch-timeout value="30" />
<trim-whitespaces value="true" />
<convert-empty-strings-to-null value="true" />
<select-content-on-cell-edit value="true" />
<large-value-preview-active value="true" />
</general>
<filters>
<prompt-filter-dialog value="true" />
<default-filter-type value="BASIC" />
</filters>
<qualified-text-editor text-length-threshold="300">
<content-types>
<content-type name="Text" enabled="true" />
<content-type name="Properties" enabled="true" />
<content-type name="XML" enabled="true" />
<content-type name="DTD" enabled="true" />
<content-type name="HTML" enabled="true" />
<content-type name="XHTML" enabled="true" />
<content-type name="Java" enabled="true" />
<content-type name="SQL" enabled="true" />
<content-type name="PL/SQL" enabled="true" />
<content-type name="JSON" enabled="true" />
<content-type name="JSON5" enabled="true" />
<content-type name="Groovy" enabled="true" />
<content-type name="AIDL" enabled="true" />
<content-type name="YAML" enabled="true" />
<content-type name="Manifest" enabled="true" />
</content-types>
</qualified-text-editor>
<record-navigation>
<navigation-target value="VIEWER" />
</record-navigation>
</dataset-editor-settings>
<code-editor-settings>
<general>
<show-object-navigation-gutter value="false" />
<show-spec-declaration-navigation-gutter value="true" />
<enable-spellchecking value="true" />
<enable-reference-spellchecking value="false" />
</general>
<confirmations>
<save-changes value="false" />
<revert-changes value="true" />
</confirmations>
</code-editor-settings>
<code-completion-settings>
<filters>
<basic-filter>
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
<filter-element type="RESERVED_WORD" id="function" selected="true" />
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
<filter-element type="OBJECT" id="schema" selected="true" />
<filter-element type="OBJECT" id="role" selected="true" />
<filter-element type="OBJECT" id="user" selected="true" />
<filter-element type="OBJECT" id="privilege" selected="true" />
<user-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="false" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</user-schema>
<public-schema>
<filter-element type="OBJECT" id="table" selected="false" />
<filter-element type="OBJECT" id="view" selected="false" />
<filter-element type="OBJECT" id="materialized view" selected="false" />
<filter-element type="OBJECT" id="index" selected="false" />
<filter-element type="OBJECT" id="constraint" selected="false" />
<filter-element type="OBJECT" id="trigger" selected="false" />
<filter-element type="OBJECT" id="synonym" selected="false" />
<filter-element type="OBJECT" id="sequence" selected="false" />
<filter-element type="OBJECT" id="procedure" selected="false" />
<filter-element type="OBJECT" id="function" selected="false" />
<filter-element type="OBJECT" id="package" selected="false" />
<filter-element type="OBJECT" id="type" selected="false" />
<filter-element type="OBJECT" id="dimension" selected="false" />
<filter-element type="OBJECT" id="cluster" selected="false" />
<filter-element type="OBJECT" id="dblink" selected="false" />
</public-schema>
<any-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</any-schema>
</basic-filter>
<extended-filter>
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
<filter-element type="RESERVED_WORD" id="function" selected="true" />
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
<filter-element type="OBJECT" id="schema" selected="true" />
<filter-element type="OBJECT" id="user" selected="true" />
<filter-element type="OBJECT" id="role" selected="true" />
<filter-element type="OBJECT" id="privilege" selected="true" />
<user-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</user-schema>
<public-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</public-schema>
<any-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</any-schema>
</extended-filter>
</filters>
<sorting enabled="true">
<sorting-element type="RESERVED_WORD" id="keyword" />
<sorting-element type="RESERVED_WORD" id="datatype" />
<sorting-element type="OBJECT" id="column" />
<sorting-element type="OBJECT" id="table" />
<sorting-element type="OBJECT" id="view" />
<sorting-element type="OBJECT" id="materialized view" />
<sorting-element type="OBJECT" id="index" />
<sorting-element type="OBJECT" id="constraint" />
<sorting-element type="OBJECT" id="trigger" />
<sorting-element type="OBJECT" id="synonym" />
<sorting-element type="OBJECT" id="sequence" />
<sorting-element type="OBJECT" id="procedure" />
<sorting-element type="OBJECT" id="function" />
<sorting-element type="OBJECT" id="package" />
<sorting-element type="OBJECT" id="type" />
<sorting-element type="OBJECT" id="dimension" />
<sorting-element type="OBJECT" id="cluster" />
<sorting-element type="OBJECT" id="dblink" />
<sorting-element type="OBJECT" id="schema" />
<sorting-element type="OBJECT" id="role" />
<sorting-element type="OBJECT" id="user" />
<sorting-element type="RESERVED_WORD" id="function" />
<sorting-element type="RESERVED_WORD" id="parameter" />
</sorting>
<format>
<enforce-code-style-case value="true" />
</format>
</code-completion-settings>
<execution-engine-settings>
<statement-execution>
<fetch-block-size value="100" />
<execution-timeout value="20" />
<debug-execution-timeout value="600" />
<focus-result value="false" />
<prompt-execution value="false" />
</statement-execution>
<script-execution>
<command-line-interfaces />
<execution-timeout value="300" />
</script-execution>
<method-execution>
<execution-timeout value="30" />
<debug-execution-timeout value="600" />
<parameter-history-size value="10" />
</method-execution>
</execution-engine-settings>
<operation-settings>
<transactions>
<uncommitted-changes>
<on-project-close value="ASK" />
<on-disconnect value="ASK" />
<on-autocommit-toggle value="ASK" />
</uncommitted-changes>
<multiple-uncommitted-changes>
<on-commit value="ASK" />
<on-rollback value="ASK" />
</multiple-uncommitted-changes>
</transactions>
<session-browser>
<disconnect-session value="ASK" />
<kill-session value="ASK" />
<reload-on-filter-change value="false" />
</session-browser>
<compiler>
<compile-type value="KEEP" />
<compile-dependencies value="ASK" />
<always-show-controls value="false" />
</compiler>
<debugger>
<debugger-type value="ASK" />
<use-generic-runners value="true" />
</debugger>
</operation-settings>
<ddl-file-settings>
<extensions>
<mapping file-type-id="VIEW" extensions="vw" />
<mapping file-type-id="TRIGGER" extensions="trg" />
<mapping file-type-id="PROCEDURE" extensions="prc" />
<mapping file-type-id="FUNCTION" extensions="fnc" />
<mapping file-type-id="PACKAGE" extensions="pkg" />
<mapping file-type-id="PACKAGE_SPEC" extensions="pks" />
<mapping file-type-id="PACKAGE_BODY" extensions="pkb" />
<mapping file-type-id="TYPE" extensions="tpe" />
<mapping file-type-id="TYPE_SPEC" extensions="tps" />
<mapping file-type-id="TYPE_BODY" extensions="tpb" />
</extensions>
<general>
<lookup-ddl-files value="true" />
<create-ddl-files value="false" />
<synchronize-ddl-files value="true" />
<use-qualified-names value="false" />
<make-scripts-rerunnable value="true" />
</general>
</ddl-file-settings>
<general-settings>
<regional-settings>
<date-format value="MEDIUM" />
<number-format value="UNGROUPED" />
<locale value="SYSTEM_DEFAULT" />
<use-custom-formats value="false" />
</regional-settings>
<environment>
<environment-types>
<environment-type id="development" name="Development" description="Development environment" color="-2430209/-12296320" readonly-code="false" readonly-data="false" />
<environment-type id="integration" name="Integration" description="Integration environment" color="-2621494/-12163514" readonly-code="true" readonly-data="false" />
<environment-type id="production" name="Production" description="Productive environment" color="-11574/-10271420" readonly-code="true" readonly-data="true" />
<environment-type id="other" name="Other" description="" color="-1576/-10724543" readonly-code="false" readonly-data="false" />
</environment-types>
<visibility-settings>
<connection-tabs value="true" />
<dialog-headers value="true" />
<object-editor-tabs value="true" />
<script-editor-tabs value="false" />
<execution-result-tabs value="true" />
</visibility-settings>
</environment>
</general-settings>
</component>
<component name="DBNavigator.Project.StatementExecutionManager">
<execution-variables />
</component>
</project>

@ -0,0 +1,7 @@
<component name="ProjectDictionaryState">
<dictionary name="hp">
<words>
<w>annoucement</w>
</words>
</dictionary>
</component>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="Android Studio default JDK" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="BintrayJCenter" />
<option name="name" value="BintrayJCenter" />
<option name="url" value="https://jcenter.bintray.com/" />
</remote-repository>
<remote-repository>
<option name="id" value="Google" />
<option name="name" value="Google" />
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenRepo" />
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
</component>
</project>

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

@ -0,0 +1,3 @@
# 简言
一款简单的记录文字的软件

1
app/.gitignore vendored

@ -0,0 +1 @@
/build

@ -0,0 +1,39 @@
apply plugin: 'com.android.application'
android {
signingConfigs {
// debug {
// storeFile file('D:\\apppp\\Android Studio\\_key_directory\\keystore.jks')
// storePassword '951225tyb'
// keyAlias = 'piggynote'
// keyPassword '951225tyb'
// }
}
compileSdkVersion 33
defaultConfig {
applicationId "cc.liuyx.note"
minSdkVersion 23
targetSdkVersion 33
versionCode 3
versionName "1.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta2'
testImplementation 'junit:junit:4.13-beta-3'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:design:28.0.0'
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.githang:status-bar-compat:0.7'
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

Binary file not shown.

Binary file not shown.

@ -0,0 +1 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":3,"versionName":"1.3","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]

@ -0,0 +1,26 @@
package com.example.atry;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.atry", appContext.getPackageName());
}
}

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.atry">
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<application
android:theme="@style/DayTheme"
android:allowBackup="true"
android:icon="@mipmap/piggy_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/piggy_launcher_round"
android:supportsRtl="true"
>
<activity android:name="cc.liuyx.note.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="cc.liuyx.note.EditActivity">
</activity>
<activity android:name="cc.liuyx.note.FabColorActivity" />
<activity android:name="cc.liuyx.note.UserSettingsActivity" />
<activity android:name="cc.liuyx.note.alarm.EditAlarmActivity" />
<receiver android:name="cc.liuyx.note.alarm.AlarmReceiver" />
</application>
</manifest>

@ -0,0 +1,78 @@
package cc.liuyx.note;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Color;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.util.TypedValue;
import com.example.atry.R;
import com.githang.statusbar.StatusBarCompat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
public abstract class BaseActivity extends AppCompatActivity {
public final String TAG = "BaseActivity";
public final String ACTION = "NIGHT_SWITCH";
protected BroadcastReceiver receiver;
protected IntentFilter filter;
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setNightMode();
TypedValue typedValue = new TypedValue();
this.getTheme().resolveAttribute(R.attr.tvBackground, typedValue, true);
StatusBarCompat.setStatusBarColor(this, ContextCompat.getColor(this, typedValue.resourceId));
filter = new IntentFilter();
filter.addAction(ACTION);
receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
needRefresh();
}
};
registerReceiver(receiver, filter);
}
public boolean isNightMode(){
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
return sharedPreferences.getBoolean("nightMode", false);
}
public void setNightMode(){
if(isNightMode()) this.setTheme(R.style.NightTheme);
else setTheme(R.style.DayTheme);
}
protected abstract void needRefresh();
@Override
public void onDestroy(){
super.onDestroy();
unregisterReceiver(receiver);
}
public long calStrToSec(String date) throws ParseException {//decode calender date to second
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
long secTime = format.parse(date).getTime();
return secTime;
}
}

@ -0,0 +1,212 @@
package cc.liuyx.note;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.Toolbar;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.Spinner;
import com.example.atry.R;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import cc.liuyx.note.db.NoteDatabase;
public class EditActivity extends BaseActivity {
private NoteDatabase dbHelper;
private Context context = this;
private EditText et;
private String old_content = "";
private String old_time = "";
private int old_Tag = 1;
private long id = 0;
private int openMode = 0;
private int tag = 1;
private boolean tagChange = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.edit_layout);
Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
setSupportActionBar(myToolbar);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Spinner mySpinner = (Spinner) findViewById(R.id.spinner);
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
List<String> tagList = Arrays.asList(sharedPreferences.getString("tagListString", null).split("_")); //获取tags
ArrayAdapter<String> myAdapter = new ArrayAdapter<String>(this, R.layout.spinner_item, tagList);
myAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
mySpinner.setAdapter(myAdapter);
mySpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
tag = (int) id + 1;
tagChange = true;
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
if (isNightMode())
myToolbar.setNavigationIcon(getDrawable(R.drawable.ic_keyboard_arrow_left_white_24dp));
else myToolbar.setNavigationIcon(getDrawable(R.drawable.ic_keyboard_arrow_left_black_24dp));
myToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
if (openMode == 4) {
if (et.getText().toString().length() == 0) {
intent.putExtra("mode", -1); //nothing new happens.
} else {
intent.putExtra("mode", 0); // new one note;
intent.putExtra("content", et.getText().toString());
intent.putExtra("time", dateToStr());
intent.putExtra("tag", tag);
}
} else {
if (et.getText().toString().equals(old_content) && !tagChange)
intent.putExtra("mode", -1); // edit nothing
else {
intent.putExtra("mode", 1); //edit the content
intent.putExtra("content", et.getText().toString());
intent.putExtra("time", dateToStr());
intent.putExtra("id", id);
intent.putExtra("tag", tag);
}
}
setResult(RESULT_OK, intent);
finish();//返回
overridePendingTransition(R.anim.in_lefttoright, R.anim.out_lefttoright);
}
});
et = (EditText) findViewById(R.id.et);
Intent getIntent = getIntent();
openMode = getIntent.getIntExtra("mode", 0);
if (openMode == 3) {//打开已存在的note
id = getIntent.getLongExtra("id", 0);
old_content = getIntent.getStringExtra("content");
old_time = getIntent.getStringExtra("time");
old_Tag = getIntent.getIntExtra("tag", 1);
et.setText(old_content);
et.setSelection(old_content.length());
mySpinner.setSelection(old_Tag - 1);
}
}
@Override
protected void needRefresh() {
setNightMode();
startActivity(new Intent(this, EditActivity.class));
overridePendingTransition(R.anim.night_switch, R.anim.night_switch_over);
finish();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.edit_menu, menu);
return super.onCreateOptionsMenu(menu);
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_HOME) {
return true;
} else if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
Intent intent = new Intent();
if (openMode == 4) {
if (et.getText().toString().length() == 0) {
intent.putExtra("mode", -1); //nothing new happens.
} else {
intent.putExtra("mode", 0); // new one note;
intent.putExtra("content", et.getText().toString());
intent.putExtra("time", dateToStr());
intent.putExtra("tag", tag);
}
} else {
if (et.getText().toString().equals(old_content) && !tagChange)
intent.putExtra("mode", -1); // edit nothing
else {
intent.putExtra("mode", 1); //edit the content
intent.putExtra("content", et.getText().toString());
intent.putExtra("time", dateToStr());
intent.putExtra("id", id);
intent.putExtra("tag", tag);
}
}
setResult(RESULT_OK, intent);
finish();
overridePendingTransition(R.anim.in_lefttoright, R.anim.out_lefttoright);
return true;
}
return super.onKeyDown(keyCode, event);
}
@SuppressLint("NonConstantResourceId")
@Override
public boolean onOptionsItemSelected(MenuItem item) {
final Intent intent = new Intent();
switch (item.getItemId()) {
case R.id.delete:
deleteNote(intent);
break;
}
return super.onOptionsItemSelected(item);
}
public String dateToStr() {
Date date = new Date();
@SuppressLint("SimpleDateFormat") SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return simpleDateFormat.format(date);
}
private void deleteNote(Intent intent) {
new AlertDialog.Builder(EditActivity.this)
.setMessage("Delete this Note ?")
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (openMode == 4) {
intent.putExtra("mode", -1); // delete the note
setResult(RESULT_OK, intent);
} else {
intent.putExtra("mode", 2); // delete the note
intent.putExtra("id", id);
setResult(RESULT_OK, intent);
}
finish();
}
}).setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
}).create().show();
}
}

@ -0,0 +1,190 @@
package cc.liuyx.note;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;
import com.example.atry.R;
import java.util.Objects;
public class FabColorActivity extends AppCompatActivity implements View.OnClickListener {
private Toolbar myToolbar;
private int openMode;
private SharedPreferences sharedPreferences;
private ImageView q,w,e,r,t,y,u,i,o,p, curFab, defFab;
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.setting_fabcolor);
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
openMode = getIntent().getIntExtra("mode", 1);
myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
setSupportActionBar(myToolbar);
Objects.requireNonNull(getSupportActionBar()).setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); //设置toolbar取代actionbar
myToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.putExtra("opMode", 0);//无事发生
setResult(RESULT_OK, intent);
overridePendingTransition(R.anim.in_lefttoright, R.anim.out_lefttoright);
finish();
}
});
initImageView();
}
private void initImageView(){
q = findViewById(R.id.q);
w = findViewById(R.id.w);
e = findViewById(R.id.e);
r = findViewById(R.id.r);
t = findViewById(R.id.t);
y = findViewById(R.id.y);
u = findViewById(R.id.u);
i = findViewById(R.id.i);
o = findViewById(R.id.o);
p = findViewById(R.id.p);
curFab = findViewById(R.id.curFab);
if(openMode == 1) chooseCurFabColor(sharedPreferences.getInt("fabColor", -500041));
else chooseCurFabColor(sharedPreferences.getInt("fabPlanColor", -500041));
defFab = findViewById(R.id.defFab);
setClick();
}
private void chooseCurFabColor(int fabColor){
//根据 preference.xml中的fabColor值调整curFab颜色从MainActivity抄过来的
switch (fabColor){
case -500072:
curFab.setBackgroundResource(R.color.q);
break;
case -500081:
curFab.setBackgroundResource(R.color.w);
break;
case -500061:
curFab.setBackgroundResource(R.color.e);
break;
case -500074:
curFab.setBackgroundResource(R.color.r);
break;
case -500078:
curFab.setBackgroundResource(R.color.t);
break;
case -500083:
curFab.setBackgroundResource(R.color.y);
break;
case -500079:
curFab.setBackgroundResource(R.color.u);
break;
case -500063:
curFab.setBackgroundResource(R.color.i);
break;
case -500066:
curFab.setBackgroundResource(R.color.o);
break;
case -500069:
curFab.setBackgroundResource(R.color.p);
break;
default:
curFab.setBackgroundResource(R.color.fabColor1);
}
}
private void setClick(){
q.setOnClickListener(this);
w.setOnClickListener(this);
e.setOnClickListener(this);
r.setOnClickListener(this);
t.setOnClickListener(this);
y.setOnClickListener(this);
u.setOnClickListener(this);
i.setOnClickListener(this);
o.setOnClickListener(this);
p.setOnClickListener(this);
curFab.setOnClickListener(this);
defFab.setOnClickListener(this);
}
@SuppressLint("NonConstantResourceId")
@Override
public void onClick(View v) {
if(v.getId() == R.id.curFab){
Toast.makeText(this, "Current color cannot be selected!", Toast.LENGTH_SHORT).show();
}else {
Intent intent = new Intent();
intent.putExtra("opMode", openMode);//decide which button according to input intent
switch (v.getId()) {
case R.id.q:
intent.putExtra("id", -500072);
break;
case R.id.w:
intent.putExtra("id", -500081);
break;
case R.id.e:
intent.putExtra("id", -500061);
break;
case R.id.r:
intent.putExtra("id", -500074);
break;
case R.id.t:
intent.putExtra("id", -500078);
break;
case R.id.y:
intent.putExtra("id", -500083);
break;
case R.id.u:
intent.putExtra("id", -500079);
break;
case R.id.i:
intent.putExtra("id", -500063);
break;
case R.id.o:
intent.putExtra("id", -500066);
break;
case R.id.p:
intent.putExtra("id", -500069);
break;
case R.id.defFab:
intent.putExtra("id", -500041);
break;
}
setResult(RESULT_OK, intent);
overridePendingTransition(R.anim.in_lefttoright, R.anim.out_lefttoright);
finish();
}
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
if( keyCode== KeyEvent.KEYCODE_HOME){
return true;
} else if( keyCode== KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN){
Intent intent = new Intent();
intent.putExtra("opMode", 0);
setResult(RESULT_OK, intent);
finish();
overridePendingTransition(R.anim.in_lefttoright, R.anim.out_lefttoright);
return true;
}
return super.onKeyDown(keyCode, event);
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,174 @@
package cc.liuyx.note;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.widget.Toolbar;
import android.view.KeyEvent;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
import android.widget.Switch;
import com.example.atry.R;
import java.util.Objects;
public class UserSettingsActivity extends BaseActivity {
private Switch nightMode;
private Switch reverseSort;
private LinearLayout fabColor;
private LinearLayout fabPlanColor;
private Switch noteTitle;
private SharedPreferences sharedPreferences;
private static boolean night_change;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.preference_layout);
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
Intent intent = getIntent();
if (intent.getExtras() != null)
night_change = intent.getBooleanExtra("night_change", false);
else night_change = false;
initView();
Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
setSupportActionBar(myToolbar);
Objects.requireNonNull(getSupportActionBar()).setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
if (isNightMode())
myToolbar.setNavigationIcon(getDrawable(R.drawable.ic_settings_white_24dp));
else myToolbar.setNavigationIcon(getDrawable(R.drawable.ic_settings_black_24dp));
}
@Override
protected void needRefresh() {
//因为自身的刷新与其他activity不同步所以此处留白
}
private void initView() {
nightMode = findViewById(R.id.nightMode);
reverseSort = findViewById(R.id.reverseSort);
fabColor = findViewById(R.id.fabColor);
fabPlanColor = findViewById(R.id.fabPlanColor);
noteTitle = findViewById(R.id.noteTitle);
nightMode.setChecked(sharedPreferences.getBoolean("nightMode", false));
reverseSort.setChecked(sharedPreferences.getBoolean("reverseSort", false));
nightMode.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
setNightModePref(isChecked);
setSelfNightMode();
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
boolean temp = false;
}
});
reverseSort.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
SharedPreferences sharedPreferences1 = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
SharedPreferences.Editor editor = sharedPreferences1.edit();
editor.putBoolean("reverseSort", isChecked);
editor.apply();
}
});
fabColor.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(UserSettingsActivity.this, FabColorActivity.class);
intent.putExtra("mode", 1); // add note button
startActivityForResult(intent, 1);
overridePendingTransition(R.anim.in_righttoleft, R.anim.no);
}
});
fabPlanColor.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(UserSettingsActivity.this, FabColorActivity.class);
intent.putExtra("mode", 2); // add plan button
startActivityForResult(intent, 1);
overridePendingTransition(R.anim.in_righttoleft, R.anim.no);
}
});
noteTitle.setChecked(sharedPreferences.getBoolean("noteTitle", true));
noteTitle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
SharedPreferences sharedPreferences1 = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
SharedPreferences.Editor editor = sharedPreferences1.edit();
editor.putBoolean("noteTitle", isChecked);
editor.apply();
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
assert data != null;
int opMode = data.getExtras().getInt("opMode", -1);
if (opMode == 1) {
int imgId = data.getExtras().getInt("id");
SharedPreferences.Editor editor = sharedPreferences.edit(); // 开始编辑该文件
editor.putInt("fabColor", imgId);
editor.apply();
} else if (opMode == 2) {
int imgId = data.getExtras().getInt("id");
SharedPreferences.Editor editor = sharedPreferences.edit(); // 开始编辑该文件
editor.putInt("fabPlanColor", imgId);
editor.apply();
}
}
private void setSelfNightMode() {
//重新赋值并重启本activity
super.setNightMode();
Intent intent = new Intent(this, UserSettingsActivity.class);
intent.putExtra("night_change", !night_change); //重启一次正负颠倒。最终为正值时重启MainActivity。
startActivity(new Intent(this, UserSettingsActivity.class));
overridePendingTransition(R.anim.night_switch, R.anim.night_switch_over);
finish();
}
private void setNightModePref(boolean night) {
//通过nightMode switch修改pref中的nightMode
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean("nightMode", night);
editor.apply();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
Intent intent = new Intent();
intent.setAction("NIGHT_SWITCH");
sendBroadcast(intent);
finish();
overridePendingTransition(R.anim.in_lefttoright, R.anim.out_lefttoright);
return true;
}
return super.onKeyDown(keyCode, event);
}
}

@ -0,0 +1,114 @@
package cc.liuyx.note.adapter;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Filter;
import android.widget.Filterable;
import android.widget.TextView;
import com.example.atry.R;
import java.util.ArrayList;
import java.util.List;
import cc.liuyx.note.entity.Note;
public class NoteAdapter extends BaseAdapter implements Filterable {
private Context mContext;
private List<Note> backList;//用来备份原始数据
private List<Note> noteList;//这个数据是会改变的,所以要有个变量来备份一下原始数据
private MyFilter mFilter;
public NoteAdapter(Context mContext, List<Note> noteList) {
this.mContext = mContext;
this.noteList = noteList;
backList = noteList;
}
@Override
public int getCount() {
return noteList.size();
}
@Override
public Object getItem(int position) {
return noteList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(mContext);
mContext.setTheme((sharedPreferences.getBoolean("nightMode", false)? R.style.NightTheme: R.style.DayTheme));
View v = View.inflate(mContext, R.layout.note_layout, null);
TextView tv_content = (TextView)v.findViewById(R.id.tv_content);
TextView tv_time = (TextView)v.findViewById(R.id.tv_time);
//Set text for TextView
String allText = noteList.get(position).getContent();
if (sharedPreferences.getBoolean("noteTitle" ,true))
tv_content.setText(allText.split("\n")[0]);
else tv_content.setText(allText);
tv_time.setText(noteList.get(position).getTime());
//Save note id to tag
v.setTag(noteList.get(position).getId());
return v;
}
@Override
public Filter getFilter() {
if (mFilter ==null){
mFilter = new MyFilter();
}
return mFilter;
}
class MyFilter extends Filter {
//我们在performFiltering(CharSequence charSequence)这个方法中定义过滤规则
@Override
protected FilterResults performFiltering(CharSequence charSequence) {
FilterResults result = new FilterResults();
List<Note> list;
if (TextUtils.isEmpty(charSequence)) {//当过滤的关键字为空的时候,我们则显示所有的数据
list = backList;
} else {//否则把符合条件的数据对象添加到集合中
list = new ArrayList<>();
for (Note note : backList) {
if (note.getContent().contains(charSequence)) {
list.add(note);
}
}
}
result.values = list; //将得到的集合保存到FilterResults的value变量中
result.count = list.size();//将集合的大小保存到FilterResults的count变量中
return result;
}
//在publishResults方法中告诉适配器更新界面
@Override
protected void publishResults(CharSequence charSequence, FilterResults filterResults) {
noteList = (List<Note>)filterResults.values;
if (filterResults.count>0){
notifyDataSetChanged();//通知数据发生了改变
}else {
notifyDataSetInvalidated();//通知数据失效
}
}
}
}

@ -0,0 +1,62 @@
package cc.liuyx.note.adapter;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.atry.R;
import java.util.List;
public class TagAdapter extends BaseAdapter {
private Context context;
private List<String> tagList;
private List<Integer> numList;
public TagAdapter(Context context, List<String> tagList, List<Integer> numList) {
this.context = context;
this.tagList = tagList;
this.numList = numList;
}
@Override
public int getCount() {
return tagList.size();
}
@Override
public Object getItem(int position) {
return tagList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
for(int i = 0; i < numList.size(); i++) Log.d("tag", numList.get(i).toString());
Log.d("tag", "getView: " + numList.size());
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
context.setTheme((sharedPreferences.getBoolean("nightMode", false)? R.style.NightTheme: R.style.DayTheme));
View v = View.inflate(context, R.layout.tag_layout, null);
TextView blank_tag = v.findViewById(R.id.blank_tag);
TextView text_tag = v.findViewById(R.id.text_tag);
ImageView delete_tag = v.findViewById(R.id.delete_tag);
blank_tag.setText(numList.get(position).toString());
text_tag.setText(tagList.get(position));
return v;
}
}

@ -0,0 +1,47 @@
package cc.liuyx.note.alarm;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.support.v4.app.NotificationCompat;
import cc.liuyx.note.MainActivity;
import com.example.atry.R;
public class AlarmReceiver extends BroadcastReceiver {
private String channelId = "Piggy Notes";
private String name = "ChannelName";
@Override
public void onReceive(Context context, Intent intent) {
String title = intent.getExtras().getString("title");
String content = intent.getExtras().getString("content");
int id = intent.getExtras().getInt("id");
Intent intent1 = new Intent(context, MainActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, id, intent1, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);
intent1.putExtra("mode", 1);
NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel mChannel = new NotificationChannel(channelId, name, NotificationManager.IMPORTANCE_DEFAULT);
mChannel.enableVibration(true);
manager.createNotificationChannel(mChannel);
}
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, channelId)
.setContentTitle(title).setContentText(content).setSmallIcon(R.drawable.red_alarm_24dp)
.setContentIntent(pendingIntent).setAutoCancel(true).setFullScreenIntent(pendingIntent, true);
Notification notification = builder.build();
manager.notify(1, notification);
}
}

@ -0,0 +1,86 @@
package cc.liuyx.note.alarm;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import java.util.ArrayList;
import java.util.List;
public class CRUD {
SQLiteOpenHelper dbHandler;
SQLiteDatabase db;
private static final String[] columns = {
PlanDatabase.ID,
PlanDatabase.TITLE,
PlanDatabase.CONTENT,
PlanDatabase.TIME,
};
public CRUD(Context context){
dbHandler = new PlanDatabase(context);
}
public void open(){
db = dbHandler.getWritableDatabase();
}
public void close(){
dbHandler.close();
}
public Plan addPlan(Plan plan){
//add a plan object to database
ContentValues contentValues = new ContentValues();
contentValues.put(PlanDatabase.TITLE, plan.getTitle());
contentValues.put(PlanDatabase.CONTENT, plan.getContent());
contentValues.put(PlanDatabase.TIME, plan.getTime());
long insertId = db.insert(PlanDatabase.TABLE_NAME, null, contentValues);
plan.setId(insertId);
return plan;
}
public Plan getPlan(long id){
//get a plan from database using cursor index
Cursor cursor = db.query(PlanDatabase.TABLE_NAME,columns,PlanDatabase.ID + "=?",
new String[]{String.valueOf(id)},null,null, null, null);
if (cursor != null) cursor.moveToFirst();
Plan e = new Plan(cursor.getString(1),cursor.getString(2), cursor.getString(3));
return e;
}
public List<Plan> getAllPlans(){
Cursor cursor = db.query(PlanDatabase.TABLE_NAME,columns,null,null,null, null, null);
List<Plan> plans = new ArrayList<>();
if(cursor.getCount() > 0){
while(cursor.moveToNext()){
Plan plan = new Plan();
plan.setId(cursor.getLong(cursor.getColumnIndex(PlanDatabase.ID)));
plan.setTitle(cursor.getString(cursor.getColumnIndex(PlanDatabase.TITLE)));
plan.setContent(cursor.getString(cursor.getColumnIndex(PlanDatabase.CONTENT)));
plan.setTime(cursor.getString(cursor.getColumnIndex(PlanDatabase.TIME)));
plans.add(plan);
}
}
return plans;
}
public int updatePlan(Plan plan) {
//update the info of an existing plan
ContentValues values = new ContentValues();
values.put(PlanDatabase.TITLE, plan.getTitle());
values.put(PlanDatabase.CONTENT, plan.getContent());
values.put(PlanDatabase.TIME, plan.getTime());
// updating row
return db.update(PlanDatabase.TABLE_NAME, values,
PlanDatabase.ID + "=?",new String[] { String.valueOf(plan.getId())});
}
public void removePlan(Plan plan) {
//remove a plan according to ID value
db.delete(PlanDatabase.TABLE_NAME, PlanDatabase.ID + "=" + plan.getId(), null);
}
}

@ -0,0 +1,329 @@
package cc.liuyx.note.alarm;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;
import cc.liuyx.note.BaseActivity;
import com.example.atry.R;
import java.util.Calendar;
public class EditAlarmActivity extends BaseActivity implements View.OnClickListener {
private DatePickerDialog.OnDateSetListener dateSetListener;
private TimePickerDialog.OnTimeSetListener timeSetListener;
private EditText et_title;
private EditText et;
private Button set_date;
private Button set_time;
private TextView date;
private TextView time;
private Plan plan;
private int[] dateArray = new int[3];
private int[] timeArray = new int[2];
private int openMode = 0;
private String old_title = "";
private String old_content = "";
private String old_time = "";
private long id = 0;
private boolean timeChange = false;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.edit_alarm_layout);
Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
setSupportActionBar(myToolbar);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
init();
final Intent intent = getIntent();
openMode = intent.getExtras().getInt("mode", 0);
if(openMode == 1){
id = intent.getLongExtra("id", 0);
old_title = intent.getStringExtra("title");
old_content = intent.getStringExtra("content");
old_time = intent.getStringExtra("time");
et_title.setText(old_title);
et_title.setSelection(old_title.length());
et.setText(old_content);
et.setSelection(old_content.length());
String[] wholeTime = old_time.split(" ");
String[] temp = wholeTime[0].split("-");
String[] temp1 = wholeTime[1].split(":");
setDateTV(Integer.parseInt(temp[0]), Integer.parseInt(temp[1]), Integer.parseInt(temp[2]));
setTimeTV(Integer.parseInt(temp1[0]), Integer.parseInt(temp1[1]));
}
if(isNightMode()) myToolbar.setNavigationIcon(getDrawable(R.drawable.ic_keyboard_arrow_left_white_24dp));
else myToolbar.setNavigationIcon(getDrawable(R.drawable.ic_keyboard_arrow_left_black_24dp));
myToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(!canBeSet()) {
Toast.makeText(EditAlarmActivity.this, "Invalid Time", Toast.LENGTH_SHORT).show();
}else if(et.getText().toString().length() + et_title.getText().toString().length() == 0 && openMode == 2){
Intent intent1 = new Intent();
intent1.putExtra("mode", -1);//nothing new happens.
setResult(RESULT_OK, intent1);
finish();//返回
overridePendingTransition(R.anim.in_lefttoright, R.anim.out_lefttoright);
}
else if (et_title.getText().toString().length() == 0) {
Toast.makeText(EditAlarmActivity.this, "Title cannot be empty", Toast.LENGTH_SHORT).show();
}
else {
isTimeChange();
Intent intent = new Intent();
if (openMode == 2) {
intent.putExtra("mode", 10); // new one plan;
intent.putExtra("title", et_title.getText().toString());
intent.putExtra("content", et.getText().toString());
intent.putExtra("time", date.getText().toString() + " " + time.getText().toString());
Log.d(TAG, date.getText().toString() + time.getText().toString());
} else {
if (et.getText().toString().equals(old_content) && et_title.getText().toString().equals(old_title) && !timeChange) {
intent.putExtra("mode", -1); // edit nothing
}
else {
intent.putExtra("mode", 11); //edit the content
intent.putExtra("title", et_title.getText().toString());
intent.putExtra("content", et.getText().toString());
intent.putExtra("time", date.getText().toString() + " " + time.getText().toString());
intent.putExtra("id", id);
}
}
setResult(RESULT_OK, intent);
finish();//返回
overridePendingTransition(R.anim.in_lefttoright, R.anim.out_lefttoright);
}
}
});
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
if( keyCode== KeyEvent.KEYCODE_HOME){
return true;
} else if( keyCode== KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN){
if(!canBeSet()) {
Toast.makeText(EditAlarmActivity.this, "Invalid Time", Toast.LENGTH_SHORT).show();
}else if(et.getText().toString().length() + et_title.getText().toString().length() == 0 && openMode == 2){
Intent intent1 = new Intent();
intent1.putExtra("mode", -1);//nothing new happens.
setResult(RESULT_OK, intent1);
finish();//返回
overridePendingTransition(R.anim.in_lefttoright, R.anim.out_lefttoright);
}
else if (et_title.getText().toString().length() == 0) {
Toast.makeText(EditAlarmActivity.this, "Title cannot be empty", Toast.LENGTH_SHORT).show();
}
else {
isTimeChange();
Intent intent = new Intent();
if (openMode == 2) {
intent.putExtra("mode", 10); // new one plan;
intent.putExtra("title", et_title.getText().toString());
intent.putExtra("content", et.getText().toString());
intent.putExtra("time", date.getText().toString() + " " + time.getText().toString());
Log.d(TAG, date.getText().toString() + time.getText().toString());
} else {
if (et.getText().toString().equals(old_content) && et_title.getText().toString().equals(old_title) && !timeChange) {
intent.putExtra("mode", -1); // edit nothing
}
else {
intent.putExtra("mode", 11); //edit the content
intent.putExtra("title", et_title.getText().toString());
intent.putExtra("content", et.getText().toString());
intent.putExtra("time", date.getText().toString() + " " + time.getText().toString());
intent.putExtra("id", id);
}
}
setResult(RESULT_OK, intent);
finish();//返回
overridePendingTransition(R.anim.in_lefttoright, R.anim.out_lefttoright);
}
}
return super.onKeyDown(keyCode, event);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.edit_menu, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
final Intent intent = new Intent();
switch (item.getItemId()){
case R.id.delete:
new AlertDialog.Builder(EditAlarmActivity.this)
.setMessage("Delete this plan ?")
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if(openMode == 2){
intent.putExtra("mode", -1); // delete the plan
setResult(RESULT_OK, intent);
}
else {
intent.putExtra("mode", 12); // delete the plan
intent.putExtra("id", id);
setResult(RESULT_OK, intent);
}
finish();
}
}).setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
}).create().show();
break;
}
return super.onOptionsItemSelected(item);
}
@Override
protected void needRefresh() {
setNightMode();
startActivity(new Intent(this, EditAlarmActivity.class));
overridePendingTransition(R.anim.night_switch, R.anim.night_switch_over);
finish();
}
private void init(){
plan = new Plan();
dateArray[0] = plan.getYear();
dateArray[1] = plan.getMonth() + 1;
dateArray[2] = plan.getDay();
timeArray[0] = plan.getHour();
timeArray[1] = plan.getMinute();
et_title = findViewById(R.id.et_title);
et = findViewById(R.id.et);
set_date = findViewById(R.id.set_date);
set_time = findViewById(R.id.set_time);
date = findViewById(R.id.date);
time = findViewById(R.id.time);
//initialize two textviews
setDateTV(dateArray[0], dateArray[1], dateArray[2]);
setTimeTV((timeArray[1]>54? timeArray[0]+1 : timeArray[0]), (timeArray[1]+5)%60);
Log.d(TAG, "init: "+dateArray[1]);
set_date.setOnClickListener(this);
set_time.setOnClickListener(this);
dateSetListener = new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
setDateTV(year, month+1, dayOfMonth);
}
};
timeSetListener = new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
setTimeTV(hourOfDay, minute);
}
};
}
private void setDateTV(int y, int m, int d){
//update tv and dateArray
String temp = y + "-";
if(m<10) temp += "0";
temp += (m + "-");
if(d<10) temp +="0";
temp += d;
date.setText(temp);
dateArray[0] = y;
dateArray[1] = m;
dateArray[2] = d;
}
private void setTimeTV(int h, int m){
//update tv and timeArra
String temp = "";
if(h<10) temp += "0";
temp += (h + ":");
if(m<10) temp += "0";
temp += m;
time.setText(temp);
timeArray[0] = h;
timeArray[1] = m;
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.set_date: //choose day
DatePickerDialog dialog = new DatePickerDialog(EditAlarmActivity.this,
(isNightMode()?R.style.NightDialogTheme :R.style.DayDialogTheme), dateSetListener,
dateArray[0], dateArray[1] - 1, dateArray[2]);
//dialog.getWindow().setBackgroundDrawable(new ColorDrawable((isNightMode()?Color.BLACK : Color.WHITE)));
dialog.show();
break;
case R.id.set_time://choose hour and minute
TimePickerDialog dialog1 = new TimePickerDialog(EditAlarmActivity.this,
(isNightMode()?R.style.NightDialogTheme :R.style.DayDialogTheme), timeSetListener,
timeArray[0], timeArray[1], true);
//dialog1.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialog1.show();
break;
}
}
private void isTimeChange(){
String newTime = date.getText().toString() + " " + time.getText().toString();
if(!newTime.equals(old_time)) timeChange = true;
}
private boolean canBeSet(){
Calendar calendar = Calendar.getInstance();
calendar.set(dateArray[0], dateArray[1] - 1, dateArray[2], timeArray[0], timeArray[1]);
Calendar cur = Calendar.getInstance();
Log.d(TAG, "canBeSet: " + cur.getTime().toString() + calendar.getTime().toString());
if(cur.before(calendar)) return true;
else {
Toast.makeText(this, "Invalid Time", Toast.LENGTH_SHORT).show();
return false;
}
}
}

@ -0,0 +1,91 @@
package cc.liuyx.note.alarm;
import android.util.Log;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class Plan {
private long id;
private String title;
private String content;
private Calendar planTime;
public Plan(String title, String content, String planTime) {
this.title = title;
this.content = content;
setTime(planTime);
}
public Plan(){
this.planTime = Calendar.getInstance();
}
public int getYear(){
return planTime.get(Calendar.YEAR);
}
public int getMonth(){
return planTime.get(Calendar.MONTH);
}
public int getDay() {
return planTime.get(Calendar.DAY_OF_MONTH);
}
public int getHour() {
return planTime.get(Calendar.HOUR_OF_DAY);
}
public int getMinute() {
return planTime.get(Calendar.MINUTE);
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Calendar getPlanTime() {
return planTime;
}
public String getTime(){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
return simpleDateFormat.format(planTime.getTime());
}
public void setTime(String format){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
try {
Date temp = simpleDateFormat.parse(format);
Log.d("shit", ""+temp);
planTime = Calendar.getInstance();
planTime.setTime(temp);
} catch (ParseException e) {
}
}
}

@ -0,0 +1,109 @@
package cc.liuyx.note.alarm;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Filter;
import android.widget.Filterable;
import android.widget.TextView;
import com.example.atry.R;
import java.util.ArrayList;
import java.util.List;
public class PlanAdapter extends BaseAdapter implements Filterable {
private Context mContext;
private List<Plan> backList;//用来备份原始数据
private List<Plan> planList;//这个数据是会改变的,所以要有个变量来备份一下原始数据
PlanAdapter.MyFilter mFilter;
public PlanAdapter(Context mContext, List<Plan> planList) {
this.mContext = mContext;
this.planList = planList;
backList = planList;
}
@Override
public int getCount() {
return planList.size();
}
@Override
public Object getItem(int position) {
return planList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(mContext);
mContext.setTheme((sharedPreferences.getBoolean("nightMode", false)? R.style.NightTheme: R.style.DayTheme));
View v = View.inflate(mContext, R.layout.plan_layout, null);
TextView tv_title = (TextView)v.findViewById(R.id.tv_title);
TextView tv_content = (TextView)v.findViewById(R.id.tv_content);
TextView tv_time = (TextView)v.findViewById(R.id.tv_time);
//Set text for TextView
tv_title.setText(planList.get(position).getTitle());
tv_content.setText(planList.get(position).getContent());
tv_time.setText(planList.get(position).getTime());
//Save plan id to tag
v.setTag(planList.get(position).getId());
return v;
}
@Override
public Filter getFilter() {
if (mFilter ==null){
mFilter = new PlanAdapter.MyFilter();
}
return mFilter;
}
class MyFilter extends Filter {
//我们在performFiltering(CharSequence charSequence)这个方法中定义过滤规则
@Override
protected FilterResults performFiltering(CharSequence charSequence) {
FilterResults result = new FilterResults();
List<Plan> list;
if (TextUtils.isEmpty(charSequence)) {//当过滤的关键字为空的时候,我们则显示所有的数据
list = backList;
} else {//否则把符合条件的数据对象添加到集合中
list = new ArrayList<>();
for (Plan plan : backList) {
if (plan.getTitle().contains(charSequence) || plan.getContent().contains(charSequence)) {
list.add(plan);
}
}
}
result.values = list; //将得到的集合保存到FilterResults的value变量中
result.count = list.size();//将集合的大小保存到FilterResults的count变量中
return result;
}
//在publishResults方法中告诉适配器更新界面
@Override
protected void publishResults(CharSequence charSequence, FilterResults filterResults) {
planList = (List<Plan>)filterResults.values;
if (filterResults.count>0){
notifyDataSetChanged();//通知数据发生了改变
}else {
notifyDataSetInvalidated();//通知数据失效
}
}
}
}

@ -0,0 +1,37 @@
package cc.liuyx.note.alarm;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class PlanDatabase extends SQLiteOpenHelper {
public static final String TABLE_NAME = "plans";
public static final String TITLE = "title";
public static final String CONTENT = "content";
public static final String ID = "_id";
public static final String TIME = "time";
public static final String MODE = "mode";
public PlanDatabase(Context context){
super(context, "plans", null, 1);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("CREATE TABLE "+ TABLE_NAME
+ "("
+ ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
+ TITLE + " TEXT NOT NULL,"
+ CONTENT + " TEXT,"
+ TIME + " TEXT NOT NULL)"
);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
}

@ -0,0 +1,91 @@
package cc.liuyx.note.db;
import android.annotation.SuppressLint;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import java.util.ArrayList;
import java.util.List;
import cc.liuyx.note.entity.Note;
public class CRUD {
SQLiteOpenHelper dbHandler;
SQLiteDatabase db;
private static final String[] columns = {
NoteDatabase.ID,
NoteDatabase.CONTENT,
NoteDatabase.TIME,
NoteDatabase.MODE
};
public CRUD(Context context){
dbHandler = new NoteDatabase(context);
}
public void open(){
db = dbHandler.getWritableDatabase();
}
public void close(){
dbHandler.close();
}
public void addNote(Note note){
//add a note object to database
ContentValues contentValues = new ContentValues();
contentValues.put(NoteDatabase.CONTENT, note.getContent());
contentValues.put(NoteDatabase.TIME, note.getTime());
contentValues.put(NoteDatabase.MODE, note.getTag());
long insertId = db.insert(NoteDatabase.TABLE_NAME, null, contentValues);
note.setId(insertId);
}
public Note getNote(long id){
//get a note from database using cursor index
Cursor cursor = db.query(NoteDatabase.TABLE_NAME,columns,NoteDatabase.ID + "=?",
new String[]{String.valueOf(id)},null,null, null, null);
if (cursor != null) cursor.moveToFirst();
assert cursor != null;
return new Note(cursor.getString(1),cursor.getString(2), cursor.getInt(3));
}
@SuppressLint("Range")
public List<Note> getAllNotes(){
Cursor cursor = db.query(NoteDatabase.TABLE_NAME,columns,null,null,null, null, null);
List<Note> notes = new ArrayList<>();
if(cursor.getCount() > 0){
while(cursor.moveToNext()){
Note note = new Note();
note.setId(cursor.getLong(cursor.getColumnIndex(NoteDatabase.ID)));
note.setContent(cursor.getString(cursor.getColumnIndex(NoteDatabase.CONTENT)));
note.setTime(cursor.getString(cursor.getColumnIndex(NoteDatabase.TIME)));
note.setTag(cursor.getInt(cursor.getColumnIndex(NoteDatabase.MODE)));
notes.add(note);
}
}
return notes;
}
public void updateNote(Note note) {
//update the info of an existing note
ContentValues values = new ContentValues();
values.put(NoteDatabase.CONTENT, note.getContent());
values.put(NoteDatabase.TIME, note.getTime());
values.put(NoteDatabase.MODE, note.getTag());
// updating row
db.update(NoteDatabase.TABLE_NAME, values,
NoteDatabase.ID + "=?", new String[]{String.valueOf(note.getId())});
}
public void removeNote(Note note) {
//remove a note according to ID value
db.delete(NoteDatabase.TABLE_NAME, NoteDatabase.ID + "=" + note.getId(), null);
}
}

@ -0,0 +1,54 @@
package cc.liuyx.note.db;
import android.annotation.SuppressLint;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
public class NoteDatabase extends SQLiteOpenHelper {
public static final String TABLE_NAME = "notes";
public static final String CONTENT = "content";
public static final String ID = "_id";
public static final String TIME = "time";
public static final String MODE = "mode";
public NoteDatabase(Context context) {
super(context, "notes", null, 1);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("CREATE TABLE " + TABLE_NAME
+ "("
+ ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
+ CONTENT + " TEXT NOT NULL,"
+ TIME + " TEXT NOT NULL,"
+ MODE + " INTEGER DEFAULT 1)"
);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
private void updateMode(SQLiteDatabase db) {
//version 1 -> 2, 增加 mode -- notes的分类默认为1
db.execSQL("alter table " + TABLE_NAME + " add column " + MODE);
Cursor cursor = db.rawQuery("select * from " + TABLE_NAME, null);
while (cursor.moveToNext()) {
@SuppressLint("Range") String content = cursor.getString(cursor.getColumnIndex(CONTENT));
@SuppressLint("Range") String time = cursor.getString(cursor.getColumnIndex(TIME));
@SuppressLint("Range") int mode = cursor.getInt(cursor.getColumnIndex(MODE));
ContentValues values = new ContentValues();
values.put(CONTENT, content);
values.put(TIME, time);
values.put(MODE, 1);
db.update(TABLE_NAME, values, CONTENT + "=?", new String[]{content});
}
Log.d("Base", "update db 1 - 2");
}
}

@ -0,0 +1,55 @@
package cc.liuyx.note.entity;
public class Note {
private long id;
private String content;
private String time;
private int tag;
public Note() {
}
public Note(String content, String time, int tag) {
this.content = content;
this.time = time;
this.tag = tag;
}
public long getId() {
return id;
}
public String getContent() {
return content;
}
public String getTime() {
return time;
}
public void setId(long id) {
this.id = id;
}
public void setContent(String content) {
this.content = content;
}
public void setTime(String time) {
this.time = time;
}
@Override
public String toString() {
return content + "\n" + time.substring(5,16) + " "+ id;
}
public int getTag() {
return tag;
}
public void setTag(int tag) {
this.tag = tag;
}
}

@ -0,0 +1,28 @@
package cc.liuyx.note.entity;
public class SpinnerItem {
private String tagName;
private int tagId;
public SpinnerItem(String tagName, int tagId) {
this.tagName = tagName;
this.tagId = tagId;
}
public String getTagName() {
return tagName;
}
public void setTagName(String tagName) {
this.tagName = tagName;
}
public int getTagId() {
return tagId;
}
public void setTagId(int tagId) {
this.tagId = tagId;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 定义从左向右进入的动画 -->
<translate
android:duration="400"
android:fromXDelta="-100%"
android:toXDelta="0" />
</set>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="400"
android:fromXDelta="100%"
android:toXDelta="0" />
</set>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:duration="600"
/>
</set>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:fromAlpha="0"
android:toAlpha="1"
android:duration="100"
android:interpolator="@android:anim/accelerate_interpolator">
</alpha>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:fromAlpha="1"
android:toAlpha="0"
android:duration="100"
android:interpolator="@android:anim/accelerate_interpolator">
</alpha>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
</set>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="400"
android:fromXDelta="0"
android:toXDelta="100%" />
</set>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 定义从右向左动画退出动画 -->
<translate
android:duration="400"
android:fromXDelta="0"
android:toXDelta="-100%" />
</set>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha
android:fromAlpha="1.0"
android:toAlpha="0.0"
android:duration="600"
/>
</set>

@ -0,0 +1,34 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeWidth="1"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#808080"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M7,10l5,5 5,-5z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#DFDFDF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M7,10l5,5 5,-5z"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,6v3l4,-4 -4,-4v3c-4.42,0 -8,3.58 -8,8 0,1.57 0.46,3.03 1.24,4.26L6.7,14.8c-0.45,-0.83 -0.7,-1.79 -0.7,-2.8 0,-3.31 2.69,-6 6,-6zM18.76,7.74L17.3,9.2c0.44,0.84 0.7,1.79 0.7,2.8 0,3.31 -2.69,6 -6,6v-3l-4,4 4,4v-3c4.42,0 8,-3.58 8,-8 0,-1.57 -0.46,-3.03 -1.24,-4.26z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,6v3l4,-4 -4,-4v3c-4.42,0 -8,3.58 -8,8 0,1.57 0.46,3.03 1.24,4.26L6.7,14.8c-0.45,-0.83 -0.7,-1.79 -0.7,-2.8 0,-3.31 2.69,-6 6,-6zM18.76,7.74L17.3,9.2c0.44,0.84 0.7,1.79 0.7,2.8 0,3.31 -2.69,6 -6,6v-3l-4,4 4,4v-3c4.42,0 8,-3.58 8,-8 0,-1.57 -0.46,-3.03 -1.24,-4.26z"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2L18,7L6,7v12zM8.46,11.88l1.41,-1.41L12,12.59l2.12,-2.12 1.41,1.41L13.41,14l2.12,2.12 -1.41,1.41L12,15.41l-2.12,2.12 -1.41,-1.41L10.59,14l-2.13,-2.12zM15.5,4l-1,-1h-5l-1,1L5,4v2h14L19,4z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2L18,7L6,7v12zM8.46,11.88l1.41,-1.41L12,12.59l2.12,-2.12 1.41,1.41L13.41,14l2.12,2.12 -1.41,1.41L12,15.41l-2.12,2.12 -1.41,-1.41L10.59,14l-2.13,-2.12zM15.5,4l-1,-1h-5l-1,1L5,4v2h14L19,4z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FF0000"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M11,15h2v2h-2zM11,7h2v6h-2zM11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M14.4,6L14,4H5v17h2v-7h5.6l0.4,2h7V6z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M14.4,6L14,4H5v17h2v-7h5.6l0.4,2h7V6z"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M15.41,16.09l-4.58,-4.59 4.58,-4.59L14,5.5l-6,6 6,6z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M15.41,16.09l-4.58,-4.59 4.58,-4.59L14,5.5l-6,6 6,6z"/>
</vector>

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#008577"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z"/>
</vector>

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M19,13H5v-2h14v2z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M19,13H5v-2h14v2z"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M19.1,12.9a2.8,2.8 0,0 0,0.1 -0.9,2.8 2.8,0 0,0 -0.1,-0.9l2.1,-1.6a0.7,0.7 0,0 0,0.1 -0.6L19.4,5.5a0.7,0.7 0,0 0,-0.6 -0.2l-2.4,1a6.5,6.5 0,0 0,-1.6 -0.9l-0.4,-2.6a0.5,0.5 0,0 0,-0.5 -0.4H10.1a0.5,0.5 0,0 0,-0.5 0.4L9.3,5.4a5.6,5.6 0,0 0,-1.7 0.9l-2.4,-1a0.4,0.4 0,0 0,-0.5 0.2l-2,3.4c-0.1,0.2 0,0.4 0.2,0.6l2,1.6a2.8,2.8 0,0 0,-0.1 0.9,2.8 2.8,0 0,0 0.1,0.9L2.8,14.5a0.7,0.7 0,0 0,-0.1 0.6l1.9,3.4a0.7,0.7 0,0 0,0.6 0.2l2.4,-1a6.5,6.5 0,0 0,1.6 0.9l0.4,2.6a0.5,0.5 0,0 0,0.5 0.4h3.8a0.5,0.5 0,0 0,0.5 -0.4l0.3,-2.6a5.6,5.6 0,0 0,1.7 -0.9l2.4,1a0.4,0.4 0,0 0,0.5 -0.2l2,-3.4c0.1,-0.2 0,-0.4 -0.2,-0.6ZM12,15.6A3.6,3.6 0,1 1,15.6 12,3.6 3.6,0 0,1 12,15.6Z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M19.1,12.9a2.8,2.8 0,0 0,0.1 -0.9,2.8 2.8,0 0,0 -0.1,-0.9l2.1,-1.6a0.7,0.7 0,0 0,0.1 -0.6L19.4,5.5a0.7,0.7 0,0 0,-0.6 -0.2l-2.4,1a6.5,6.5 0,0 0,-1.6 -0.9l-0.4,-2.6a0.5,0.5 0,0 0,-0.5 -0.4H10.1a0.5,0.5 0,0 0,-0.5 0.4L9.3,5.4a5.6,5.6 0,0 0,-1.7 0.9l-2.4,-1a0.4,0.4 0,0 0,-0.5 0.2l-2,3.4c-0.1,0.2 0,0.4 0.2,0.6l2,1.6a2.8,2.8 0,0 0,-0.1 0.9,2.8 2.8,0 0,0 0.1,0.9L2.8,14.5a0.7,0.7 0,0 0,-0.1 0.6l1.9,3.4a0.7,0.7 0,0 0,0.6 0.2l2.4,-1a6.5,6.5 0,0 0,1.6 0.9l0.4,2.6a0.5,0.5 0,0 0,0.5 0.4h3.8a0.5,0.5 0,0 0,0.5 -0.4l0.3,-2.6a5.6,5.6 0,0 0,1.7 -0.9l2.4,1a0.4,0.4 0,0 0,0.5 -0.2l2,-3.4c0.1,-0.2 0,-0.4 -0.2,-0.6ZM12,15.6A3.6,3.6 0,1 1,15.6 12,3.6 3.6,0 0,1 12,15.6Z"/>
</vector>

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 这是每条note的形状 -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- shadow -->
<item>
<shape android:shape="rectangle">
<solid android:color="?attr/lvBackground" />
<corners android:radius="6dp"/>
</shape>
</item>
<item android:bottom="3dp">
<shape android:shape="rectangle">
<solid android:color="?attr/tvBackground" />
<corners android:radius="6dp"/>
</shape>
</item>
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FF0000"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M22,5.72l-4.6,-3.86 -1.29,1.53 4.6,3.86L22,5.72zM7.88,3.39L6.6,1.86 2,5.71l1.29,1.53 4.59,-3.85zM12.5,8L11,8v6l4.75,2.85 0.75,-1.23 -4,-2.37L12.5,8zM12,4c-4.97,0 -9,4.03 -9,9s4.02,9 9,9c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,20c-3.87,0 -7,-3.13 -7,-7s3.13,-7 7,-7 7,3.13 7,7 -3.13,7 -7,7z"/>
</vector>

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape>
<corners android:radius="5dp" />
<solid android:color="?attr/tvBackground">
</solid>
</shape>
</item>
<item
android:gravity="end"
android:drawable="?attr/spinnerArrow" >
</item>
</layer-list>

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="0dp"
android:background="?attr/lvBackground"
android:orientation="vertical"
tools:context="cc.liuyx.note.MainActivity">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#66000000"
android:visibility="gone" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_margin="10dp"
android:clickable="true"
android:contentDescription="小记"
android:focusable="true"
app:backgroundTint="@color/q"
app:srcCompat="@drawable/ic_add_black_24dp" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_alarm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="80dp"
android:layout_marginBottom="10dp"
android:clickable="true"
android:contentDescription="计划"
android:focusable="true"
app:backgroundTint="@color/q"
app:srcCompat="@drawable/ic_flag_black_24dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="?attr/toolbarTheme"
app:popupTheme="@style/Toolbar.Title"
app:titleTextColor="?attr/titleColor">
<Switch
android:id="@+id/content_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="20dp"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:switchMinWidth="40dp" />
</android.support.v7.widget.Toolbar>
<LinearLayout
android:id="@+id/lv_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView
android:id="@+id/lv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/my_toolbar"
android:layout_marginLeft="10dp"
android:layout_marginTop="8dp"
android:layout_marginRight="10dp"
android:divider="?attr/lvBackground"
android:dividerHeight="8dp">
</ListView>
</LinearLayout>
<LinearLayout
android:id="@+id/lv_plan_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView
android:id="@+id/lv_plan"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/my_toolbar"
android:layout_marginLeft="10dp"
android:layout_marginTop="8dp"
android:layout_marginRight="10dp"
android:divider="?attr/lvBackground"
android:dividerHeight="8dp">
</ListView>
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/emptyView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="快去写下你的想法吧!"
android:textSize="20sp"
android:visibility="gone" />
</RelativeLayout>

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="?attr/lvBackground"
>
<android.support.v7.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
app:titleTextColor="?attr/titleColor"
app:title="新建计划"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
</android.support.v7.widget.Toolbar>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingLeft="5dp"
android:paddingRight="5dp">
<EditText
android:id="@+id/et_title"
android:layout_width="match_parent"
android:layout_height="60dp"
android:maxLines="1"
android:maxLength="20"
android:textSize="28dp"
android:textColor="?attr/tvMainColor"
android:hint="Title (20 chars max)"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="1.2">
<TextView
style="@style/centerTV"
android:id="@+id/date"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="18dp"
android:textColor="?attr/tvMainColor"/>
<Button
android:id="@+id/set_date"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Set Date"
/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="1">
<TextView
style="@style/centerTV"
android:id="@+id/time"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="18dp"
android:textColor="?attr/tvMainColor"/>
<Button
android:id="@+id/set_time"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Set Time"
/>
</LinearLayout>
</LinearLayout>
<EditText
android:id="@+id/et"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@null"
android:layout_margin="8dp"
android:textColor="?attr/tvMainColor"
android:textSize="24dp"
android:gravity="top"
android:hint="Content ( Optional )"
/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="?attr/lvBackground">
<android.support.v7.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
app:titleTextColor="?attr/titleColor"
app:title="新建笔记"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
<Spinner
android:id="@+id/spinner"
style="@style/spinner"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginStart="50dp"
android:dropDownWidth="wrap_content"
android:popupTheme="@style/spinnerPop"
android:spinnerMode="dropdown" />
</android.support.v7.widget.Toolbar>
<EditText
android:id="@+id/et"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="8dp"
android:gravity="top"
android:background="@null"
android:textColor="?attr/tvMainColor"
android:textSize="24dp" />
</LinearLayout>

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="5dp"
android:paddingBottom="12dp"
android:background="@drawable/note_shape"
android:outlineAmbientShadowColor="@color/black">
<TextView
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Content"
android:textSize="20dp"
android:textColor="?attr/tvMainColor"
android:singleLine="true"/>
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Time"
android:textSize="16dp"
android:textColor="@color/greyC"/>
</LinearLayout>

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingTop="5dp"
android:paddingBottom="12dp"
android:background="@drawable/note_shape"
android:outlineAmbientShadowColor="@color/black">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Title"
android:textSize="28dp"
android:singleLine="true"
android:textColor="?attr/tvMainColor"/>
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Time"
android:gravity="center"
android:textSize="24dp"
android:textColor="?attr/tvMainColor"/>
</LinearLayout>
<TextView
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Content"
android:textSize="20dp"
android:textColor="?attr/tvSubColor"
android:singleLine="true"/>
</LinearLayout>

@ -0,0 +1,253 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:background="?attr/lvBackground">
<android.support.v7.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
app:titleTextColor="?attr/titleColor"
app:title="设置"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="黑夜模式"
android:textColor="?attr/tvMainColor"
android:textSize="20dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_night_summary"
android:textColor="?attr/tvSubColor"
android:textSize="16dp" />
</LinearLayout>
<Switch
android:id="@+id/nightMode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:clickable="true"
android:gravity="center"
android:switchMinWidth="50dp"
/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:foreground="@color/greyC"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_reversesort"
android:textColor="?attr/tvMainColor"
android:textSize="20dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_reversesort_summary"
android:textColor="?attr/tvSubColor"
android:textSize="16dp" />
</LinearLayout>
<Switch
android:id="@+id/reverseSort"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:checked="false"
android:gravity="center"
android:switchMinWidth="50dp"
android:textOff="OFF"
android:textOn="ON" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:foreground="@color/greyC"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/fabColor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_fabcolor"
android:textColor="?attr/tvMainColor"
android:textSize="20dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_fabcolor_summary"
android:textColor="?attr/tvSubColor"
android:textSize="16dp" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="15dp"
android:layout_marginStart="15dp"
android:src="?attr/addTag"
/>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:foreground="@color/greyC"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/fabPlanColor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_fabplancolor"
android:textColor="?attr/tvMainColor"
android:textSize="20dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_fabplancolor_summary"
android:textColor="?attr/tvSubColor"
android:textSize="16dp" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="?attr/addPlanTag"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:layout_gravity="center_vertical"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:foreground="@color/greyC"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_notetitle"
android:textColor="?attr/tvMainColor"
android:textSize="20dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_notetitle_summary"
android:textColor="?attr/tvSubColor"
android:textSize="16dp" />
</LinearLayout>
<Switch
android:id="@+id/noteTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:clickable="true"
android:gravity="center"
android:switchMinWidth="50dp"
/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:foreground="@color/greyC"
/>
</LinearLayout>

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cover">
</View>
</LinearLayout>

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:title="Color of ADD button"
app:titleTextColor="?attr/titleColor"
/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1">
<TextView
style="@style/TVsetting"
android:text="Current:"
/>
<ImageView
android:id="@+id/curFab"
style="@style/IVsetting"
android:background="@color/q"
/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1">
<TextView
style="@style/TVsetting"
android:text="Default:"
/>
<ImageView
android:id="@+id/defFab"
style="@style/IVsetting"
android:background="@color/fabColor1"
/>
</LinearLayout>
</LinearLayout>
<TextView
style="@style/TVsetting"
android:text="Recommendation:"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/q"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_margin="10dp"
android:background="@color/q"
android:layout_weight="1"/>
<ImageView
android:id="@+id/w"
android:background="@color/w"
style="@style/IVsetting"/>
<ImageView
android:id="@+id/e"
style="@style/IVsetting"
android:background="@color/e" />
<ImageView
android:id="@+id/r"
android:background="@color/r"
style="@style/IVsetting"/>
<ImageView
android:id="@+id/t"
android:background="@color/t"
style="@style/IVsetting"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/y"
android:background="@color/y"
style="@style/IVsetting"/>
<ImageView
android:id="@+id/u"
android:background="@color/u"
style="@style/IVsetting"/>
<ImageView
android:id="@+id/i"
android:background="@color/i"
style="@style/IVsetting"/>
<ImageView
android:id="@+id/o"
android:background="@color/o"
style="@style/IVsetting"/>
<ImageView
android:id="@+id/p"
android:background="@color/p"
style="@style/IVsetting"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:focusable="true"
android:clickable="true"
android:background="?attr/lvBackground">
<android.support.v7.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:title="简言"
app:titleTextColor="?attr/titleColor"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:focusableInTouchMode="true"
android:clickable="true"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal"
android:focusable="true"
android:clickable="true"
>
<ImageView
android:id="@+id/setting_settings_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:src="?attr/settingIcon"
android:layout_gravity="center"
/>
<TextView
android:id="@+id/setting_settings_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="设置"
android:textColor="?attr/tvMainColor"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:layout_gravity="center"
android:textSize="18sp"/>
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/black"
android:alpha="0.2"/>
<ListView
android:id="@+id/lv_tag"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</ListView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal"
android:background="?attr/tvBackground">
<ImageView
android:layout_width="44dp"
android:layout_height="match_parent"
android:src="?attr/addTag"/>
<TextView
android:id="@+id/add_tag"
android:clickable="true"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Add New Tag"
android:gravity="center_vertical"
android:textColor="?attr/tvMainColor"
android:textSize="20sp"
android:layout_marginStart="12dp"
android:focusable="true" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="80dp" android:layout_height="wrap_content"
android:textColor="?attr/tvMainColor"
android:paddingLeft="12dp"
android:textSize="16dp"
>
</TextView>

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="48dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
>
<TextView
android:id="@+id/blank_tag"
android:layout_width="44dp"
android:textSize="22dp"
android:textColor="?attr/tvMainColor"
android:gravity="center"
android:layout_height="match_parent"
android:layout_gravity="center"
/>
<TextView
android:id="@+id/text_tag"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_marginStart="12dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:textColor="?attr/tvMainColor"
android:textSize="24dp" />
</LinearLayout>
<ImageView
android:id="@+id/delete_tag"
android:layout_width="44dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:visibility="invisible"
android:src="?attr/removeTag"
android:background="?attr/tvBackground"
android:clickable="true"
/>
</LinearLayout>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/delete"
android:icon="?attr/menu_delete"
android:title="Delete"
app:showAsAction="always"/>
</menu>

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
<item
android:id="@+id/refresh"
android:icon="?attr/renewIcon"
app:showAsAction="always"
android:title="Renew"
/>
<item
android:id="@+id/action_search"
android:icon="?attr/menu_search"
app:showAsAction="always"
app:actionViewClass="android.support.v7.widget.SearchView"
android:title="Search"
/>
<item
android:id="@+id/menu_clear"
android:icon="?attr/menu_delete_all"
android:title="Clear"
app:showAsAction="always"
/>
</menu>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save