Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| de5f4f881f | |||
| 0d1e462563 | |||
| 1fbb7ebadf | |||
| aaec7b4768 | |||
| 903b281f8c | |||
| 564797c2c9 | |||
| 42c1685176 | |||
| d52ce68cf5 | |||
| 6f260fd0b0 | |||
| e3dd446623 | |||
| 0f5fabea00 | |||
| ffd20ef524 | |||
| 883cbf0756 |
@@ -0,0 +1,9 @@
|
|||||||
|
*.iml
|
||||||
|
.gradle
|
||||||
|
/local.properties
|
||||||
|
/.idea/workspace.xml
|
||||||
|
/.idea/libraries
|
||||||
|
.DS_Store
|
||||||
|
/build
|
||||||
|
/captures
|
||||||
|
.externalNativeBuild
|
||||||
Generated
+3
@@ -0,0 +1,3 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
Generated
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="AndroidProjectSystem">
|
||||||
|
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+14
File diff suppressed because one or more lines are too long
Generated
+41
@@ -0,0 +1,41 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="AppInsightsSettings">
|
||||||
|
<option name="selectedTabId" value="Firebase Crashlytics" />
|
||||||
|
<option name="tabSettings">
|
||||||
|
<map>
|
||||||
|
<entry key="Android Vitals">
|
||||||
|
<value>
|
||||||
|
<InsightsFilterSettings>
|
||||||
|
<option name="connection">
|
||||||
|
<ConnectionSetting>
|
||||||
|
<option name="appId" value="com.cpm.abbott" />
|
||||||
|
</ConnectionSetting>
|
||||||
|
</option>
|
||||||
|
<option name="signal" value="SIGNAL_UNSPECIFIED" />
|
||||||
|
<option name="timeIntervalDays" value="SEVEN_DAYS" />
|
||||||
|
<option name="visibilityType" value="ALL" />
|
||||||
|
</InsightsFilterSettings>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="Firebase Crashlytics">
|
||||||
|
<value>
|
||||||
|
<InsightsFilterSettings>
|
||||||
|
<option name="connection">
|
||||||
|
<ConnectionSetting>
|
||||||
|
<option name="appId" value="cpm.com.gskmtorange" />
|
||||||
|
<option name="mobileSdkAppId" value="1:310038602345:android:dab7010946bd056dd1f8f8" />
|
||||||
|
<option name="projectId" value="gskorangev2" />
|
||||||
|
<option name="projectNumber" value="310038602345" />
|
||||||
|
</ConnectionSetting>
|
||||||
|
</option>
|
||||||
|
<option name="signal" value="SIGNAL_UNSPECIFIED" />
|
||||||
|
<option name="timeIntervalDays" value="THIRTY_DAYS" />
|
||||||
|
<option name="visibilityType" value="ALL" />
|
||||||
|
</InsightsFilterSettings>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+32
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="WizardSettings">
|
||||||
|
<option name="children">
|
||||||
|
<map>
|
||||||
|
<entry key="vectorWizard">
|
||||||
|
<value>
|
||||||
|
<PersistentState>
|
||||||
|
<option name="children">
|
||||||
|
<map>
|
||||||
|
<entry key="vectorAssetStep">
|
||||||
|
<value>
|
||||||
|
<PersistentState>
|
||||||
|
<option name="values">
|
||||||
|
<map>
|
||||||
|
<entry key="assetSourceType" value="FILE" />
|
||||||
|
<entry key="outputName" value="social_media" />
|
||||||
|
<entry key="sourceFile" value="C:\Users\ravik\Downloads\social-media (1).svg" />
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</PersistentState>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</PersistentState>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+1870
File diff suppressed because it is too large
Load Diff
Generated
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<bytecodeTargetLevel target="17" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+10
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="deploymentTargetDropDown">
|
||||||
|
<value>
|
||||||
|
<entry key="GSKMTOrange">
|
||||||
|
<State />
|
||||||
|
</entry>
|
||||||
|
</value>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+18
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="deploymentTargetSelector">
|
||||||
|
<selectionStates>
|
||||||
|
<SelectionState runConfigName="GSKMTOrange">
|
||||||
|
<option name="selectionMode" value="DROPDOWN" />
|
||||||
|
<DropdownSelection timestamp="2026-04-28T11:27:59.892971400Z">
|
||||||
|
<Target type="DEFAULT_BOOT">
|
||||||
|
<handle>
|
||||||
|
<DeviceId pluginId="PhysicalDevice" identifier="serial=HA1712TP" />
|
||||||
|
</handle>
|
||||||
|
</Target>
|
||||||
|
</DropdownSelection>
|
||||||
|
<DialogSelection />
|
||||||
|
</SelectionState>
|
||||||
|
</selectionStates>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+13
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DeviceTable">
|
||||||
|
<option name="columnSorters">
|
||||||
|
<list>
|
||||||
|
<ColumnSorterState>
|
||||||
|
<option name="column" value="Name" />
|
||||||
|
<option name="order" value="ASCENDING" />
|
||||||
|
</ColumnSorterState>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+20
@@ -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="CHOOSE_PER_TEST" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="gradleJvm" value="jbr-21" />
|
||||||
|
<option name="modules">
|
||||||
|
<set>
|
||||||
|
<option value="$PROJECT_DIR$" />
|
||||||
|
<option value="$PROJECT_DIR$/GSKMTOrange" />
|
||||||
|
<option value="$PROJECT_DIR$/library" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</GradleProjectSettings>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+30
@@ -0,0 +1,30 @@
|
|||||||
|
<?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="maven" />
|
||||||
|
<option name="name" value="maven" />
|
||||||
|
<option name="url" value="https://jitpack.io" />
|
||||||
|
</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>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="KotlinJpsPluginSettings">
|
||||||
|
<option name="version" value="1.9.22" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+10
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectMigrations">
|
||||||
|
<option name="MigrateToGradleLocalJavaHome">
|
||||||
|
<set>
|
||||||
|
<option value="$PROJECT_DIR$" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+59
@@ -0,0 +1,59 @@
|
|||||||
|
<project version="4">
|
||||||
|
<component name="DesignSurface">
|
||||||
|
<option name="filePathToZoomLevelMap">
|
||||||
|
<map>
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_daily_data_menu.xml" value="0.11277173913043478" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_login.xml" value="0.25" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_msl__availability.xml" value="0.115625" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_msl__availability_stock_facing.xml" value="0.11197916666666667" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_order_confirm.xml" value="0.2" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_order_status_detail.xml" value="0.22" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_order_taking.xml" value="0.2" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_visit_type_status.xml" value="0.11875" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_daily_main_menu.xml" value="0.13697916666666668" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_msl__availability_stock_facing.xml" value="0.11197916666666667" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_order_status_detail.xml" value="0.17" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_order_taking.xml" value="0.11197916666666667" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_store_wise_performance.xml" value="0.11302083333333333" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/contentcatgoryadpterlayout.xml" value="0.10833333333333334" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/contentorderstatus.xml" value="0.16302083333333334" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/daily_main_menu_row.xml" value="0.15416666666666667" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_category_wise_performance.xml" value="0.1390625" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_msl_availability_stock_facing_child.xml" value="0.16" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_msl_availability_stock_facing_header.xml" value="0.2" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_order_received_status_child.xml" value="0.2" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_order_status_child.xml" value="0.17" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_order_taking.xml" value="0.128125" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_order_taking_child.xml" value="0.2" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/order_status_item_layout.xml" value="0.33" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/storelist.xml" value="0.11875" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/storelist_child.xml" value="0.159375" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/storelistfablayout.xml" value="0.11875" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/visitstatuslist.xml" value="0.11875" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/visittypelist_child.xml" value="0.159375" />
|
||||||
|
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_audit.xml" value="0.14990942028985507" />
|
||||||
|
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_main.xml" value="0.20416666666666666" />
|
||||||
|
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/audit_question_list_item.xml" value="0.30676552363299353" />
|
||||||
|
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_audit.xml" value="0.14990942028985507" />
|
||||||
|
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_t2_pcompliance.xml" value="0.20416666666666666" />
|
||||||
|
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/t2p_sku_dialog_layout.xml" value="0.20416666666666666" />
|
||||||
|
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/t2pbranddialoglayout.xml" value="0.20416666666666666" />
|
||||||
|
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/menu/activity_main_drawer.xml" value="0.20416666666666666" />
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectType">
|
||||||
|
<option name="id" value="Android" />
|
||||||
|
</component>
|
||||||
|
<component name="VisualizationToolProject">
|
||||||
|
<option name="state">
|
||||||
|
<ProjectState>
|
||||||
|
<option name="scale" value="0.097802734375" />
|
||||||
|
</ProjectState>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+17
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RunConfigurationProducerService">
|
||||||
|
<option name="ignoredProducers">
|
||||||
|
<set>
|
||||||
|
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||||
|
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||||
|
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||||
|
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||||
|
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||||
|
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||||
|
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||||
|
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="StudioBotProjectSettings">
|
||||||
|
<option name="shareContext" value="OptedIn" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+6
@@ -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 @@
|
|||||||
|
/build
|
||||||
@@ -0,0 +1,180 @@
|
|||||||
|
apply plugin: 'com.android.application'
|
||||||
|
apply plugin: 'com.google.gms.google-services'
|
||||||
|
apply plugin: 'com.google.firebase.crashlytics'
|
||||||
|
apply plugin: 'org.jetbrains.kotlin.android'
|
||||||
|
android {
|
||||||
|
namespace("cpm.com.gskmtorange")
|
||||||
|
compileSdk 36
|
||||||
|
|
||||||
|
lintOptions {
|
||||||
|
checkReleaseBuilds false
|
||||||
|
disable 'MissingTranslation'
|
||||||
|
abortOnError false
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
// all*.exclude module: 'okio'
|
||||||
|
//all*.exclude group: 'com.squareup.okhttp3', module: 'okhttp'
|
||||||
|
all*.exclude module: 'support-v4' // This removes all other versions of `support-v4` if gets duplicated from all the artifacts.
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
multiDexEnabled true
|
||||||
|
useLibrary 'org.apache.http.legacy'
|
||||||
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
applicationId "cpm.com.gskmtorange"
|
||||||
|
minSdkVersion 26
|
||||||
|
targetSdk(34)
|
||||||
|
|
||||||
|
// For Lebanon
|
||||||
|
/*versionCode 1
|
||||||
|
versionName "1.0"*/
|
||||||
|
//For Egypt
|
||||||
|
versionCode 39
|
||||||
|
versionName "5.0"
|
||||||
|
//For UAE
|
||||||
|
/*versionCode 29
|
||||||
|
versionName "4.1"*/
|
||||||
|
//For Turkey
|
||||||
|
/* versionCode 34
|
||||||
|
versionName "4.6"*/
|
||||||
|
//For Turkey
|
||||||
|
/*versionCode 32
|
||||||
|
versionName "4.4"*/
|
||||||
|
//For KSA
|
||||||
|
/*versionCode 28
|
||||||
|
versionName "4.0"*/
|
||||||
|
|
||||||
|
// adding price facing
|
||||||
|
/* versionCode 27
|
||||||
|
versionName "3.8"*/
|
||||||
|
//sa
|
||||||
|
/* versionCode 28
|
||||||
|
versionName "3.9"*/
|
||||||
|
/* //Kenya
|
||||||
|
versionCode 2
|
||||||
|
versionName "1.1"*/
|
||||||
|
//kenya-lite
|
||||||
|
/* versionCode 2
|
||||||
|
versionName "1.1"*/
|
||||||
|
//nigeria
|
||||||
|
/*versionCode 1
|
||||||
|
versionName "1.0"*/
|
||||||
|
//For jordan
|
||||||
|
/* versionCode 7
|
||||||
|
versionName "1.6"*/
|
||||||
|
//For Kuwait
|
||||||
|
/*versionCode 1
|
||||||
|
versionName "1.0"*/
|
||||||
|
//For Bahrain
|
||||||
|
/*versionCode 1
|
||||||
|
versionName "1.0"*/
|
||||||
|
//For QATAR
|
||||||
|
/*versionCode 1
|
||||||
|
versionName "1.0"*/
|
||||||
|
//For Libya
|
||||||
|
/*versionCode 3
|
||||||
|
versionName "1.2"*/
|
||||||
|
//For Oman
|
||||||
|
/*versionCode 1
|
||||||
|
versionName "1.0"*/
|
||||||
|
ndk {abiFilters "armeabi-v7a", "arm64-v8a"}
|
||||||
|
}
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
config {
|
||||||
|
keyAlias 'hp'
|
||||||
|
keyPassword 'android'
|
||||||
|
storeFile file('D:\\jeevanp_cpm_projects\\keystore\\hp.dat')
|
||||||
|
storePassword 'android'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
debuggable true
|
||||||
|
signingConfig signingConfigs.config
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'proguard-camera-lib.pro'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_17
|
||||||
|
targetCompatibility JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
|
|
||||||
|
firebaseCrashlytics {
|
||||||
|
nativeSymbolUploadEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
buildFeatures {
|
||||||
|
viewBinding = true
|
||||||
|
}
|
||||||
|
|
||||||
|
packagingOptions {
|
||||||
|
exclude 'META-INF/LICENSE'
|
||||||
|
exclude 'META-INF/NOTICE'
|
||||||
|
exclude 'META-INF/gradle/incremental.annotation.processors'
|
||||||
|
exclude 'META-INF/AL2.0'
|
||||||
|
exclude 'META-INF/LGPL2.1'
|
||||||
|
}
|
||||||
|
kotlin {
|
||||||
|
jvmToolchain(17)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation 'androidx.activity:activity-ktx:1.13.0'
|
||||||
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
implementation files('libs/ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar')
|
||||||
|
// implementation files('libs/ksoap2-android-assembly-3.6.4.jar')
|
||||||
|
// implementation files('libs/ksoap2-android-3.3.0.jar')
|
||||||
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
|
implementation 'com.google.android.material:material:1.12.0'
|
||||||
|
implementation project(path: ':library')
|
||||||
|
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
|
||||||
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
|
implementation 'androidx.activity:activity:1.10.1'
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.7.1'
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
testImplementation 'org.mockito:mockito-core:4.11.0'
|
||||||
|
testImplementation 'org.mockito:mockito-android:4.11.0'
|
||||||
|
testImplementation 'org.robolectric:robolectric:4.10.3'
|
||||||
|
implementation "androidx.navigation:navigation-fragment-ktx:2.9.0"
|
||||||
|
androidTestImplementation "androidx.test:core:1.6.1"
|
||||||
|
androidTestImplementation "androidx.test:espresso:espresso-core:3.5.1"
|
||||||
|
androidTestImplementation "androidx.test.ext:junit:1.2.1"
|
||||||
|
androidTestImplementation "androidx.test:annotation:1.0.1"
|
||||||
|
implementation 'com.google.code.gson:gson:2.11.0'
|
||||||
|
implementation 'com.github.bumptech.glide:glide:4.16.0'
|
||||||
|
|
||||||
|
implementation platform('com.google.firebase:firebase-bom:33.14.0')
|
||||||
|
implementation 'com.google.firebase:firebase-crashlytics'
|
||||||
|
implementation 'com.google.firebase:firebase-messaging'
|
||||||
|
implementation 'com.google.android.gms:play-services-location:21.3.0'
|
||||||
|
implementation 'com.google.android.gms:play-services-maps:19.2.0'
|
||||||
|
implementation 'com.google.firebase:firebase-analytics:22.4.0'
|
||||||
|
implementation 'com.google.firebase:firebase-appindexing:20.0.0'
|
||||||
|
// implementation 'com.google.firebase:firebase-crashlytics:19.4.3'
|
||||||
|
implementation 'com.google.firebase:firebase-auth:23.2.1'
|
||||||
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
|
implementation 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
|
||||||
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
|
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
|
||||||
|
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.22"))
|
||||||
|
implementation 'androidx.multidex:multidex:2.0.1'
|
||||||
|
// Main SDK dependency
|
||||||
|
// implementation("com.github.pratham-PDots:camera_lib:1.5.1.1")
|
||||||
|
// implementation("com.github.pratham-PDots:camera_lib:1.5.3.2")
|
||||||
|
// implementation("com.github.pratham-PDots:camera_lib:1.5.4.5")
|
||||||
|
//latest
|
||||||
|
implementation("com.github.pratham-PDots:camera_lib:1.5.4.9")
|
||||||
|
implementation 'com.github.miteshpithadiya:SearchableSpinner:master'
|
||||||
|
implementation "androidx.core:core-splashscreen:1.0.1"
|
||||||
|
implementation "androidx.media3:media3-exoplayer:1.3.1"
|
||||||
|
implementation "androidx.media3:media3-ui:1.3.1"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"project_info": {
|
||||||
|
"project_number": "310038602345",
|
||||||
|
"project_id": "gskorangev2",
|
||||||
|
"storage_bucket": "gskorangev2.appspot.com"
|
||||||
|
},
|
||||||
|
"client": [
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:310038602345:android:dab7010946bd056dd1f8f8",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "cpm.com.gskmtorange"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "310038602345-ctmpg90bjppcgqam7jt4j3tn3e3hqtvr.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyDg2pgsaB0sWKD9pAF7mb9DSk8ec5rX7uI"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"appinvite_service": {
|
||||||
|
"other_platform_oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "310038602345-ctmpg90bjppcgqam7jt4j3tn3e3hqtvr.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configuration_version": "1"
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Vendored
+20
@@ -0,0 +1,20 @@
|
|||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# By default, the flags in this file are appended to flags specified
|
||||||
|
# in E:\adt-bundle-windows-x86_64-20140702\sdk/tools/proguard/proguard-android.txt
|
||||||
|
# You can edit the include path and order by changing the proguardFiles
|
||||||
|
# directive in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# Add any project specific keep options here:
|
||||||
|
|
||||||
|
# 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 *;
|
||||||
|
#}
|
||||||
|
-keep class com.github.pratham_pdots.camera_lib. { *; }
|
||||||
|
-keep class com.github.pratham_pdots. { *; }
|
||||||
|
-dontwarn com.github.pratham_pdots.**
|
||||||
Binary file not shown.
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"artifactType": {
|
||||||
|
"type": "APK",
|
||||||
|
"kind": "Directory"
|
||||||
|
},
|
||||||
|
"applicationId": "cpm.com.gskmtorange",
|
||||||
|
"variantName": "release",
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"type": "SINGLE",
|
||||||
|
"filters": [],
|
||||||
|
"attributes": [],
|
||||||
|
"versionCode": 39,
|
||||||
|
"versionName": "5.0",
|
||||||
|
"outputFile": "GSKMTOrange-release.apk"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"elementType": "File",
|
||||||
|
"minSdkVersionForDexing": 26
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package cpm.com.gskmtorange;
|
||||||
|
import android.content.Context;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
import androidx.test.InstrumentationRegistry;
|
||||||
|
import androidx.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instrumentation 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() throws Exception {
|
||||||
|
// Context of the app under test.
|
||||||
|
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||||
|
assertEquals("cpm.com.gskmtorange", appContext.getPackageName());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<resources>
|
||||||
|
<!--
|
||||||
|
TODO: Before you run your application, you need a Google Maps API key.
|
||||||
|
|
||||||
|
To get one, follow this link, follow the directions and press "Create" at the end:
|
||||||
|
|
||||||
|
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=F4:46:9C:04:7D:FD:3B:33:B1:A3:4B:8C:38:BD:77:0C:D4:36:98:E5%3Bcpm.com.gskmtorange
|
||||||
|
|
||||||
|
You can also add your credentials to an existing key, using these values:
|
||||||
|
|
||||||
|
Package name:
|
||||||
|
F4:46:9C:04:7D:FD:3B:33:B1:A3:4B:8C:38:BD:77:0C:D4:36:98:E5
|
||||||
|
|
||||||
|
SHA-1 certificate fingerprint:
|
||||||
|
F4:46:9C:04:7D:FD:3B:33:B1:A3:4B:8C:38:BD:77:0C:D4:36:98:E5
|
||||||
|
|
||||||
|
Alternatively, follow the directions here:
|
||||||
|
https://developers.google.com/maps/documentation/android/start#get-key
|
||||||
|
|
||||||
|
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
|
||||||
|
string in this file.
|
||||||
|
-->
|
||||||
|
<!--<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyDdgvyAY0_pb-k7PLPJoG6wR-KN0xnhkRE</string>-->
|
||||||
|
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyCs2VZqLl4OgStAraUHr8012cUc7vf3Uo8</string>
|
||||||
|
|
||||||
|
</resources>
|
||||||
@@ -0,0 +1,566 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
package="cpm.com.gskmtorange">
|
||||||
|
<!-- To auto-complete the email text field in the login form with the user's emails -->
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.camera"
|
||||||
|
android:required="false" />
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||||
|
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||||
|
<uses-permission android:name="android.permission.READ_PROFILE" />
|
||||||
|
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
|
<uses-permission
|
||||||
|
android:name="android.permission.READ_EXTERNAL_STORAGE"
|
||||||
|
android:maxSdkVersion="32" />
|
||||||
|
<uses-permission
|
||||||
|
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||||
|
tools:ignore="ScopedStorage" /> <!-- Devices running Android 13 (API level 33) or higher -->
|
||||||
|
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||||
|
<!--
|
||||||
|
To handle the reselection within the app on devices running Android 14
|
||||||
|
or higher if your app targets Android 14 (API level 34) or higher.
|
||||||
|
-->
|
||||||
|
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED" />
|
||||||
|
<uses-permission android:name="com.android.providers.media.MediaProvider" />
|
||||||
|
<uses-permission android:name="android.permission.MANAGE_DEVICE_POLICY_CAMERA" />
|
||||||
|
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.camera.any"
|
||||||
|
android:required="true" />
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.camera.autofocus"
|
||||||
|
android:required="false" />
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:allowBackup="true"
|
||||||
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:largeHeap="true"
|
||||||
|
android:networkSecurityConfig="@xml/network_security_config"
|
||||||
|
android:requestLegacyExternalStorage="true"
|
||||||
|
android:supportsRtl="false"
|
||||||
|
android:theme="@style/AppTheme"
|
||||||
|
android:usesCleartextTraffic="true"
|
||||||
|
tools:replace="android:supportsRtl">
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.BannerActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
android:exported="false" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.PD_Realtime_Report_Detail"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.PD_Realtime_Report"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.WebViewActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.PD_Pog_Activity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.PDVisibilityActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".Paralleldots.PdJavaImageActivity"
|
||||||
|
android:exported="false" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.PDimageActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.StockEntryActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.VisitTypeStatusActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="Ad hoc - Visit Type"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.OrderStatusDetailActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.OrderConfirmActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.OrderTakingActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.NewStockDataActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_new_stock_data"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.CounterfeitIndicatorWebActivity"
|
||||||
|
android:label="@string/title_activity_counterfeit_indicator_web"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.StockPricingActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_stock_pricing"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".pharma_stores.PharmaActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_paharma"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.StockActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/stock"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.CounterfeitProductsActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_counterfeit_products"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".password.MPinActivity"
|
||||||
|
android:label="@string/title_activity_mpin"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".password.ChangePasswordActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_change_password"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".SplashScreenActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:exported="true"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".LoginActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_login"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".MainActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/main_menu_activity_name"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".autoupdate.AutoUpdateActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".SelectLanguageActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_select_language"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".download.DownloadActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".GeoTag.GeoTagStoreList"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_store_list"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.StoreListActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_store_list"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.StoreimageActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_store_image"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".GeoTag.GeoTagActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_store_geotag"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<!--
|
||||||
|
<meta-data
|
||||||
|
android:name="com.google.android.maps.v2.API_KEY"
|
||||||
|
android:value="AIzaSyD02po19go2JMhXJeAnKDiZSiNloPsWqzI" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.google.android.gms.version"
|
||||||
|
android:value="@integer/google_play_services_version" />
|
||||||
|
-->
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.T2PComplianceActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> <!-- Gagan Start Declaration -->
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.CategoryListActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.CategoryWisePerformanceActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.DailyDataMenuActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.MSL_AvailabilityActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.Stock_FacingActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.PromoComplianceActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.StoreWisePerformanceActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> <!-- Gagan End Declaration -->
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.NonWorkingReason"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_Non_Work"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.AdditionalVisibility"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_Additional_visibility"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".upload.UploadActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_upload"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.SettingsActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_settings"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.CheckoutActivity"
|
||||||
|
android:label="@string/title_activity_checkout"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.ServiceActivity"
|
||||||
|
android:label="@string/title_activity_service"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".upload.PreviousDataUploadActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_upload"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.T2pBrand_Avaibility"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_t2p_brand__avaibility"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.StockFacing_PlanogramTrackerActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_stock_facing__planogram_tracker"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.CategoryPicture"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_category_picture"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.StoreCheckoutImageActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_store_checkout_image"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.MSL_Availability_StockFacingActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.FutureJCPActivity"
|
||||||
|
android:label=""
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.CreateSelfActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_create_self"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.NoCameraActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_create_self"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.PlanogramPDFActivity"
|
||||||
|
android:label="@string/category_performance_PLANOGRAM"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.StockDataActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_stock_data"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.AuditActivity"
|
||||||
|
android:label="@string/audit"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
|
||||||
|
<service
|
||||||
|
android:name=".service.FCMNotificationService"
|
||||||
|
android:enabled="true"
|
||||||
|
android:exported="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||||
|
</intent-filter>
|
||||||
|
</service>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.POGQuestionsActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_pogquestions"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
<!--
|
||||||
|
The API key for Google Maps-based APIs is defined as a string resource.
|
||||||
|
(See the file "res/values/google_maps_api.xml").
|
||||||
|
Note that the API key is linked to the encryption key used to sign the APK.
|
||||||
|
You need a different API key for each encryption key, including the release key that is used to
|
||||||
|
sign the APK for publishing.
|
||||||
|
You can define the keys for the debug and release targets in src/debug/ and src/release/.
|
||||||
|
-->
|
||||||
|
<!--
|
||||||
|
<meta-data
|
||||||
|
android:name="com.google.android.geo.API_KEY"
|
||||||
|
android:value="@string/google_maps_key" />
|
||||||
|
-->
|
||||||
|
<meta-data
|
||||||
|
android:name="com.google.android.geo.API_KEY"
|
||||||
|
android:value="@string/google_maps_key" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".storeinmap.StoreListMapActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_store_list_map"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
<activity
|
||||||
|
android:name=".storeinmap.StoreListRouteActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_store_list_route"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
<activity
|
||||||
|
android:name=".storeinmap.StoreRouteActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_store_route"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.MessageActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_message"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.ConversationActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_conversation"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.CoachingVisitActivity"
|
||||||
|
android:label="@string/title_activity_coaching_visit"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.CoachingVisitStoreActivity"
|
||||||
|
android:label="@string/title_activity_coaching_visit_store"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.DeliveryCallActivity"
|
||||||
|
android:label="@string/delivery_call"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.DeliveryCallAddStoreActivity"
|
||||||
|
android:label="@string/delivery_call"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.AdditionalPromoSKUwiseActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_additional_promo_skuwise"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.CompetitionPromoActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/competition_promotion"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
|
||||||
|
<provider
|
||||||
|
android:name="androidx.core.content.FileProvider"
|
||||||
|
android:authorities="${applicationId}.fileprovider"
|
||||||
|
android:exported="false"
|
||||||
|
android:grantUriPermissions="true">
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||||
|
android:resource="@xml/provider_paths" />
|
||||||
|
</provider>
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
Binary file not shown.
@@ -0,0 +1,60 @@
|
|||||||
|
{
|
||||||
|
"Mer_NoticeBoard": [
|
||||||
|
{
|
||||||
|
"NoticeBoardId": 1,
|
||||||
|
"NoticThumnail_Path": "https:\/\/bigm1.parinaam.in\/notice\/ThumbnailImages\/",
|
||||||
|
"NoticeLink_Thumbnail": "https:\/\/dle.parinaam.in\/Parinaam\/BM_th1.png",
|
||||||
|
"NoticeLink_FullPage": "https:\/\/dle.parinaam.in\/testdb\/share3.html?e=CPD03388&p=58678&en=test%20mer",
|
||||||
|
"FullPageTarget": "html-webview"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"NoticeBoardId": 4,
|
||||||
|
"NoticThumnail_Path": "https:\/\/bigm1.parinaam.in\/notice\/ThumbnailImages\/",
|
||||||
|
"NoticeLink_Thumbnail": "https:\/\/dle.parinaam.in\/app\/Content\/Test\/video.png",
|
||||||
|
"NoticeLink_FullPage": "https:\/\/dle.parinaam.in\/Trainings\/Data_security_video-final_eng.mp4?e=CPD03388&p=58678&en=test%20mer",
|
||||||
|
"FullPageTarget": "video"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"NoticeBoardId": 5,
|
||||||
|
"NoticThumnail_Path": "https:\/\/bigm1.parinaam.in\/notice\/ThumbnailImages\/",
|
||||||
|
"NoticeLink_Thumbnail": "https:\/\/dle.parinaam.in\/app\/Content\/Test\/image.png",
|
||||||
|
"NoticeLink_FullPage": "https:\/\/dle.parinaam.in\/Trainings\/datasec_training_th.png?e=CPD03388&p=58678&en=test%20mer",
|
||||||
|
"FullPageTarget": "image"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"NoticeBoardId": 6,
|
||||||
|
"NoticThumnail_Path": "https:\/\/bigm1.parinaam.in\/notice\/ThumbnailImages\/",
|
||||||
|
"NoticeLink_Thumbnail": "https:\/\/dle.parinaam.in\/app\/Content\/Test\/html-webview.png",
|
||||||
|
"NoticeLink_FullPage": "https:\/\/dle.parinaam.in\/testdb\/image.html?e=CPD03388&p=58678&en=test%20mer",
|
||||||
|
"FullPageTarget": "html-webview"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"NoticeBoardId": 7,
|
||||||
|
"NoticThumnail_Path": "https:\/\/bigm1.parinaam.in\/notice\/ThumbnailImages\/",
|
||||||
|
"NoticeLink_Thumbnail": "https:\/\/dle.parinaam.in\/app\/Content\/Test\/html-browser.png",
|
||||||
|
"NoticeLink_FullPage": "https:\/\/cd.parinaam.in?e=CPD03388&p=58678&en=test%20mer",
|
||||||
|
"FullPageTarget": "html-webbrowser"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"NoticeBoardId": 8,
|
||||||
|
"NoticThumnail_Path": "https:\/\/bigm1.parinaam.in\/notice\/ThumbnailImages\/",
|
||||||
|
"NoticeLink_Thumbnail": "https:\/\/dle.parinaam.in\/app\/Content\/Test\/Frame.png",
|
||||||
|
"NoticeLink_FullPage": "https:\/\/dle.parinaam.in\/testdb\/share1.html?e=CPD03388&p=58678&en=test%20mer",
|
||||||
|
"FullPageTarget": "html-webview"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"NoticeBoardId": 9,
|
||||||
|
"NoticThumnail_Path": "https:\/\/bigm1.parinaam.in\/notice\/ThumbnailImages\/",
|
||||||
|
"NoticeLink_Thumbnail": "https:\/\/dle.parinaam.in\/app\/Content\/Test\/deeplink.png",
|
||||||
|
"NoticeLink_FullPage": "reports?e=CPD03388&p=58678&en=test%20mer",
|
||||||
|
"FullPageTarget": "deeplink"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"NoticeBoardId": 10,
|
||||||
|
"NoticThumnail_Path": "https:\/\/bigm1.parinaam.in\/notice\/ThumbnailImages\/",
|
||||||
|
"NoticeLink_Thumbnail": "https:\/\/dle.parinaam.in\/app\/Content\/Test\/contact.png",
|
||||||
|
"NoticeLink_FullPage": "{\"Name\":\"CPMHelpline\",\"Label\":\"Mobile\",\"Value\":\"9898989898\"}?e=CPD03388&p=58678&en=test%20mer",
|
||||||
|
"FullPageTarget": "contact"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 86 KiB |
@@ -0,0 +1,46 @@
|
|||||||
|
package cpm.com.gskmtorange;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class AppUtils {
|
||||||
|
public static File getInternalDirectory(Context context, String folderName) {
|
||||||
|
File dir = context.getExternalFilesDir("");
|
||||||
|
File file = new File(dir, folderName);
|
||||||
|
if (!file.exists()) {
|
||||||
|
file.mkdirs();
|
||||||
|
}
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static File getFile(Context context, String fileName, String folderName) {
|
||||||
|
File dir = getInternalDirectory(context, folderName);
|
||||||
|
if (fileName == null || fileName.isEmpty()) {
|
||||||
|
return dir;
|
||||||
|
} else {
|
||||||
|
return new File(dir, fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void saveByteArrayToFile(byte[] byteArray, String fileName) throws IOException {
|
||||||
|
try (FileOutputStream fileOutputStream = new FileOutputStream(fileName)) {
|
||||||
|
fileOutputStream.write(byteArray);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static void clearMyFiles(Context activity, String folderName) {
|
||||||
|
File[] files = getInternalDirectory(activity, folderName).listFiles();
|
||||||
|
if (files != null) {
|
||||||
|
for (File file : files) {
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static File getExterDir(Context context) {
|
||||||
|
return context.getExternalFilesDir("");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,266 @@
|
|||||||
|
package cpm.com.gskmtorange.GeoTag;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.download.DownloadActivity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ashishc on 27-12-2016.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class GeoTagStoreList extends AppCompatActivity implements View.OnClickListener {
|
||||||
|
|
||||||
|
private SharedPreferences preferences;
|
||||||
|
ArrayList<StoreBean> storelist = new ArrayList<StoreBean>();
|
||||||
|
String date, visit_status;
|
||||||
|
GSKOrangeDB db;
|
||||||
|
// ListView list;
|
||||||
|
ValueAdapter adapter;
|
||||||
|
RecyclerView recyclerView;
|
||||||
|
private SharedPreferences.Editor editor = null;
|
||||||
|
LinearLayout parent_linear, nodata_linear;
|
||||||
|
LinearLayout linearlay;
|
||||||
|
FloatingActionButton fab;
|
||||||
|
Toolbar toolbar;
|
||||||
|
|
||||||
|
private Context context;
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.geotagstorelistfab);
|
||||||
|
//list = (ListView) findViewById(R.id.list_id);
|
||||||
|
|
||||||
|
recyclerView = (RecyclerView) findViewById(R.id.drawer_layout_recycle);
|
||||||
|
linearlay = (LinearLayout) findViewById(R.id.no_data_lay);
|
||||||
|
// nodata_linear = (LinearLayout) findViewById(R.id.no_data_lay);
|
||||||
|
//parent_linear = (LinearLayout) findViewById(R.id.parent_linear);
|
||||||
|
fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
|
context = this;
|
||||||
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
|
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
visit_status = preferences.getString(CommonString.KEY_STOREVISITED_STATUS, "");
|
||||||
|
|
||||||
|
db = new GSKOrangeDB(GeoTagStoreList.this);
|
||||||
|
db.open();
|
||||||
|
|
||||||
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
Intent in = new Intent(context, DownloadActivity.class);
|
||||||
|
startActivity(in);
|
||||||
|
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
storelist = db.getStoreData(date, CommonString.KEY_JOURNEY_PLAN);
|
||||||
|
|
||||||
|
if (storelist.size() > 0) {
|
||||||
|
adapter = new ValueAdapter(context, storelist);
|
||||||
|
recyclerView.setAdapter(adapter);
|
||||||
|
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
recyclerView.setVisibility(View.INVISIBLE);
|
||||||
|
linearlay.setVisibility(View.VISIBLE);
|
||||||
|
fab.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
if (id == android.R.id.home) {
|
||||||
|
|
||||||
|
finish();
|
||||||
|
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
/* Intent intent = new Intent(GeoTagStoreList.this, MainActivity.class);
|
||||||
|
|
||||||
|
startActivity(intent);*/
|
||||||
|
GeoTagStoreList.this.finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class ValueAdapter extends RecyclerView.Adapter<ValueAdapter.MyViewHolder> {
|
||||||
|
|
||||||
|
private LayoutInflater inflator;
|
||||||
|
|
||||||
|
List<StoreBean> data = Collections.emptyList();
|
||||||
|
|
||||||
|
public ValueAdapter(Context context, List<StoreBean> data) {
|
||||||
|
|
||||||
|
inflator = LayoutInflater.from(context);
|
||||||
|
this.data = data;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ValueAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int i) {
|
||||||
|
View view = inflator.inflate(R.layout.geotagstorelist, parent, false);
|
||||||
|
|
||||||
|
MyViewHolder holder = new MyViewHolder(view);
|
||||||
|
return holder;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(final ValueAdapter.MyViewHolder viewHolder, final int position) {
|
||||||
|
final StoreBean current = data.get(position);
|
||||||
|
//viewHolder.txt.setText(current.txt);
|
||||||
|
|
||||||
|
viewHolder.txt.setText(current.getSTORE_NAME());
|
||||||
|
viewHolder.txt_storeAddress.setText(current.getADDRESS());
|
||||||
|
|
||||||
|
if (current.getGEO_TAG().equalsIgnoreCase("Y")) {
|
||||||
|
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||||
|
viewHolder.imageview.setBackgroundResource(R.mipmap.geopin);
|
||||||
|
} else if (current.getGEO_TAG().equalsIgnoreCase("D")) {
|
||||||
|
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||||
|
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
||||||
|
} else if (current.getGEO_TAG().equalsIgnoreCase("U")) {
|
||||||
|
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||||
|
viewHolder.imageview.setBackgroundResource(R.mipmap.tick);
|
||||||
|
} else if (current.getGEO_TAG().equalsIgnoreCase("P")) {
|
||||||
|
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||||
|
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
||||||
|
} else {
|
||||||
|
viewHolder.imageview.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
viewHolder.relativelayout.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (current.getGEO_TAG().equalsIgnoreCase("Y")) {
|
||||||
|
Snackbar.make(v, R.string.title_geo_tag_activity_geo_already_done, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
} else if (current.getGEO_TAG().equalsIgnoreCase("D")) {
|
||||||
|
Snackbar.make(v, R.string.title_geo_tag_activity_geo_data, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
|
||||||
|
} else if (current.getGEO_TAG().equalsIgnoreCase("U")) {
|
||||||
|
Snackbar.make(v, R.string.title_geo_tag_activity_upload_data, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
|
||||||
|
} else if (current.getGEO_TAG().equalsIgnoreCase("P")) {
|
||||||
|
Snackbar.make(v, R.string.title_geo_tag_activity_geo_data, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// PUT IN PREFERENCES
|
||||||
|
editor = preferences.edit();
|
||||||
|
editor.putString(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||||
|
editor.putString(CommonString.KEY_STORE_NAME, current.getSTORE_NAME());
|
||||||
|
editor.putString(CommonString.KEY_VISIT_DATE, current.getVISIT_DATE());
|
||||||
|
editor.commit();
|
||||||
|
|
||||||
|
Intent in = new Intent(GeoTagStoreList.this, GeoTagActivity.class);
|
||||||
|
startActivity(in);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return data.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
class MyViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
TextView txt, txt_storeAddress;
|
||||||
|
ImageView icon;
|
||||||
|
RelativeLayout relativelayout;
|
||||||
|
ImageView imageview;
|
||||||
|
|
||||||
|
public MyViewHolder(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
txt = (TextView) itemView.findViewById(R.id.geolistviewxml_storename);
|
||||||
|
relativelayout = (RelativeLayout) itemView.findViewById(R.id.relativelayout);
|
||||||
|
imageview = (ImageView) itemView.findViewById(R.id.imageView1);
|
||||||
|
txt_storeAddress = (TextView) itemView.findViewById(R.id.txt_storeAddress);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*public List<StoreBean> getdata() {
|
||||||
|
List<StoreBean> data = new ArrayList<>();
|
||||||
|
|
||||||
|
storelist = db.getStoreData(date);
|
||||||
|
|
||||||
|
StoreBean storelistdata = new StoreBean();
|
||||||
|
|
||||||
|
for (int i = 0; i < storelist.size(); i++) {
|
||||||
|
storelistdata.setSTORE_NAME(storelist.get(0).getSTORE_NAME());
|
||||||
|
|
||||||
|
data.add(storelistdata);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View arg0) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
toolbar.setTitle(getString(R.string.title_activity_store_geotag));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+279
@@ -0,0 +1,279 @@
|
|||||||
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
|
public class AdditionalDialogGetterSetter {
|
||||||
|
public String Display_id,display,brand_id,brand, trg_quantity, image1, image2, category_id,
|
||||||
|
image3, BEFORE_QTY, camera1, camera2, camera3, AFTER_QTY, store_id, stock_count, question_id, question, answer, type,
|
||||||
|
KEY_ID, unique_id,image_url, sku_id,quantity, process_id, sku_name, stock_flag,subcatid,subcat,subcatEng;
|
||||||
|
|
||||||
|
|
||||||
|
public String getSubcatid() {
|
||||||
|
return subcatid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubcatid(String subcatid) {
|
||||||
|
this.subcatid = subcatid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubcat() {
|
||||||
|
return subcat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubcat(String subcat) {
|
||||||
|
this.subcat = subcat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubcatEng() {
|
||||||
|
return subcatEng;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubcatEng(String subcatEng) {
|
||||||
|
this.subcatEng = subcatEng;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCOMMON_ID() {
|
||||||
|
return COMMON_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCOMMON_ID(String COMMON_ID) {
|
||||||
|
this.COMMON_ID = COMMON_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
String COMMON_ID;
|
||||||
|
|
||||||
|
public String getCategoryId() {
|
||||||
|
return categoryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategoryId(String categoryId) {
|
||||||
|
this.categoryId = categoryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
String categoryId;
|
||||||
|
|
||||||
|
public String getStock_flag() {
|
||||||
|
return stock_flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStock_flag(String stock_flag) {
|
||||||
|
this.stock_flag = stock_flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSku_name() {
|
||||||
|
return sku_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSku_name(String sku_name) {
|
||||||
|
this.sku_name = sku_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProcess_id() {
|
||||||
|
return process_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcess_id(String process_id) {
|
||||||
|
this.process_id = process_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSku_id() {
|
||||||
|
return sku_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSku_id(String sku_id) {
|
||||||
|
this.sku_id = sku_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQuantity() {
|
||||||
|
return quantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuantity(String quantity) {
|
||||||
|
this.quantity = quantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImage_url() {
|
||||||
|
return image_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImage_url(String image_url) {
|
||||||
|
this.image_url = image_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUnique_id() {
|
||||||
|
return unique_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUnique_id(String unique_id) {
|
||||||
|
this.unique_id = unique_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKEY_ID() {
|
||||||
|
return KEY_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKEY_ID(String kEY_ID) {
|
||||||
|
KEY_ID = kEY_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCategory_id() {
|
||||||
|
return category_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategory_id(String category_id) {
|
||||||
|
this.category_id = category_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQuestion_id() {
|
||||||
|
return question_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuestion_id(String question_id) {
|
||||||
|
this.question_id = question_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQuestion() {
|
||||||
|
return question;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuestion(String question) {
|
||||||
|
this.question = question;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAnswer() {
|
||||||
|
return answer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAnswer(String answer) {
|
||||||
|
this.answer = answer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStock_count() {
|
||||||
|
return stock_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStock_count(String stock_count) {
|
||||||
|
this.stock_count = stock_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStore_id() {
|
||||||
|
return store_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStore_id(String store_id) {
|
||||||
|
this.store_id = store_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCamera1() {
|
||||||
|
return camera1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCamera1(String camera1) {
|
||||||
|
this.camera1 = camera1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCamera2() {
|
||||||
|
return camera2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCamera2(String camera2) {
|
||||||
|
this.camera2 = camera2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCamera3() {
|
||||||
|
return camera3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCamera3(String camera3) {
|
||||||
|
this.camera3 = camera3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDisplay_id() {
|
||||||
|
return Display_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDisplay_id(String display_id) {
|
||||||
|
Display_id = display_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDisplay() {
|
||||||
|
return display;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDisplay(String display) {
|
||||||
|
this.display = display;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBrand_id() {
|
||||||
|
return brand_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBrand_id(String brand_id) {
|
||||||
|
this.brand_id = brand_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBrand() {
|
||||||
|
return brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBrand(String brand) {
|
||||||
|
this.brand = brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTrg_quantity() {
|
||||||
|
return trg_quantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrg_quantity(String trg_quantity) {
|
||||||
|
this.trg_quantity = trg_quantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImage1() {
|
||||||
|
return image1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImage1(String image1) {
|
||||||
|
this.image1 = image1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImage2() {
|
||||||
|
return image2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImage2(String image2) {
|
||||||
|
this.image2 = image2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImage3() {
|
||||||
|
return image3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImage3(String image3) {
|
||||||
|
this.image3 = image3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBEFORE_QTY() {
|
||||||
|
return BEFORE_QTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBEFORE_QTY(String bEFORE_QTY) {
|
||||||
|
BEFORE_QTY = bEFORE_QTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAFTER_QTY() {
|
||||||
|
return AFTER_QTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAFTER_QTY(String aFTER_QTY) {
|
||||||
|
AFTER_QTY = aFTER_QTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+149
@@ -0,0 +1,149 @@
|
|||||||
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ashishc on 09-01-2017.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class AddittionalGetterSetter {
|
||||||
|
|
||||||
|
|
||||||
|
public String getBrand() {
|
||||||
|
return Brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBrand(String brand) {
|
||||||
|
Brand = brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBrand_id() {
|
||||||
|
return Brand_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBrand_id(String brand_id) {
|
||||||
|
Brand_id = brand_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSku() {
|
||||||
|
return Sku;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSku(String sku) {
|
||||||
|
Sku = sku;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSku_id() {
|
||||||
|
return Sku_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSku_id(String sku_id) {
|
||||||
|
Sku_id = sku_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStore_id() {
|
||||||
|
return Store_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStore_id(String store_id) {
|
||||||
|
Store_id = store_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImage() {
|
||||||
|
return Image;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImage(String image) {
|
||||||
|
Image = image;
|
||||||
|
}
|
||||||
|
|
||||||
|
String Brand,Brand_id,Sku,Sku_id,Store_id,Image="";
|
||||||
|
|
||||||
|
String SubCatId,SubCat="";
|
||||||
|
|
||||||
|
public String getSubCatId() {
|
||||||
|
return SubCatId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubCatId(String subCatId) {
|
||||||
|
SubCatId = subCatId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubCat() {
|
||||||
|
return SubCat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubCat(String subCat) {
|
||||||
|
SubCat = subCat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubCatEng() {
|
||||||
|
return SubCatEng;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubCatEng(String subCatEng) {
|
||||||
|
SubCatEng = subCatEng;
|
||||||
|
}
|
||||||
|
|
||||||
|
String SubCatEng="";
|
||||||
|
|
||||||
|
String Image2="";
|
||||||
|
|
||||||
|
public String getImage3() {
|
||||||
|
return Image3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImage3(String image3) {
|
||||||
|
Image3 = image3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImage2() {
|
||||||
|
return Image2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImage2(String image2) {
|
||||||
|
Image2 = image2;
|
||||||
|
}
|
||||||
|
|
||||||
|
String Image3="";
|
||||||
|
|
||||||
|
public String getKey_id() {
|
||||||
|
return key_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKey_id(String key_id) {
|
||||||
|
this.key_id = key_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
String key_id;
|
||||||
|
|
||||||
|
public String getBtn_toogle() {
|
||||||
|
return btn_toogle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBtn_toogle(String btn_toogle) {
|
||||||
|
this.btn_toogle = btn_toogle;
|
||||||
|
}
|
||||||
|
|
||||||
|
String btn_toogle;
|
||||||
|
|
||||||
|
public String getCategoryId() {
|
||||||
|
return categoryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategoryId(String categoryId) {
|
||||||
|
this.categoryId = categoryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
String categoryId;
|
||||||
|
|
||||||
|
ArrayList<AdditionalDialogGetterSetter> skuDialogList = new ArrayList<>();
|
||||||
|
|
||||||
|
public ArrayList<AdditionalDialogGetterSetter> getSkuDialogList() {
|
||||||
|
return skuDialogList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSkuDialogList(ArrayList<AdditionalDialogGetterSetter> skuDialogList) {
|
||||||
|
this.skuDialogList = skuDialogList;
|
||||||
|
}
|
||||||
|
}
|
||||||
+84
@@ -0,0 +1,84 @@
|
|||||||
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ashishc on 07-02-2017.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class BrandAvabilityGetterSetter {
|
||||||
|
|
||||||
|
String BRAND_ID;
|
||||||
|
String BRAND;
|
||||||
|
String keyAccount_id;
|
||||||
|
String class_id;
|
||||||
|
String categoryId;
|
||||||
|
|
||||||
|
public String getStore_id() {
|
||||||
|
return store_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStore_id(String store_id) {
|
||||||
|
this.store_id = store_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
String store_id;
|
||||||
|
|
||||||
|
public String getStoreType_id() {
|
||||||
|
return storeType_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStoreType_id(String storeType_id) {
|
||||||
|
this.storeType_id = storeType_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCategoryId() {
|
||||||
|
return categoryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategoryId(String categoryId) {
|
||||||
|
this.categoryId = categoryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getClass_id() {
|
||||||
|
return class_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClass_id(String class_id) {
|
||||||
|
this.class_id = class_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKeyAccount_id() {
|
||||||
|
return keyAccount_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKeyAccount_id(String keyAccount_id) {
|
||||||
|
this.keyAccount_id = keyAccount_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
String storeType_id;
|
||||||
|
|
||||||
|
|
||||||
|
public String getBRAND() {
|
||||||
|
return BRAND;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBRAND(String BRAND) {
|
||||||
|
this.BRAND = BRAND;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBRAND_ID() {
|
||||||
|
return BRAND_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBRAND_ID(String BRAND_ID) {
|
||||||
|
this.BRAND_ID = BRAND_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+194
@@ -0,0 +1,194 @@
|
|||||||
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.adapter.data.ImageUri;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ashishc on 20-02-2017.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class CategoryPictureGetterSetter {
|
||||||
|
String subCatCode = "", CategoryImage1 = "", CategoryImage2 = "", CategoryImage3 = "", CategoryImage4 = "", image_allow = "0",categoryId,COMMON_ID,KEY_ID;
|
||||||
|
|
||||||
|
public String getSubCatCode() {
|
||||||
|
return subCatCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubCatCode(String subCatCode) {
|
||||||
|
this.subCatCode = subCatCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCategoryId() {
|
||||||
|
return categoryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategoryId(String categoryId) {
|
||||||
|
this.categoryId = categoryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCOMMON_ID() {
|
||||||
|
return COMMON_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCOMMON_ID(String COMMON_ID) {
|
||||||
|
this.COMMON_ID = COMMON_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKEY_ID() {
|
||||||
|
return KEY_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKEY_ID(String KEY_ID) {
|
||||||
|
this.KEY_ID = KEY_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCamera_allow() {
|
||||||
|
return camera_allow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCamera_allow(String camera_allow) {
|
||||||
|
this.camera_allow = camera_allow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getClass_id() {
|
||||||
|
return class_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClass_id(String class_id) {
|
||||||
|
this.class_id = class_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStore_type_id() {
|
||||||
|
return store_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStore_type_id(String store_type_id) {
|
||||||
|
this.store_type_id = store_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKey_account_id() {
|
||||||
|
return key_account_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKey_account_id(String key_account_id) {
|
||||||
|
this.key_account_id = key_account_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
String camera_allow, class_id, store_type_id, key_account_id;
|
||||||
|
|
||||||
|
|
||||||
|
public String getStore_ID() {
|
||||||
|
return Store_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStore_ID(String store_ID) {
|
||||||
|
Store_ID = store_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
String Store_ID;
|
||||||
|
|
||||||
|
String SubCategoryCamera1;
|
||||||
|
|
||||||
|
String Toggle_value="1";
|
||||||
|
|
||||||
|
public String getToggle_value() {
|
||||||
|
return Toggle_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToggle_value(String toggle_value) {
|
||||||
|
Toggle_value = toggle_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String SUB_CATEGORY_ID;
|
||||||
|
|
||||||
|
public String getSUB_CATEGORY() {
|
||||||
|
return SUB_CATEGORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSUB_CATEGORY(String SUB_CATEGORY) {
|
||||||
|
this.SUB_CATEGORY = SUB_CATEGORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSUB_CATEGORY_ID() {
|
||||||
|
return SUB_CATEGORY_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSUB_CATEGORY_ID(String SUB_CATEGORY_ID) {
|
||||||
|
this.SUB_CATEGORY_ID = SUB_CATEGORY_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
String SUB_CATEGORY;
|
||||||
|
|
||||||
|
|
||||||
|
public String getSubCategoryCamera1() {
|
||||||
|
return SubCategoryCamera1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubCategoryCamera1(String subCategoryCamera1) {
|
||||||
|
SubCategoryCamera1 = subCategoryCamera1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubCategoryCamera2() {
|
||||||
|
return SubCategoryCamera2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubCategoryCamera2(String subCategoryCamera2) {
|
||||||
|
SubCategoryCamera2 = subCategoryCamera2;
|
||||||
|
}
|
||||||
|
|
||||||
|
String SubCategoryCamera2;
|
||||||
|
|
||||||
|
public String getCategoryImage2() {
|
||||||
|
return CategoryImage2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategoryImage2(String categoryImage2) {
|
||||||
|
CategoryImage2 = categoryImage2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCategoryImage1() {
|
||||||
|
return CategoryImage1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategoryImage1(String categoryImage1) {
|
||||||
|
CategoryImage1 = categoryImage1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCategoryImage3() {
|
||||||
|
return CategoryImage3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategoryImage3(String categoryImage3) {
|
||||||
|
CategoryImage3 = categoryImage3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCategoryImage4() {
|
||||||
|
return CategoryImage4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategoryImage4(String categoryImage4) {
|
||||||
|
CategoryImage4 = categoryImage4;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getImage_allow() {
|
||||||
|
return image_allow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImage_allow(String image_allow) {
|
||||||
|
this.image_allow = image_allow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<ImageUri> getImageUris() {
|
||||||
|
return imageUris;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImageUris(ArrayList<ImageUri> imageUris) {
|
||||||
|
this.imageUris = imageUris;
|
||||||
|
}
|
||||||
|
|
||||||
|
ArrayList<ImageUri> imageUris = new ArrayList<>();
|
||||||
|
}
|
||||||
+110
@@ -0,0 +1,110 @@
|
|||||||
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
|
public class ChatMessageGetterSetter {
|
||||||
|
|
||||||
|
String REC_ID, CHAT_ID, MESSAGE, MESSAGEDATE , SENDERID, SENDER, RECEIVERID, RECEIVER, COMMENTDATE, COMMENT, STOREID, ORDERID, SENDER_USERID;
|
||||||
|
|
||||||
|
public String getREC_ID() {
|
||||||
|
return REC_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setREC_ID(String REC_ID) {
|
||||||
|
this.REC_ID = REC_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCHAT_ID() {
|
||||||
|
return CHAT_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCHAT_ID(String CHAT_ID) {
|
||||||
|
this.CHAT_ID = CHAT_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMESSAGE() {
|
||||||
|
return MESSAGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMESSAGE(String MESSAGE) {
|
||||||
|
this.MESSAGE = MESSAGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMESSAGEDATE() {
|
||||||
|
return MESSAGEDATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMESSAGEDATE(String MESSAGEDATE) {
|
||||||
|
this.MESSAGEDATE = MESSAGEDATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSENDERID() {
|
||||||
|
return SENDERID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSENDERID(String SENDERID) {
|
||||||
|
this.SENDERID = SENDERID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSENDER() {
|
||||||
|
return SENDER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSENDER(String SENDER) {
|
||||||
|
this.SENDER = SENDER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRECEIVERID() {
|
||||||
|
return RECEIVERID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRECEIVERID(String RECEIVERID) {
|
||||||
|
this.RECEIVERID = RECEIVERID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRECEIVER() {
|
||||||
|
return RECEIVER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRECEIVER(String RECEIVER) {
|
||||||
|
this.RECEIVER = RECEIVER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCOMMENTDATE() {
|
||||||
|
return COMMENTDATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCOMMENTDATE(String COMMENTDATE) {
|
||||||
|
this.COMMENTDATE = COMMENTDATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCOMMENT() {
|
||||||
|
return COMMENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCOMMENT(String COMMENT) {
|
||||||
|
this.COMMENT = COMMENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSTOREID() {
|
||||||
|
return STOREID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSTOREID(String STOREID) {
|
||||||
|
this.STOREID = STOREID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getORDERID() {
|
||||||
|
return ORDERID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setORDERID(String ORDERID) {
|
||||||
|
this.ORDERID = ORDERID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSENDER_USERID() {
|
||||||
|
return SENDER_USERID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSENDER_USERID(String SENDER_USERID) {
|
||||||
|
this.SENDER_USERID = SENDER_USERID;
|
||||||
|
}
|
||||||
|
}
|
||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
|
public class CoachingVisitGetterSetter {
|
||||||
|
|
||||||
|
String emp_id, img_path = "";
|
||||||
|
boolean exists;
|
||||||
|
|
||||||
|
public String getEmp_id() {
|
||||||
|
return emp_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmp_id(String emp_id) {
|
||||||
|
this.emp_id = emp_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImg_path() {
|
||||||
|
return img_path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImg_path(String img_path) {
|
||||||
|
this.img_path = img_path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isExists() {
|
||||||
|
return exists;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExists(boolean exists) {
|
||||||
|
this.exists = exists;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,280 @@
|
|||||||
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
|
public class CoverageBean {
|
||||||
|
protected int MID;
|
||||||
|
protected String process_id;
|
||||||
|
|
||||||
|
public String flag_from;
|
||||||
|
|
||||||
|
public String getGEO_TAG() {
|
||||||
|
return GEO_TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGEO_TAG(String GEO_TAG) {
|
||||||
|
this.GEO_TAG = GEO_TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String GEO_TAG;
|
||||||
|
|
||||||
|
public String getProcess_id() {
|
||||||
|
return process_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcess_id(String process_id) {
|
||||||
|
this.process_id = process_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String storeId;
|
||||||
|
protected String storename;
|
||||||
|
|
||||||
|
public String getStorename() {
|
||||||
|
return storename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStorename(String storename) {
|
||||||
|
this.storename = storename;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String Remark;
|
||||||
|
|
||||||
|
public String getRemark() {
|
||||||
|
return Remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
Remark = remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String userId;
|
||||||
|
protected String app_version;
|
||||||
|
protected String image_allow;
|
||||||
|
|
||||||
|
public String getImage_allow() {
|
||||||
|
return image_allow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImage_allow(String image_allow) {
|
||||||
|
this.image_allow = image_allow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApp_version() {
|
||||||
|
return app_version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApp_version(String app_version) {
|
||||||
|
this.app_version = app_version;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String inTime;
|
||||||
|
|
||||||
|
protected String outTime;
|
||||||
|
|
||||||
|
protected String visitDate;
|
||||||
|
|
||||||
|
protected String keycontactId;
|
||||||
|
|
||||||
|
protected String isdDeploy;
|
||||||
|
|
||||||
|
protected String uploadStatus;
|
||||||
|
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
private String reasonid = "";
|
||||||
|
|
||||||
|
private String sub_reasonId = "";
|
||||||
|
|
||||||
|
public String getSub_reasonId() {
|
||||||
|
return sub_reasonId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSub_reasonId(String sub_reasonId) {
|
||||||
|
this.sub_reasonId = sub_reasonId;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String reason = "";
|
||||||
|
|
||||||
|
private String status = "N";
|
||||||
|
|
||||||
|
private String image = "";
|
||||||
|
|
||||||
|
|
||||||
|
public String getImage() {
|
||||||
|
return image;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImage(String image) {
|
||||||
|
this.image = image;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMID() {
|
||||||
|
return MID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMID(int mID) {
|
||||||
|
MID = mID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStoreId() {
|
||||||
|
return storeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStoreId(String storeId) {
|
||||||
|
this.storeId = storeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserId() {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserId(String userId) {
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInTime() {
|
||||||
|
return inTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInTime(String inTime) {
|
||||||
|
this.inTime = inTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOutTime() {
|
||||||
|
return outTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOutTime(String outTime) {
|
||||||
|
this.outTime = outTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVisitDate() {
|
||||||
|
return visitDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVisitDate(String visitDate) {
|
||||||
|
this.visitDate = visitDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKeycontactId() {
|
||||||
|
return keycontactId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKeycontactId(String keycontactId) {
|
||||||
|
this.keycontactId = keycontactId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsdDeploy() {
|
||||||
|
return isdDeploy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsdDeploy(String isdDeploy) {
|
||||||
|
this.isdDeploy = isdDeploy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUploadStatus() {
|
||||||
|
return uploadStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUploadStatus(String uploadStatus) {
|
||||||
|
this.uploadStatus = uploadStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLatitude() {
|
||||||
|
return latitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLatitude(String latitude) {
|
||||||
|
this.latitude = latitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLongitude() {
|
||||||
|
return longitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLongitude(String longitude) {
|
||||||
|
this.longitude = longitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReasonid() {
|
||||||
|
return reasonid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReasonid(String reasonid) {
|
||||||
|
this.reasonid = reasonid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReason() {
|
||||||
|
return reason;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReason(String reason) {
|
||||||
|
this.reason = reason;
|
||||||
|
}
|
||||||
|
|
||||||
|
String CheckOut_Image = "";
|
||||||
|
|
||||||
|
|
||||||
|
public String getCheckOut_Image() {
|
||||||
|
return CheckOut_Image;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCheckOut_Image(String checkOut_Image) {
|
||||||
|
CheckOut_Image = checkOut_Image;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlag_from() {
|
||||||
|
return flag_from;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlag_from(String flag_from) {
|
||||||
|
this.flag_from = flag_from;
|
||||||
|
}
|
||||||
|
|
||||||
|
String keyAccountId;
|
||||||
|
String classId;
|
||||||
|
|
||||||
|
public String getKeyAccountId() {
|
||||||
|
return keyAccountId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKeyAccountId(String keyAccountId) {
|
||||||
|
this.keyAccountId = keyAccountId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getClassId() {
|
||||||
|
return classId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClassId(String classId) {
|
||||||
|
this.classId = classId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStoreTypeId() {
|
||||||
|
return storeTypeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStoreTypeId(String storeTypeId) {
|
||||||
|
this.storeTypeId = storeTypeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
String storeTypeId;
|
||||||
|
|
||||||
|
public String getMappingStk() {
|
||||||
|
return mappingStk;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMappingStk(String mappingStk) {
|
||||||
|
this.mappingStk = mappingStk;
|
||||||
|
}
|
||||||
|
|
||||||
|
String mappingStk="";
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
|
public class GeotaggingBeans {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String storeid;
|
||||||
|
public String url1;
|
||||||
|
public String url2;
|
||||||
|
public String status;
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String url3;
|
||||||
|
public double Latitude ;
|
||||||
|
public double Longitude;
|
||||||
|
|
||||||
|
public String getStoreid() {
|
||||||
|
return storeid;
|
||||||
|
}
|
||||||
|
public void setStoreid(String storeid) {
|
||||||
|
this.storeid = storeid;
|
||||||
|
}
|
||||||
|
public double getLatitude() {
|
||||||
|
return Latitude;
|
||||||
|
}
|
||||||
|
public void setLatitude(double d) {
|
||||||
|
Latitude = d;
|
||||||
|
}
|
||||||
|
public double getLongitude() {
|
||||||
|
return Longitude;
|
||||||
|
}
|
||||||
|
public void setLongitude(double d) {
|
||||||
|
Longitude = d;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setUrl1(String url1)
|
||||||
|
{
|
||||||
|
|
||||||
|
this.url1=url1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrl1()
|
||||||
|
{
|
||||||
|
|
||||||
|
return url1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUrl2(String url2)
|
||||||
|
{
|
||||||
|
|
||||||
|
this.url2=url2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrl2()
|
||||||
|
{
|
||||||
|
|
||||||
|
return url2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUrl3(String url3)
|
||||||
|
{
|
||||||
|
|
||||||
|
this.url3=url3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrl3()
|
||||||
|
{
|
||||||
|
|
||||||
|
return url3;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class NoticeboardItem implements Serializable {
|
||||||
|
String NoticeBoardId;
|
||||||
|
String NoticThumnail_Path;
|
||||||
|
String NoticeLink_Thumbnail;
|
||||||
|
String NoticeLink_FullPage;
|
||||||
|
String FullPageTarget;
|
||||||
|
|
||||||
|
public String getNoticeBoardId() {
|
||||||
|
return NoticeBoardId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoticeBoardId(String noticeBoardId) {
|
||||||
|
this.NoticeBoardId = noticeBoardId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNoticThumnail_Path() {
|
||||||
|
return NoticThumnail_Path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoticThumnail_Path(String noticThumnail_Path) {
|
||||||
|
this.NoticThumnail_Path = noticThumnail_Path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNoticeLink_Thumbnail() {
|
||||||
|
return NoticeLink_Thumbnail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoticeLink_Thumbnail(String noticeLink_Thumbnail) {
|
||||||
|
this.NoticeLink_Thumbnail = noticeLink_Thumbnail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNoticeLink_FullPage() {
|
||||||
|
return NoticeLink_FullPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoticeLink_FullPage(String noticeLink_FullPage) {
|
||||||
|
this.NoticeLink_FullPage = noticeLink_FullPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFullPageTarget() {
|
||||||
|
return FullPageTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFullPageTarget(String fullPageTarget) {
|
||||||
|
this.FullPageTarget = fullPageTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class OrderReceivedStatus implements Serializable {
|
||||||
|
//TextView sys_gen_poTV,storepoTV,podateTV,lineItemTV,statusTV;
|
||||||
|
String sys_gen_po="";
|
||||||
|
String storepo="";
|
||||||
|
String podate="";
|
||||||
|
String lineItem="";
|
||||||
|
String status="";
|
||||||
|
int SKU_ID;
|
||||||
|
int ORDERQTY;
|
||||||
|
int CATEGORY_ID;
|
||||||
|
int POID;
|
||||||
|
|
||||||
|
public int getPOID() {
|
||||||
|
return POID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPOID(int POID) {
|
||||||
|
this.POID = POID;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getStoreid() {
|
||||||
|
return Storeid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStoreid(int storeid) {
|
||||||
|
Storeid = storeid;
|
||||||
|
}
|
||||||
|
|
||||||
|
int Storeid;
|
||||||
|
|
||||||
|
public int getSKU_ID() {
|
||||||
|
return SKU_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSKU_ID(int SKU_ID) {
|
||||||
|
this.SKU_ID = SKU_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getORDERQTY() {
|
||||||
|
return ORDERQTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setORDERQTY(int ORDERQTY) {
|
||||||
|
this.ORDERQTY = ORDERQTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCATEGORY_ID() {
|
||||||
|
return CATEGORY_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCATEGORY_ID(int CATEGORY_ID) {
|
||||||
|
this.CATEGORY_ID = CATEGORY_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getSys_gen_po() {
|
||||||
|
return sys_gen_po;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSys_gen_po(String sys_gen_po) {
|
||||||
|
this.sys_gen_po = sys_gen_po;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStorepo() {
|
||||||
|
return storepo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStorepo(String storepo) {
|
||||||
|
this.storepo = storepo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPodate() {
|
||||||
|
return podate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPodate(String podate) {
|
||||||
|
this.podate = podate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLineItem() {
|
||||||
|
return lineItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLineItem(String lineItem) {
|
||||||
|
this.lineItem = lineItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class PD_CONFIGURATION {
|
||||||
|
ArrayList<String> PROJECT_ID = new ArrayList<>();
|
||||||
|
ArrayList<String> USER_ID = new ArrayList<>();
|
||||||
|
public ArrayList<String> getUSER_ID() {
|
||||||
|
return USER_ID;
|
||||||
|
}
|
||||||
|
public void setUSER_ID(String USER_ID) {
|
||||||
|
this.USER_ID.add(USER_ID);
|
||||||
|
}
|
||||||
|
public ArrayList<String> getPROJECT_ID() {
|
||||||
|
return PROJECT_ID;
|
||||||
|
}
|
||||||
|
public void setPROJECT_ID(String PROJECT_ID) {
|
||||||
|
this.PROJECT_ID.add(PROJECT_ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,193 @@
|
|||||||
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ashishc on 29-12-2016.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class StoreBean implements Serializable{
|
||||||
|
String STORE_ID;
|
||||||
|
String EMP_ID;
|
||||||
|
String KEYACCOUNT;
|
||||||
|
String STORE_NAME;
|
||||||
|
String ADDRESS;
|
||||||
|
String CITY;
|
||||||
|
String STORETYPE;
|
||||||
|
String CLASSIFICATION;
|
||||||
|
String KEYACCOUNT_ID;
|
||||||
|
String STORETYPE_ID;
|
||||||
|
String CLASS_ID;
|
||||||
|
String VISIT_DATE;
|
||||||
|
String CAMERA_ALLOW;
|
||||||
|
String UPLOAD_STATUS;
|
||||||
|
String LATITUDE;
|
||||||
|
String LONGITUDE;
|
||||||
|
String POG_TYPE_ID;
|
||||||
|
|
||||||
|
public String getFACING_HIDE() {
|
||||||
|
return FACING_HIDE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFACING_HIDE(String FACING_HIDE) {
|
||||||
|
this.FACING_HIDE = FACING_HIDE;
|
||||||
|
}
|
||||||
|
|
||||||
|
String FACING_HIDE;
|
||||||
|
|
||||||
|
public String getSTORE_ID() {
|
||||||
|
return STORE_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSTORE_ID(String STORE_ID) {
|
||||||
|
this.STORE_ID = STORE_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEMP_ID() {
|
||||||
|
return EMP_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEMP_ID(String EMP_ID) {
|
||||||
|
this.EMP_ID = EMP_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKEYACCOUNT() {
|
||||||
|
return KEYACCOUNT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKEYACCOUNT(String KEYACCOUNT) {
|
||||||
|
this.KEYACCOUNT = KEYACCOUNT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSTORE_NAME() {
|
||||||
|
return STORE_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSTORE_NAME(String STORE_NAME) {
|
||||||
|
this.STORE_NAME = STORE_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getADDRESS() {
|
||||||
|
return ADDRESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setADDRESS(String ADDRESS) {
|
||||||
|
this.ADDRESS = ADDRESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCITY() {
|
||||||
|
return CITY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCITY(String CITY) {
|
||||||
|
this.CITY = CITY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSTORETYPE() {
|
||||||
|
return STORETYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSTORETYPE(String STORETYPE) {
|
||||||
|
this.STORETYPE = STORETYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCLASSIFICATION() {
|
||||||
|
return CLASSIFICATION;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCLASSIFICATION(String CLASSIFICATION) {
|
||||||
|
this.CLASSIFICATION = CLASSIFICATION;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKEYACCOUNT_ID() {
|
||||||
|
return KEYACCOUNT_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKEYACCOUNT_ID(String KEYACCOUNT_ID) {
|
||||||
|
this.KEYACCOUNT_ID = KEYACCOUNT_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSTORETYPE_ID() {
|
||||||
|
return STORETYPE_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSTORETYPE_ID(String STORETYPE_ID) {
|
||||||
|
this.STORETYPE_ID = STORETYPE_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCLASS_ID() {
|
||||||
|
return CLASS_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCLASS_ID(String CLASS_ID) {
|
||||||
|
this.CLASS_ID = CLASS_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVISIT_DATE() {
|
||||||
|
return VISIT_DATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVISIT_DATE(String VISIT_DATE) {
|
||||||
|
this.VISIT_DATE = VISIT_DATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCAMERA_ALLOW() {
|
||||||
|
return CAMERA_ALLOW;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCAMERA_ALLOW(String CAMERA_ALLOW) {
|
||||||
|
this.CAMERA_ALLOW = CAMERA_ALLOW;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUPLOAD_STATUS() {
|
||||||
|
return UPLOAD_STATUS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUPLOAD_STATUS(String UPLOAD_STATUS) {
|
||||||
|
this.UPLOAD_STATUS = UPLOAD_STATUS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCHECKOUT_STATUS() {
|
||||||
|
return CHECKOUT_STATUS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCHECKOUT_STATUS(String CHECKOUT_STATUS) {
|
||||||
|
this.CHECKOUT_STATUS = CHECKOUT_STATUS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGEO_TAG() {
|
||||||
|
return GEO_TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGEO_TAG(String GEO_TAG) {
|
||||||
|
this.GEO_TAG = GEO_TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
String CHECKOUT_STATUS;
|
||||||
|
String GEO_TAG ;
|
||||||
|
|
||||||
|
|
||||||
|
public String getLATITUDE() {
|
||||||
|
return LATITUDE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLATITUDE(String LATITUDE) {
|
||||||
|
this.LATITUDE = LATITUDE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLONGITUDE() {
|
||||||
|
return LONGITUDE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLONGITUDE(String LONGITUDE) {
|
||||||
|
this.LONGITUDE = LONGITUDE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPOG_TYPE_ID() {
|
||||||
|
return POG_TYPE_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPOG_TYPE_ID(String POG_TYPE_ID) {
|
||||||
|
this.POG_TYPE_ID = POG_TYPE_ID;
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,818 @@
|
|||||||
|
package cpm.com.gskmtorange;
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.net.ConnectivityManager;
|
||||||
|
import android.net.NetworkInfo;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.webkit.WebView;
|
||||||
|
import android.webkit.WebViewClient;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.ActionBarDrawerToggle;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
|
import androidx.core.view.GravityCompat;
|
||||||
|
import androidx.drawerlayout.widget.DrawerLayout;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import androidx.viewpager2.widget.ViewPager2;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||||
|
import com.google.android.material.navigation.NavigationView;
|
||||||
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
|
import org.json.JSONObject;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
|
import cpm.com.gskmtorange.GeoTag.GeoTagStoreList;
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.CounterfeitIndicatorWebActivity;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.DeliveryCallActivity;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.FutureJCPActivity;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.PlanogramPDFActivity;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.ServiceActivity;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.SettingsActivity;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.StoreListActivity;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.WebViewActivity;
|
||||||
|
import cpm.com.gskmtorange.download.DownloadActivity;
|
||||||
|
import cpm.com.gskmtorange.password.ChangePasswordActivity;
|
||||||
|
import cpm.com.gskmtorange.upload.PreviousDataUploadActivity;
|
||||||
|
import cpm.com.gskmtorange.upload.UploadActivity;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.NoticeItem;
|
||||||
|
|
||||||
|
public class MainActivity extends AppCompatActivity
|
||||||
|
implements NavigationView.OnNavigationItemSelectedListener {
|
||||||
|
private Context context;
|
||||||
|
WebView webView;
|
||||||
|
ImageView imageView;
|
||||||
|
ViewPager2 viewPager;
|
||||||
|
private Handler sliderHandler = new Handler();
|
||||||
|
private Runnable sliderRunnable;
|
||||||
|
private List<ImageView> dots = new ArrayList<>();
|
||||||
|
List<NoticeItem>bannerlist = null;
|
||||||
|
String date;
|
||||||
|
String app_ver;
|
||||||
|
private SharedPreferences preferences = null;
|
||||||
|
GSKOrangeDB db;
|
||||||
|
String user_name, country_id;
|
||||||
|
ArrayList<StoreBean> storelist = new ArrayList<StoreBean>();
|
||||||
|
View headerView;
|
||||||
|
ArrayList<CoverageBean> coverageList;
|
||||||
|
String error_msg;
|
||||||
|
Toolbar toolbar;
|
||||||
|
LinearLayout dotsLayout;
|
||||||
|
NavigationView navigationView;
|
||||||
|
|
||||||
|
@SuppressLint("SetJavaScriptEnabled")
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_main);
|
||||||
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
viewPager = findViewById(R.id.viewPager);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
context = this;
|
||||||
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
imageView = (ImageView) findViewById(R.id.img_main);
|
||||||
|
dotsLayout = findViewById(R.id.dotsLayout);
|
||||||
|
webView = (WebView) findViewById(R.id.webview);
|
||||||
|
String url = preferences.getString(CommonString.KEY_NOTICE_BOARD_LINK, "");
|
||||||
|
// String url = "https://dle.parinaam.in/OneApp/Dabur/brand-spiels/dabur-brand-spiels.html";
|
||||||
|
user_name = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||||
|
db = new GSKOrangeDB(MainActivity.this);
|
||||||
|
db.open();
|
||||||
|
webView.setWebViewClient(new MyWebViewClient());
|
||||||
|
webView.getSettings().setJavaScriptEnabled(true);
|
||||||
|
|
||||||
|
String json = preferences.getString("NOTICEBOARD_DATA", null) != null
|
||||||
|
? preferences.getString("NOTICEBOARD_DATA", null)
|
||||||
|
: "";
|
||||||
|
Log.d("noticejsondata",json);
|
||||||
|
if (!json.isEmpty()) {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
NoticeResponse response =
|
||||||
|
gson.fromJson(json, NoticeResponse.class);
|
||||||
|
bannerlist = response.Mer_NoticeBoard;
|
||||||
|
Log.d("SIZE", String.valueOf(bannerlist.size()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(bannerlist!=null && bannerlist.size()>0){
|
||||||
|
setupDots(bannerlist.size());
|
||||||
|
viewPager.setAdapter(new NoticeAdapter(bannerlist, this::handleClick));
|
||||||
|
}
|
||||||
|
viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
|
||||||
|
@Override
|
||||||
|
public void onPageSelected(int position) {
|
||||||
|
super.onPageSelected(position);
|
||||||
|
|
||||||
|
setActiveDot(position); // 👈 your dots logic
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPageScrollStateChanged(int state) {
|
||||||
|
super.onPageScrollStateChanged(state);
|
||||||
|
|
||||||
|
if (state == ViewPager2.SCROLL_STATE_DRAGGING) {
|
||||||
|
sliderHandler.removeCallbacks(sliderRunnable); // stop
|
||||||
|
}
|
||||||
|
else if (state == ViewPager2.SCROLL_STATE_IDLE) {
|
||||||
|
startAutoSlide(); // 🔥 don't call postDelayed directly
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
viewPager.setClipToPadding(false);
|
||||||
|
viewPager.setClipChildren(false);
|
||||||
|
|
||||||
|
if (!url.isEmpty()) {
|
||||||
|
webView.loadUrl(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
|
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
|
||||||
|
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
||||||
|
drawer.setDrawerListener(toggle);
|
||||||
|
toggle.syncState();
|
||||||
|
navigationView = (NavigationView) findViewById(R.id.nav_view);
|
||||||
|
headerView = LayoutInflater.from(this).inflate(R.layout.nav_header_main, navigationView, false);
|
||||||
|
TextView tv_username = (TextView) headerView.findViewById(R.id.nav_user_name);
|
||||||
|
//tv_usertype = (TextView) headerView.findViewById(R.id.nav_user_type);
|
||||||
|
ImageView img_change_password = (ImageView) headerView.findViewById(R.id.img_change_password);
|
||||||
|
tv_username.setText(user_name);
|
||||||
|
//tv_usertype.setText(user_type);
|
||||||
|
|
||||||
|
img_change_password.setOnClickListener(v -> {
|
||||||
|
Intent in = new Intent(context, ChangePasswordActivity.class);
|
||||||
|
startActivity(in);
|
||||||
|
});
|
||||||
|
|
||||||
|
navigationView.addHeaderView(headerView);
|
||||||
|
navigationView.setNavigationItemSelectedListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupDots(int size) {
|
||||||
|
dotsLayout.removeAllViews();
|
||||||
|
dots.clear();
|
||||||
|
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
ImageView dot = new ImageView(this);
|
||||||
|
|
||||||
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
|
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||||
|
);
|
||||||
|
params.setMargins(8, 0, 8, 0);
|
||||||
|
dot.setLayoutParams(params);
|
||||||
|
|
||||||
|
// default (inactive)
|
||||||
|
dot.setImageResource(R.drawable.dot_inactive);
|
||||||
|
|
||||||
|
dotsLayout.addView(dot);
|
||||||
|
dots.add(dot);
|
||||||
|
}
|
||||||
|
|
||||||
|
// set first dot active
|
||||||
|
if (size > 0) {
|
||||||
|
setActiveDot(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setActiveDot(int position) {
|
||||||
|
|
||||||
|
for (int i = 0; i < dots.size(); i++) {
|
||||||
|
ImageView dot = dots.get(i);
|
||||||
|
|
||||||
|
if (i == position) {
|
||||||
|
// Active dot (bigger + dark)
|
||||||
|
dot.setImageResource(R.drawable.dot_active);
|
||||||
|
|
||||||
|
dot.animate()
|
||||||
|
.scaleX(1f)
|
||||||
|
.scaleY(1f)
|
||||||
|
.setDuration(200)
|
||||||
|
.start();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Inactive dot (small + light)
|
||||||
|
dot.setImageResource(R.drawable.dot_inactive);
|
||||||
|
|
||||||
|
dot.animate()
|
||||||
|
.scaleX(1f)
|
||||||
|
.scaleY(1f)
|
||||||
|
.setDuration(200)
|
||||||
|
.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleClick(NoticeItem item) {
|
||||||
|
|
||||||
|
String url = String.valueOf(item.getNoticeLink_FullPage());
|
||||||
|
String type = String.valueOf(item.getFullPageTarget());
|
||||||
|
// Log.d("clickdata",url + ","+type);
|
||||||
|
Log.e("clickdata", "URL = " + url);
|
||||||
|
System.out.println("FULL URL = " + url);
|
||||||
|
|
||||||
|
if (type == null) return;
|
||||||
|
|
||||||
|
switch (type.toLowerCase()) {
|
||||||
|
case "html-webview":
|
||||||
|
Log.d("itemdata", String.valueOf(item.getFullPageTarget()));
|
||||||
|
Intent webIntent = new Intent(this, WebViewActivity.class);
|
||||||
|
webIntent.putExtra("url", url);
|
||||||
|
webIntent.putExtra("type", item.getFullPageTarget());
|
||||||
|
webIntent.putExtra("dt_level", "");
|
||||||
|
startActivity(webIntent);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "html-webbrowser":
|
||||||
|
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "video":
|
||||||
|
Intent videoIntent = new Intent(this, WebViewActivity.class);
|
||||||
|
videoIntent.putExtra("url", url);
|
||||||
|
videoIntent.putExtra("type", item.getFullPageTarget());
|
||||||
|
videoIntent.putExtra("dt_level", "");
|
||||||
|
startActivity(videoIntent);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "image":
|
||||||
|
Intent imageIntent = new Intent(this, WebViewActivity.class);
|
||||||
|
imageIntent.putExtra("url", url);
|
||||||
|
imageIntent.putExtra("type", item.getFullPageTarget());
|
||||||
|
imageIntent.putExtra("dt_level", "");
|
||||||
|
startActivity(imageIntent);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "deeplink":
|
||||||
|
try {
|
||||||
|
Intent deepIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||||
|
startActivity(deepIntent);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Toast.makeText(this, "Invalid deeplink", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "contact":
|
||||||
|
handleContact(url);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
Toast.makeText(this, "Unsupported type", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleContact(String raw) {
|
||||||
|
try {
|
||||||
|
// remove query params
|
||||||
|
String jsonPart = raw.split("\\?")[0];
|
||||||
|
|
||||||
|
JSONObject obj = new JSONObject(jsonPart);
|
||||||
|
|
||||||
|
String number = obj.getString("Value");
|
||||||
|
|
||||||
|
Intent intent = new Intent(Intent.ACTION_DIAL);
|
||||||
|
intent.setData(Uri.parse("tel:" + number));
|
||||||
|
startActivity(intent);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Toast.makeText(this, "Invalid contact data", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String loadJSONFromAsset() {
|
||||||
|
String json = null;
|
||||||
|
try {
|
||||||
|
InputStream is = getAssets().open("notice.json");
|
||||||
|
int size = is.available();
|
||||||
|
byte[] buffer = new byte[size];
|
||||||
|
is.read(buffer);
|
||||||
|
is.close();
|
||||||
|
json = new String(buffer, "UTF-8");
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
toolbar.setTitle(getString(R.string.main_menu_activity_name));
|
||||||
|
db.open();
|
||||||
|
//usk
|
||||||
|
navigationView = (NavigationView) findViewById(R.id.nav_view);
|
||||||
|
startAutoSlide();
|
||||||
|
try {
|
||||||
|
app_ver = String.valueOf(getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
|
||||||
|
// login_version.setText("Parinaam Version " + app_ver);
|
||||||
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
// get menu from navigationView
|
||||||
|
Menu menu = navigationView.getMenu();
|
||||||
|
// find MenuItem you want to change
|
||||||
|
MenuItem nav_route_plan = menu.findItem(R.id.nav_route_plan);
|
||||||
|
nav_route_plan.setTitle(getResources().getString(R.string.menu_daily_route_plan));
|
||||||
|
MenuItem nav_route_plan1 = menu.findItem(R.id.nav_download);
|
||||||
|
nav_route_plan1.setTitle(getResources().getString(R.string.menu_daily_download));
|
||||||
|
MenuItem nav_route_plan2 = menu.findItem(R.id.nav_upload);
|
||||||
|
nav_route_plan2.setTitle(getResources().getString(R.string.menu_upload_data));
|
||||||
|
MenuItem nav_route_plan3 = menu.findItem(R.id.nav_geotag);
|
||||||
|
nav_route_plan3.setTitle(getResources().getString(R.string.menu_geotag));
|
||||||
|
MenuItem nav_route_plan4 = menu.findItem(R.id.nav_deviation);
|
||||||
|
nav_route_plan4.setTitle(getResources().getString(R.string.menu_deviation_data));
|
||||||
|
MenuItem nav_route_plan5 = menu.findItem(R.id.nav_delivery_call);
|
||||||
|
nav_route_plan5.setTitle(getResources().getString(R.string.delivery_call));
|
||||||
|
MenuItem nav_route_plan6 = menu.findItem(R.id.nav_future_jcp);
|
||||||
|
nav_route_plan6.setTitle(getResources().getString(R.string.future_route_plan));
|
||||||
|
MenuItem nav_route_plan7 = menu.findItem(R.id.nav_planogram);
|
||||||
|
nav_route_plan7.setTitle(getResources().getString(R.string.category_performance_PLANOGRAM));
|
||||||
|
MenuItem nav_route_plan8 = menu.findItem(R.id.nav_pharmacy_stores);
|
||||||
|
nav_route_plan8.setTitle(getResources().getString(R.string.pharma_stores));
|
||||||
|
MenuItem nav_route_plan9 = menu.findItem(R.id.nav_additional_stores);
|
||||||
|
nav_route_plan9.setTitle(getResources().getString(R.string.additional_stores));
|
||||||
|
MenuItem nav_route_plan10 = menu.findItem(R.id.nav_additional_adhoc_stores);
|
||||||
|
nav_route_plan10.setTitle(getResources().getString(R.string.additional_adhoc_stores));
|
||||||
|
MenuItem nav_route_plan11 = menu.findItem(R.id.nav_counterfeit_indicator);
|
||||||
|
nav_route_plan11.setTitle(getResources().getString(R.string.title_activity_counterfeit_indicator_web));
|
||||||
|
MenuItem nav_route_plan12 = menu.findItem(R.id.nav_exit);
|
||||||
|
nav_route_plan12.setTitle(getResources().getString(R.string.menu_exit));
|
||||||
|
MenuItem nav_route_plan13 = menu.findItem(R.id.nav_setting);
|
||||||
|
nav_route_plan13.setTitle(getResources().getString(R.string.menu_setting));
|
||||||
|
MenuItem nav_route_plan14 = menu.findItem(R.id.nav_services);
|
||||||
|
nav_route_plan14.setTitle(getResources().getString(R.string.menu_services));
|
||||||
|
|
||||||
|
MenuItem nav_route_plan15 = menu.findItem(R.id.nav_version);
|
||||||
|
nav_route_plan15.setTitle("Version/Versiyon - " + app_ver + "-T3");
|
||||||
|
//Enable disable According to Configuration
|
||||||
|
ArrayList<ConfigurationMasterGetterSetter> configurationData = db.getConfigurationMasterData(country_id);
|
||||||
|
if (!configurationData.isEmpty()) {
|
||||||
|
for (int i = 0; i < configurationData.size(); i++) {
|
||||||
|
if (configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("ADHOC REPORTING") &&
|
||||||
|
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")) {
|
||||||
|
Menu nav_Menu = navigationView.getMenu();
|
||||||
|
nav_Menu.findItem(R.id.nav_deviation).setVisible(true);
|
||||||
|
}
|
||||||
|
//temp remove it
|
||||||
|
if (configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("PDF ALLOW") &&
|
||||||
|
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")) {
|
||||||
|
Menu nav_Menu = navigationView.getMenu();
|
||||||
|
nav_Menu.findItem(R.id.nav_planogram).setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("DELIVERY CALLS") &&
|
||||||
|
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")) {
|
||||||
|
Menu nav_Menu = navigationView.getMenu();
|
||||||
|
nav_Menu.findItem(R.id.nav_delivery_call).setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("ADDITIONAL STORE") &&
|
||||||
|
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")) {
|
||||||
|
Menu nav_Menu = navigationView.getMenu();
|
||||||
|
nav_Menu.findItem(R.id.nav_additional_stores).setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("PHARMA STORE") &&
|
||||||
|
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")) {
|
||||||
|
Menu nav_Menu = navigationView.getMenu();
|
||||||
|
nav_Menu.findItem(R.id.nav_pharmacy_stores).setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("COUNTERFEIT INDICATORS") &&
|
||||||
|
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")) {
|
||||||
|
Menu nav_Menu = navigationView.getMenu();
|
||||||
|
nav_Menu.findItem(R.id.nav_counterfeit_indicator).setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
db.open();
|
||||||
|
coverageList = db.getCoverageData(date, null);
|
||||||
|
storelist = db.getStoreData(date, CommonString.KEY_JOURNEY_PLAN);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startAutoSlide() {
|
||||||
|
|
||||||
|
if (sliderRunnable != null) {
|
||||||
|
sliderHandler.removeCallbacks(sliderRunnable); // 🔥 prevent duplicate
|
||||||
|
}
|
||||||
|
|
||||||
|
sliderRunnable = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
if (viewPager.getAdapter() == null) return;
|
||||||
|
|
||||||
|
int nextItem = (viewPager.getCurrentItem() + 1) %
|
||||||
|
viewPager.getAdapter().getItemCount();
|
||||||
|
|
||||||
|
viewPager.setCurrentItem(nextItem, true);
|
||||||
|
|
||||||
|
sliderHandler.postDelayed(this, 3000); // 3 sec
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
sliderHandler.postDelayed(sliderRunnable, 3000);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
super.onBackPressed();
|
||||||
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
|
if (drawer.isDrawerOpen(GravityCompat.START)) {
|
||||||
|
drawer.closeDrawer(GravityCompat.START);
|
||||||
|
} else {
|
||||||
|
// super.onBackPressed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("StatementWithEmptyBody")
|
||||||
|
@Override
|
||||||
|
public boolean onNavigationItemSelected(MenuItem item) {
|
||||||
|
// Handle navigation view item clicks here.
|
||||||
|
int id = item.getItemId();
|
||||||
|
if (id == R.id.nav_route_plan) {
|
||||||
|
Intent in_jcp = new Intent(this, StoreListActivity.class);
|
||||||
|
in_jcp.putExtra(CommonString.KEY_STORE_FLAG, CommonString.FROM_JCP);
|
||||||
|
startActivity(in_jcp);
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
} else if (id == R.id.nav_download) {
|
||||||
|
downloadMethod();
|
||||||
|
} else if (id == R.id.nav_upload) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
|
||||||
|
builder.setTitle(getResources().getString(R.string.dialog_title));
|
||||||
|
builder.setMessage(getResources().getString(R.string.want_to_upload)).setCancelable(false)
|
||||||
|
.setPositiveButton(getResources().getString(R.string.ok), (dialog, id1) -> {
|
||||||
|
db.open();
|
||||||
|
if (checkNetIsAvailable()) {
|
||||||
|
if (db.getSKUMasterData(null).isEmpty()) {
|
||||||
|
Snackbar.make(webView, R.string.title_store_list_download_data, Snackbar.LENGTH_SHORT)
|
||||||
|
.setAction("Action", null).show();
|
||||||
|
} else {
|
||||||
|
if (coverageList.isEmpty()) {
|
||||||
|
Snackbar.make(webView, R.string.no_data_for_upload, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||||
|
} else {
|
||||||
|
if (isStoreCheckedIn() && isValid()) {
|
||||||
|
Intent i = new Intent(getBaseContext(), UploadActivity.class);
|
||||||
|
startActivity(i);
|
||||||
|
} else {
|
||||||
|
Snackbar.make(webView, error_msg, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Snackbar.make(webView, getResources().getString(R.string.nonetwork), Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||||
|
}
|
||||||
|
}).setNegativeButton(getResources().getString(R.string.cancel), (dialog, which) -> dialog.dismiss());
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
|
||||||
|
} else if (id == R.id.nav_geotag) {
|
||||||
|
if (!storelist.isEmpty()) {
|
||||||
|
Intent startDownload = new Intent(this, GeoTagStoreList.class);
|
||||||
|
startActivity(startDownload);
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
} else {
|
||||||
|
Snackbar.make(headerView, R.string.title_store_list_download_data, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (id == R.id.nav_exit) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
|
||||||
|
builder.setTitle(getResources().getString(R.string.dialog_title));
|
||||||
|
builder.setMessage(getResources().getString(R.string.want_to_exit)).setCancelable(false)
|
||||||
|
.setPositiveButton(getResources().getString(R.string.ok), (dialog, id12) -> {
|
||||||
|
ActivityCompat.finishAffinity(MainActivity.this);
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}).setNegativeButton(getResources().getString(R.string.cancel), (dialog, which) -> {
|
||||||
|
dialog.dismiss();
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
|
||||||
|
} else if (id == R.id.nav_setting) {
|
||||||
|
Intent startDownload = new Intent(this, SettingsActivity.class);
|
||||||
|
startActivity(startDownload);
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
} else if (id == R.id.nav_services) {
|
||||||
|
Intent startservice = new Intent(this, ServiceActivity.class);
|
||||||
|
startActivity(startservice);
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
} else if (id == R.id.nav_future_jcp) {
|
||||||
|
Intent startDownload = new Intent(this, FutureJCPActivity.class);
|
||||||
|
startActivity(startDownload);
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
} else if (id == R.id.nav_planogram) {
|
||||||
|
if (checkNetIsAvailable()) {
|
||||||
|
Intent planogram_pdf = new Intent(this, PlanogramPDFActivity.class);
|
||||||
|
startActivity(planogram_pdf);
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
} else {
|
||||||
|
Snackbar.make(webView, getResources().getString(R.string.nonetwork), Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (id == R.id.nav_deviation) {
|
||||||
|
db.open();
|
||||||
|
if (db.getSKUMasterData(null).isEmpty()) {
|
||||||
|
Snackbar.make(webView, R.string.title_store_list_download_data, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||||
|
} else {
|
||||||
|
Intent in = new Intent(this, StoreListActivity.class);
|
||||||
|
in.putExtra(CommonString.KEY_STORE_FLAG, CommonString.FROM_DEVIATION);
|
||||||
|
startActivity(in);
|
||||||
|
}
|
||||||
|
} else if (id == R.id.nav_delivery_call) {
|
||||||
|
Intent in = new Intent(this, DeliveryCallActivity.class);
|
||||||
|
startActivity(in);
|
||||||
|
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
} else if (id == R.id.nav_pharmacy_stores) {
|
||||||
|
Intent in = new Intent(this, StoreListActivity.class);
|
||||||
|
in.putExtra(CommonString.KEY_STORE_FLAG, CommonString.FROM_PHARMA);
|
||||||
|
startActivity(in);
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
} else if (id == R.id.nav_additional_stores) {
|
||||||
|
db.open();
|
||||||
|
if (db.getSKUMasterData(null).isEmpty()) {
|
||||||
|
Snackbar.make(webView, R.string.title_store_list_download_data, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||||
|
} else {
|
||||||
|
Intent in = new Intent(this, StoreListActivity.class);
|
||||||
|
in.putExtra(CommonString.KEY_STORE_FLAG, CommonString.FROM_ADDITIONAL);
|
||||||
|
startActivity(in);
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
}
|
||||||
|
} else if (id == R.id.nav_additional_adhoc_stores) {
|
||||||
|
db.open();
|
||||||
|
if (db.getSKUMasterData(null).isEmpty()) {
|
||||||
|
Snackbar.make(webView, R.string.title_store_list_download_data, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||||
|
} else {
|
||||||
|
Intent in = new Intent(this, StoreListActivity.class);
|
||||||
|
in.putExtra(CommonString.KEY_STORE_FLAG, CommonString.FROM_ADDITIONAL_ADHOC);
|
||||||
|
startActivity(in);
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
}
|
||||||
|
} else if (id == R.id.nav_counterfeit_indicator) {
|
||||||
|
Intent intent = new Intent(this, CounterfeitIndicatorWebActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
|
drawer.closeDrawer(GravityCompat.START);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private class MyWebViewClient extends WebViewClient {
|
||||||
|
@Override
|
||||||
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||||
|
view.loadUrl(url);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPageFinished(WebView view, String url) {
|
||||||
|
imageView.setVisibility(View.GONE);
|
||||||
|
webView.setVisibility(View.VISIBLE);
|
||||||
|
super.onPageFinished(view, url);
|
||||||
|
view.clearCache(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
||||||
|
super.onPageStarted(view, url, favicon);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean checkNetIsAvailable() {
|
||||||
|
ConnectivityManager cm =
|
||||||
|
(ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
|
|
||||||
|
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
|
||||||
|
boolean isConnected = activeNetwork != null &&
|
||||||
|
activeNetwork.isConnectedOrConnecting();
|
||||||
|
return isConnected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isStoreCheckedIn() {
|
||||||
|
|
||||||
|
boolean result_flag = true;
|
||||||
|
for (int i = 0; i < coverageList.size(); i++) {
|
||||||
|
|
||||||
|
String status = coverageList.get(i).getStatus();
|
||||||
|
if (status.equals(CommonString.KEY_INVALID) || status.equals(CommonString.KEY_VALID)) {
|
||||||
|
result_flag = false;
|
||||||
|
error_msg = getResources().getString(R.string.title_store_list_checkout_current);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result_flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isValid() {
|
||||||
|
boolean flag = false;
|
||||||
|
String storestatus = "";
|
||||||
|
for (int i = 0; i < coverageList.size(); i++) {
|
||||||
|
|
||||||
|
StoreBean store_data = db.getSpecificStoreData(date, coverageList.get(i).getStoreId(), coverageList.get(i).getFlag_from());
|
||||||
|
|
||||||
|
storestatus = store_data.getUPLOAD_STATUS();
|
||||||
|
String coverage_status = store_data.getCHECKOUT_STATUS();
|
||||||
|
|
||||||
|
if (!storestatus.equalsIgnoreCase(CommonString.KEY_U) && !storestatus.equalsIgnoreCase(CommonString.KEY_UN)) {
|
||||||
|
if ((coverage_status.equalsIgnoreCase(CommonString.KEY_Y) || storestatus.equalsIgnoreCase(CommonString.KEY_P) ||
|
||||||
|
storestatus.equalsIgnoreCase(CommonString.STORE_STATUS_LEAVE))) {
|
||||||
|
flag = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!flag)
|
||||||
|
error_msg = getResources().getString(R.string.no_data_for_upload);
|
||||||
|
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPreviousValid(String visit_date) {
|
||||||
|
boolean isvalid = false;
|
||||||
|
ArrayList<CoverageBean> coverage_list = db.getPreviousCoverageData(visit_date, null);
|
||||||
|
for (int i = 0; i < coverage_list.size(); i++) {
|
||||||
|
StoreBean storeData = db.getSpecificStoreData(coverage_list.get(i).getVisitDate(), coverage_list.get(i).getStoreId(), coverage_list.get(i).getFlag_from());
|
||||||
|
if (storeData.getSTORE_ID() != null) {
|
||||||
|
|
||||||
|
if (!storeData.getUPLOAD_STATUS().equals(CommonString.KEY_U) && !storeData.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_UN) && (storeData.getCHECKOUT_STATUS().equals(CommonString.KEY_Y) ||
|
||||||
|
storeData.getCHECKOUT_STATUS().equals(CommonString.KEY_L) || storeData.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_P))) {
|
||||||
|
isvalid = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return isvalid;
|
||||||
|
}
|
||||||
|
|
||||||
|
//for download
|
||||||
|
public void downloadMethod() {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
|
||||||
|
builder.setTitle(getResources().getString(R.string.dialog_title));
|
||||||
|
builder.setMessage(getResources().getString(R.string.want_to_download)).setCancelable(false)
|
||||||
|
.setPositiveButton(getResources().getString(R.string.ok), (dialog, id) -> {
|
||||||
|
if (checkNetIsAvailable()) {
|
||||||
|
boolean previousflag = false;
|
||||||
|
if (db.isPreviousCoverageDataFilled(date)) {
|
||||||
|
if (isPreviousValid(date)) {
|
||||||
|
previousflag = true;
|
||||||
|
} else {
|
||||||
|
db.deletePreviousCoverageData(date);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (previousflag) {
|
||||||
|
AlertDialog.Builder builder1 = new AlertDialog.Builder(MainActivity.this);
|
||||||
|
builder1.setTitle("Parinaam");
|
||||||
|
builder1.setMessage(getResources().getString(R.string.previous_data_upload)).setCancelable(false)
|
||||||
|
.setPositiveButton(getResources().getString(R.string.ok), (dialog1, id1) -> {
|
||||||
|
Intent in = new Intent(context, PreviousDataUploadActivity.class);
|
||||||
|
startActivity(in);
|
||||||
|
//finish();
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder1.create();
|
||||||
|
alert.show();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Intent in = new Intent(context, DownloadActivity.class);
|
||||||
|
startActivity(in);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Snackbar.make(webView, getResources().getString(R.string.nonetwork), Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||||
|
}
|
||||||
|
}).setNegativeButton(getResources().getString(R.string.cancel), (dialog, which) -> {
|
||||||
|
dialog.dismiss();
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
public class NoticeAdapter extends RecyclerView.Adapter<NoticeAdapter.ViewHolder> {
|
||||||
|
|
||||||
|
private List<NoticeItem> list;
|
||||||
|
private OnItemClickListener listener;
|
||||||
|
|
||||||
|
// Interface for click handling
|
||||||
|
public interface OnItemClickListener {
|
||||||
|
void onClick(NoticeItem item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NoticeAdapter(List<NoticeItem> list, OnItemClickListener listener) {
|
||||||
|
this.list = list;
|
||||||
|
this.listener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
ImageView image;
|
||||||
|
|
||||||
|
public ViewHolder(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
image = itemView.findViewById(R.id.bannerImage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NoticeAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
View view = LayoutInflater.from(parent.getContext())
|
||||||
|
.inflate(R.layout.banner_item, parent, false);
|
||||||
|
return new ViewHolder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(NoticeAdapter.ViewHolder holder, int position) {
|
||||||
|
NoticeItem item = list.get(position);
|
||||||
|
|
||||||
|
String url = String.valueOf(item.getNoticeLink_Thumbnail());
|
||||||
|
Glide.with(holder.itemView.getContext())
|
||||||
|
.load(url)
|
||||||
|
.transform(new RoundedCorners(30))
|
||||||
|
.into(holder.image);
|
||||||
|
|
||||||
|
holder.itemView.setOnClickListener(v -> {
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onClick(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return list != null ? list.size() : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Append storeid and merid to the provided URL as query parameters.
|
||||||
|
* If the URL already contains query params, append with '&', otherwise use '?'.
|
||||||
|
*/
|
||||||
|
private String appendStoreMerQuery(String url, String storeId, String merId) {
|
||||||
|
if (url == null) return null;
|
||||||
|
try {
|
||||||
|
StringBuilder sb = new StringBuilder(url);
|
||||||
|
String separator = url.contains("?") ? "&" : "?";
|
||||||
|
boolean appended = false;
|
||||||
|
if (storeId != null && !storeId.isEmpty()) {
|
||||||
|
sb.append(separator).append("storeid=").append(URLEncoder.encode(storeId, "UTF-8"));
|
||||||
|
separator = "&";
|
||||||
|
appended = true;
|
||||||
|
}
|
||||||
|
if (merId != null && !merId.isEmpty()) {
|
||||||
|
sb.append(separator).append("merid=").append(URLEncoder.encode(merId, "UTF-8"));
|
||||||
|
appended = true;
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package cpm.com.gskmtorange;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
|
|
||||||
|
public class MovableFloatingActionButton extends FloatingActionButton implements View.OnTouchListener {
|
||||||
|
|
||||||
|
private final static float CLICK_DRAG_TOLERANCE = 10; // Often, there will be a slight, unintentional, drag when the user taps the FAB, so we need to account for this.
|
||||||
|
|
||||||
|
private float downRawX, downRawY;
|
||||||
|
private float dX, dY;
|
||||||
|
|
||||||
|
public MovableFloatingActionButton(Context context) {
|
||||||
|
super(context);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MovableFloatingActionButton(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MovableFloatingActionButton(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||||
|
super(context, attrs, defStyleAttr);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
setOnTouchListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onTouch(View view, MotionEvent motionEvent){
|
||||||
|
|
||||||
|
int action = motionEvent.getAction();
|
||||||
|
if (action == MotionEvent.ACTION_DOWN) {
|
||||||
|
|
||||||
|
downRawX = motionEvent.getRawX();
|
||||||
|
downRawY = motionEvent.getRawY();
|
||||||
|
dX = view.getX() - downRawX;
|
||||||
|
dY = view.getY() - downRawY;
|
||||||
|
|
||||||
|
return true; // Consumed
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (action == MotionEvent.ACTION_MOVE) {
|
||||||
|
|
||||||
|
int viewWidth = view.getWidth();
|
||||||
|
int viewHeight = view.getHeight();
|
||||||
|
|
||||||
|
View viewParent = (View)view.getParent();
|
||||||
|
int parentWidth = viewParent.getWidth();
|
||||||
|
int parentHeight = viewParent.getHeight();
|
||||||
|
|
||||||
|
float newX = motionEvent.getRawX() + dX;
|
||||||
|
newX = Math.max(0, newX); // Don't allow the FAB past the left hand side of the parent
|
||||||
|
newX = Math.min(parentWidth - viewWidth, newX); // Don't allow the FAB past the right hand side of the parent
|
||||||
|
|
||||||
|
float newY = motionEvent.getRawY() + dY;
|
||||||
|
newY = Math.max(0, newY); // Don't allow the FAB past the top of the parent
|
||||||
|
newY = Math.min(parentHeight - viewHeight, newY); // Don't allow the FAB past the bottom of the parent
|
||||||
|
|
||||||
|
view.animate()
|
||||||
|
.x(newX)
|
||||||
|
.y(newY)
|
||||||
|
.setDuration(0)
|
||||||
|
.start();
|
||||||
|
|
||||||
|
return true; // Consumed
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (action == MotionEvent.ACTION_UP) {
|
||||||
|
|
||||||
|
float upRawX = motionEvent.getRawX();
|
||||||
|
float upRawY = motionEvent.getRawY();
|
||||||
|
|
||||||
|
float upDX = upRawX - downRawX;
|
||||||
|
float upDY = upRawY - downRawY;
|
||||||
|
|
||||||
|
if (Math.abs(upDX) < CLICK_DRAG_TOLERANCE && Math.abs(upDY) < CLICK_DRAG_TOLERANCE) { // A click
|
||||||
|
return performClick();
|
||||||
|
}
|
||||||
|
else { // A drag
|
||||||
|
return true; // Consumed
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return super.onTouchEvent(motionEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package cpm.com.gskmtorange;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.NoticeItem;
|
||||||
|
|
||||||
|
public class NoticeResponse implements Serializable {
|
||||||
|
List<NoticeItem> Mer_NoticeBoard;
|
||||||
|
|
||||||
|
public NoticeResponse(List<NoticeItem> list) {
|
||||||
|
this.Mer_NoticeBoard = list;
|
||||||
|
}
|
||||||
|
public List<NoticeItem> getMer_NoticeBoard() {
|
||||||
|
return Mer_NoticeBoard;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package cpm.com.gskmtorange.Paralleldots;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.activity.EdgeToEdge;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.core.graphics.Insets;
|
||||||
|
import androidx.core.view.ViewCompat;
|
||||||
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
|
||||||
|
public class PdJavaImageActivity extends AppCompatActivity {
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
EdgeToEdge.enable(this);
|
||||||
|
setContentView(R.layout.activity_pd_java_image);
|
||||||
|
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||||
|
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||||
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||||
|
return insets;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
package cpm.com.gskmtorange;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
|
||||||
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.password.MPinActivity;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
||||||
|
|
||||||
|
public class SelectLanguageActivity extends AppCompatActivity implements View.OnClickListener {
|
||||||
|
Button btn_lang_1, btn_lang_2;
|
||||||
|
private Context context;
|
||||||
|
private SharedPreferences preferences = null;
|
||||||
|
private SharedPreferences.Editor editor = null;
|
||||||
|
LoginGetterSetter login_data;
|
||||||
|
ArrayList<String> language, culture_id;
|
||||||
|
boolean selected_flag = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_select_language);
|
||||||
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
context = this;
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
editor = preferences.edit();
|
||||||
|
btn_lang_1 = (Button) findViewById(R.id.btn_language_one);
|
||||||
|
btn_lang_2 = (Button) findViewById(R.id.btn_language_two);
|
||||||
|
login_data = (LoginGetterSetter) getIntent().getSerializableExtra(CommonString.KEY_LOGIN_DATA);
|
||||||
|
language = login_data.getCULTURE_NAME();
|
||||||
|
culture_id = login_data.getCULTURE_ID();
|
||||||
|
setDataFromSharedPreferences(login_data);
|
||||||
|
if (language.size() > 1) {
|
||||||
|
btn_lang_1.setText(language.get(0));
|
||||||
|
btn_lang_2.setText(language.get(1));
|
||||||
|
btn_lang_1.setOnClickListener(this);
|
||||||
|
btn_lang_2.setOnClickListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
if (selected_flag) {
|
||||||
|
/* Intent intent = new Intent(getBaseContext(),
|
||||||
|
MainActivity.class);
|
||||||
|
intent.putExtra(CommonString.KEY_LOGIN_DATA, login_data);
|
||||||
|
startActivity(intent);
|
||||||
|
finish();*/
|
||||||
|
|
||||||
|
Intent in = new Intent(context, MPinActivity.class);
|
||||||
|
in.putExtra(CommonString.IS_PASSWORD_CHECK, false);
|
||||||
|
startActivity(in);
|
||||||
|
finish();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Snackbar.make(view, getString(R.string.select_language), Snackbar.LENGTH_LONG)
|
||||||
|
.setAction("Action", null).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
int id = view.getId();
|
||||||
|
|
||||||
|
if (id == R.id.btn_language_one) {
|
||||||
|
selected_flag = true;
|
||||||
|
CommonFunctions.updateLangResources(context, language.get(0));
|
||||||
|
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
|
btn_lang_1.setTextColor(getResources().getColor(R.color.white));
|
||||||
|
btn_lang_2.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
|
editor.putString(CommonString.KEY_LANGUAGE, language.get(0));
|
||||||
|
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(0));
|
||||||
|
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(0));
|
||||||
|
editor.commit();
|
||||||
|
|
||||||
|
} else if (id == R.id.btn_language_two) {
|
||||||
|
selected_flag = true;
|
||||||
|
CommonFunctions.updateLangResources(context, language.get(1));
|
||||||
|
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
|
btn_lang_1.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
btn_lang_2.setTextColor(getResources().getColor(R.color.white));
|
||||||
|
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
|
editor.putString(CommonString.KEY_LANGUAGE, language.get(1));
|
||||||
|
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(1));
|
||||||
|
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(1));
|
||||||
|
editor.commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
String jsonCurProduct = gson.toJson(lgs);
|
||||||
|
SharedPreferences.Editor editor = preferences.edit();
|
||||||
|
editor.putString(CommonString.KEY_LOOGIN_PREF, jsonCurProduct);
|
||||||
|
editor.commit();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package cpm.com.gskmtorange;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.graphics.PixelFormat;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.password.MPinActivity;
|
||||||
|
|
||||||
|
public class SplashScreenActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private static int SPLASH_TIME_OUT = 3000;
|
||||||
|
LinearLayout linearLayout;
|
||||||
|
private Context context;
|
||||||
|
private SharedPreferences preferences = null;
|
||||||
|
|
||||||
|
/* public void onAttachedToWindow() {
|
||||||
|
super.onAttachedToWindow();
|
||||||
|
Window window = getWindow();
|
||||||
|
window.setFormat(PixelFormat.RGBA_8888);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when the activity is first created.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
context = this;
|
||||||
|
try {
|
||||||
|
// Optional: hide the status bar safely
|
||||||
|
getWindow().getDecorView().setSystemUiVisibility(
|
||||||
|
View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||||
|
);
|
||||||
|
}catch (Exception ignored){}
|
||||||
|
setContentView(R.layout.activity_splash_main_layout);
|
||||||
|
linearLayout = findViewById(R.id.lin_lay);
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
startSplashTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void sendToLogin() {
|
||||||
|
try {
|
||||||
|
String mpin = preferences.getString(CommonString.MPIN, null);
|
||||||
|
Intent intent;
|
||||||
|
if (mpin != null) {
|
||||||
|
intent = new Intent(this, MPinActivity.class);
|
||||||
|
intent.putExtra(CommonString.IS_PASSWORD_CHECK, true);
|
||||||
|
} else {
|
||||||
|
intent = new Intent(this, LoginActivity.class);
|
||||||
|
}
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
} catch (Exception ignored) {} finally {
|
||||||
|
String mpin = preferences.getString(CommonString.MPIN, null);
|
||||||
|
Intent intent;
|
||||||
|
if (mpin != null) {
|
||||||
|
intent = new Intent(this, MPinActivity.class);
|
||||||
|
intent.putExtra(CommonString.IS_PASSWORD_CHECK, true);
|
||||||
|
} else {
|
||||||
|
intent = new Intent(this, LoginActivity.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startSplashTimer() {
|
||||||
|
new Handler(Looper.getMainLooper()).postDelayed(this::sendToLogin, 3000);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
package cpm.com.gskmtorange.adapter;
|
||||||
|
|
||||||
|
import android.content.ClipData;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.listener.DragListener;
|
||||||
|
import cpm.com.gskmtorange.listener.Listener;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraDataGetterSetter;
|
||||||
|
|
||||||
|
public class ListAdapter extends RecyclerView.Adapter<ListAdapter.ListViewHolder>
|
||||||
|
implements View.OnTouchListener {
|
||||||
|
|
||||||
|
private List<NoCameraDataGetterSetter> list;
|
||||||
|
private Listener listener;
|
||||||
|
|
||||||
|
public ListAdapter(List<NoCameraDataGetterSetter> list, Listener listener) {
|
||||||
|
this.list = list;
|
||||||
|
this.listener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ListViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
View view = LayoutInflater.from(
|
||||||
|
parent.getContext()).inflate(R.layout.brand_item_top_item, parent, false);
|
||||||
|
return new ListViewHolder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(ListViewHolder holder, int position) {
|
||||||
|
holder.text.setText(list.get(position).getSKUGROUP_NAME());
|
||||||
|
holder.linear_parent.setTag(position);
|
||||||
|
holder.linear_parent.setOnTouchListener(this);
|
||||||
|
holder.linear_parent.setOnDragListener(new DragListener(listener));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return list.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onTouch(View v, MotionEvent event) {
|
||||||
|
switch (event.getAction()) {
|
||||||
|
case MotionEvent.ACTION_DOWN:
|
||||||
|
ClipData data = ClipData.newPlainText("", "");
|
||||||
|
View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(v);
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
|
v.startDragAndDrop(data, shadowBuilder, v, 0);
|
||||||
|
} else {
|
||||||
|
v.startDrag(data, shadowBuilder, v, 0);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<NoCameraDataGetterSetter> getList() {
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
void updateList(List<NoCameraDataGetterSetter> list) {
|
||||||
|
this.list = list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DragListener getDragInstance() {
|
||||||
|
if (listener != null) {
|
||||||
|
return new DragListener(listener);
|
||||||
|
} else {
|
||||||
|
Log.e("ListAdapter", "Listener wasn't initialized!");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ListViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
TextView text;
|
||||||
|
LinearLayout linear_parent;
|
||||||
|
|
||||||
|
ListViewHolder(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
|
||||||
|
text = (TextView) itemView.findViewById(R.id.tv_brand);
|
||||||
|
linear_parent = (LinearLayout) itemView.findViewById(R.id.linear_parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
package cpm.com.gskmtorange.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.cardview.widget.CardView;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.listener.DragListener;
|
||||||
|
import cpm.com.gskmtorange.listener.Listener;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraDataGetterSetter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by yadavendras on 17-10-2017.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class MyAdapter extends RecyclerView.Adapter<MyAdapter.MyViewHolder> {
|
||||||
|
|
||||||
|
private LayoutInflater inflator;
|
||||||
|
|
||||||
|
List<NoCameraDataGetterSetter> data = Collections.emptyList();
|
||||||
|
private Listener listener;
|
||||||
|
RecyclerView rec;
|
||||||
|
|
||||||
|
public MyAdapter(Context context, List<NoCameraDataGetterSetter> data, Listener listener, RecyclerView rec) {
|
||||||
|
|
||||||
|
inflator = LayoutInflater.from(context);
|
||||||
|
this.data = data;
|
||||||
|
this.listener = listener;
|
||||||
|
this.rec = rec;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
View view = inflator.inflate(R.layout.brand_item, parent, false);
|
||||||
|
|
||||||
|
MyAdapter.MyViewHolder holder = new MyAdapter.MyViewHolder(view);
|
||||||
|
|
||||||
|
return holder;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(MyViewHolder holder, final int position) {
|
||||||
|
|
||||||
|
final NoCameraDataGetterSetter current = data.get(position);
|
||||||
|
|
||||||
|
if(current.getSKUGROUP_ID()!=null){
|
||||||
|
if(current.getSKUGROUP_ID().equals("-1")){
|
||||||
|
holder.parent_card.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
holder.parent_card.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
LinearLayout.LayoutParams lprams = new LinearLayout.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||||
|
LinearLayout.LayoutParams.MATCH_PARENT);
|
||||||
|
|
||||||
|
int width;
|
||||||
|
if(current.isVertical()){
|
||||||
|
width = current.getFacing()* CommonString.UNIT_VERTICAL;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
width = current.getFacing()* CommonString.UNIT_HORIZONTAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
lprams.width = width;
|
||||||
|
lprams.setMargins(2,0,0,0);
|
||||||
|
holder.parent_card.setLayoutParams(lprams);
|
||||||
|
}
|
||||||
|
|
||||||
|
final String name = current.getSKUGROUP_NAME();
|
||||||
|
|
||||||
|
holder.name.setText(name);
|
||||||
|
holder.tv_facing.setText(current.getFacing()+"");
|
||||||
|
|
||||||
|
holder.linear_parent.setTag(position);
|
||||||
|
//holder.linear_parent.getLayoutParams().width = 100;
|
||||||
|
//holder.linear_parent.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
|
||||||
|
holder.linear_parent.setOnDragListener(new DragListener(listener));
|
||||||
|
|
||||||
|
holder.linear_parent.setOnLongClickListener(new View.OnLongClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onLongClick(View view) {
|
||||||
|
//Blank item cannot be edited or deleted
|
||||||
|
if(!current.getSKUGROUP_ID().equals("-1")){
|
||||||
|
listener.deleteItem(view, position, rec,current);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public DragListener getDragInstance() {
|
||||||
|
if (listener != null) {
|
||||||
|
return new DragListener(listener);
|
||||||
|
} else {
|
||||||
|
Log.e("ListAdapter", "Listener wasn't initialized!");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return data.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<NoCameraDataGetterSetter> getList() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateList(List<NoCameraDataGetterSetter> list) {
|
||||||
|
this.data = list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class MyViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
TextView name;
|
||||||
|
TextView tv_facing;
|
||||||
|
LinearLayout linear_parent;
|
||||||
|
CardView parent_card;
|
||||||
|
|
||||||
|
public MyViewHolder(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
name = (TextView) itemView.findViewById(R.id.tv_brand);
|
||||||
|
tv_facing = (TextView) itemView.findViewById(R.id.tv_facing);
|
||||||
|
linear_parent = (LinearLayout) itemView.findViewById(R.id.linear_parent);
|
||||||
|
parent_card = (CardView) itemView.findViewById(R.id.parent_card);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package cpm.com.gskmtorange.adapter
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.Context
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter
|
||||||
|
import cpm.com.gskmtorange.R
|
||||||
|
import cpm.com.gskmtorange.adapter.data.ImageUri
|
||||||
|
import cpm.com.gskmtorange.databinding.ItemRealtimePdBinding
|
||||||
|
|
||||||
|
class RealtimeAdapter(
|
||||||
|
val category: String?,
|
||||||
|
var context: Context,
|
||||||
|
private var subcates: ArrayList<CategoryPictureGetterSetter>?,
|
||||||
|
private val btnlistener: BtnClickListener,
|
||||||
|
) : RecyclerView.Adapter<RealtimeAdapter.CustomViewHolder>() {
|
||||||
|
class CustomViewHolder(view: View) : RecyclerView.ViewHolder(view)
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = CustomViewHolder(
|
||||||
|
ItemRealtimePdBinding.inflate(LayoutInflater.from(context), parent, false).root
|
||||||
|
)
|
||||||
|
|
||||||
|
@SuppressLint(
|
||||||
|
"NotifyDataSetChanged", "ClickableViewAccessibility",
|
||||||
|
"UseCompatLoadingForDrawables", "SetTextI18n"
|
||||||
|
)
|
||||||
|
override fun onBindViewHolder(holder: CustomViewHolder, position: Int) {
|
||||||
|
ItemRealtimePdBinding.bind(holder.itemView).apply {
|
||||||
|
val subcat = subcates!![position]
|
||||||
|
tvSubCategory.text = "$category-${subcat.suB_CATEGORY}"
|
||||||
|
analyticBT.text = context.getString(R.string.view_report_pd)
|
||||||
|
analyticBT.setOnClickListener {
|
||||||
|
btnlistener.onStartSessionClick(position, subcat)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount(): Int {
|
||||||
|
return subcates!!.size
|
||||||
|
}
|
||||||
|
|
||||||
|
interface BtnClickListener {
|
||||||
|
fun onStartSessionClick(_pos: Int, data: CategoryPictureGetterSetter)
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
fun addsubCatItems(langList: ArrayList<CategoryPictureGetterSetter>?) {
|
||||||
|
subcates = langList
|
||||||
|
notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun updateItem(position: Int, uris: List<ImageUri>) {
|
||||||
|
subcates!![position].imageUris = (subcates!![position].imageUris
|
||||||
|
?: ArrayList()).apply { addAll(uris as ArrayList<ImageUri>) }
|
||||||
|
notifyItemChanged(position)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package cpm.com.gskmtorange.adapter
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.Log
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.google.android.material.imageview.ShapeableImageView
|
||||||
|
import cpm.com.gskmtorange.R
|
||||||
|
import cpm.com.gskmtorange.adapter.data.ImageUri
|
||||||
|
import cpm.com.gskmtorange.constant.CommonUtils.imgPreviewwithError
|
||||||
|
|
||||||
|
class SavedImagesAdapter(private val context: Context, private val images: List<ImageUri>) :
|
||||||
|
RecyclerView.Adapter<SavedImagesAdapter.SavedImageViewHolder>() {
|
||||||
|
|
||||||
|
class SavedImageViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||||
|
val imageView: ShapeableImageView = view.findViewById(R.id.imageView)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SavedImageViewHolder {
|
||||||
|
val view = LayoutInflater.from(parent.context)
|
||||||
|
.inflate(R.layout.item_image, parent, false)
|
||||||
|
return SavedImageViewHolder(view)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: SavedImageViewHolder, position: Int) {
|
||||||
|
Log.d("imagedata",images[position].uri)
|
||||||
|
imgPreviewwithError(
|
||||||
|
context = context,
|
||||||
|
url = images[position].uri,
|
||||||
|
imgView = holder.imageView,
|
||||||
|
R.drawable.pdr
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount(): Int = images.size
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package cpm.com.gskmtorange.adapter
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.net.Uri
|
||||||
|
import android.util.Log
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.bumptech.glide.Glide
|
||||||
|
import cpm.com.gskmtorange.dailyentry.WebViewActivity
|
||||||
|
import cpm.com.gskmtorange.databinding.ItemCategoryScoreBinding
|
||||||
|
import cpm.com.gskmtorange.databinding.ItemOverallScoreBinding
|
||||||
|
import cpm.com.gskmtorange.databinding.ItemPdImageBinding
|
||||||
|
import cpm.com.gskmtorange.utils.ScoreItem
|
||||||
|
|
||||||
|
class ScoreAdapter(private val items: List<ScoreItem>) :
|
||||||
|
RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||||
|
|
||||||
|
private val TYPE_OVERALL = 0
|
||||||
|
private val TYPE_CATEGORY = 1
|
||||||
|
private val TYPE_IMAGE = 2
|
||||||
|
|
||||||
|
override fun getItemViewType(position: Int): Int {
|
||||||
|
return when (items[position]) {
|
||||||
|
is ScoreItem.OverallScore -> TYPE_OVERALL
|
||||||
|
is ScoreItem.CategoryScore -> TYPE_CATEGORY
|
||||||
|
is ScoreItem.ImageItem -> TYPE_IMAGE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||||
|
val inflater = LayoutInflater.from(parent.context)
|
||||||
|
return when (viewType) {
|
||||||
|
TYPE_OVERALL -> {
|
||||||
|
val binding = ItemOverallScoreBinding.inflate(inflater, parent, false)
|
||||||
|
OverallViewHolder(binding)
|
||||||
|
}
|
||||||
|
TYPE_CATEGORY -> {
|
||||||
|
val binding = ItemCategoryScoreBinding.inflate(inflater, parent, false)
|
||||||
|
CategoryViewHolder(binding)
|
||||||
|
}
|
||||||
|
TYPE_IMAGE -> {
|
||||||
|
val binding = ItemPdImageBinding.inflate(inflater, parent, false)
|
||||||
|
ImageViewHolder(binding)
|
||||||
|
}
|
||||||
|
else -> throw IllegalArgumentException("Invalid view type")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||||
|
when (val item = items[position]) {
|
||||||
|
is ScoreItem.OverallScore -> (holder as OverallViewHolder).bind(item)
|
||||||
|
is ScoreItem.CategoryScore -> (holder as CategoryViewHolder).bind(item)
|
||||||
|
is ScoreItem.ImageItem -> (holder as ImageViewHolder).bind(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount(): Int = items.size
|
||||||
|
|
||||||
|
class OverallViewHolder(private val binding: ItemOverallScoreBinding) :
|
||||||
|
RecyclerView.ViewHolder(binding.root) {
|
||||||
|
|
||||||
|
fun bind(item: ScoreItem.OverallScore) {
|
||||||
|
binding.tvOsa.text = "OSA: ${item.osa}"
|
||||||
|
binding.tvMsl.text = "MSL: ${item.msl}"
|
||||||
|
binding.tvPosm.text = "POSM: ${item.posm}"
|
||||||
|
binding.tvSosSku.text = "SOS (SKU): ${item.sosSku}"
|
||||||
|
binding.tvSosBrand.text = "SOS (Brand): ${item.sosBrand}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CategoryViewHolder(private val binding: ItemCategoryScoreBinding) :
|
||||||
|
RecyclerView.ViewHolder(binding.root) {
|
||||||
|
|
||||||
|
fun bind(item: ScoreItem.CategoryScore) {
|
||||||
|
binding.tvCategory.text = item.categoryName
|
||||||
|
binding.tvMsl.text = "MSL: ${item.msl}"
|
||||||
|
binding.tvPosm.text = "POSM: ${item.posm}"
|
||||||
|
binding.tvSosSku.text = "SOS (SKU): ${item.sosSku}"
|
||||||
|
binding.tvSosBrand.text = "SOS (Brand): ${item.sosBrand}"
|
||||||
|
|
||||||
|
binding.layoutBrands.removeAllViews()
|
||||||
|
for (brand in item.brandDetails) {
|
||||||
|
val tv = TextView(binding.root.context)
|
||||||
|
tv.text = "${brand.first}: ${brand.second}"
|
||||||
|
binding.layoutBrands.addView(tv)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ImageViewHolder(private val binding: ItemPdImageBinding) :
|
||||||
|
RecyclerView.ViewHolder(binding.root) {
|
||||||
|
|
||||||
|
fun bind(item: ScoreItem.ImageItem) {
|
||||||
|
Log.d("itemuri",item.url)
|
||||||
|
/* binding.btnViewImage.setOnClickListener {
|
||||||
|
val context = binding.root.context
|
||||||
|
val intent = Intent(context, WebViewActivity::class.java)
|
||||||
|
intent.putExtra("url", item.url)
|
||||||
|
context.startActivity(intent)
|
||||||
|
}*/
|
||||||
|
val actualUrl = if (item.url.contains("?url=")) {
|
||||||
|
item.url.substringAfter("?url=") // extract the real image link
|
||||||
|
} else item.url
|
||||||
|
|
||||||
|
Glide.with(binding.ivRawImage.context)
|
||||||
|
.load(actualUrl)
|
||||||
|
//.placeholder(R.drawable.ic_placeholder) // optional
|
||||||
|
// .error(R.drawable.ic_broken_image) // fallback if fail
|
||||||
|
.into(binding.ivRawImage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package cpm.com.gskmtorange.adapter
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.Context
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter
|
||||||
|
import cpm.com.gskmtorange.adapter.data.ImageUri
|
||||||
|
import cpm.com.gskmtorange.databinding.ItemSubcategoryPdBinding
|
||||||
|
|
||||||
|
class SubCatPdAdapter(
|
||||||
|
val category: String?,
|
||||||
|
var context: Context,
|
||||||
|
private var subcates: ArrayList<CategoryPictureGetterSetter>?,
|
||||||
|
private val btnlistener: BtnClickListener,
|
||||||
|
) : RecyclerView.Adapter<SubCatPdAdapter.CustomViewHolder>() {
|
||||||
|
class CustomViewHolder(view: View) : RecyclerView.ViewHolder(view)
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = CustomViewHolder(
|
||||||
|
ItemSubcategoryPdBinding.inflate(LayoutInflater.from(context), parent, false).root
|
||||||
|
)
|
||||||
|
|
||||||
|
@SuppressLint(
|
||||||
|
"NotifyDataSetChanged", "ClickableViewAccessibility",
|
||||||
|
"UseCompatLoadingForDrawables", "SetTextI18n"
|
||||||
|
)
|
||||||
|
override fun onBindViewHolder(holder: CustomViewHolder, position: Int) {
|
||||||
|
ItemSubcategoryPdBinding.bind(holder.itemView).apply {
|
||||||
|
val subcat = subcates!![position]
|
||||||
|
tvSubCategory.text = "$category - ${subcat.suB_CATEGORY}"
|
||||||
|
imgStartSession.setOnClickListener {
|
||||||
|
btnlistener.onStartSessionClick(_pos = position, data = subcat)
|
||||||
|
}
|
||||||
|
|
||||||
|
val savedImagesAdapter =
|
||||||
|
SavedImagesAdapter(context = context, images = subcat.imageUris)
|
||||||
|
imgRecycler.adapter = savedImagesAdapter
|
||||||
|
imgRecycler.setLayoutManager(GridLayoutManager(context, 3))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount(): Int {
|
||||||
|
return subcates!!.size
|
||||||
|
}
|
||||||
|
|
||||||
|
interface BtnClickListener {
|
||||||
|
fun onStartSessionClick(_pos: Int, data: CategoryPictureGetterSetter)
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
fun addsubCatItems(langList: ArrayList<CategoryPictureGetterSetter>?) {
|
||||||
|
subcates = langList
|
||||||
|
notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun updateItem(position: Int, uris: List<ImageUri>) {
|
||||||
|
subcates!![position].imageUris = (subcates!![position].imageUris
|
||||||
|
?: ArrayList()).apply { addAll(uris as ArrayList<ImageUri>) }
|
||||||
|
notifyItemChanged(position)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package cpm.com.gskmtorange.adapter.data
|
||||||
|
|
||||||
|
data class ImageUri(val uri: String, val modify_uri: String)
|
||||||
@@ -0,0 +1,306 @@
|
|||||||
|
package cpm.com.gskmtorange.autoupdate;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.AsyncTask;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.LoginActivity;
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
|
||||||
|
public class AutoUpdateActivity extends AppCompatActivity {
|
||||||
|
private Context context;
|
||||||
|
String versionCode;
|
||||||
|
int length;
|
||||||
|
private Dialog dialog;
|
||||||
|
private ProgressBar pb;
|
||||||
|
private TextView percentage, message;
|
||||||
|
private Data data;
|
||||||
|
String path = "", p, s;
|
||||||
|
ProgressBar progressBar;
|
||||||
|
private boolean status;
|
||||||
|
private SharedPreferences preferences;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_login);
|
||||||
|
Intent intent = getIntent();
|
||||||
|
context = this;
|
||||||
|
path = intent.getStringExtra(CommonString.KEY_PATH);
|
||||||
|
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
|
|
||||||
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
|
builder.setTitle("Parinaam");
|
||||||
|
builder.setMessage(getString(R.string.new_update_available))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
|
SharedPreferences preferences = PreferenceManager
|
||||||
|
.getDefaultSharedPreferences(AutoUpdateActivity.this);
|
||||||
|
SharedPreferences.Editor editor = preferences.edit();
|
||||||
|
editor.clear();
|
||||||
|
editor.commit();
|
||||||
|
|
||||||
|
/*new File(
|
||||||
|
"/data/data/com.cpm.gsk_mt/databases/GTMT_DATABASE")
|
||||||
|
.delete();*/
|
||||||
|
|
||||||
|
new DownloadTask(AutoUpdateActivity.this).execute();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
|
||||||
|
alert.show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private class DownloadTask extends AsyncTask<Void, Data, String> {
|
||||||
|
|
||||||
|
private Context context;
|
||||||
|
|
||||||
|
DownloadTask(Context context) {
|
||||||
|
this.context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPreExecute() {
|
||||||
|
|
||||||
|
super.onPreExecute();
|
||||||
|
|
||||||
|
dialog = new Dialog(context);
|
||||||
|
dialog.setContentView(R.layout.custom_layout);
|
||||||
|
dialog.setTitle("Download");
|
||||||
|
dialog.setCancelable(false);
|
||||||
|
dialog.show();
|
||||||
|
|
||||||
|
pb = (ProgressBar) dialog.findViewById(R.id.progressBar1);
|
||||||
|
percentage = (TextView) dialog.findViewById(R.id.percentage);
|
||||||
|
message = (TextView) dialog.findViewById(R.id.message);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String doInBackground(Void... params) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
data = new Data();
|
||||||
|
data.name = "Downloading Application";
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
versionCode = getPackageManager().getPackageInfo(
|
||||||
|
getPackageName(), 0).versionName;
|
||||||
|
|
||||||
|
data.name = "Upgrading Version : " + versionCode;
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
// download application
|
||||||
|
URL url = new URL(path);
|
||||||
|
HttpURLConnection c = (HttpURLConnection) url.openConnection();
|
||||||
|
c.setRequestMethod("GET");
|
||||||
|
// c.setDoOutput(true);
|
||||||
|
c.getResponseCode();
|
||||||
|
c.connect();
|
||||||
|
length = c.getContentLength();
|
||||||
|
|
||||||
|
String size = new DecimalFormat("##.##")
|
||||||
|
.format((double) ((double) length / 1024) / 1024)
|
||||||
|
+ " MB";
|
||||||
|
Log.e("appsize",size);
|
||||||
|
|
||||||
|
/*String PATH = Environment.getExternalStorageDirectory()
|
||||||
|
+ "/download/";*/
|
||||||
|
String PATH = CommonString.getApkFolder(context);
|
||||||
|
File file = new File(PATH);
|
||||||
|
// file.mkdirs();
|
||||||
|
File outputFile = new File(file, "app.apk");
|
||||||
|
FileOutputStream fos = new FileOutputStream(outputFile);
|
||||||
|
|
||||||
|
InputStream is = c.getInputStream();
|
||||||
|
|
||||||
|
int bytes = 0;
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
int len1 = 0;
|
||||||
|
|
||||||
|
while ((len1 = is.read(buffer)) != -1) {
|
||||||
|
|
||||||
|
bytes = (bytes + len1);
|
||||||
|
|
||||||
|
s = new DecimalFormat("##.##")
|
||||||
|
.format((double) ((double) (bytes / 1024)) / 1024);
|
||||||
|
|
||||||
|
p = s.length() == 3 ? s + "0" : s;
|
||||||
|
|
||||||
|
p = p + " MB";
|
||||||
|
data.value = (int) ((double) (((double) bytes) / length) * 100);
|
||||||
|
|
||||||
|
data.name = "Download " + p + "/" + size;
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
fos.write(buffer, 0, len1);
|
||||||
|
|
||||||
|
}
|
||||||
|
fos.close();
|
||||||
|
is.close();
|
||||||
|
|
||||||
|
return CommonString.KEY_SUCCESS;
|
||||||
|
|
||||||
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
/* final AlertMessage message = new AlertMessage(
|
||||||
|
AutoUpdateActivity.this,
|
||||||
|
AlertMessage.MESSAGE_EXCEPTION, "download", e);*/
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
showAlert(CommonString.MESSAGE_EXCEPTION);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
|
|
||||||
|
/* final AlertMessage message = new AlertMessage(
|
||||||
|
AutoUpdateActivity.this,
|
||||||
|
AlertMessage.MESSAGE_EXCEPTION, "download", e);*/
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
showAlert(CommonString.MESSAGE_EXCEPTION);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
/* final AlertMessage message = new AlertMessage(
|
||||||
|
AutoUpdateActivity.this,
|
||||||
|
AlertMessage.MESSAGE_SOCKETEXCEPTION, "update", e);*/
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
showAlert(CommonString.MESSAGE_SOCKETEXCEPTION);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
/* final AlertMessage message = new AlertMessage(
|
||||||
|
AutoUpdateActivity.this,
|
||||||
|
AlertMessage.MESSAGE_EXCEPTION, "download", e);*/
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
showAlert(CommonString.MESSAGE_EXCEPTION);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onProgressUpdate(Data... values) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
pb.setProgress(values[0].value);
|
||||||
|
percentage.setText(values[0].value + "%");
|
||||||
|
message.setText(values[0].name);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPostExecute(String result) {
|
||||||
|
|
||||||
|
super.onPostExecute(result);
|
||||||
|
dialog.dismiss();
|
||||||
|
|
||||||
|
if (result.equals(CommonString.KEY_SUCCESS)) {
|
||||||
|
|
||||||
|
/* File toInstall = new File(Environment.getExternalStorageDirectory()
|
||||||
|
+ "/download/"
|
||||||
|
+ "app.apk");*/
|
||||||
|
File toInstall = new File(CommonString.getApkFolder(context) + "app.apk");
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
|
Uri apkUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", toInstall);
|
||||||
|
Intent intent = new Intent(Intent.ACTION_INSTALL_PACKAGE);
|
||||||
|
intent.setData(apkUri);
|
||||||
|
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
|
startActivity(intent);
|
||||||
|
} else {
|
||||||
|
Uri apkUri = Uri.fromFile(toInstall);
|
||||||
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||||
|
intent.setDataAndType(apkUri, "application/vnd.android.package-archive");
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
AutoUpdateActivity.this.finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class Data {
|
||||||
|
int value;
|
||||||
|
String name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showAlert(String str) {
|
||||||
|
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(AutoUpdateActivity.this);
|
||||||
|
builder.setTitle("Parinaam");
|
||||||
|
builder.setMessage(str).setCancelable(false)
|
||||||
|
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
|
/* Intent i = new Intent(activity, StorelistActivity.class);
|
||||||
|
activity.startActivity(i);
|
||||||
|
activity.finish();*/
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,241 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview;
|
||||||
|
|
||||||
|
import android.animation.ObjectAnimator;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.graphics.Typeface;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.util.TypedValue;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/16.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class BigButtonView extends FrameLayout {
|
||||||
|
|
||||||
|
private FrameLayout frameLayout;
|
||||||
|
private View clickEffect;
|
||||||
|
private TextView text;
|
||||||
|
private TextView subText;
|
||||||
|
private String textString = "";
|
||||||
|
private String subTextString = "";
|
||||||
|
private ObjectAnimator clickEffectAnimator;
|
||||||
|
private int duration = 500;
|
||||||
|
private OnPressListener onPressListener;
|
||||||
|
|
||||||
|
public BigButtonView(Context context) {
|
||||||
|
this(context, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigButtonView(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
|
||||||
|
LayoutInflater.from(context).inflate(R.layout.big_button_view, this, true);
|
||||||
|
|
||||||
|
Resources resources = getResources();
|
||||||
|
|
||||||
|
frameLayout = (FrameLayout)findViewById(R.id.frame_layout);
|
||||||
|
|
||||||
|
text = (TextView)findViewById(R.id.text);
|
||||||
|
text.setText(textString);
|
||||||
|
text.setTextColor(ContextCompat.getColor(context, R.color.default_big_button_text_color));
|
||||||
|
text.setTextSize(resources.getInteger(R.integer.default_big_button_text_size));
|
||||||
|
|
||||||
|
subText = (TextView)findViewById(R.id.sub_text);
|
||||||
|
subText.setText(subTextString);
|
||||||
|
subText.setTextColor(ContextCompat.getColor(context, R.color.default_big_button_sub_text_color));
|
||||||
|
subText.setTextSize(resources.getInteger(R.integer.default_big_button_sub_text_size));
|
||||||
|
|
||||||
|
clickEffect = findViewById(R.id.click_effect);
|
||||||
|
clickEffect.setAlpha(0);
|
||||||
|
clickEffectAnimator = ObjectAnimator.ofFloat(clickEffect, "alpha", 1f, 0f);
|
||||||
|
clickEffectAnimator.setDuration(duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the listener, for returning what happened to BlurLockView.
|
||||||
|
*
|
||||||
|
* @param onPressListener OnPressListener.
|
||||||
|
*/
|
||||||
|
public void setOnPressListener(OnPressListener onPressListener) {
|
||||||
|
this.onPressListener = onPressListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the width of the button.
|
||||||
|
*
|
||||||
|
* @param width Width, in pixels.
|
||||||
|
*/
|
||||||
|
public void setWidth(int width) {
|
||||||
|
ViewGroup.LayoutParams layoutParams = frameLayout.getLayoutParams();
|
||||||
|
layoutParams.width = width;
|
||||||
|
frameLayout.setLayoutParams(layoutParams);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the height of the button.
|
||||||
|
*
|
||||||
|
* @param height Height, in pixels.
|
||||||
|
*/
|
||||||
|
public void setHeight(int height) {
|
||||||
|
ViewGroup.LayoutParams layoutParams = frameLayout.getLayoutParams();
|
||||||
|
layoutParams.height = height;
|
||||||
|
frameLayout.setLayoutParams(layoutParams);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the resource of background.
|
||||||
|
*
|
||||||
|
* @param resourceId ResourceId.
|
||||||
|
*/
|
||||||
|
public void setBackground(int resourceId) {
|
||||||
|
frameLayout.setBackgroundResource(resourceId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the resource of click effect.
|
||||||
|
*
|
||||||
|
* @param resourceId ResourceId.
|
||||||
|
*/
|
||||||
|
public void setEffect(int resourceId) {
|
||||||
|
clickEffect.setBackgroundResource(resourceId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the duration of the effect.
|
||||||
|
*
|
||||||
|
* @param duration Duration, in ms.
|
||||||
|
*/
|
||||||
|
public void setEffectDuration(int duration) {
|
||||||
|
this.duration = duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the text size of the main text.
|
||||||
|
*
|
||||||
|
* @param size Text size, in sp.
|
||||||
|
*/
|
||||||
|
public void setTextSize(int size) {
|
||||||
|
text.setTextSize(TypedValue.COMPLEX_UNIT_SP, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the text size of the sub text.
|
||||||
|
*
|
||||||
|
* @param size Text size, in sp.
|
||||||
|
*/
|
||||||
|
public void setSubTextSize(int size) {
|
||||||
|
subText.setTextSize(TypedValue.COMPLEX_UNIT_SP, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the text color of main text.
|
||||||
|
*
|
||||||
|
* @param color Color.
|
||||||
|
*/
|
||||||
|
public void setTextColor(int color) {
|
||||||
|
text.setTextColor(color);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the text color of sub text.
|
||||||
|
*
|
||||||
|
* @param color Color.
|
||||||
|
*/
|
||||||
|
public void setSubTextColor(int color) {
|
||||||
|
subText.setTextColor(color);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set font of button.
|
||||||
|
*
|
||||||
|
* @param typeFace New font.
|
||||||
|
*/
|
||||||
|
public void setTypeFace(Typeface typeFace) {
|
||||||
|
text.setTypeface(typeFace);
|
||||||
|
subText.setTypeface(typeFace);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the string of the text.
|
||||||
|
*
|
||||||
|
* @param textString The new string.
|
||||||
|
*/
|
||||||
|
public void setText(String textString) {
|
||||||
|
this.textString = textString;
|
||||||
|
if (text != null) text.setText(textString);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the string of the sub text.
|
||||||
|
*
|
||||||
|
* @param subTextString The new string.
|
||||||
|
*/
|
||||||
|
public void setSubText(String subTextString) {
|
||||||
|
this.subTextString = subTextString;
|
||||||
|
if (subText != null) subText.setText(subTextString);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the visibility of sub textview.
|
||||||
|
*
|
||||||
|
* @param visibility The visibility.
|
||||||
|
*/
|
||||||
|
public void setSubTextVisibility(int visibility) {
|
||||||
|
if (visibility == GONE) {
|
||||||
|
text.setGravity(Gravity.CENTER);
|
||||||
|
} else {
|
||||||
|
text.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM);
|
||||||
|
}
|
||||||
|
subText.setVisibility(visibility);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Perform the click effect.
|
||||||
|
*
|
||||||
|
* @param event MotionEvent.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean dispatchTouchEvent(MotionEvent event) {
|
||||||
|
switch(event.getAction()){
|
||||||
|
case MotionEvent.ACTION_DOWN:
|
||||||
|
if (onPressListener != null) onPressListener.onPress(textString);
|
||||||
|
clickEffectAnimator.cancel();
|
||||||
|
clickEffect.setAlpha(1);
|
||||||
|
break;
|
||||||
|
case MotionEvent.ACTION_UP:
|
||||||
|
clickEffectAnimator.start();
|
||||||
|
break;
|
||||||
|
default:break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.dispatchTouchEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear the animation.
|
||||||
|
*/
|
||||||
|
public void clearAnimation() {
|
||||||
|
if (clickEffect.getAlpha() == 1) {
|
||||||
|
clickEffectAnimator.cancel();
|
||||||
|
clickEffectAnimator.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnPressListener {
|
||||||
|
void onPress(String string);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,871 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview;
|
||||||
|
|
||||||
|
import android.animation.Animator;
|
||||||
|
import android.animation.AnimatorListenerAdapter;
|
||||||
|
import android.animation.ObjectAnimator;
|
||||||
|
import android.animation.ValueAnimator;
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.graphics.Point;
|
||||||
|
import android.graphics.Typeface;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.Display;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import java.util.Stack;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.blurlockview.Directions.HideType;
|
||||||
|
import cpm.com.gskmtorange.blurlockview.Directions.ShowType;
|
||||||
|
import cpm.com.gskmtorange.blurlockview.Eases.EaseType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/16.
|
||||||
|
*/
|
||||||
|
public class BlurLockView extends FrameLayout
|
||||||
|
implements
|
||||||
|
BigButtonView.OnPressListener,
|
||||||
|
SmallButtonView.OnPressListener {
|
||||||
|
|
||||||
|
private final char CHARS[][] = {
|
||||||
|
{'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'},
|
||||||
|
{'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P'},
|
||||||
|
{ 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L' },
|
||||||
|
{ 'Z', 'X', 'C', 'V', 'B', 'N', 'M' }
|
||||||
|
};
|
||||||
|
|
||||||
|
private Password type = Password.NUMBER;
|
||||||
|
|
||||||
|
private int passwordLength = 4;
|
||||||
|
private String correctPassword = null;
|
||||||
|
private int incorrectInputTimes = 0;
|
||||||
|
private Typeface typeface;
|
||||||
|
|
||||||
|
private boolean animationIsPlaying = false;
|
||||||
|
|
||||||
|
public boolean isIs_Password_Check_Mode() {
|
||||||
|
return is_Password_Check_Mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIs_Password_Check_Mode(boolean is_Password_Check_Mode) {
|
||||||
|
this.is_Password_Check_Mode = is_Password_Check_Mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean is_Password_Check_Mode = false;
|
||||||
|
|
||||||
|
private Stack<String> passwordStack = null;
|
||||||
|
|
||||||
|
private TextView title;
|
||||||
|
private Indicator indicator;
|
||||||
|
|
||||||
|
private BigButtonView[] bigButtonViews;
|
||||||
|
private SmallButtonView[][] smallButtonViews;
|
||||||
|
private BlurView mBlurView;
|
||||||
|
private TextView leftButton;
|
||||||
|
private TextView rightButton;
|
||||||
|
|
||||||
|
private OnLeftButtonClickListener onLeftButtonClickListener;
|
||||||
|
private OnPasswordInputListener onPasswordInputListener;
|
||||||
|
|
||||||
|
public BlurLockView(Context context) {
|
||||||
|
this(context, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlurLockView(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Init.
|
||||||
|
*/
|
||||||
|
private void init() {
|
||||||
|
// number password
|
||||||
|
LayoutInflater.from(getContext()).inflate(R.layout.number_lock_view, this, true);
|
||||||
|
|
||||||
|
bigButtonViews = new BigButtonView[10];
|
||||||
|
bigButtonViews[0] = (BigButtonView)findViewById(R.id.button_0);
|
||||||
|
bigButtonViews[1] = (BigButtonView)findViewById(R.id.button_1);
|
||||||
|
bigButtonViews[2] = (BigButtonView)findViewById(R.id.button_2);
|
||||||
|
bigButtonViews[3] = (BigButtonView)findViewById(R.id.button_3);
|
||||||
|
bigButtonViews[4] = (BigButtonView)findViewById(R.id.button_4);
|
||||||
|
bigButtonViews[5] = (BigButtonView)findViewById(R.id.button_5);
|
||||||
|
bigButtonViews[6] = (BigButtonView)findViewById(R.id.button_6);
|
||||||
|
bigButtonViews[7] = (BigButtonView)findViewById(R.id.button_7);
|
||||||
|
bigButtonViews[8] = (BigButtonView)findViewById(R.id.button_8);
|
||||||
|
bigButtonViews[9] = (BigButtonView)findViewById(R.id.button_9);
|
||||||
|
|
||||||
|
String[] texts = getResources().getStringArray(R.array.default_big_button_text);
|
||||||
|
String[] subTexts = getResources().getStringArray(R.array.default_big_button_sub_text);
|
||||||
|
for (int i = 0; i < 10; i++) {
|
||||||
|
bigButtonViews[i].setOnPressListener(this);
|
||||||
|
bigButtonViews[i].setText(texts[i]);
|
||||||
|
//bigButtonViews[i].setSubText(subTexts[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
bigButtonViews[0].setSubTextVisibility(View.GONE);
|
||||||
|
bigButtonViews[1].setSubTextVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
|
// text password
|
||||||
|
smallButtonViews = new SmallButtonView[4][10];
|
||||||
|
|
||||||
|
// get screen width
|
||||||
|
Display display = ((Activity)getContext()).getWindowManager().getDefaultDisplay();
|
||||||
|
Point size = new Point();
|
||||||
|
display.getSize(size);
|
||||||
|
int width = size.x;
|
||||||
|
|
||||||
|
int buttonHorizontalMargin = 6;
|
||||||
|
int buttonVerticalMargin = 24;
|
||||||
|
int buttonWidth = (width - 11 * buttonHorizontalMargin) / 10;
|
||||||
|
|
||||||
|
// add buttons to lines
|
||||||
|
LinearLayout line1 = (LinearLayout)findViewById(R.id.line_1);
|
||||||
|
for (int i = 0; i < 10; i++) {
|
||||||
|
smallButtonViews[0][i] = new SmallButtonView(getContext());
|
||||||
|
smallButtonViews[0][i].setOnPressListener(this);
|
||||||
|
smallButtonViews[0][i].setText(CHARS[0][i] + "");
|
||||||
|
smallButtonViews[0][i].setWidth(buttonWidth);
|
||||||
|
smallButtonViews[0][i].setHeight(buttonWidth);
|
||||||
|
|
||||||
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||||
|
buttonWidth,
|
||||||
|
buttonWidth
|
||||||
|
);
|
||||||
|
if (i == 0)
|
||||||
|
params.setMargins(buttonHorizontalMargin, buttonVerticalMargin / 2, buttonHorizontalMargin / 2, buttonVerticalMargin / 2);
|
||||||
|
else if (i == 9)
|
||||||
|
params.setMargins(buttonHorizontalMargin / 2, buttonVerticalMargin / 2, buttonHorizontalMargin, buttonVerticalMargin / 2);
|
||||||
|
else
|
||||||
|
params.setMargins(buttonHorizontalMargin / 2, buttonVerticalMargin / 2, buttonHorizontalMargin / 2, buttonVerticalMargin / 2);
|
||||||
|
line1.addView(smallButtonViews[0][i], params);
|
||||||
|
}
|
||||||
|
|
||||||
|
LinearLayout line2 = (LinearLayout)findViewById(R.id.line_2);
|
||||||
|
for (int i = 0; i < 10; i++) {
|
||||||
|
smallButtonViews[1][i] = new SmallButtonView(getContext());
|
||||||
|
smallButtonViews[1][i].setOnPressListener(this);
|
||||||
|
smallButtonViews[1][i].setText(CHARS[1][i] + "");
|
||||||
|
smallButtonViews[1][i].setWidth(buttonWidth);
|
||||||
|
smallButtonViews[1][i].setHeight(buttonWidth);
|
||||||
|
|
||||||
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||||
|
buttonWidth,
|
||||||
|
buttonWidth
|
||||||
|
);
|
||||||
|
if (i == 0)
|
||||||
|
params.setMargins(buttonHorizontalMargin, buttonVerticalMargin / 2, buttonHorizontalMargin / 2, buttonVerticalMargin / 2);
|
||||||
|
else if (i == 9)
|
||||||
|
params.setMargins(buttonHorizontalMargin / 2, buttonVerticalMargin / 2, buttonHorizontalMargin, buttonVerticalMargin / 2);
|
||||||
|
else
|
||||||
|
params.setMargins(buttonHorizontalMargin / 2, buttonVerticalMargin / 2, buttonHorizontalMargin / 2, buttonVerticalMargin / 2);
|
||||||
|
line2.addView(smallButtonViews[1][i], params);
|
||||||
|
}
|
||||||
|
|
||||||
|
LinearLayout line3 = (LinearLayout)findViewById(R.id.line_3);
|
||||||
|
for (int i = 0; i < 9; i++) {
|
||||||
|
smallButtonViews[2][i] = new SmallButtonView(getContext());
|
||||||
|
smallButtonViews[2][i].setOnPressListener(this);
|
||||||
|
smallButtonViews[2][i].setText(CHARS[2][i] + "");
|
||||||
|
smallButtonViews[2][i].setWidth(buttonWidth);
|
||||||
|
smallButtonViews[2][i].setHeight(buttonWidth);
|
||||||
|
|
||||||
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||||
|
buttonWidth,
|
||||||
|
buttonWidth
|
||||||
|
);
|
||||||
|
|
||||||
|
if (i == 0)
|
||||||
|
params.setMargins(buttonHorizontalMargin, buttonVerticalMargin / 2, buttonHorizontalMargin / 2, buttonVerticalMargin / 2);
|
||||||
|
else if (i == 8)
|
||||||
|
params.setMargins(buttonHorizontalMargin / 2, buttonVerticalMargin / 2, buttonHorizontalMargin, buttonVerticalMargin / 2);
|
||||||
|
else
|
||||||
|
params.setMargins(buttonHorizontalMargin / 2, buttonVerticalMargin / 2, buttonHorizontalMargin / 2, buttonVerticalMargin / 2);
|
||||||
|
line3.addView(smallButtonViews[2][i], params);
|
||||||
|
}
|
||||||
|
|
||||||
|
LinearLayout line4 = (LinearLayout)findViewById(R.id.line_4);
|
||||||
|
for (int i = 0; i < 7; i++) {
|
||||||
|
smallButtonViews[3][i] = new SmallButtonView(getContext());
|
||||||
|
smallButtonViews[3][i].setOnPressListener(this);
|
||||||
|
smallButtonViews[3][i].setText(CHARS[3][i] + "");
|
||||||
|
smallButtonViews[3][i].setWidth(buttonWidth);
|
||||||
|
smallButtonViews[3][i].setHeight(buttonWidth);
|
||||||
|
|
||||||
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||||
|
buttonWidth,
|
||||||
|
buttonWidth
|
||||||
|
);
|
||||||
|
|
||||||
|
if (i == 0)
|
||||||
|
params.setMargins(buttonHorizontalMargin, buttonVerticalMargin / 2, buttonHorizontalMargin / 2, buttonVerticalMargin / 2);
|
||||||
|
else if (i == 6)
|
||||||
|
params.setMargins(buttonHorizontalMargin / 2, buttonVerticalMargin / 2, buttonHorizontalMargin, buttonVerticalMargin / 2);
|
||||||
|
else
|
||||||
|
params.setMargins(buttonHorizontalMargin / 2, buttonVerticalMargin / 2, buttonHorizontalMargin / 2, buttonVerticalMargin / 2);
|
||||||
|
line4.addView(smallButtonViews[3][i], params);
|
||||||
|
}
|
||||||
|
|
||||||
|
passwordStack = new Stack<>();
|
||||||
|
|
||||||
|
mBlurView = (BlurView)findViewById(R.id.blurview);
|
||||||
|
mBlurView.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Resources resources = getResources();
|
||||||
|
|
||||||
|
indicator = (Indicator)findViewById(R.id.indicator);
|
||||||
|
indicator.setPasswordLength(passwordLength);
|
||||||
|
|
||||||
|
title = (TextView)findViewById(R.id.title);
|
||||||
|
title.setTextColor(ContextCompat.getColor(getContext(), R.color.default_title_text_color));
|
||||||
|
title.setTextSize(resources.getInteger(R.integer.default_title_text_size));
|
||||||
|
|
||||||
|
leftButton = (TextView)findViewById(R.id.left_button);
|
||||||
|
leftButton.setTextColor(ContextCompat.getColor(getContext(), R.color.default_left_button_text_color));
|
||||||
|
leftButton.setTextSize(resources.getInteger(R.integer.default_left_button_text_size));
|
||||||
|
leftButton.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (onLeftButtonClickListener != null) onLeftButtonClickListener.onClick();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
rightButton = (TextView)findViewById(R.id.right_button);
|
||||||
|
rightButton.setTextColor(ContextCompat.getColor(getContext(), R.color.default_right_button_text_color));
|
||||||
|
rightButton.setTextSize(resources.getInteger(R.integer.default_right_button_text_size));
|
||||||
|
rightButton.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (passwordStack.size() > 0) {
|
||||||
|
passwordStack.pop();
|
||||||
|
indicator.delete();
|
||||||
|
if (onPasswordInputListener != null){
|
||||||
|
StringBuilder nowPassword = new StringBuilder("");
|
||||||
|
for (String s : passwordStack) {
|
||||||
|
nowPassword.append(s);
|
||||||
|
}
|
||||||
|
onPasswordInputListener.clear(nowPassword.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the text keyboard smoothly or not.
|
||||||
|
*
|
||||||
|
* @param smoothly Smoothly or not.
|
||||||
|
*/
|
||||||
|
private void showText(boolean smoothly) {
|
||||||
|
if (animationIsPlaying) return;
|
||||||
|
animationIsPlaying = true;
|
||||||
|
if (smoothly) {
|
||||||
|
ObjectAnimator.ofFloat(findViewById(R.id.layout_123), "alpha", 1f, 0f)
|
||||||
|
.setDuration(500).start();
|
||||||
|
ObjectAnimator.ofFloat(findViewById(R.id.layout_456), "alpha", 1f, 0f)
|
||||||
|
.setDuration(500).start();
|
||||||
|
ObjectAnimator.ofFloat(findViewById(R.id.layout_789), "alpha", 1f, 0f)
|
||||||
|
.setDuration(500).start();
|
||||||
|
ObjectAnimator.ofFloat(findViewById(R.id.button_0), "alpha", 1f, 0f)
|
||||||
|
.setDuration(500).start();
|
||||||
|
ObjectAnimator showAnimator =
|
||||||
|
ObjectAnimator.ofFloat(findViewById(R.id.text_layout), "alpha", 0f, 1f);
|
||||||
|
showAnimator.setDuration(500).addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationStart(Animator animation) {
|
||||||
|
super.onAnimationStart(animation);
|
||||||
|
findViewById(R.id.text_layout).setVisibility(VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
super.onAnimationEnd(animation);
|
||||||
|
findViewById(R.id.layout_123).setVisibility(INVISIBLE);
|
||||||
|
findViewById(R.id.layout_456).setVisibility(INVISIBLE);
|
||||||
|
findViewById(R.id.layout_789).setVisibility(INVISIBLE);
|
||||||
|
findViewById(R.id.button_0).setVisibility(INVISIBLE);
|
||||||
|
animationIsPlaying = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
showAnimator.start();
|
||||||
|
} else {
|
||||||
|
findViewById(R.id.layout_123).setVisibility(INVISIBLE);
|
||||||
|
findViewById(R.id.layout_456).setVisibility(INVISIBLE);
|
||||||
|
findViewById(R.id.layout_789).setVisibility(INVISIBLE);
|
||||||
|
findViewById(R.id.button_0).setVisibility(INVISIBLE);
|
||||||
|
findViewById(R.id.text_layout).setVisibility(VISIBLE);
|
||||||
|
animationIsPlaying = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the number keyboard smoothly or not.
|
||||||
|
*
|
||||||
|
* @param smoothly Smoothly or not.
|
||||||
|
*/
|
||||||
|
private void showNumber(boolean smoothly) {
|
||||||
|
if (animationIsPlaying) return;
|
||||||
|
animationIsPlaying = true;
|
||||||
|
if (smoothly) {
|
||||||
|
ObjectAnimator.ofFloat(findViewById(R.id.layout_123), "alpha", 0f, 1f)
|
||||||
|
.setDuration(500).start();
|
||||||
|
ObjectAnimator.ofFloat(findViewById(R.id.layout_456), "alpha", 0f, 1f)
|
||||||
|
.setDuration(500).start();
|
||||||
|
ObjectAnimator.ofFloat(findViewById(R.id.layout_789), "alpha", 0f, 1f)
|
||||||
|
.setDuration(500).start();
|
||||||
|
ObjectAnimator.ofFloat(findViewById(R.id.button_0), "alpha", 0f, 1f)
|
||||||
|
.setDuration(500).start();
|
||||||
|
ObjectAnimator showAnimator =
|
||||||
|
ObjectAnimator.ofFloat(findViewById(R.id.text_layout), "alpha", 1f, 0f);
|
||||||
|
showAnimator.setDuration(500).addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationStart(Animator animation) {
|
||||||
|
super.onAnimationStart(animation);
|
||||||
|
findViewById(R.id.layout_123).setVisibility(VISIBLE);
|
||||||
|
findViewById(R.id.layout_456).setVisibility(VISIBLE);
|
||||||
|
findViewById(R.id.layout_789).setVisibility(VISIBLE);
|
||||||
|
findViewById(R.id.button_0).setVisibility(VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
super.onAnimationEnd(animation);
|
||||||
|
findViewById(R.id.text_layout).setVisibility(INVISIBLE);
|
||||||
|
animationIsPlaying = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
showAnimator.start();
|
||||||
|
} else {
|
||||||
|
findViewById(R.id.layout_123).setVisibility(VISIBLE);
|
||||||
|
findViewById(R.id.layout_456).setVisibility(VISIBLE);
|
||||||
|
findViewById(R.id.layout_789).setVisibility(VISIBLE);
|
||||||
|
findViewById(R.id.button_0).setVisibility(VISIBLE);
|
||||||
|
findViewById(R.id.text_layout).setVisibility(INVISIBLE);
|
||||||
|
animationIsPlaying = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the view that need to be blurred.
|
||||||
|
*
|
||||||
|
* @param blurredView The view.
|
||||||
|
*/
|
||||||
|
public void setBlurredView(View blurredView) {
|
||||||
|
mBlurView.setBlurredView(blurredView);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the listener.
|
||||||
|
*
|
||||||
|
* @param onLeftButtonClickListener Listener.
|
||||||
|
*/
|
||||||
|
public void setOnLeftButtonClickListener(OnLeftButtonClickListener onLeftButtonClickListener) {
|
||||||
|
this.onLeftButtonClickListener = onLeftButtonClickListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the listener.
|
||||||
|
*
|
||||||
|
* @param onPasswordInputListener Listener.
|
||||||
|
*/
|
||||||
|
public void setOnPasswordInputListener(OnPasswordInputListener onPasswordInputListener) {
|
||||||
|
this.onPasswordInputListener = onPasswordInputListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* From the button views.
|
||||||
|
*
|
||||||
|
* @param string The string from button views.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onPress(String string) {
|
||||||
|
if (correctPassword == null) {
|
||||||
|
throw new RuntimeException("The correct password has NOT been set!");
|
||||||
|
}
|
||||||
|
if (passwordStack.size() >= passwordLength) return;
|
||||||
|
passwordStack.push(string);
|
||||||
|
indicator.add();
|
||||||
|
StringBuilder nowPassword = new StringBuilder("");
|
||||||
|
for (String s : passwordStack) {
|
||||||
|
nowPassword.append(s);
|
||||||
|
}
|
||||||
|
String nowPasswordString = nowPassword.toString();
|
||||||
|
if (correctPassword.equals(nowPasswordString)) {
|
||||||
|
// correct password
|
||||||
|
if (onPasswordInputListener != null)
|
||||||
|
onPasswordInputListener.correct(nowPasswordString);
|
||||||
|
} else {
|
||||||
|
if (correctPassword.length() > nowPasswordString.length()) {
|
||||||
|
// input right now
|
||||||
|
if (onPasswordInputListener != null)
|
||||||
|
onPasswordInputListener.input(nowPasswordString);
|
||||||
|
} else {
|
||||||
|
// incorrect password
|
||||||
|
if (onPasswordInputListener != null)
|
||||||
|
onPasswordInputListener.incorrect(nowPasswordString);
|
||||||
|
if(is_Password_Check_Mode){
|
||||||
|
// perform the clear animation
|
||||||
|
incorrectInputTimes++;
|
||||||
|
indicator.clear();
|
||||||
|
passwordStack.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prevent click 2 or above buttons at the same time.
|
||||||
|
*
|
||||||
|
* @param event
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean dispatchTouchEvent(MotionEvent event) {
|
||||||
|
if (event.getPointerCount() > 1) {
|
||||||
|
if (Password.NUMBER.equals(type)) {
|
||||||
|
for (int i = 0; i < bigButtonViews.length; i++) bigButtonViews[i].clearAnimation();
|
||||||
|
} else if (Password.TEXT.equals(type)) {
|
||||||
|
for (int i = 0; i < smallButtonViews.length; i++) {
|
||||||
|
for (int j = 0; j < smallButtonViews[i].length; j++) {
|
||||||
|
if (smallButtonViews[i][j] != null) smallButtonViews[i][j].clearAnimation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.dispatchTouchEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set big buttons' background.
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
public void setBigButtonViewsBackground(int id) {
|
||||||
|
for (int i = 0; i < 10; i++) bigButtonViews[i].setBackground(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set big buttons' click effect.
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
public void setBigButtonViewsClickEffect(int id) {
|
||||||
|
for (int i = 0; i < 10; i++) bigButtonViews[i].setEffect(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the click effect duration.
|
||||||
|
*
|
||||||
|
* @param duration
|
||||||
|
*/
|
||||||
|
public void setBigButtonViewsClickEffectDuration(int duration) {
|
||||||
|
for (int i = 0; i < 10; i++) bigButtonViews[i].setEffectDuration(duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set small buttons' background.
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
public void setSmallButtonViewsBackground(int id) {
|
||||||
|
for (int i = 0; i < smallButtonViews.length; i++)
|
||||||
|
for (int j = 0; j < smallButtonViews[i].length; j++)
|
||||||
|
if (smallButtonViews[i][j] != null)
|
||||||
|
smallButtonViews[i][j].setBackground(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set small buttons' click effect.
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
public void setSmallButtonViewsClickEffect(int id) {
|
||||||
|
for (int i = 0; i < smallButtonViews.length; i++)
|
||||||
|
for (int j = 0; j < smallButtonViews[i].length; j++)
|
||||||
|
if (smallButtonViews[i][j] != null)
|
||||||
|
smallButtonViews[i][j].setEffect(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the click effect duration.
|
||||||
|
*
|
||||||
|
* @param duration
|
||||||
|
*/
|
||||||
|
public void setSmallButtonViewsClickEffectDuration(int duration) {
|
||||||
|
for (int i = 0; i < smallButtonViews.length; i++)
|
||||||
|
for (int j = 0; j < smallButtonViews[i].length; j++)
|
||||||
|
if (smallButtonViews[i][j] != null)
|
||||||
|
smallButtonViews[i][j].setEffectDuration(duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set all the fonts.
|
||||||
|
*
|
||||||
|
* @param typeface
|
||||||
|
*/
|
||||||
|
public void setTypeface(Typeface typeface) {
|
||||||
|
this.typeface = typeface;
|
||||||
|
if (type.equals(Password.NUMBER)) {
|
||||||
|
for (int i = 0; i < 10; i++) bigButtonViews[i].setTypeFace(typeface);
|
||||||
|
} else if (type.equals(Password.TEXT)) {
|
||||||
|
for (int i = 0; i < smallButtonViews.length; i++)
|
||||||
|
for (int j = 0; j < smallButtonViews[i].length; j++)
|
||||||
|
if (smallButtonViews[i][j] != null)
|
||||||
|
smallButtonViews[i][j].setTypeFace(typeface);
|
||||||
|
}
|
||||||
|
title.setTypeface(typeface);
|
||||||
|
leftButton.setTypeface(typeface);
|
||||||
|
rightButton.setTypeface(typeface);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set all the text color.
|
||||||
|
*
|
||||||
|
* @param color
|
||||||
|
*/
|
||||||
|
public void setTextColor(int color) {
|
||||||
|
if (type.equals(Password.NUMBER)) {
|
||||||
|
for (int i = 0; i < 10; i++) {
|
||||||
|
bigButtonViews[i].setTextColor(color);
|
||||||
|
bigButtonViews[i].setSubTextColor(color);
|
||||||
|
}
|
||||||
|
} else if (type.equals(Password.TEXT)) {
|
||||||
|
for (int i = 0; i < smallButtonViews.length; i++)
|
||||||
|
for (int j = 0; j < smallButtonViews[i].length; j++)
|
||||||
|
if (smallButtonViews[i][j] != null)
|
||||||
|
smallButtonViews[i][j].setTextColor(color);
|
||||||
|
}
|
||||||
|
title.setTextColor(color);
|
||||||
|
leftButton.setTextColor(color);
|
||||||
|
rightButton.setTextColor(color);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the length of the password.
|
||||||
|
* Default length is 4.
|
||||||
|
*
|
||||||
|
* @param passwordLength
|
||||||
|
*/
|
||||||
|
public void setPasswordLength(int passwordLength) {
|
||||||
|
this.passwordLength = passwordLength;
|
||||||
|
indicator.setPasswordLength(passwordLength);
|
||||||
|
passwordStack.clear();
|
||||||
|
correctPassword = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the password type.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Password getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the password type.
|
||||||
|
*
|
||||||
|
* @param type Number or text.
|
||||||
|
*/
|
||||||
|
public void setType(Password type, boolean smoothly) {
|
||||||
|
if (animationIsPlaying) return;
|
||||||
|
this.type = type;
|
||||||
|
indicator.clear();
|
||||||
|
passwordStack.clear();
|
||||||
|
if (Password.NUMBER.equals(type)) {
|
||||||
|
showNumber(smoothly);
|
||||||
|
} else if (Password.TEXT.equals(type)) {
|
||||||
|
showText(smoothly);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the title text.
|
||||||
|
*
|
||||||
|
* @param string
|
||||||
|
*/
|
||||||
|
public void setTitle(String string) {
|
||||||
|
title.setText(string);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the text of left button.
|
||||||
|
*
|
||||||
|
* @param string
|
||||||
|
*/
|
||||||
|
public void setLeftButton(String string) {
|
||||||
|
leftButton.setText(string);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the text of right button.
|
||||||
|
*
|
||||||
|
* @param string
|
||||||
|
*/
|
||||||
|
public void setRightButton(String string) {
|
||||||
|
rightButton.setText(string);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the target password.
|
||||||
|
*
|
||||||
|
* @param correctPassword The target password.
|
||||||
|
*/
|
||||||
|
public void setCorrectPassword(String correctPassword) {
|
||||||
|
setPasswordLength(correctPassword.length());
|
||||||
|
this.correctPassword = correctPassword;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* You can use this to reset the incorrect input times.
|
||||||
|
*
|
||||||
|
* @param incorrectInputTimes The incorrect input times.
|
||||||
|
*/
|
||||||
|
public void setIncorrectInputTimes(int incorrectInputTimes) {
|
||||||
|
this.incorrectInputTimes = incorrectInputTimes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the incorrect input times.
|
||||||
|
*
|
||||||
|
* @return Incorrect input times.
|
||||||
|
*/
|
||||||
|
public int getIncorrectInputTimes() {
|
||||||
|
return incorrectInputTimes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Invalidate the blur view.
|
||||||
|
*/
|
||||||
|
public void update() {
|
||||||
|
mBlurView.invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show this BlurLockView.
|
||||||
|
*
|
||||||
|
* @param duration Duration, in ms.
|
||||||
|
* @param showType Direction, in ShowType.
|
||||||
|
* @param easeType Ease type, in EaseType.
|
||||||
|
*/
|
||||||
|
public void show(int duration, ShowType showType, EaseType easeType) {
|
||||||
|
if (animationIsPlaying) return;
|
||||||
|
animationIsPlaying = true;
|
||||||
|
indicator.clear();
|
||||||
|
passwordStack.clear();
|
||||||
|
ObjectAnimator animator = null;
|
||||||
|
setVisibility(VISIBLE);
|
||||||
|
if (showType.equals(ShowType.FROM_TOP_TO_BOTTOM)) {
|
||||||
|
animator = ObjectAnimator.ofFloat(this, "translationY",
|
||||||
|
getTranslationY() - getHeight(),
|
||||||
|
getTranslationY());
|
||||||
|
} else if (showType.equals(ShowType.FROM_RIGHT_TO_LEFT)) {
|
||||||
|
animator = ObjectAnimator.ofFloat(this, "translationX",
|
||||||
|
getTranslationX() + getWidth(),
|
||||||
|
getTranslationX());
|
||||||
|
} else if (showType.equals(ShowType.FROM_BOTTOM_TO_TOP)) {
|
||||||
|
animator = ObjectAnimator.ofFloat(this, "translationY",
|
||||||
|
getTranslationY() + getHeight(),
|
||||||
|
getTranslationY());
|
||||||
|
} else if (showType.equals(ShowType.FROM_LEFT_TO_RIGHT)) {
|
||||||
|
animator = ObjectAnimator.ofFloat(this, "translationX",
|
||||||
|
getTranslationX() - getWidth(),
|
||||||
|
getTranslationX());
|
||||||
|
} else if (showType.equals(ShowType.FADE_IN)) {
|
||||||
|
animator = ObjectAnimator.ofFloat(this, "alpha",
|
||||||
|
0,
|
||||||
|
1);
|
||||||
|
}
|
||||||
|
animator.setDuration(duration);
|
||||||
|
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationUpdate(ValueAnimator animation) {
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
animator.addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
super.onAnimationEnd(animation);
|
||||||
|
animationIsPlaying = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
animator.setInterpolator(InterpolatorFactory.getInterpolator(easeType));
|
||||||
|
animator.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hide this BlurLockView.
|
||||||
|
*
|
||||||
|
* @param duration Duration, in ms.
|
||||||
|
* @param hideType Direction, in HideType.
|
||||||
|
* @param easeType Ease type, in EaseType.
|
||||||
|
*/
|
||||||
|
public void hide(int duration, HideType hideType, EaseType easeType) {
|
||||||
|
if (animationIsPlaying) return;
|
||||||
|
animationIsPlaying = true;
|
||||||
|
ObjectAnimator animator = null;
|
||||||
|
final float originalX = getTranslationX();
|
||||||
|
final float originalY = getTranslationY();
|
||||||
|
if (hideType.equals(HideType.FROM_TOP_TO_BOTTOM)) {
|
||||||
|
animator = ObjectAnimator.ofFloat(this, "translationY",
|
||||||
|
getTranslationY(),
|
||||||
|
getTranslationY() + getHeight());
|
||||||
|
} else if (hideType.equals(HideType.FROM_RIGHT_TO_LEFT)) {
|
||||||
|
animator = ObjectAnimator.ofFloat(this, "translationX",
|
||||||
|
getTranslationX(),
|
||||||
|
getTranslationX() - getWidth());
|
||||||
|
} else if (hideType.equals(HideType.FROM_BOTTOM_TO_TOP)) {
|
||||||
|
animator = ObjectAnimator.ofFloat(this, "translationY",
|
||||||
|
getTranslationY(),
|
||||||
|
getTranslationY() - getHeight());
|
||||||
|
} else if (hideType.equals(HideType.FROM_LEFT_TO_RIGHT)) {
|
||||||
|
animator = ObjectAnimator.ofFloat(this, "translationX",
|
||||||
|
getTranslationX(),
|
||||||
|
getTranslationX() + getWidth());
|
||||||
|
} else if (hideType.equals(HideType.FADE_OUT)) {
|
||||||
|
animator = ObjectAnimator.ofFloat(this, "alpha",
|
||||||
|
1,
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
animator.setDuration(duration);
|
||||||
|
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationUpdate(ValueAnimator animation) {
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
animator.addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
super.onAnimationEnd(animation);
|
||||||
|
setVisibility(INVISIBLE);
|
||||||
|
setTranslationX(originalX);
|
||||||
|
setTranslationY(originalY);
|
||||||
|
setAlpha(1);
|
||||||
|
animationIsPlaying = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
animator.setInterpolator(InterpolatorFactory.getInterpolator(easeType));
|
||||||
|
animator.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnPasswordInputListener {
|
||||||
|
void correct(String inputPassword);
|
||||||
|
void incorrect(String inputPassword);
|
||||||
|
void input(String inputPassword);
|
||||||
|
void clear(String remainingPassword);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnLeftButtonClickListener {
|
||||||
|
void onClick();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the title.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public TextView getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the left button.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public TextView getLeftButton() {
|
||||||
|
return leftButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the right button.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public TextView getRightButton() {
|
||||||
|
return rightButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the numbers.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public BigButtonView[] getBigButtonViews() {
|
||||||
|
return bigButtonViews;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the texts.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public SmallButtonView[][] getSmallButtonViews() {
|
||||||
|
return smallButtonViews;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the blur radius.
|
||||||
|
*/
|
||||||
|
public void setBlurRadius(int blurRadius) {
|
||||||
|
mBlurView.setBlurRadius(blurRadius);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the blur radius.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int getBlurRadius() {
|
||||||
|
return mBlurView.getBlurRadius();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the downsample factor.
|
||||||
|
* @param downsampleFactor
|
||||||
|
*/
|
||||||
|
public void setDownsampleFactor(int downsampleFactor) {
|
||||||
|
mBlurView.setDownsampleFactor(downsampleFactor);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the downsample factor.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int getDownsampleFactor() {
|
||||||
|
return mBlurView.getDownsampleFactor();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the overlay color.
|
||||||
|
* @param color
|
||||||
|
*/
|
||||||
|
public void setOverlayColor(int color) {
|
||||||
|
mBlurView.setOverlayColor(color);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the overlay color.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int getOverlayColor() {
|
||||||
|
return mBlurView.getmOverlayColor();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,194 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.renderscript.Allocation;
|
||||||
|
import android.renderscript.Element;
|
||||||
|
import android.renderscript.RenderScript;
|
||||||
|
import android.renderscript.ScriptIntrinsicBlur;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/16.
|
||||||
|
*/
|
||||||
|
public class BlurView extends View {
|
||||||
|
|
||||||
|
private int mBlurRadius;
|
||||||
|
private int mDownsampleFactor;
|
||||||
|
private int mOverlayColor;
|
||||||
|
|
||||||
|
private View mBlurredView;
|
||||||
|
private int mBlurredViewWidth, mBlurredViewHeight;
|
||||||
|
|
||||||
|
private boolean mDownsampleFactorChanged;
|
||||||
|
private Bitmap mBitmapToBlur, mBlurredBitmap;
|
||||||
|
private Canvas mBlurringCanvas;
|
||||||
|
private RenderScript mRenderScript;
|
||||||
|
private ScriptIntrinsicBlur mBlurScript;
|
||||||
|
private Allocation mBlurInput, mBlurOutput;
|
||||||
|
|
||||||
|
public BlurView(Context context) {
|
||||||
|
this(context, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlurView(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
|
||||||
|
final Resources res = getResources();
|
||||||
|
final int defaultBlurRadius = res.getInteger(R.integer.default_blur_radius);
|
||||||
|
final int defaultDownsampleFactor = res.getInteger(R.integer.default_downsample_factor);
|
||||||
|
final int defaultOverlayColor = res.getColor(R.color.default_overlay_color);
|
||||||
|
|
||||||
|
initializeRenderScript(context);
|
||||||
|
|
||||||
|
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.BlurView);
|
||||||
|
setBlurRadius(a.getInt(R.styleable.BlurView_blurRadius, defaultBlurRadius));
|
||||||
|
setDownsampleFactor(a.getInt(R.styleable.BlurView_downsampleFactor,
|
||||||
|
defaultDownsampleFactor));
|
||||||
|
setOverlayColor(a.getColor(R.styleable.BlurView_overlayColor, defaultOverlayColor));
|
||||||
|
a.recycle();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBlurredView(View blurredView) {
|
||||||
|
mBlurredView = blurredView;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDraw(Canvas canvas) {
|
||||||
|
super.onDraw(canvas);
|
||||||
|
if (mBlurredView != null) {
|
||||||
|
if (prepare()) {
|
||||||
|
// If the background of the blurred view is a color drawable, we use it to clear
|
||||||
|
// the blurring canvas, which ensures that edges of the child views are blurred
|
||||||
|
// as well; otherwise we clear the blurring canvas with a transparent color.
|
||||||
|
if (mBlurredView.getBackground() != null && mBlurredView.getBackground() instanceof ColorDrawable) {
|
||||||
|
mBitmapToBlur.eraseColor(((ColorDrawable) mBlurredView.getBackground()).getColor());
|
||||||
|
} else {
|
||||||
|
mBitmapToBlur.eraseColor(Color.TRANSPARENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
int[] mBlurredViewXY = new int[2];
|
||||||
|
mBlurredView.getLocationOnScreen(mBlurredViewXY);
|
||||||
|
int[] mBlurringViewXY = new int[2];
|
||||||
|
getLocationOnScreen(mBlurringViewXY);
|
||||||
|
|
||||||
|
mBlurredView.draw(mBlurringCanvas);
|
||||||
|
blur();
|
||||||
|
|
||||||
|
canvas.save();
|
||||||
|
|
||||||
|
// modify here to get the correct bitmap when the blurring view is in a parent
|
||||||
|
canvas.translate(mBlurredViewXY[0] - mBlurringViewXY[0], mBlurredViewXY[1] - mBlurringViewXY[1]);
|
||||||
|
canvas.scale(mDownsampleFactor, mDownsampleFactor);
|
||||||
|
canvas.drawBitmap(mBlurredBitmap, 0, 0, null);
|
||||||
|
canvas.restore();
|
||||||
|
}
|
||||||
|
canvas.drawColor(mOverlayColor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBlurRadius(int radius) {
|
||||||
|
mBlurRadius = radius;
|
||||||
|
mBlurScript.setRadius(mBlurRadius);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBlurRadius() {
|
||||||
|
return mBlurRadius;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDownsampleFactor(int factor) {
|
||||||
|
if (factor <= 0) {
|
||||||
|
throw new IllegalArgumentException("Downsample factor must be greater than 0.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mDownsampleFactor != factor) {
|
||||||
|
mDownsampleFactor = factor;
|
||||||
|
mDownsampleFactorChanged = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDownsampleFactor() {
|
||||||
|
return mDownsampleFactor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOverlayColor(int color) {
|
||||||
|
mOverlayColor = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getmOverlayColor() {
|
||||||
|
return mOverlayColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initializeRenderScript(Context context) {
|
||||||
|
mRenderScript = RenderScript.create(context);
|
||||||
|
mBlurScript = ScriptIntrinsicBlur.create(mRenderScript, Element.U8_4(mRenderScript));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean prepare() {
|
||||||
|
final int width = mBlurredView.getWidth();
|
||||||
|
final int height = mBlurredView.getHeight();
|
||||||
|
|
||||||
|
if (mBlurringCanvas == null || mDownsampleFactorChanged
|
||||||
|
|| mBlurredViewWidth != width || mBlurredViewHeight != height) {
|
||||||
|
mDownsampleFactorChanged = false;
|
||||||
|
|
||||||
|
mBlurredViewWidth = width;
|
||||||
|
mBlurredViewHeight = height;
|
||||||
|
|
||||||
|
int scaledWidth = width / mDownsampleFactor;
|
||||||
|
int scaledHeight = height / mDownsampleFactor;
|
||||||
|
|
||||||
|
// The following manipulation is to avoid some RenderScript artifacts at the edge.
|
||||||
|
scaledWidth = scaledWidth - scaledWidth % 4 + 4;
|
||||||
|
scaledHeight = scaledHeight - scaledHeight % 4 + 4;
|
||||||
|
|
||||||
|
if (mBlurredBitmap == null
|
||||||
|
|| mBlurredBitmap.getWidth() != scaledWidth
|
||||||
|
|| mBlurredBitmap.getHeight() != scaledHeight) {
|
||||||
|
mBitmapToBlur = Bitmap.createBitmap(scaledWidth, scaledHeight,
|
||||||
|
Bitmap.Config.ARGB_8888);
|
||||||
|
if (mBitmapToBlur == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
mBlurredBitmap = Bitmap.createBitmap(scaledWidth, scaledHeight,
|
||||||
|
Bitmap.Config.ARGB_8888);
|
||||||
|
if (mBlurredBitmap == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mBlurringCanvas = new Canvas(mBitmapToBlur);
|
||||||
|
mBlurringCanvas.scale(1f / mDownsampleFactor, 1f / mDownsampleFactor);
|
||||||
|
mBlurInput = Allocation.createFromBitmap(mRenderScript, mBitmapToBlur,
|
||||||
|
Allocation.MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT);
|
||||||
|
mBlurOutput = Allocation.createTyped(mRenderScript, mBlurInput.getType());
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void blur() {
|
||||||
|
mBlurInput.copyFrom(mBitmapToBlur);
|
||||||
|
mBlurScript.setInput(mBlurInput);
|
||||||
|
mBlurScript.forEach(mBlurOutput);
|
||||||
|
mBlurOutput.copyTo(mBlurredBitmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDetachedFromWindow() {
|
||||||
|
super.onDetachedFromWindow();
|
||||||
|
if (mRenderScript != null) {
|
||||||
|
mRenderScript.destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Directions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/17.
|
||||||
|
*/
|
||||||
|
public enum HideType {
|
||||||
|
|
||||||
|
FROM_TOP_TO_BOTTOM(0),
|
||||||
|
FROM_RIGHT_TO_LEFT(1),
|
||||||
|
FROM_BOTTOM_TO_TOP(2),
|
||||||
|
FROM_LEFT_TO_RIGHT(3),
|
||||||
|
FADE_OUT(4);
|
||||||
|
|
||||||
|
int type;
|
||||||
|
|
||||||
|
HideType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Directions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/17.
|
||||||
|
*/
|
||||||
|
public enum ShowType {
|
||||||
|
|
||||||
|
FROM_TOP_TO_BOTTOM(0),
|
||||||
|
FROM_RIGHT_TO_LEFT(1),
|
||||||
|
FROM_BOTTOM_TO_TOP(2),
|
||||||
|
FROM_LEFT_TO_RIGHT(3),
|
||||||
|
FADE_IN(4);
|
||||||
|
|
||||||
|
int type;
|
||||||
|
|
||||||
|
ShowType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview;
|
||||||
|
|
||||||
|
import android.animation.ObjectAnimator;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/17.
|
||||||
|
*/
|
||||||
|
public class Dot extends FrameLayout {
|
||||||
|
|
||||||
|
private View selected;
|
||||||
|
private View unselected;
|
||||||
|
|
||||||
|
private ObjectAnimator selectedAnimator;
|
||||||
|
private ObjectAnimator unselectedAnimator;
|
||||||
|
|
||||||
|
private boolean isSelected = false;
|
||||||
|
|
||||||
|
public Dot(Context context) {
|
||||||
|
this(context, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Dot(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
|
||||||
|
LayoutInflater.from(context).inflate(R.layout.dot_view, this, true);
|
||||||
|
|
||||||
|
selected = findViewById(R.id.selected);
|
||||||
|
unselected = findViewById(R.id.unselected);
|
||||||
|
|
||||||
|
clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set this dot to selected or not.
|
||||||
|
*
|
||||||
|
* @param isSelected Selected or not.
|
||||||
|
*/
|
||||||
|
public void setSelected(boolean isSelected) {
|
||||||
|
if (!(this.isSelected ^ isSelected)) return;
|
||||||
|
this.isSelected = isSelected;
|
||||||
|
if (isSelected) {
|
||||||
|
// change to selected
|
||||||
|
selected.setAlpha(0);
|
||||||
|
unselected.setAlpha(1);
|
||||||
|
if (selectedAnimator != null) selectedAnimator.cancel();
|
||||||
|
if (unselectedAnimator != null) unselectedAnimator.cancel();
|
||||||
|
|
||||||
|
selectedAnimator = ObjectAnimator.ofFloat(selected, "alpha", 0f, 1f);
|
||||||
|
selectedAnimator.setDuration(300);
|
||||||
|
selectedAnimator.start();
|
||||||
|
|
||||||
|
unselectedAnimator = ObjectAnimator.ofFloat(unselected, "alpha", 1f, 0f);
|
||||||
|
unselectedAnimator.setDuration(300);
|
||||||
|
unselectedAnimator.start();
|
||||||
|
} else {
|
||||||
|
// change to unselected
|
||||||
|
selected.setAlpha(1);
|
||||||
|
unselected.setAlpha(0);
|
||||||
|
if (selectedAnimator != null) selectedAnimator.cancel();
|
||||||
|
if (unselectedAnimator != null) unselectedAnimator.cancel();
|
||||||
|
|
||||||
|
selectedAnimator = ObjectAnimator.ofFloat(selected, "alpha", 1f, 0f);
|
||||||
|
selectedAnimator.setDuration(300);
|
||||||
|
selectedAnimator.start();
|
||||||
|
|
||||||
|
unselectedAnimator = ObjectAnimator.ofFloat(unselected, "alpha", 0f, 1f);
|
||||||
|
unselectedAnimator.setDuration(300);
|
||||||
|
unselectedAnimator.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear the dot.
|
||||||
|
*/
|
||||||
|
public void clear() {
|
||||||
|
selected.setAlpha(0);
|
||||||
|
unselected.setAlpha(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
import android.graphics.PointF;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
public abstract class CubicBezier {
|
||||||
|
|
||||||
|
private PointF start;
|
||||||
|
private PointF end;
|
||||||
|
private PointF a = new PointF();
|
||||||
|
private PointF b = new PointF();
|
||||||
|
private PointF c = new PointF();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* init the 4 values of the cubic-bezier
|
||||||
|
* @param startX x of start
|
||||||
|
* @param startY y of start
|
||||||
|
* @param endX x of end
|
||||||
|
* @param endY y of end
|
||||||
|
*/
|
||||||
|
public void init(float startX, float startY, float endX, float endY) {
|
||||||
|
setStart(new PointF(startX, startY));
|
||||||
|
setEnd(new PointF(endX, endY));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(double startX, double startY, double endX, double endY) {
|
||||||
|
init((float) startX, (float) startY, (float) endX, (float) endY);
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getOffset(float offset) {
|
||||||
|
return getBezierCoordinateY(getXForTime(offset));
|
||||||
|
}
|
||||||
|
|
||||||
|
private float getBezierCoordinateY(float time) {
|
||||||
|
c.y = 3 * start.y;
|
||||||
|
b.y = 3 * (end.y - start.y) - c.y;
|
||||||
|
a.y = 1 - c.y - b.y;
|
||||||
|
return time * (c.y + time * (b.y + time * a.y));
|
||||||
|
}
|
||||||
|
|
||||||
|
private float getXForTime(float time) {
|
||||||
|
float x = time;
|
||||||
|
float z;
|
||||||
|
for (int i = 1; i < 14; i++) {
|
||||||
|
z = getBezierCoordinateX(x) - time;
|
||||||
|
if (Math.abs(z) < 1e-3) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
x -= z / getXDerivate(x);
|
||||||
|
}
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
private float getXDerivate(float t) {
|
||||||
|
return c.x + t * (2 * b.x + 3 * a.x * t);
|
||||||
|
}
|
||||||
|
|
||||||
|
private float getBezierCoordinateX(float time) {
|
||||||
|
c.x = 3 * start.x;
|
||||||
|
b.x = 3 * (end.x - start.x) - c.x;
|
||||||
|
a.x = 1 - c.x - b.x;
|
||||||
|
return time * (c.x + time * (b.x + time * a.x));
|
||||||
|
}
|
||||||
|
|
||||||
|
public PointF getStart() {
|
||||||
|
return start;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStart(PointF start) {
|
||||||
|
this.start = start;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PointF getEnd() {
|
||||||
|
return end;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnd(PointF end) {
|
||||||
|
this.end = end;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInBack extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInBack() {
|
||||||
|
init(0.6, -0.28, 0.735, 0.045);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInBounce extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInBounce() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getOffset(float t) {
|
||||||
|
float b = 0;
|
||||||
|
float c = 1;
|
||||||
|
float d = 1;
|
||||||
|
return c - easeOutBounce(d-t, 0, c, d) + b;
|
||||||
|
}
|
||||||
|
|
||||||
|
private float easeOutBounce(float t, float b, float c, float d) {
|
||||||
|
if ((t/=d) < (1/2.75f)) {
|
||||||
|
return c*(7.5625f*t*t) + b;
|
||||||
|
} else if (t < (2/2.75f)) {
|
||||||
|
return c*(7.5625f*(t-=(1.5f/2.75f))*t + .75f) + b;
|
||||||
|
} else if (t < (2.5/2.75)) {
|
||||||
|
return c*(7.5625f*(t-=(2.25f/2.75f))*t + .9375f) + b;
|
||||||
|
} else {
|
||||||
|
return c*(7.5625f*(t-=(2.625f/2.75f))*t + .984375f) + b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInCirc extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInCirc() {
|
||||||
|
init(0.6, 0.04, 0.98, 0.335);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInCubic extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInCubic() {
|
||||||
|
init(0.55, 0.055, 0.675, 0.19);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInElastic extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInElastic() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getOffset(float t) {
|
||||||
|
float b = 0;
|
||||||
|
float c = 1;
|
||||||
|
float d = 1;
|
||||||
|
if (t==0) return b; if ((t/=d)==1) return b+c;
|
||||||
|
float p=d*.3f;
|
||||||
|
float a=c;
|
||||||
|
float s=p/4;
|
||||||
|
return -(a*(float) Math.pow(2,10*(t-=1)) * (float) Math.sin( (t*d-s)*(2*(float) Math.PI)/p )) + b;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInExpo extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInExpo() {
|
||||||
|
init(0.95, 0.05, 0.795, 0.035);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInOutBack extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInOutBack() {
|
||||||
|
init(0.68, -0.55, 0.265, 1.55);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInOutBounce extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInOutBounce() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getOffset(float t) {
|
||||||
|
float b = 0;
|
||||||
|
float c = 1;
|
||||||
|
float d = 1;
|
||||||
|
if (t < d / 2)
|
||||||
|
return easeInBounce(t * 2, 0, c, d) * .5f + b;
|
||||||
|
else
|
||||||
|
return easeOutBounce(t * 2 - d, 0, c, d) * .5f + c * .5f + b;
|
||||||
|
}
|
||||||
|
|
||||||
|
private float easeInBounce(float t, float b, float c, float d) {
|
||||||
|
return c - easeOutBounce(d - t, 0, c, d) + b;
|
||||||
|
}
|
||||||
|
|
||||||
|
private float easeOutBounce(float t, float b, float c, float d) {
|
||||||
|
if ((t/=d) < (1/2.75f)) {
|
||||||
|
return c*(7.5625f*t*t) + b;
|
||||||
|
} else if (t < (2/2.75f)) {
|
||||||
|
return c*(7.5625f*(t-=(1.5f/2.75f))*t + .75f) + b;
|
||||||
|
} else if (t < (2.5/2.75)) {
|
||||||
|
return c*(7.5625f*(t-=(2.25f/2.75f))*t + .9375f) + b;
|
||||||
|
} else {
|
||||||
|
return c*(7.5625f*(t-=(2.625f/2.75f))*t + .984375f) + b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInOutCirc extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInOutCirc() {
|
||||||
|
init(0.785, 0.135, 0.15, 0.86);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInOutCubic extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInOutCubic() {
|
||||||
|
init(0.645, 0.045, 0.355, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInOutElastic extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInOutElastic() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getOffset(float t) {
|
||||||
|
float b = 0;
|
||||||
|
float c = 1;
|
||||||
|
float d = 1;
|
||||||
|
if (t==0) return b; if ((t/=d/2)==2) return b+c;
|
||||||
|
float p=d*(.3f*1.5f);
|
||||||
|
float a=c;
|
||||||
|
float s=p/4;
|
||||||
|
if (t < 1) return -.5f*(a*(float) Math.pow(2,10*(t-=1)) * (float) Math.sin( (t*d-s)*(2*(float) Math.PI)/p )) + b;
|
||||||
|
return a*(float) Math.pow(2,-10*(t-=1)) * (float) Math.sin( (t*d-s)*(2*(float) Math.PI)/p )*.5f + c + b;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInOutExpo extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInOutExpo() {
|
||||||
|
init(1, 0, 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInOutQuad extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInOutQuad() {
|
||||||
|
init(0.455, 0.03, 0.515, 0.955);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInOutQuart extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInOutQuart() {
|
||||||
|
init(0.77, 0, 0.175, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInOutQuint extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInOutQuint() {
|
||||||
|
init(0.86, 0, 0.07, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInOutSine extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInOutSine() {
|
||||||
|
init(0.445, 0.05, 0.55, 0.95);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInQuad extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInQuad() {
|
||||||
|
init(0.55, 0.085, 0.68, 0.53);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInQuart extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInQuart() {
|
||||||
|
init(0.895, 0.03, 0.685, 0.22);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInQuint extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInQuint() {
|
||||||
|
init(0.755, 0.05, 0.855, 0.06);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseInSine extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseInSine() {
|
||||||
|
init(0.47, 0, 0.745, 0.715);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseOutBack extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseOutBack() {
|
||||||
|
init(0.175, 0.885, 0.32, 1.275);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseOutBounce extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseOutBounce() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getOffset(float t) {
|
||||||
|
float b = 0;
|
||||||
|
float c = 1;
|
||||||
|
float d = 1;
|
||||||
|
if ((t/=d) < (1/2.75f)) {
|
||||||
|
return c*(7.5625f*t*t) + b;
|
||||||
|
} else if (t < (2/2.75f)) {
|
||||||
|
return c*(7.5625f*(t-=(1.5f/2.75f))*t + .75f) + b;
|
||||||
|
} else if (t < (2.5/2.75)) {
|
||||||
|
return c*(7.5625f*(t-=(2.25f/2.75f))*t + .9375f) + b;
|
||||||
|
} else {
|
||||||
|
return c*(7.5625f*(t-=(2.625f/2.75f))*t + .984375f) + b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseOutCirc extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseOutCirc() {
|
||||||
|
init(0.075, 0.82, 0.165, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseOutCubic extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseOutCubic() {
|
||||||
|
init(0.215, 0.61, 0.355, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseOutElastic extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseOutElastic() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getOffset(float t) {
|
||||||
|
float b = 0;
|
||||||
|
float c = 1;
|
||||||
|
float d = 1;
|
||||||
|
if (t==0) return b; if ((t/=d)==1) return b+c;
|
||||||
|
float p=d*.3f;
|
||||||
|
float a=c;
|
||||||
|
float s=p/4;
|
||||||
|
return (a*(float) Math.pow(2,-10*t) * (float) Math.sin( (t*d-s)*(2*(float) Math.PI)/p ) + c + b);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseOutExpo extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseOutExpo() {
|
||||||
|
init(0.19, 1, 0.22, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseOutQuad extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseOutQuad() {
|
||||||
|
init(0.25, 0.46, 0.45, 0.94);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package cpm.com.gskmtorange.blurlockview.Eases;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Weiping on 2016/3/3.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EaseOutQuart extends CubicBezier {
|
||||||
|
|
||||||
|
public EaseOutQuart() {
|
||||||
|
init(0.165, 0.84, 0.44, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user