From 3f36a53b67173c08ced9b90fd36e36471892b2bc Mon Sep 17 00:00:00 2001 From: Waheed Nazir Date: Thu, 11 Feb 2021 00:21:30 +0800 Subject: [PATCH] 1) Code cleaning 2) Migrated to AndroidX 3) Kotlin code refactored. --- .idea/codeStyles/Project.xml | 16 ++ .idea/compiler.xml | 1 + .idea/jarRepositories.xml | 25 ++ ...droidx_annotation_annotation_1_0_0_jar.xml | 11 - ...androidx_appcompat_appcompat_1_0_0_aar.xml | 15 -- ...droidx_arch_core_core_common_2_0_0_jar.xml | 11 - ...roidx_arch_core_core_runtime_2_0_0_aar.xml | 5 + ...inflater_asynclayoutinflater_1_0_0_aar.xml | 12 - ...__androidx_cardview_cardview_1_0_0_aar.xml | 3 + ...droidx_collection_collection_1_0_0_jar.xml | 11 - ...atorlayout_coordinatorlayout_1_0_0_aar.xml | 15 -- .../Gradle__androidx_core_core_1_0_0_aar.xml | 15 -- ..._cursoradapter_cursoradapter_1_0_0_aar.xml | 5 + ...droidx_customview_customview_1_0_0_aar.xml | 5 + ...dx_documentfile_documentfile_1_0_0_aar.xml | 12 - ...dx_drawerlayout_drawerlayout_1_0_0_aar.xml | 6 + ...__androidx_fragment_fragment_1_0_0_aar.xml | 15 -- ...dx_interpolator_interpolator_1_0_0_aar.xml | 5 + ...egacy_legacy_support_core_ui_1_0_0_aar.xml | 12 - ...cy_legacy_support_core_utils_1_0_0_aar.xml | 12 - ...x_lifecycle_lifecycle_common_2_0_0_jar.xml | 11 - ...lifecycle_lifecycle_livedata_2_0_0_aar.xml | 5 + ...ycle_lifecycle_livedata_core_2_0_0_aar.xml | 5 + ..._lifecycle_lifecycle_runtime_2_0_0_aar.xml | 12 - ...ifecycle_lifecycle_viewmodel_2_0_0_aar.xml | 12 - ...adle__androidx_loader_loader_1_0_0_aar.xml | 5 + ...anager_localbroadcastmanager_1_0_0_aar.xml | 5 +- ...Gradle__androidx_print_print_1_0_0_aar.xml | 15 -- ...dx_recyclerview_recyclerview_1_0_0_aar.xml | 15 -- ...panelayout_slidingpanelayout_1_0_0_aar.xml | 12 - ...eshlayout_swiperefreshlayout_1_0_0_aar.xml | 15 -- ...droidx_transition_transition_1_0_0_aar.xml | 15 -- ...ectordrawable_vectordrawable_1_0_0_aar.xml | 12 - ...able_vectordrawable_animated_1_0_0_aar.xml | 12 - ...rcelable_versionedparcelable_1_0_0_aar.xml | 12 - ...androidx_viewpager_viewpager_1_0_0_aar.xml | 5 + ...le_android_material_material_1_0_0_aar.xml | 13 - ...le__org_jetbrains_annotations_13_0_jar.xml | 11 - ...brains_kotlin_kotlin_stdlib_1_3_21_jar.xml | 11 - ...kotlin_kotlin_stdlib_common_1_3_21_jar.xml | 11 - ...s_kotlin_kotlin_stdlib_jdk7_1_3_21_jar.xml | 11 - .idea/misc.xml | 2 +- .idea/modules.xml | 4 +- 73)WebViewAppKotlin.iml | 19 -- app/app.iml | 236 ------------------ app/build.gradle | 9 +- app/src/main/AndroidManifest.xml | 38 +-- .../utilities/NetworkChangeReceiver.kt | 4 +- .../webappkotlin}/utilities/NetworkUtils.kt | 2 +- .../webappkotlin}/view/WebViewActivity.kt | 90 ++++--- app/src/main/res/menu/menu_main.xml | 2 +- build.gradle | 4 +- gradle/wrapper/gradle-wrapper.properties | 4 +- local.properties | 4 +- 54 files changed, 187 insertions(+), 668 deletions(-) create mode 100644 .idea/jarRepositories.xml delete mode 100644 .idea/libraries/Gradle__androidx_annotation_annotation_1_0_0_jar.xml delete mode 100644 .idea/libraries/Gradle__androidx_appcompat_appcompat_1_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__androidx_arch_core_core_common_2_0_0_jar.xml delete mode 100644 .idea/libraries/Gradle__androidx_asynclayoutinflater_asynclayoutinflater_1_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__androidx_collection_collection_1_0_0_jar.xml delete mode 100644 .idea/libraries/Gradle__androidx_coordinatorlayout_coordinatorlayout_1_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__androidx_core_core_1_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__androidx_documentfile_documentfile_1_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__androidx_fragment_fragment_1_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__androidx_legacy_legacy_support_core_ui_1_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__androidx_legacy_legacy_support_core_utils_1_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_0_0_jar.xml delete mode 100644 .idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__androidx_print_print_1_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__androidx_recyclerview_recyclerview_1_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__androidx_slidingpanelayout_slidingpanelayout_1_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__androidx_transition_transition_1_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__com_google_android_material_material_1_0_0_aar.xml delete mode 100644 .idea/libraries/Gradle__org_jetbrains_annotations_13_0_jar.xml delete mode 100644 .idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_3_21_jar.xml delete mode 100644 .idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_common_1_3_21_jar.xml delete mode 100644 .idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_jdk7_1_3_21_jar.xml delete mode 100644 73)WebViewAppKotlin.iml delete mode 100644 app/app.iml rename app/src/main/java/com/{finja/payrollplus => wavetech/webappkotlin}/utilities/NetworkChangeReceiver.kt (94%) rename app/src/main/java/com/{finja/payrollplus => wavetech/webappkotlin}/utilities/NetworkUtils.kt (92%) rename app/src/main/java/com/{finja/payrollplus => wavetech/webappkotlin}/view/WebViewActivity.kt (77%) diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 1bec35e..31d977a 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,6 +1,22 @@ + + diff --git a/.idea/compiler.xml b/.idea/compiler.xml index d05235f..6015108 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -8,5 +8,6 @@ + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..a5f05cd --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_annotation_annotation_1_0_0_jar.xml b/.idea/libraries/Gradle__androidx_annotation_annotation_1_0_0_jar.xml deleted file mode 100644 index 3fea121..0000000 --- a/.idea/libraries/Gradle__androidx_annotation_annotation_1_0_0_jar.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_0_0_aar.xml deleted file mode 100644 index 4da5e81..0000000 --- a/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_0_0_aar.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_arch_core_core_common_2_0_0_jar.xml b/.idea/libraries/Gradle__androidx_arch_core_core_common_2_0_0_jar.xml deleted file mode 100644 index 83e1a45..0000000 --- a/.idea/libraries/Gradle__androidx_arch_core_core_common_2_0_0_jar.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_0_0_aar.xml b/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_0_0_aar.xml index 1d540fb..dbb0b29 100644 --- a/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_0_0_aar.xml +++ b/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_0_0_aar.xml @@ -3,6 +3,11 @@ + + + + + diff --git a/.idea/libraries/Gradle__androidx_asynclayoutinflater_asynclayoutinflater_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_asynclayoutinflater_asynclayoutinflater_1_0_0_aar.xml deleted file mode 100644 index 5f6a69b..0000000 --- a/.idea/libraries/Gradle__androidx_asynclayoutinflater_asynclayoutinflater_1_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_cardview_cardview_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_cardview_cardview_1_0_0_aar.xml index 836aede..218cf60 100644 --- a/.idea/libraries/Gradle__androidx_cardview_cardview_1_0_0_aar.xml +++ b/.idea/libraries/Gradle__androidx_cardview_cardview_1_0_0_aar.xml @@ -3,6 +3,9 @@ + + + diff --git a/.idea/libraries/Gradle__androidx_collection_collection_1_0_0_jar.xml b/.idea/libraries/Gradle__androidx_collection_collection_1_0_0_jar.xml deleted file mode 100644 index 2fee65b..0000000 --- a/.idea/libraries/Gradle__androidx_collection_collection_1_0_0_jar.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_coordinatorlayout_coordinatorlayout_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_coordinatorlayout_coordinatorlayout_1_0_0_aar.xml deleted file mode 100644 index 77789a2..0000000 --- a/.idea/libraries/Gradle__androidx_coordinatorlayout_coordinatorlayout_1_0_0_aar.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_core_core_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_core_core_1_0_0_aar.xml deleted file mode 100644 index 393368b..0000000 --- a/.idea/libraries/Gradle__androidx_core_core_1_0_0_aar.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml index 842ad04..93be6e9 100644 --- a/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml +++ b/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml @@ -3,6 +3,11 @@ + + + + + diff --git a/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml index a7deabf..a0189c9 100644 --- a/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml +++ b/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml @@ -3,6 +3,11 @@ + + + + + diff --git a/.idea/libraries/Gradle__androidx_documentfile_documentfile_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_documentfile_documentfile_1_0_0_aar.xml deleted file mode 100644 index ebf0607..0000000 --- a/.idea/libraries/Gradle__androidx_documentfile_documentfile_1_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml index 09bb0d2..41a3f29 100644 --- a/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml +++ b/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml @@ -2,10 +2,16 @@ + + + + + + diff --git a/.idea/libraries/Gradle__androidx_fragment_fragment_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_fragment_fragment_1_0_0_aar.xml deleted file mode 100644 index 9405166..0000000 --- a/.idea/libraries/Gradle__androidx_fragment_fragment_1_0_0_aar.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml index e087f13..9d41b2e 100644 --- a/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml +++ b/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml @@ -3,6 +3,11 @@ + + + + + diff --git a/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_ui_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_ui_1_0_0_aar.xml deleted file mode 100644 index f61006c..0000000 --- a/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_ui_1_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_utils_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_utils_1_0_0_aar.xml deleted file mode 100644 index 1f6e291..0000000 --- a/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_utils_1_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_0_0_jar.xml b/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_0_0_jar.xml deleted file mode 100644 index f2e418b..0000000 --- a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_0_0_jar.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml b/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml index 59d89a3..10e305f 100644 --- a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml +++ b/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml @@ -3,6 +3,11 @@ + + + + + diff --git a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_0_0_aar.xml b/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_0_0_aar.xml index eb7d316..aec763e 100644 --- a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_0_0_aar.xml +++ b/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_0_0_aar.xml @@ -3,6 +3,11 @@ + + + + + diff --git a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_0_0_aar.xml b/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_0_0_aar.xml deleted file mode 100644 index 3617c4d..0000000 --- a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_0_0_aar.xml b/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_0_0_aar.xml deleted file mode 100644 index 1b4fc64..0000000 --- a/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml index b58d264..cbc2727 100644 --- a/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml +++ b/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml @@ -3,6 +3,11 @@ + + + + + diff --git a/.idea/libraries/Gradle__androidx_localbroadcastmanager_localbroadcastmanager_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_localbroadcastmanager_localbroadcastmanager_1_0_0_aar.xml index 204bf4e..88c94c2 100644 --- a/.idea/libraries/Gradle__androidx_localbroadcastmanager_localbroadcastmanager_1_0_0_aar.xml +++ b/.idea/libraries/Gradle__androidx_localbroadcastmanager_localbroadcastmanager_1_0_0_aar.xml @@ -1,8 +1,9 @@ - - + + + diff --git a/.idea/libraries/Gradle__androidx_print_print_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_print_print_1_0_0_aar.xml deleted file mode 100644 index 8d1bc0c..0000000 --- a/.idea/libraries/Gradle__androidx_print_print_1_0_0_aar.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_recyclerview_recyclerview_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_recyclerview_recyclerview_1_0_0_aar.xml deleted file mode 100644 index 6f7e1b4..0000000 --- a/.idea/libraries/Gradle__androidx_recyclerview_recyclerview_1_0_0_aar.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_slidingpanelayout_slidingpanelayout_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_slidingpanelayout_slidingpanelayout_1_0_0_aar.xml deleted file mode 100644 index 00fe1e0..0000000 --- a/.idea/libraries/Gradle__androidx_slidingpanelayout_slidingpanelayout_1_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml deleted file mode 100644 index 7cd5578..0000000 --- a/.idea/libraries/Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_transition_transition_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_transition_transition_1_0_0_aar.xml deleted file mode 100644 index 4045552..0000000 --- a/.idea/libraries/Gradle__androidx_transition_transition_1_0_0_aar.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_0_0_aar.xml deleted file mode 100644 index 69d326c..0000000 --- a/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_0_0_aar.xml deleted file mode 100644 index 3ffd325..0000000 --- a/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_0_0_aar.xml deleted file mode 100644 index 8463d95..0000000 --- a/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_0_0_aar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml b/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml index b26114c..7c01170 100644 --- a/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml +++ b/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml @@ -3,6 +3,11 @@ + + + + + diff --git a/.idea/libraries/Gradle__com_google_android_material_material_1_0_0_aar.xml b/.idea/libraries/Gradle__com_google_android_material_material_1_0_0_aar.xml deleted file mode 100644 index e9e86d2..0000000 --- a/.idea/libraries/Gradle__com_google_android_material_material_1_0_0_aar.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0_jar.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0_jar.xml deleted file mode 100644 index 93524e8..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0_jar.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_3_21_jar.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_3_21_jar.xml deleted file mode 100644 index 33bb7c9..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_3_21_jar.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_common_1_3_21_jar.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_common_1_3_21_jar.xml deleted file mode 100644 index eda94cd..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_common_1_3_21_jar.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_jdk7_1_3_21_jar.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_jdk7_1_3_21_jar.xml deleted file mode 100644 index 1279d47..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_jdk7_1_3_21_jar.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 703e5d4..3378229 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -5,7 +5,7 @@ - + diff --git a/.idea/modules.xml b/.idea/modules.xml index 7e111e9..8b5a63c 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,8 +2,8 @@ - - + + \ No newline at end of file diff --git a/73)WebViewAppKotlin.iml b/73)WebViewAppKotlin.iml deleted file mode 100644 index e2a9a9a..0000000 --- a/73)WebViewAppKotlin.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/app.iml b/app/app.iml deleted file mode 100644 index 8fdb74e..0000000 --- a/app/app.iml +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 7343276..700f7e1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,13 +5,13 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { - compileSdkVersion 28 + compileSdkVersion 30 flavorDimensions "default" defaultConfig { applicationId "com.wavetech.webappkotlin" minSdkVersion 16 - targetSdkVersion 28 + targetSdkVersion 30 versionCode 1 versionName "1.0" } @@ -47,6 +47,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'com.android.support:appcompat-v7:28.0.0' - implementation 'com.android.support:design:28.0.0' + implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'com.google.android.material:material:1.2.1' + implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4d77ded..e65c40d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,10 +1,11 @@ + xmlns:tools="http://schemas.android.com/tools" + package="com.wavetech.webappkotlin"> - - - + + + + android:theme="@style/AppTheme" + tools:targetApi="m"> - + - + - - + + - - + + + android:scheme="https" /> + android:scheme="http" /> - + diff --git a/app/src/main/java/com/finja/payrollplus/utilities/NetworkChangeReceiver.kt b/app/src/main/java/com/wavetech/webappkotlin/utilities/NetworkChangeReceiver.kt similarity index 94% rename from app/src/main/java/com/finja/payrollplus/utilities/NetworkChangeReceiver.kt rename to app/src/main/java/com/wavetech/webappkotlin/utilities/NetworkChangeReceiver.kt index de0e330..9573c3f 100644 --- a/app/src/main/java/com/finja/payrollplus/utilities/NetworkChangeReceiver.kt +++ b/app/src/main/java/com/wavetech/webappkotlin/utilities/NetworkChangeReceiver.kt @@ -1,11 +1,11 @@ -package com.finja.payrollplus.utilities +package com.wavetech.webappkotlin.utilities import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.net.ConnectivityManager import androidx.localbroadcastmanager.content.LocalBroadcastManager -import com.finja.payrollplus.R +import com.wavetech.webappkotlin.R class NetworkChangeReceiver : BroadcastReceiver() { diff --git a/app/src/main/java/com/finja/payrollplus/utilities/NetworkUtils.kt b/app/src/main/java/com/wavetech/webappkotlin/utilities/NetworkUtils.kt similarity index 92% rename from app/src/main/java/com/finja/payrollplus/utilities/NetworkUtils.kt rename to app/src/main/java/com/wavetech/webappkotlin/utilities/NetworkUtils.kt index 2dad827..476dfff 100644 --- a/app/src/main/java/com/finja/payrollplus/utilities/NetworkUtils.kt +++ b/app/src/main/java/com/wavetech/webappkotlin/utilities/NetworkUtils.kt @@ -1,4 +1,4 @@ -package com.finja.payrollplus.utilities +package com.wavetech.webappkotlin.utilities import android.content.Context import android.net.ConnectivityManager diff --git a/app/src/main/java/com/finja/payrollplus/view/WebViewActivity.kt b/app/src/main/java/com/wavetech/webappkotlin/view/WebViewActivity.kt similarity index 77% rename from app/src/main/java/com/finja/payrollplus/view/WebViewActivity.kt rename to app/src/main/java/com/wavetech/webappkotlin/view/WebViewActivity.kt index c2375c9..bd89b29 100644 --- a/app/src/main/java/com/finja/payrollplus/view/WebViewActivity.kt +++ b/app/src/main/java/com/wavetech/webappkotlin/view/WebViewActivity.kt @@ -1,4 +1,4 @@ -package com.finja.payrollplus.view +package com.wavetech.webappkotlin.view import android.annotation.SuppressLint import android.app.AlertDialog @@ -16,14 +16,14 @@ import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatDialog import androidx.localbroadcastmanager.content.LocalBroadcastManager -import com.finja.payrollplus.BuildConfig -import com.finja.payrollplus.R -import com.finja.payrollplus.utilities.NetworkChangeReceiver -import com.finja.payrollplus.utilities.NetworkUtils +import com.wavetech.webappkotlin.BuildConfig +import com.wavetech.webappkotlin.R +import com.wavetech.webappkotlin.utilities.NetworkChangeReceiver +import com.wavetech.webappkotlin.utilities.NetworkUtils import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.general_custom_dialog_network_error.* -class WebViewActivity : AppCompatActivity() { +open class WebViewActivity : AppCompatActivity() { private val networkUtils = NetworkUtils() private val networkChangeReceiver = NetworkChangeReceiver() @@ -50,8 +50,8 @@ class WebViewActivity : AppCompatActivity() { if (networkUtils.haveNetworkConnection(this@WebViewActivity)) { loadWeb(BuildConfig.URL) } else { - imgv_network_error.setVisibility(View.GONE) - webView.setVisibility(View.VISIBLE) + imgv_network_error.visibility = View.GONE + webView.visibility = View.VISIBLE overlayView.visibility = View.VISIBLE connectionLostAlert("Quit", BuildConfig.URL) } @@ -60,12 +60,12 @@ class WebViewActivity : AppCompatActivity() { /** */ @SuppressLint("SetJavaScriptEnabled", "AddJavascriptInterface", "ClickableViewAccessibility") - private fun loadWeb(url: String?) { - val webSettings = webView.getSettings() - webSettings.setJavaScriptEnabled(true) - webSettings.setBuiltInZoomControls(false) - webView.setWebViewClient(myWebClient()) - webView.setWebChromeClient(MyWebChromeClient()) + private fun loadWeb(url: String) { + val webSettings = webView.settings + webSettings.javaScriptEnabled = true + webSettings.builtInZoomControls = false + webView.webViewClient = myWebClient() + webView.webChromeClient = MyWebChromeClient() webView.addJavascriptInterface(JavaScriptHandler(), "Your_Handler_NAME") try { webView.loadData("", "text/html", null) @@ -74,9 +74,9 @@ class WebViewActivity : AppCompatActivity() { e.printStackTrace() } - webView.setOnTouchListener { _, event -> + webView.setOnTouchListener { _, _ -> if (!networkUtils.haveNetworkConnection(this)) { - connectionLostAlert("Quit", webView.getUrl()) + webView.url?.let { connectionLostAlert("Quit", it) } } false } @@ -94,12 +94,12 @@ class WebViewActivity : AppCompatActivity() { inner class myWebClient : WebViewClient() { override fun onPageStarted(view: WebView, url: String, favicon: Bitmap?) { if (networkUtils.haveNetworkConnection(this@WebViewActivity)) { - imgv_network_error.setVisibility(View.GONE) - webView.setVisibility(View.VISIBLE) + imgv_network_error.visibility = View.GONE + webView.visibility = View.VISIBLE overlayView.visibility = View.VISIBLE super.onPageStarted(view, url, favicon) } else { - webView.setVisibility(View.GONE) + webView.visibility = View.GONE imgv_network_error.setVisibility(View.VISIBLE) overlayView.visibility = View.VISIBLE connectionLostAlert("Quit", url) @@ -108,16 +108,20 @@ class WebViewActivity : AppCompatActivity() { override fun onPageFinished(view: WebView, url: String) { if (networkUtils.haveNetworkConnection(this@WebViewActivity)) { - webView.setVisibility(View.VISIBLE) + webView.visibility = View.VISIBLE overlayView.visibility = View.GONE super.onPageFinished(view, url) } } - override fun onReceivedError(view: WebView, request: WebResourceRequest, error: WebResourceError) { + override fun onReceivedError( + view: WebView, + request: WebResourceRequest, + error: WebResourceError + ) { try { - webView.setVisibility(View.GONE) - imgv_network_error.setVisibility(View.VISIBLE) + webView.visibility = View.GONE + imgv_network_error.visibility = View.VISIBLE overlayView.visibility = View.VISIBLE } catch (e: Exception) { e.printStackTrace() @@ -131,7 +135,12 @@ class WebViewActivity : AppCompatActivity() { */ internal inner class MyWebChromeClient : WebChromeClient() { - override fun onJsConfirm(view: WebView, url: String, message: String, result: JsResult): Boolean { + override fun onJsConfirm( + view: WebView, + url: String, + message: String, + result: JsResult + ): Boolean { return super.onJsConfirm(view, url, message, result) } @@ -145,7 +154,12 @@ class WebViewActivity : AppCompatActivity() { return super.onJsPrompt(view, url, message, defaultValue, result) } - override fun onJsAlert(view: WebView, url: String, message: String, result: JsResult): Boolean { + override fun onJsAlert( + view: WebView, + url: String, + message: String, + result: JsResult + ): Boolean { result.confirm() if (message.equals("exit", ignoreCase = true)) { finish() @@ -181,7 +195,7 @@ class WebViewActivity : AppCompatActivity() { /** * Back Press Alert Dialog */ - fun generalDailog(title: String, message: String) { + private fun generalDailog(title: String, message: String) { try { val builder = AlertDialog.Builder(this@WebViewActivity) @@ -214,13 +228,14 @@ class WebViewActivity : AppCompatActivity() { if (intent != null && intent.extras != null && !intent.extras!!.isEmpty) { if (!intent.getBooleanExtra("isConnected", false)) { - var url = "" - if (webView.getUrl() == null) { - url = BuildConfig.URL + val url = if (webView.url == null) { + BuildConfig.URL } else { - url = webView.getUrl(); + webView.url + } + url?.let { url1 -> + connectionLostAlert("Quit", url1) } - connectionLostAlert("Quit", url) } } } @@ -274,17 +289,17 @@ class WebViewActivity : AppCompatActivity() { /** */ - protected fun isTextEmpty(text: String?): Boolean { + private fun isTextEmpty(text: String?): Boolean { var result = "" - try { + return try { if (text != null) { result = text.trim { it <= ' ' } - return result.isEmpty() || result.equals("null", ignoreCase = true) + result.isEmpty() || result.equals("null", ignoreCase = true) } else { - return true + true } } catch (e: Exception) { - return false + false } } @@ -294,7 +309,8 @@ class WebViewActivity : AppCompatActivity() { */ override fun onDestroy() { try { - LocalBroadcastManager.getInstance(this).unregisterReceiver(mNotificationReceiverInternet) + LocalBroadcastManager.getInstance(this) + .unregisterReceiver(mNotificationReceiverInternet) LocalBroadcastManager.getInstance(this).unregisterReceiver(networkChangeReceiver) } catch (e: Exception) { e.printStackTrace() diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml index 6990f1e..361c66e 100644 --- a/app/src/main/res/menu/menu_main.xml +++ b/app/src/main/res/menu/menu_main.xml @@ -1,7 +1,7 @@ + tools:context="com.wavetech.webappkotlin.view.WebViewActivity">