Compare commits
24 Commits
Author | SHA1 | Date |
---|---|---|
Jenly | ad203b292d | 4 years ago |
Jenly | 00fd88c259 | 4 years ago |
Jenly | ed24593d5c | 4 years ago |
Jenly | b77f795b3d | 4 years ago |
Jenly | 2263780073 | 4 years ago |
Jenly | cbb98f0ff5 | 4 years ago |
Jenly | 165709991f | 4 years ago |
Jenly | 6d6848ed94 | 4 years ago |
Jenly | 0f335e154b | 4 years ago |
Jenly | 23a99f6cd9 | 4 years ago |
Jenly | dc5ff74a9e | 4 years ago |
jenly1314 | 21d9d4215e | 5 years ago |
jenly1314 | 46c743cb26 | 5 years ago |
jenly1314 | 888ce12ddc | 5 years ago |
jenly1314 | 32e71c030e | 5 years ago |
jenly1314 | 946b6e8550 | 5 years ago |
jenly1314 | d7a9bd8dd0 | 5 years ago |
jenly1314 | 6dee0be157 | 5 years ago |
jenly1314 | b68626587a | 5 years ago |
jenly1314 | bd74ae12ce | 5 years ago |
jenly1314 | 62210f4b88 | 5 years ago |
jenly1314 | 76f489f8d2 | 5 years ago |
jenly1314 | 4f4e977604 | 5 years ago |
jenly1314 | 38d7641303 | 5 years ago |
@ -0,0 +1,27 @@ |
||||
version: 2 |
||||
jobs: |
||||
build: |
||||
working_directory: ~/code |
||||
docker: |
||||
- image: circleci/android:api-28 |
||||
environment: |
||||
JVM_OPTS: -Xmx3200m |
||||
steps: |
||||
- checkout |
||||
- restore_cache: |
||||
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} |
||||
- run: |
||||
name: Download Dependencies |
||||
command: ./gradlew androidDependencies |
||||
- save_cache: |
||||
paths: |
||||
- ~/.gradle |
||||
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} |
||||
- run: |
||||
name: Run Tests |
||||
command: ./gradlew lint test |
||||
- store_artifacts: |
||||
path: app/build/reports |
||||
destination: reports |
||||
- store_test_results: |
||||
path: app/build/test-results |
Binary file not shown.
@ -1,52 +0,0 @@ |
||||
<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> |
@ -1,8 +0,0 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="CompilerConfiguration"> |
||||
<annotationProcessing> |
||||
<profile default="true" name="Default" enabled="true" /> |
||||
</annotationProcessing> |
||||
</component> |
||||
</project> |
@ -1,456 +0,0 @@ |
||||
<?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="true" /> |
||||
<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="true" /> |
||||
<loaded-nodes /> |
||||
</component> |
||||
<component name="DBNavigator.Project.DatabaseFileManager"> |
||||
<open-files /> |
||||
</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 /> |
||||
<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" /> |
||||
</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="NESTED TABLE" enabled="false" /> |
||||
<object-type name="COLUMN" enabled="false" /> |
||||
<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="TYPE ATTRIBUTE" enabled="false" /> |
||||
<object-type name="ARGUMENT" enabled="false" /> |
||||
<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> |
||||
<tracking-columns> |
||||
<columnNames value="" /> |
||||
<visible value="true" /> |
||||
<editable value="false" /> |
||||
</tracking-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="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> |
@ -1,6 +0,0 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="Encoding"> |
||||
<file url="PROJECT" charset="UTF-8" /> |
||||
</component> |
||||
</project> |
@ -1,20 +0,0 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="GradleSettings"> |
||||
<option name="linkedExternalProjectsSettings"> |
||||
<GradleProjectSettings> |
||||
<option name="distributionType" value="DEFAULT_WRAPPED" /> |
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" /> |
||||
<option name="modules"> |
||||
<set> |
||||
<option value="$PROJECT_DIR$" /> |
||||
<option value="$PROJECT_DIR$/app" /> |
||||
<option value="$PROJECT_DIR$/app-dialog" /> |
||||
<option value="$PROJECT_DIR$/app-updater" /> |
||||
</set> |
||||
</option> |
||||
<option name="resolveModulePerSourceSet" value="false" /> |
||||
</GradleProjectSettings> |
||||
</option> |
||||
</component> |
||||
</project> |
@ -1,83 +0,0 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="MarkdownProjectSettings" wasCopied="true"> |
||||
<PreviewSettings splitEditorLayout="SPLIT" splitEditorPreview="PREVIEW" useGrayscaleRendering="false" zoomFactor="1.0" maxImageWidth="0" showGitHubPageIfSynced="false" allowBrowsingInPreview="false" synchronizePreviewPosition="true" highlightPreviewType="NONE" highlightFadeOut="5" highlightOnTyping="true" synchronizeSourcePosition="true" verticallyAlignSourceAndPreviewSyncPosition="true" showSearchHighlightsInPreview="true" showSelectionInPreview="true" openRemoteLinks="true" replaceUnicodeEmoji="false" lastLayoutSetsDefault="false"> |
||||
<PanelProvider> |
||||
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.panel" providerName="Default - Swing" /> |
||||
</PanelProvider> |
||||
</PreviewSettings> |
||||
<ParserSettings gitHubSyntaxChange="false" emojiShortcuts="0" emojiImages="0"> |
||||
<PegdownExtensions> |
||||
<option name="ABBREVIATIONS" value="false" /> |
||||
<option name="ANCHORLINKS" value="true" /> |
||||
<option name="ASIDE" value="false" /> |
||||
<option name="ATXHEADERSPACE" value="true" /> |
||||
<option name="AUTOLINKS" value="true" /> |
||||
<option name="DEFINITIONS" value="false" /> |
||||
<option name="DEFINITION_BREAK_DOUBLE_BLANK_LINE" value="false" /> |
||||
<option name="FENCED_CODE_BLOCKS" value="true" /> |
||||
<option name="FOOTNOTES" value="false" /> |
||||
<option name="HARDWRAPS" value="false" /> |
||||
<option name="HTML_DEEP_PARSER" value="false" /> |
||||
<option name="INSERTED" value="false" /> |
||||
<option name="QUOTES" value="false" /> |
||||
<option name="RELAXEDHRULES" value="true" /> |
||||
<option name="SMARTS" value="false" /> |
||||
<option name="STRIKETHROUGH" value="true" /> |
||||
<option name="SUBSCRIPT" value="false" /> |
||||
<option name="SUPERSCRIPT" value="false" /> |
||||
<option name="SUPPRESS_HTML_BLOCKS" value="false" /> |
||||
<option name="SUPPRESS_INLINE_HTML" value="false" /> |
||||
<option name="TABLES" value="true" /> |
||||
<option name="TASKLISTITEMS" value="true" /> |
||||
<option name="TOC" value="false" /> |
||||
<option name="WIKILINKS" value="true" /> |
||||
</PegdownExtensions> |
||||
<ParserOptions> |
||||
<option name="ADMONITION_EXT" value="false" /> |
||||
<option name="ATTRIBUTES_EXT" value="false" /> |
||||
<option name="COMMONMARK_LISTS" value="false" /> |
||||
<option name="DUMMY" value="false" /> |
||||
<option name="EMOJI_SHORTCUTS" value="true" /> |
||||
<option name="ENUMERATED_REFERENCES_EXT" value="false" /> |
||||
<option name="FLEXMARK_FRONT_MATTER" value="false" /> |
||||
<option name="GFM_LOOSE_BLANK_LINE_AFTER_ITEM_PARA" value="true" /> |
||||
<option name="GFM_TABLE_RENDERING" value="true" /> |
||||
<option name="GITBOOK_URL_ENCODING" value="false" /> |
||||
<option name="GITHUB_LISTS" value="true" /> |
||||
<option name="GITHUB_WIKI_LINKS" value="true" /> |
||||
<option name="GITLAB_EXT" value="false" /> |
||||
<option name="GITLAB_MATH_EXT" value="false" /> |
||||
<option name="GITLAB_MERMAID_EXT" value="false" /> |
||||
<option name="HEADER_ID_NON_ASCII_TO_LOWERCASE" value="false" /> |
||||
<option name="HEADER_ID_NO_DUPED_DASHES" value="false" /> |
||||
<option name="JEKYLL_FRONT_MATTER" value="false" /> |
||||
<option name="MACROS_EXT" value="false" /> |
||||
<option name="NO_TEXT_ATTRIBUTES" value="false" /> |
||||
<option name="PARSE_HTML_ANCHOR_ID" value="false" /> |
||||
<option name="SIM_TOC_BLANK_LINE_SPACER" value="true" /> |
||||
</ParserOptions> |
||||
</ParserSettings> |
||||
<HtmlSettings headerTopEnabled="false" headerBottomEnabled="false" bodyTopEnabled="false" bodyBottomEnabled="false" embedUrlContent="false" addPageHeader="true" embedImages="false" embedHttpImages="false" imageUriSerials="false" addDocTypeHtml="true" noParaTags="false"> |
||||
<GeneratorProvider> |
||||
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.generator" providerName="Default Swing HTML Generator" /> |
||||
</GeneratorProvider> |
||||
<headerTop /> |
||||
<headerBottom /> |
||||
<bodyTop /> |
||||
<bodyBottom /> |
||||
</HtmlSettings> |
||||
<CssSettings previewScheme="UI_SCHEME" cssUri="" isCssUriEnabled="false" isCssUriSerial="false" isCssTextEnabled="false" isDynamicPageWidth="true"> |
||||
<StylesheetProvider> |
||||
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.css" providerName="Default Swing Stylesheet" /> |
||||
</StylesheetProvider> |
||||
<ScriptProviders /> |
||||
<cssText /> |
||||
<cssUriHistory /> |
||||
</CssSettings> |
||||
<HtmlExportSettings updateOnSave="false" parentDir="$ProjectFileDir$" targetDir="$ProjectFileDir$" cssDir="" scriptDir="" plainHtml="false" imageDir="" copyLinkedImages="false" imageUniquifyType="0" targetPathType="2" targetExt="" useTargetExt="false" noCssNoScripts="false" useElementStyleAttribute="false" linkToExportedHtml="true" exportOnSettingsChange="true" regenerateOnProjectOpen="false" linkFormatType="HTTP_ABSOLUTE" /> |
||||
<LinkMapSettings> |
||||
<textMaps /> |
||||
</LinkMapSettings> |
||||
</component> |
||||
</project> |
@ -1,3 +0,0 @@ |
||||
<component name="MarkdownNavigator.ProfileManager"> |
||||
<settings default="" pdf-export="" plain-text-search-scope="Project Files" /> |
||||
</component> |
@ -1,38 +0,0 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="NullableNotNullManager"> |
||||
<option name="myDefaultNullable" value="android.support.annotation.Nullable" /> |
||||
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" /> |
||||
<option name="myNullables"> |
||||
<value> |
||||
<list size="7"> |
||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" /> |
||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" /> |
||||
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" /> |
||||
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" /> |
||||
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" /> |
||||
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" /> |
||||
<item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" /> |
||||
</list> |
||||
</value> |
||||
</option> |
||||
<option name="myNotNulls"> |
||||
<value> |
||||
<list size="6"> |
||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" /> |
||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" /> |
||||
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" /> |
||||
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" /> |
||||
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" /> |
||||
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" /> |
||||
</list> |
||||
</value> |
||||
</option> |
||||
</component> |
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" 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> |
@ -1,12 +0,0 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="RunConfigurationProducerService"> |
||||
<option name="ignoredProducers"> |
||||
<set> |
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" /> |
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" /> |
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" /> |
||||
</set> |
||||
</option> |
||||
</component> |
||||
</project> |
@ -1,6 +0,0 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="VcsDirectoryMappings"> |
||||
<mapping directory="" vcs="Git" /> |
||||
</component> |
||||
</project> |
@ -0,0 +1,3 @@ |
||||
POM_NAME=App Dialog |
||||
POM_ARTIFACT_ID=app-dialog |
||||
POM_PACKAGING=aar |
@ -0,0 +1,251 @@ |
||||
package com.king.app.dialog; |
||||
|
||||
import android.content.Context; |
||||
import android.support.annotation.IdRes; |
||||
import android.support.annotation.LayoutRes; |
||||
import android.support.annotation.NonNull; |
||||
import android.support.annotation.StringRes; |
||||
import android.support.annotation.StyleRes; |
||||
import android.view.View; |
||||
|
||||
/** |
||||
* @author Jenly <a href="mailto:jenly1314@gmail.com">Jenly</a> |
||||
*/ |
||||
public class BaseDialogConfig { |
||||
|
||||
/** |
||||
* 布局ID |
||||
*/ |
||||
@LayoutRes int layoutId; |
||||
/** |
||||
* 标题视图ID |
||||
*/ |
||||
@IdRes int titleId = R.id.tvDialogTitle; |
||||
/** |
||||
* 内容视图ID |
||||
*/ |
||||
@IdRes int contentId = R.id.tvDialogContent; |
||||
/** |
||||
* 取消视图ID(左边按钮) |
||||
*/ |
||||
@IdRes int cancelId = R.id.btnDialogCancel; |
||||
/** |
||||
* 确定视图ID(右边按钮) |
||||
*/ |
||||
@IdRes int okId = R.id.btnDialogOK; |
||||
/** |
||||
* 按钮中间分割线ID |
||||
*/ |
||||
@IdRes int lineId = R.id.line; |
||||
|
||||
/** |
||||
* 样式ID |
||||
*/ |
||||
@StyleRes int styleId = R.style.app_dialog; |
||||
|
||||
/** |
||||
* 标题文本 |
||||
*/ |
||||
CharSequence title; |
||||
/** |
||||
* 内容文本 |
||||
*/ |
||||
CharSequence content; |
||||
/** |
||||
* 取消按钮文本 |
||||
*/ |
||||
CharSequence cancel; |
||||
/** |
||||
* 确定按钮文本 |
||||
*/ |
||||
CharSequence ok; |
||||
/** |
||||
* 是否隐藏取消按钮,如果隐藏取消则底部只显示一个按钮 |
||||
*/ |
||||
boolean isHideCancel; |
||||
/** |
||||
* 是否隐藏标题 |
||||
*/ |
||||
boolean isHideTitle; |
||||
|
||||
View.OnClickListener onClickCancel; |
||||
|
||||
View.OnClickListener onClickOk; |
||||
|
||||
public BaseDialogConfig(){ |
||||
this(R.layout.app_dialog); |
||||
} |
||||
|
||||
public BaseDialogConfig(@LayoutRes int layoutId){ |
||||
this.layoutId = layoutId; |
||||
} |
||||
|
||||
|
||||
public @LayoutRes int getLayoutId() { |
||||
return layoutId; |
||||
} |
||||
|
||||
/** |
||||
* @param layoutId |
||||
* @return |
||||
* @deprecated 即将废弃,下一个版本可能会移除此方法 |
||||
*/ |
||||
@Deprecated |
||||
public BaseDialogConfig setLayoutId(@IdRes int layoutId) { |
||||
this.layoutId = layoutId; |
||||
return this; |
||||
} |
||||
|
||||
public int getTitleId() { |
||||
return titleId; |
||||
} |
||||
|
||||
public BaseDialogConfig setTitleId(@IdRes int titleId) { |
||||
this.titleId = titleId; |
||||
return this; |
||||
} |
||||
|
||||
public int getStyleId() { |
||||
return styleId; |
||||
} |
||||
|
||||
public BaseDialogConfig setStyleId(@IdRes int styleId) { |
||||
this.styleId = styleId; |
||||
return this; |
||||
} |
||||
|
||||
public @IdRes int getContentId() { |
||||
return contentId; |
||||
} |
||||
|
||||
public BaseDialogConfig setContentId(@IdRes int contentId) { |
||||
this.contentId = contentId; |
||||
return this; |
||||
} |
||||
|
||||
public @IdRes int getCancelId() { |
||||
return cancelId; |
||||
} |
||||
|
||||
public BaseDialogConfig setCancelId(@IdRes int cancelId) { |
||||
this.cancelId = cancelId; |
||||
return this; |
||||
} |
||||
|
||||
public @IdRes int getOkId() { |
||||
return okId; |
||||
} |
||||
|
||||
public BaseDialogConfig setOkId(@IdRes int okId) { |
||||
this.okId = okId; |
||||
return this; |
||||
} |
||||
|
||||
public @IdRes int getLineId() { |
||||
return lineId; |
||||
} |
||||
|
||||
public BaseDialogConfig setLineId(@IdRes int lineId) { |
||||
this.lineId = lineId; |
||||
return this; |
||||
} |
||||
|
||||
public CharSequence getTitle() { |
||||
return title; |
||||
} |
||||
|
||||
public BaseDialogConfig setTitle(CharSequence title) { |
||||
this.title = title; |
||||
return this; |
||||
} |
||||
|
||||
public BaseDialogConfig setTitle(@NonNull Context context, @StringRes int resId) { |
||||
this.title = context.getString(resId); |
||||
return this; |
||||
} |
||||
|
||||
public CharSequence getContent() { |
||||
return content; |
||||
} |
||||
|
||||
public BaseDialogConfig setContent(CharSequence content) { |
||||
this.content = content; |
||||
return this; |
||||
} |
||||
|
||||
public CharSequence getCancel() { |
||||
return cancel; |
||||
} |
||||
|
||||
public BaseDialogConfig setCancel(CharSequence cancel) { |
||||
this.cancel = cancel; |
||||
return this; |
||||
} |
||||
|
||||
public BaseDialogConfig setCancel(@NonNull Context context, @StringRes int resId) { |
||||
this.cancel = context.getString(resId); |
||||
return this; |
||||
} |
||||
|
||||
public CharSequence getOk() { |
||||
return ok; |
||||
} |
||||
|
||||
public BaseDialogConfig setOk(CharSequence ok) { |
||||
this.ok = ok; |
||||
return this; |
||||
} |
||||
|
||||
public BaseDialogConfig setOk(@NonNull Context context, @StringRes int resId) { |
||||
this.ok = context.getString(resId); |
||||
return this; |
||||
} |
||||
|
||||
public boolean isHideCancel() { |
||||
return isHideCancel; |
||||
} |
||||
|
||||
public BaseDialogConfig setHideCancel(boolean hideCancel) { |
||||
isHideCancel = hideCancel; |
||||
return this; |
||||
} |
||||
|
||||
public boolean isHideTitle(){ |
||||
return isHideTitle; |
||||
} |
||||
|
||||
public BaseDialogConfig setHideTitle(boolean hideTitle){ |
||||
isHideTitle = hideTitle; |
||||
return this; |
||||
} |
||||
|
||||
public View.OnClickListener getOnClickCancel() { |
||||
return onClickCancel; |
||||
} |
||||
|
||||
/** |
||||
* 设置“取消”按钮点击监听,不设置默认点击关闭弹框 |
||||
* @param onClickCancel |
||||
* @return |
||||
*/ |
||||
public BaseDialogConfig setOnClickCancel(View.OnClickListener onClickCancel) { |
||||
this.onClickCancel = onClickCancel; |
||||
return this; |
||||
} |
||||
|
||||
public View.OnClickListener getOnClickOk() { |
||||
return onClickOk; |
||||
} |
||||
|
||||
/** |
||||
* 设置“确定”按钮点击监听,不设置默认点击关闭弹框 |
||||
* @param onClickOk |
||||
* @return |
||||
*/ |
||||
public BaseDialogConfig setOnClickOk(View.OnClickListener onClickOk) { |
||||
this.onClickOk = onClickOk; |
||||
return this; |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,3 @@ |
||||
POM_NAME=App Updater |
||||
POM_ARTIFACT_ID=app-updater |
||||
POM_PACKAGING=aar |
@ -0,0 +1,231 @@ |
||||
package com.king.app.updater.http; |
||||
|
||||
import android.os.AsyncTask; |
||||
import android.support.annotation.NonNull; |
||||
import android.support.annotation.Nullable; |
||||
import android.util.Log; |
||||
|
||||
import com.king.app.updater.constant.Constants; |
||||
import com.king.app.updater.util.SSLSocketFactoryUtils; |
||||
|
||||
import org.apache.http.conn.ssl.SSLSocketFactory; |
||||
|
||||
import java.io.File; |
||||
import java.io.FileOutputStream; |
||||
import java.io.InputStream; |
||||
import java.net.ConnectException; |
||||
import java.util.Map; |
||||
import java.util.concurrent.TimeUnit; |
||||
|
||||
import okhttp3.Call; |
||||
import okhttp3.OkHttpClient; |
||||
import okhttp3.Request; |
||||
import okhttp3.Response; |
||||
|
||||
/** |
||||
* OkHttpManager使用{@link OkHttpClient}实现{@link IHttpManager} |
||||
* 使用OkHttpManager时必须依赖OkHttp库 |
||||
* @author <a href="mailto:jenly1314@gmail.com">Jenly</a> |
||||
*/ |
||||
public class OkHttpManager implements IHttpManager { |
||||
|
||||
private static final int DEFAULT_TIME_OUT = 20000; |
||||
|
||||
private OkHttpClient okHttpClient; |
||||
|
||||
private boolean isCancel; |
||||
|
||||
private static volatile OkHttpManager INSTANCE; |
||||
|
||||
public static OkHttpManager getInstance(){ |
||||
if(INSTANCE == null){ |
||||
synchronized (HttpManager.class){ |
||||
if(INSTANCE == null){ |
||||
INSTANCE = new OkHttpManager(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
return INSTANCE; |
||||
} |
||||
|
||||
private OkHttpManager(){ |
||||
this(DEFAULT_TIME_OUT); |
||||
} |
||||
|
||||
/** |
||||
* HttpManager对外暴露。如果没有特殊需求,推荐使用{@link HttpManager#getInstance()} |
||||
* @param timeout 超时时间,单位:毫秒 |
||||
*/ |
||||
public OkHttpManager(int timeout){ |
||||
this(new OkHttpClient.Builder() |
||||
.readTimeout(timeout, TimeUnit.MILLISECONDS) |
||||
.connectTimeout(timeout, TimeUnit.MILLISECONDS) |
||||
.sslSocketFactory(SSLSocketFactoryUtils.createSSLSocketFactory(),SSLSocketFactoryUtils.createTrustAllManager()) |
||||
.hostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER) |
||||
.build()); |
||||
} |
||||
|
||||
/** |
||||
* HttpManager对外暴露,推荐使用{@link HttpManager#getInstance()} |
||||
* @param okHttpClient {@link OkHttpClient} |
||||
*/ |
||||
public OkHttpManager(@NonNull OkHttpClient okHttpClient){ |
||||
this.okHttpClient = okHttpClient; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public void download(String url,final String path,final String filename, @Nullable Map<String, String> requestProperty,final DownloadCallback callback) { |
||||
isCancel = false; |
||||
new DownloadTask(okHttpClient,url,path,filename,requestProperty,callback).execute(); |
||||
} |
||||
|
||||
@Override |
||||
public void cancel() { |
||||
isCancel = true; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 异步下载任务 |
||||
*/ |
||||
private class DownloadTask extends AsyncTask<Void,Long,File> { |
||||
private String url; |
||||
|
||||
private String path; |
||||
|
||||
private String filename; |
||||
|
||||
private Map<String,String> requestProperty; |
||||
|
||||
private DownloadCallback callback; |
||||
|
||||
private Exception exception; |
||||
|
||||
private OkHttpClient okHttpClient; |
||||
|
||||
public DownloadTask(OkHttpClient okHttpClient,String url, String path, String filename ,@Nullable Map<String,String> requestProperty, DownloadCallback callback){ |
||||
this.okHttpClient = okHttpClient; |
||||
this.url = url; |
||||
this.path = path; |
||||
this.filename = filename; |
||||
this.callback = callback; |
||||
this.requestProperty = requestProperty; |
||||
|
||||
} |
||||
|
||||
@Override |
||||
protected File doInBackground(Void... voids) { |
||||
|
||||
try{ |
||||
Request.Builder builder = new Request.Builder() |
||||
.url(url) |
||||
.addHeader("Accept-Encoding", "identity") |
||||
.get(); |
||||
|
||||
if(requestProperty!=null){ |
||||
for(Map.Entry<String,String> entry : requestProperty.entrySet()){ |
||||
builder.addHeader(entry.getKey(),entry.getValue()); |
||||
} |
||||
} |
||||
|
||||
Call call = okHttpClient.newCall(builder.build()); |
||||
Response response = call.execute(); |
||||
|
||||
if(response.isSuccessful()){ |
||||
InputStream is = response.body().byteStream(); |
||||
|
||||
long length = response.body().contentLength(); |
||||
|
||||
Log.d(Constants.TAG,"contentLength:" + length); |
||||
|
||||
long progress = 0; |
||||
|
||||
byte[] buffer = new byte[8192]; |
||||
|
||||
int len; |
||||
File file = new File(path,filename); |
||||
FileOutputStream fos = new FileOutputStream(file); |
||||
while ((len = is.read(buffer)) != -1){ |
||||
if(isCancel){ |
||||
if(call != null){ |
||||
call.cancel(); |
||||
} |
||||
cancel(true); |
||||
break; |
||||
} |
||||
fos.write(buffer,0,len); |
||||
progress += len; |
||||
//更新进度
|
||||
if(length > 0){ |
||||
publishProgress(progress,length); |
||||
} |
||||
} |
||||
|
||||
fos.flush(); |
||||
fos.close(); |
||||
is.close(); |
||||
|
||||
response.close(); |
||||
|
||||
if(progress <= 0 && length <= 0){ |
||||
throw new IllegalStateException(String.format("contentLength = %d",length)); |
||||
} |
||||
|
||||
return file; |
||||
|
||||
}else {//连接失败
|
||||
throw new ConnectException(String.format("responseCode = %d",response.code())); |
||||
} |
||||
|
||||
}catch (Exception e){ |
||||
this.exception = e; |
||||
e.printStackTrace(); |
||||
} |
||||
|
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
protected void onPreExecute() { |
||||
super.onPreExecute(); |
||||
if(callback != null){ |
||||
callback.onStart(url); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
protected void onPostExecute(File file) { |
||||
super.onPostExecute(file); |
||||
if(callback != null){ |
||||
if(file != null){ |
||||
callback.onFinish(file); |
||||
}else{ |
||||
callback.onError(exception); |
||||
} |
||||
|
||||
} |
||||
} |
||||
|
||||
@Override |
||||
protected void onProgressUpdate(Long... values) { |
||||
super.onProgressUpdate(values); |
||||
if(callback != null){ |
||||
if(!isCancelled()){ |
||||
callback.onProgress(values[0],values[1]); |
||||
} |
||||
|
||||
} |
||||
} |
||||
|
||||
@Override |
||||
protected void onCancelled() { |
||||
super.onCancelled(); |
||||
if(callback != null){ |
||||
callback.onCancel(); |
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
@ -0,0 +1,222 @@ |
||||
package com.king.app.updater.util; |
||||
|
||||
import android.app.Notification; |
||||
import android.app.NotificationChannel; |
||||
import android.app.NotificationManager; |
||||
import android.app.PendingIntent; |
||||
import android.content.Context; |
||||
import android.content.Intent; |
||||
import android.os.Build; |
||||
import android.support.annotation.DrawableRes; |
||||
import android.support.annotation.RequiresApi; |
||||
import android.support.v4.app.NotificationCompat; |
||||
|
||||
import com.king.app.updater.UpdateConfig; |
||||
import com.king.app.updater.constant.Constants; |
||||
import com.king.app.updater.service.DownloadService; |
||||
|
||||
import java.io.File; |
||||
|
||||
/** |
||||
* @author <a href="mailto:jenly1314@gmail.com">Jenly</a> |
||||
*/ |
||||
public class NotificationUtils { |
||||
|
||||
private NotificationUtils(){ |
||||
throw new AssertionError(); |
||||
} |
||||
|
||||
/** |
||||
* 显示开始下载是的通知 |
||||
* @param notifyId |
||||
* @param channelId |
||||
* @param channelName |
||||
* @param icon |
||||
* @param title |
||||
* @param content |
||||
*/ |
||||
public static void showStartNotification(Context context, int notifyId,String channelId, String channelName,@DrawableRes int icon,CharSequence title,CharSequence content,boolean isVibrate,boolean isSound){ |
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ |
||||
createNotificationChannel(context,channelId,channelName,isVibrate,isSound); |
||||
} |
||||
NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content); |
||||
builder.setPriority(NotificationManager.IMPORTANCE_HIGH); |
||||
if(isVibrate && isSound){ |
||||
builder.setDefaults(Notification.DEFAULT_VIBRATE | Notification.DEFAULT_SOUND); |
||||
}else if(isVibrate){ |
||||
builder.setDefaults(Notification.DEFAULT_VIBRATE); |
||||
}else if(isSound){ |
||||
builder.setDefaults(Notification.DEFAULT_SOUND); |
||||
} |
||||
|
||||
Notification notification = builder.build(); |
||||
notification.flags = Notification.FLAG_NO_CLEAR | Notification.FLAG_ONLY_ALERT_ONCE; |
||||
notifyNotification(context,notifyId,notification); |
||||
} |
||||
|
||||
/** |
||||
* 显示下载中的通知(更新进度) |
||||
* @param notifyId |
||||
* @param channelId |
||||
* @param icon |
||||
* @param title |
||||
* @param content |
||||
* @param progress |
||||
* @param size |
||||
*/ |
||||
public static void showProgressNotification(Context context, int notifyId,String channelId,@DrawableRes int icon,CharSequence title,CharSequence content,int progress,int size){ |
||||
NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content,progress,size); |
||||
|
||||
Notification notification = builder.build(); |
||||
notification.flags = Notification.FLAG_NO_CLEAR | Notification.FLAG_ONLY_ALERT_ONCE; |
||||
notifyNotification(context,notifyId,notification); |
||||
} |
||||
|
||||
/** |
||||
* 显示下载完成时的通知(点击安装) |
||||
* @param notifyId |
||||
* @param channelId |
||||
* @param icon |
||||
* @param title |
||||
* @param content |
||||
* @param file |
||||
*/ |
||||
public static void showFinishNotification(Context context, int notifyId, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, File file, String authority){ |
||||
cancelNotification(context,notifyId); |
||||
NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content); |
||||
builder.setAutoCancel(true); |
||||
Intent intent = AppUtils.getInstallIntent(context,file,authority); |
||||
PendingIntent clickIntent = PendingIntent.getActivity(context, notifyId,intent, PendingIntent.FLAG_UPDATE_CURRENT); |
||||
builder.setContentIntent(clickIntent); |
||||
Notification notification = builder.build(); |
||||
notification.flags = Notification.FLAG_AUTO_CANCEL; |
||||
notifyNotification(context,notifyId,notification); |
||||
} |
||||
|
||||
/** |
||||
* 现在下载失败通知 |
||||
* @param context |
||||
* @param notifyId |
||||
* @param channelId |
||||
* @param icon |
||||
* @param title |
||||
* @param content |
||||
* @param isReDownload |
||||
* @param config |
||||
*/ |
||||
public static void showErrorNotification(Context context, int notifyId, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, boolean isReDownload, UpdateConfig config){ |
||||
NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content); |
||||
builder.setAutoCancel(true); |
||||
if(isReDownload){//重新下载
|
||||
Intent intent = new Intent(context, DownloadService.class); |
||||
intent.putExtra(Constants.KEY_RE_DOWNLOAD,true); |
||||
intent.putExtra(Constants.KEY_UPDATE_CONFIG,config); |
||||
PendingIntent clickIntent = PendingIntent.getService(context, notifyId,intent, PendingIntent.FLAG_UPDATE_CURRENT); |
||||
builder.setContentIntent(clickIntent); |
||||
}else{ |
||||
PendingIntent clickIntent = PendingIntent.getService(context, notifyId,new Intent(), PendingIntent.FLAG_UPDATE_CURRENT); |
||||
builder.setContentIntent(clickIntent); |
||||
} |
||||
|
||||
Notification notification = builder.build(); |
||||
notification.flags = Notification.FLAG_AUTO_CANCEL; |
||||
notifyNotification(context,notifyId,notification); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 显示通知信息(非第一次) |
||||
* @param notifyId |
||||
* @param channelId |
||||
* @param icon |
||||
* @param title |
||||
* @param content |
||||
*/ |
||||
public static void showNotification(Context context, int notifyId,String channelId,@DrawableRes int icon,CharSequence title,CharSequence content,boolean isAutoCancel){ |
||||
NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content); |
||||
builder.setAutoCancel(isAutoCancel); |
||||
Notification notification = builder.build(); |
||||
notification.flags = Notification.FLAG_AUTO_CANCEL; |
||||
notifyNotification(context,notifyId,notification); |
||||
} |
||||
|
||||
/** |
||||
* 取消通知 |
||||
* @param notifyId |
||||
*/ |
||||
public static void cancelNotification(Context context, int notifyId){ |
||||
getNotificationManager(context).cancel(notifyId); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 获取通知管理器 |
||||
* @return |
||||
*/ |
||||
public static NotificationManager getNotificationManager(Context context){ |
||||
return (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE); |
||||
} |
||||
|
||||
/** |
||||
* 创建一个通知渠道(兼容0以上版本) |
||||
* @param channelId |
||||
* @param channelName |
||||
*/ |
||||
@RequiresApi(api = Build.VERSION_CODES.O) |
||||
public static void createNotificationChannel(Context context, String channelId, String channelName,boolean isVibrate,boolean isSound){ |
||||
NotificationChannel channel = new NotificationChannel(channelId,channelName, NotificationManager.IMPORTANCE_HIGH); |
||||
channel.enableVibration(isVibrate); |
||||
if(!isSound){ |
||||
channel.setSound(null,null); |
||||
} |
||||
getNotificationManager(context).createNotificationChannel(channel); |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 构建一个通知构建器 |
||||
* @param channelId |
||||
* @param icon |
||||
* @param title |
||||
* @param content |
||||
* @return |
||||
*/ |
||||
private static NotificationCompat.Builder buildNotification(Context context, String channelId, @DrawableRes int icon,CharSequence title,CharSequence content){ |
||||
return buildNotification(context,channelId,icon,title,content,Constants.NONE,Constants.NONE); |
||||
} |
||||
|
||||
/** |
||||
* 构建一个通知构建器 |
||||
* @param channelId |
||||
* @param icon |
||||
* @param title |
||||
* @param content |
||||
* @param progress |
||||
* @param size |
||||
* @return |
||||
*/ |
||||
private static NotificationCompat.Builder buildNotification(Context context, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, int progress, int size){ |
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(context,channelId); |
||||
builder.setSmallIcon(icon); |
||||
|
||||
builder.setContentTitle(title); |
||||
builder.setContentText(content); |
||||
builder.setOngoing(true); |
||||
|
||||
if(progress!= Constants.NONE && size!=Constants.NONE){ |
||||
builder.setProgress(size,progress,false); |
||||
} |
||||
|
||||
return builder; |
||||
} |
||||
|
||||
/** |
||||
* 更新通知栏 |
||||
* @param id |
||||
* @param notification |
||||
*/ |
||||
private static void notifyNotification(Context context, int id, Notification notification){ |
||||
getNotificationManager(context).notify(id,notification); |
||||
} |
||||
|
||||
} |
Binary file not shown.
@ -1 +1 @@ |
||||
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":5,"versionName":"1.0.4","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] |
||||
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":17,"versionName":"1.0.10","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] |
Loading…
Reference in new issue