├── .gradle
└── 2.14.1
│ ├── taskArtifacts
│ ├── cache.properties
│ ├── cache.properties.lock
│ ├── fileHashes.bin
│ ├── fileSnapshots.bin
│ ├── fileSnapshotsToTreeSnapshotsIndex.bin
│ └── taskArtifacts.bin
│ └── tasks
│ ├── _SkuLib_compileReleaseJavaWithJavac
│ ├── localClassSetAnalysis
│ │ ├── localClassSetAnalysis.bin
│ │ └── localClassSetAnalysis.lock
│ └── localJarClasspathSnapshot
│ │ ├── localJarClasspathSnapshot.bin
│ │ └── localJarClasspathSnapshot.lock
│ └── _app_compileDebugJavaWithJavac
│ ├── localClassSetAnalysis
│ ├── localClassSetAnalysis.bin
│ └── localClassSetAnalysis.lock
│ └── localJarClasspathSnapshot
│ ├── localJarClasspathSnapshot.bin
│ └── localJarClasspathSnapshot.lock
├── .idea
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
├── gradle.xml
├── libraries
│ ├── animated_vector_drawable_24_2_1.xml
│ ├── animated_vector_drawable_25_0_1.xml
│ ├── appcompat_v7_24_2_1.xml
│ ├── appcompat_v7_25_0_1.xml
│ ├── design_25_0_1.xml
│ ├── espresso_core_2_2_2.xml
│ ├── espresso_idling_resource_2_2_2.xml
│ ├── exposed_instrumentation_api_publish_0_5.xml
│ ├── hamcrest_core_1_3.xml
│ ├── hamcrest_integration_1_3.xml
│ ├── hamcrest_library_1_3.xml
│ ├── javawriter_2_1_1.xml
│ ├── javax_annotation_api_1_2.xml
│ ├── javax_inject_1.xml
│ ├── jsr305_2_0_1.xml
│ ├── junit_4_12.xml
│ ├── recyclerview_v7_25_0_1.xml
│ ├── rules_0_5.xml
│ ├── runner_0_5.xml
│ ├── support_annotations_24_2_1.xml
│ ├── support_annotations_25_0_1.xml
│ ├── support_compat_24_2_1.xml
│ ├── support_compat_25_0_1.xml
│ ├── support_core_ui_24_2_1.xml
│ ├── support_core_ui_25_0_1.xml
│ ├── support_core_utils_24_2_1.xml
│ ├── support_core_utils_25_0_1.xml
│ ├── support_fragment_24_2_1.xml
│ ├── support_fragment_25_0_1.xml
│ ├── support_media_compat_24_2_1.xml
│ ├── support_media_compat_25_0_1.xml
│ ├── support_v4_24_2_1.xml
│ ├── support_v4_25_0_1.xml
│ ├── support_vector_drawable_24_2_1.xml
│ ├── support_vector_drawable_25_0_1.xml
│ └── transition_25_0_1.xml
├── misc.xml
├── modules.xml
└── runConfigurations.xml
├── README.md
├── Sku.iml
├── SkuLib
├── .gitignore
├── SkuLib.iml
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── sennie
│ │ └── skulib
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── sennie
│ │ │ └── skulib
│ │ │ ├── Sku.java
│ │ │ └── model
│ │ │ └── BaseSkuModel.java
│ └── res
│ │ └── values
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── sennie
│ └── skulib
│ └── ExampleUnitTest.java
├── app
├── .gitignore
├── app.iml
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── sennie
│ │ └── sku
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── sennie
│ │ │ └── sku
│ │ │ ├── ItemClickListener.java
│ │ │ ├── MainActivity.java
│ │ │ ├── ProductModel.java
│ │ │ ├── UiData.java
│ │ │ └── adapter
│ │ │ └── SkuAdapter.java
│ └── res
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── bottom_sheet.xml
│ │ ├── bottom_sheet_group.xml
│ │ └── sku_item_layout.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── sennie
│ └── sku
│ └── ExampleUnitTest.java
├── build.gradle
├── build
├── generated
│ └── mockable-android-24.jar
├── intermediates
│ └── dex-cache
│ │ └── cache.xml
└── jrebel
│ └── timings.json
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── local.properties
└── settings.gradle
/.gradle/2.14.1/taskArtifacts/cache.properties:
--------------------------------------------------------------------------------
1 | #Thu Nov 24 14:34:30 CST 2016
2 |
--------------------------------------------------------------------------------
/.gradle/2.14.1/taskArtifacts/cache.properties.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/.gradle/2.14.1/taskArtifacts/cache.properties.lock
--------------------------------------------------------------------------------
/.gradle/2.14.1/taskArtifacts/fileHashes.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/.gradle/2.14.1/taskArtifacts/fileHashes.bin
--------------------------------------------------------------------------------
/.gradle/2.14.1/taskArtifacts/fileSnapshots.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/.gradle/2.14.1/taskArtifacts/fileSnapshots.bin
--------------------------------------------------------------------------------
/.gradle/2.14.1/taskArtifacts/fileSnapshotsToTreeSnapshotsIndex.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/.gradle/2.14.1/taskArtifacts/fileSnapshotsToTreeSnapshotsIndex.bin
--------------------------------------------------------------------------------
/.gradle/2.14.1/taskArtifacts/taskArtifacts.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/.gradle/2.14.1/taskArtifacts/taskArtifacts.bin
--------------------------------------------------------------------------------
/.gradle/2.14.1/tasks/_SkuLib_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/.gradle/2.14.1/tasks/_SkuLib_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin
--------------------------------------------------------------------------------
/.gradle/2.14.1/tasks/_SkuLib_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/.gradle/2.14.1/tasks/_SkuLib_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock
--------------------------------------------------------------------------------
/.gradle/2.14.1/tasks/_SkuLib_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/.gradle/2.14.1/tasks/_SkuLib_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin
--------------------------------------------------------------------------------
/.gradle/2.14.1/tasks/_SkuLib_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/.gradle/2.14.1/tasks/_SkuLib_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock
--------------------------------------------------------------------------------
/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin
--------------------------------------------------------------------------------
/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock
--------------------------------------------------------------------------------
/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin
--------------------------------------------------------------------------------
/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
18 |
19 |
--------------------------------------------------------------------------------
/.idea/libraries/animated_vector_drawable_24_2_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/animated_vector_drawable_25_0_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/appcompat_v7_24_2_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/.idea/libraries/appcompat_v7_25_0_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/.idea/libraries/design_25_0_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/.idea/libraries/espresso_core_2_2_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/espresso_idling_resource_2_2_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/exposed_instrumentation_api_publish_0_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/hamcrest_core_1_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/hamcrest_integration_1_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/hamcrest_library_1_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/javawriter_2_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/javax_annotation_api_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/javax_inject_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/jsr305_2_0_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/libraries/junit_4_12.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/recyclerview_v7_25_0_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/.idea/libraries/rules_0_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/.idea/libraries/runner_0_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/.idea/libraries/support_annotations_24_2_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/support_annotations_25_0_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/support_compat_24_2_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/libraries/support_compat_25_0_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/libraries/support_core_ui_24_2_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/libraries/support_core_ui_25_0_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/libraries/support_core_utils_24_2_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/support_core_utils_25_0_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/libraries/support_fragment_24_2_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/libraries/support_fragment_25_0_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/libraries/support_media_compat_24_2_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/libraries/support_media_compat_25_0_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/libraries/support_v4_24_2_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/libraries/support_v4_25_0_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/libraries/support_vector_drawable_24_2_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/support_vector_drawable_25_0_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/transition_25_0_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | 1.8
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Sku
2 | Sku算法,Android实现,淘宝Sku实现
3 |
--------------------------------------------------------------------------------
/Sku.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/SkuLib/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/SkuLib/SkuLib.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | generateDebugSources
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
--------------------------------------------------------------------------------
/SkuLib/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion "24.0.2"
6 |
7 | defaultConfig {
8 | minSdkVersion 14
9 | targetSdkVersion 24
10 | versionCode 1
11 | versionName "1.0"
12 |
13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14 |
15 | }
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 | }
23 |
24 | dependencies {
25 | compile fileTree(dir: 'libs', include: ['*.jar'])
26 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
27 | exclude group: 'com.android.support', module: 'support-annotations'
28 | })
29 | compile 'com.android.support:appcompat-v7:24.2.1'
30 | testCompile 'junit:junit:4.12'
31 | }
32 |
--------------------------------------------------------------------------------
/SkuLib/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/niesen918/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/SkuLib/src/androidTest/java/com/sennie/skulib/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.sennie.skulib;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.sennie.skulib.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/SkuLib/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/SkuLib/src/main/java/com/sennie/skulib/Sku.java:
--------------------------------------------------------------------------------
1 | package com.sennie.skulib;
2 |
3 | import android.text.TextUtils;
4 |
5 | import com.sennie.skulib.model.BaseSkuModel;
6 |
7 | import java.util.ArrayList;
8 | import java.util.HashMap;
9 | import java.util.Map;
10 |
11 | /**
12 | * 项目名称:Sku算法
13 | * 类描述:
14 | * 创建人:N.Sun
15 | * 创建时间:2016/11/3 下午2:32
16 | * 修改人:N.Sun
17 | * 修改时间:2016/11/3 下午2:32
18 | * 修改备注:
19 | */
20 |
21 | public class Sku {
22 |
23 | /**
24 | * 算法入口
25 | *
26 | * @param initData 所有库存的hashMap组合
27 | * @return 拆分所有组合产生的所有情况(生成客户端自己的字典)
28 | */
29 | public static Map skuCollection(Map initData) {
30 | //用户返回数据
31 | HashMap result = new HashMap<>();
32 | // 遍历所有库存
33 | for (String subKey : initData.keySet()) {
34 | BaseSkuModel skuModel = initData.get(subKey);
35 | //根据;拆分key的组合
36 | String[] skuKeyAttrs = subKey.split(";");
37 |
38 | //获取所有的组合
39 | ArrayList> combArr = combInArray(skuKeyAttrs);
40 |
41 | // 对应所有组合添加到结果集里面
42 | for (int i = 0; i < combArr.size(); i++) {
43 | add2SKUResult(result, combArr.get(i), skuModel);
44 | }
45 |
46 | // 将原始的库存组合也添加进入结果集里面
47 | String key = TextUtils.join(";", skuKeyAttrs);
48 | result.put(key, skuModel);
49 | }
50 | return result;
51 | }
52 |
53 | /**
54 | * 获取所有的组合放到ArrayList里面
55 | *
56 | * @param skuKeyAttrs 单个key被; 拆分的数组
57 | * @return ArrayList
58 | */
59 | private static ArrayList> combInArray(String[] skuKeyAttrs) {
60 | if (skuKeyAttrs == null || skuKeyAttrs.length <= 0)
61 | return null;
62 | int len = skuKeyAttrs.length;
63 | ArrayList> aResult = new ArrayList<>();
64 | for (int n = 1; n < len; n++) {
65 | ArrayList aaFlags = getCombFlags(len, n);
66 | for (int i = 0; i < aaFlags.size(); i++) {
67 | Integer[] aFlag = aaFlags.get(i);
68 | ArrayList aComb = new ArrayList<>();
69 | for (int j = 0; j < aFlag.length; j++) {
70 | if (aFlag[j] == 1) {
71 | aComb.add(skuKeyAttrs[j]);
72 | }
73 | }
74 | aResult.add(aComb);
75 | }
76 | }
77 | return aResult;
78 | }
79 |
80 | /**
81 | * 算法拆分组合 用1和0 的移位去做控制
82 | * (这块需要你打印才能看的出来)
83 | *
84 | * @param len
85 | * @param n
86 | * @return
87 | */
88 | private static ArrayList getCombFlags(int len, int n) {
89 | if (n <= 0) {
90 | return new ArrayList<>();
91 | }
92 | ArrayList aResult = new ArrayList<>();
93 | Integer[] aFlag = new Integer[len];
94 | boolean bNext = true;
95 | int iCnt1 = 0;
96 | //初始化
97 | for (int i = 0; i < len; i++) {
98 | aFlag[i] = i < n ? 1 : 0;
99 | }
100 | aResult.add(aFlag.clone());
101 | while (bNext) {
102 | iCnt1 = 0;
103 | for (int i = 0; i < len - 1; i++) {
104 | if (aFlag[i] == 1 && aFlag[i + 1] == 0) {
105 | for (int j = 0; j < i; j++) {
106 | aFlag[j] = j < iCnt1 ? 1 : 0;
107 | }
108 | aFlag[i] = 0;
109 | aFlag[i + 1] = 1;
110 | Integer[] aTmp = aFlag.clone();
111 | aResult.add(aTmp);
112 | if (!TextUtils.join("", aTmp).substring(len - n).contains("0")) {
113 | bNext = false;
114 | }
115 | break;
116 | }
117 | if (aFlag[i] == 1) {
118 | iCnt1++;
119 | }
120 | }
121 | }
122 | return aResult;
123 | }
124 |
125 | /**
126 | * 添加到数据集合
127 | *
128 | * @param result
129 | * @param newKeyList
130 | * @param skuModel
131 | */
132 | private static void add2SKUResult(HashMap result, ArrayList newKeyList, BaseSkuModel skuModel) {
133 | String key = TextUtils.join(";", newKeyList);
134 | if (result.keySet().contains(key)) {
135 | result.get(key).setStock(result.get(key).getStock() + skuModel.getStock());
136 | result.get(key).setPrice(skuModel.getPrice());
137 | } else {
138 | result.put(key, new BaseSkuModel(skuModel.getPrice(), skuModel.getStock()));
139 | }
140 | }
141 |
142 | }
143 |
--------------------------------------------------------------------------------
/SkuLib/src/main/java/com/sennie/skulib/model/BaseSkuModel.java:
--------------------------------------------------------------------------------
1 | package com.sennie.skulib.model;
2 |
3 | /**
4 | * 项目名称:Sku
5 | * 类描述:Sku基本模型数据
6 | * 创建人:N.Sun
7 | * 创建时间:2016/11/24 下午3:27
8 | * 修改人:N.Sun
9 | * 修改时间:2016/11/24 下午3:27
10 | * 修改备注:
11 | */
12 | public class BaseSkuModel {
13 |
14 | //base 属性
15 | private double price;//价格
16 | private long stock;//库存
17 |
18 | public BaseSkuModel(double price, long stock) {
19 | this.price = price;
20 | this.stock = stock;
21 | }
22 |
23 | public double getPrice() {
24 | return price;
25 | }
26 |
27 | public void setPrice(double price) {
28 | this.price = price;
29 | }
30 |
31 | public long getStock() {
32 | return stock;
33 | }
34 |
35 | public void setStock(long stock) {
36 | this.stock = stock;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/SkuLib/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | SkuLib
3 |
4 |
--------------------------------------------------------------------------------
/SkuLib/src/test/java/com/sennie/skulib/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.sennie.skulib;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | generateDebugSources
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion "24.0.2"
6 | defaultConfig {
7 | applicationId "com.sennie.sku"
8 | minSdkVersion 14
9 | targetSdkVersion 24
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(include: ['*.jar'], dir: 'libs')
24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
25 | exclude group: 'com.android.support', module: 'support-annotations'
26 | })
27 | compile 'com.android.support:appcompat-v7:24.2.1'
28 | testCompile 'junit:junit:4.12'
29 | compile 'com.android.support:recyclerview-v7:25.0.1'
30 | compile project(':SkuLib')
31 | compile 'com.android.support:design:25.0.1'
32 | }
33 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/niesen918/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/sennie/sku/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.sennie.sku;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.sennie.sku", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/java/com/sennie/sku/ItemClickListener.java:
--------------------------------------------------------------------------------
1 | package com.sennie.sku;
2 |
3 | import android.util.Log;
4 |
5 | import com.sennie.sku.adapter.SkuAdapter;
6 |
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 | import static android.content.ContentValues.TAG;
11 |
12 | /**
13 | * 项目名称:Sku
14 | * 类描述:
15 | * 创建人:N.Sun
16 | * 创建时间:2016/11/24 下午5:22
17 | * 修改人:N.Sun
18 | * 修改时间:2016/11/24 下午5:22
19 | * 修改备注:
20 | */
21 | public class ItemClickListener implements SkuAdapter.OnClickListener {
22 |
23 | UiData mUiData;
24 | SkuAdapter currentAdapter;
25 |
26 | public ItemClickListener(UiData uiData, SkuAdapter currentAdapter) {
27 | mUiData = uiData;
28 | this.currentAdapter = currentAdapter;
29 | }
30 |
31 | @Override
32 | public void onItemClickListener(int position) {
33 | //屏蔽不可点击
34 | if (currentAdapter.getAttributeMembersEntities().get(position).getStatus() == 2) {
35 | return;
36 | }
37 | // 设置当前单选点击
38 | for (ProductModel.AttributesEntity.AttributeMembersEntity entity : currentAdapter.getAttributeMembersEntities()) {
39 | if (entity.equals(currentAdapter.getAttributeMembersEntities().get(position))) {
40 | entity.setStatus(1);
41 | //添加已经选择的对象
42 | currentAdapter.setCurrentSelectedItem(entity);
43 | } else {
44 | entity.setStatus(entity.getStatus() == 2 ? 2 : 0);
45 | }
46 | }
47 | //存放当前被点击的按钮
48 | mUiData.getSelectedEntities().clear();
49 | for (int i = 0; i < mUiData.getAdapters().size(); i++) {
50 | if (mUiData.getAdapters().get(i).getCurrentSelectedItem() != null) {
51 | mUiData.getSelectedEntities().add(mUiData.getAdapters().get(i).getCurrentSelectedItem());
52 | }
53 | }
54 | //处理未选中的按钮
55 | for (int i = 0; i < mUiData.getAdapters().size(); i++) {
56 | for (ProductModel.AttributesEntity.AttributeMembersEntity entity : mUiData.getAdapters().get(i).getAttributeMembersEntities()) {
57 | // 处理没有数据和没有库存(检测单个)
58 | if (mUiData.getResult().get(entity.getAttributeMemberId() + "") == null || mUiData.getResult().get(entity.getAttributeMemberId() + "").getStock() <= 0) {
59 | entity.setStatus(2);
60 | } else if (entity.equals(mUiData.getAdapters().get(i).getCurrentSelectedItem())) {
61 | entity.setStatus(1);
62 | } else {
63 | entity.setStatus(0);
64 | }
65 | // 冒泡排序
66 | List cacheSelected = new ArrayList<>();
67 | cacheSelected.add(entity);
68 | cacheSelected.addAll(mUiData.getSelectedEntities());
69 | for (int j = 0; j < cacheSelected.size() - 1; j++) {
70 | for (int k = 0; k < cacheSelected.size() - 1 - j; k++) {
71 | ProductModel.AttributesEntity.AttributeMembersEntity cacheEntity;
72 | if (cacheSelected.get(k).getAttributeGroupId() > cacheSelected.get(k + 1).getAttributeGroupId()) {
73 | //交换数据
74 | cacheEntity = cacheSelected.get(k);
75 | cacheSelected.set(k, cacheSelected.get(k + 1));
76 | cacheSelected.set(k + 1, cacheEntity);
77 | }
78 | }
79 | }
80 | for (int j = 0; j < cacheSelected.size() - 1; j++) {
81 | for (int k = 0; k < cacheSelected.size() - 1 - j; k++) {
82 | if (cacheSelected.get(k).getAttributeGroupId() == cacheSelected.get(k + 1).getAttributeGroupId()) {
83 | cacheSelected.remove(k + 1);
84 | }
85 | }
86 | }
87 | StringBuffer buffer = new StringBuffer();
88 | for (ProductModel.AttributesEntity.AttributeMembersEntity selectedEntity : cacheSelected) {
89 | buffer.append(selectedEntity.getAttributeMemberId() + ";");
90 | }
91 | Log.e(TAG, "key = " + buffer.substring(0, buffer.length() - 1));
92 | //TODO 检查数据
93 | if (mUiData.getResult().get(buffer.substring(0, buffer.length() - 1)) != null && mUiData.getResult().get(buffer.substring(0, buffer.length() - 1)).getStock() > 0) {
94 | entity.setStatus(entity.getStatus() == 1 ? 1 : 0);
95 | } else {
96 | entity.setStatus(2);
97 | }
98 | }
99 | mUiData.getAdapters().get(i).notifyDataSetChanged();
100 | }
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/app/src/main/java/com/sennie/sku/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.sennie.sku;
2 |
3 | import android.os.Bundle;
4 | import android.support.design.widget.BottomSheetBehavior;
5 | import android.support.design.widget.BottomSheetDialog;
6 | import android.support.design.widget.CoordinatorLayout;
7 | import android.support.v7.app.AppCompatActivity;
8 | import android.support.v7.widget.GridLayoutManager;
9 | import android.support.v7.widget.RecyclerView;
10 | import android.util.Log;
11 | import android.view.Gravity;
12 | import android.view.View;
13 | import android.widget.Button;
14 | import android.widget.LinearLayout;
15 | import android.widget.TextView;
16 |
17 | import com.sennie.sku.adapter.SkuAdapter;
18 | import com.sennie.skulib.Sku;
19 | import com.sennie.skulib.model.BaseSkuModel;
20 |
21 | public class MainActivity extends AppCompatActivity {
22 |
23 | private Button btnBottom;
24 |
25 | private ProductModel testData;
26 |
27 | UiData mUiData;
28 |
29 | @Override
30 | protected void onCreate(Bundle savedInstanceState) {
31 | super.onCreate(savedInstanceState);
32 | setContentView(R.layout.activity_main);
33 | btnBottom = (Button) findViewById(R.id.btn_bottom);
34 | mUiData = new UiData();
35 | // 设置模拟数据
36 | testData = new ProductModel();
37 | testData.getProductStocks().put("1;4", new BaseSkuModel(13, 20));
38 | testData.getProductStocks().put("1;5", new BaseSkuModel(14, 10));
39 | testData.getProductStocks().put("1;7", new BaseSkuModel(13, 40));
40 | testData.getProductStocks().put("2;4", new BaseSkuModel(16, 70));
41 | testData.getProductStocks().put("2;6", new BaseSkuModel(17, 30));
42 | testData.getProductStocks().put("2;7", new BaseSkuModel(12, 22));
43 | testData.getProductStocks().put("3;5", new BaseSkuModel(11, 25));
44 | testData.getProductStocks().put("3;6", new BaseSkuModel(19, 21));
45 | testData.getProductStocks().put("3;7", new BaseSkuModel(10, 29));
46 | // 设置对应的品种和规格
47 | ProductModel.AttributesEntity group01 = new ProductModel.AttributesEntity();
48 | group01.setName("颜色");
49 | group01.getAttributeMembers().add(0, new ProductModel.AttributesEntity.AttributeMembersEntity(1, 1, "红色"));
50 | group01.getAttributeMembers().add(1, new ProductModel.AttributesEntity.AttributeMembersEntity(1, 2, "白色"));
51 | group01.getAttributeMembers().add(2, new ProductModel.AttributesEntity.AttributeMembersEntity(1, 3, "绿色"));
52 | testData.getAttributes().add(0, group01);//第一组
53 |
54 | ProductModel.AttributesEntity group02 = new ProductModel.AttributesEntity();
55 | group02.setName("尺寸");
56 | group02.getAttributeMembers().add(0, new ProductModel.AttributesEntity.AttributeMembersEntity(2, 4, "80cm"));
57 | group02.getAttributeMembers().add(1, new ProductModel.AttributesEntity.AttributeMembersEntity(2, 5, "90cm"));
58 | group02.getAttributeMembers().add(2, new ProductModel.AttributesEntity.AttributeMembersEntity(2, 6, "100cm"));
59 | group02.getAttributeMembers().add(3, new ProductModel.AttributesEntity.AttributeMembersEntity(2, 7, "110cm"));
60 | testData.getAttributes().add(1, group02);//第二组
61 |
62 | }
63 |
64 | protected void bottomClick(View view) {
65 | //显示Sku
66 | showBottomSheetDialog(testData);
67 | }
68 |
69 | private void showBottomSheetDialog(ProductModel productModel) {
70 | if (mUiData.getBottomSheetDialog() == null) {
71 | mUiData.getSelectedEntities().clear();
72 | mUiData.getAdapters().clear();
73 | View view = getLayoutInflater().inflate(R.layout.bottom_sheet, null);
74 | LinearLayout llList = (LinearLayout) view.findViewById(R.id.ll_list);//列表
75 | //添加list组
76 | for (int i = 0; i < testData.getAttributes().size(); i++) {
77 | View viewList = getLayoutInflater().inflate(R.layout.bottom_sheet_group, null);
78 | TextView tvTitle = (TextView) viewList.findViewById(R.id.tv_title);
79 | RecyclerView recyclerViewBottom = (RecyclerView) viewList.findViewById(R.id.recycler_bottom);
80 | SkuAdapter skuAdapter = new SkuAdapter(testData.getAttributes().get(i).getAttributeMembers());
81 | mUiData.getAdapters().add(skuAdapter);
82 | int item = 4;//设置列数
83 | GridLayoutManager gridLayoutManager = new GridLayoutManager(this, item);
84 | recyclerViewBottom.setLayoutManager(gridLayoutManager);
85 | recyclerViewBottom.setAdapter(skuAdapter);
86 | llList.addView(viewList);
87 | }
88 | // SKU 计算
89 | mUiData.setResult(Sku.skuCollection(testData.getProductStocks()));
90 | for (String key : mUiData.getResult().keySet()) {
91 | Log.d("SKU Result", "key = " + key + " value = " + mUiData.getResult().get(key));
92 | }
93 | //设置点击监听器
94 | for (SkuAdapter adapter : mUiData.getAdapters()) {
95 | ItemClickListener listener = new ItemClickListener(mUiData, adapter);
96 | adapter.setOnClickListener(listener);
97 | }
98 | // 初始化按钮
99 | for (int i = 0; i < mUiData.getAdapters().size(); i++) {
100 | for (ProductModel.AttributesEntity.AttributeMembersEntity entity : mUiData.getAdapters().get(i).getAttributeMembersEntities()) {
101 | if (mUiData.getResult().get(entity.getAttributeMemberId() + "") == null || mUiData.getResult().get(entity.getAttributeMemberId() + "").getStock() <= 0) {
102 | entity.setStatus(2);
103 | }
104 | }
105 | }
106 | //设置价格
107 | mUiData.setBottomSheetDialog(new BottomSheetDialog(this));
108 | mUiData.getBottomSheetDialog().setContentView(view);
109 | View parent = (View) view.getParent();//获取ParentView
110 | BottomSheetBehavior behavior = BottomSheetBehavior.from(parent);
111 | view.measure(0, 0);
112 | behavior.setPeekHeight(view.getMeasuredHeight());
113 | CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) parent.getLayoutParams();
114 | params.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL;
115 | parent.setLayoutParams(params);
116 | mUiData.getBottomSheetDialog().show();
117 | } else {
118 | mUiData.getBottomSheetDialog().show();
119 | }
120 | }
121 |
122 | }
123 |
--------------------------------------------------------------------------------
/app/src/main/java/com/sennie/sku/ProductModel.java:
--------------------------------------------------------------------------------
1 | package com.sennie.sku;
2 |
3 | import com.sennie.skulib.model.BaseSkuModel;
4 |
5 | import java.util.ArrayList;
6 | import java.util.HashMap;
7 | import java.util.List;
8 | import java.util.Map;
9 |
10 | /**
11 | * 项目名称:Sku
12 | * 类描述:
13 | * 创建人:N.Sun
14 | * 创建时间:2016/11/24 下午4:17
15 | * 修改人:N.Sun
16 | * 修改时间:2016/11/24 下午4:17
17 | * 修改备注:
18 | */
19 | public class ProductModel {
20 |
21 | //存储所有录入的库存情况
22 | private Map productStocks = new HashMap<>();
23 |
24 | //记录规格的种类
25 | private List attributes = new ArrayList<>();
26 |
27 | public Map getProductStocks() {
28 | return productStocks;
29 | }
30 |
31 | public void setProductStocks(Map productStocks) {
32 | this.productStocks = productStocks;
33 | }
34 |
35 | public List getAttributes() {
36 | return attributes;
37 | }
38 |
39 | public void setAttributes(List attributes) {
40 | this.attributes = attributes;
41 | }
42 |
43 | public static class AttributesEntity {
44 |
45 | private int id;
46 | private String name;
47 | private List attributeMembers = new ArrayList<>();
48 |
49 | public int getId() {
50 | return id;
51 | }
52 |
53 | public void setId(int id) {
54 | this.id = id;
55 | }
56 |
57 | public String getName() {
58 | return name;
59 | }
60 |
61 | public void setName(String name) {
62 | this.name = name;
63 | }
64 |
65 | public List getAttributeMembers() {
66 | return attributeMembers;
67 | }
68 |
69 | public void setAttributeMembers(List attributeMembers) {
70 | this.attributeMembers = attributeMembers;
71 | }
72 |
73 | public static class AttributeMembersEntity {
74 |
75 | private int attributeGroupId;
76 | private int attributeMemberId;
77 | private String name;
78 | private int status;
79 |
80 | public AttributeMembersEntity(int attributeGroupId, int attributeMemberId, String name) {
81 | this.attributeGroupId = attributeGroupId;
82 | this.attributeMemberId = attributeMemberId;
83 | this.name = name;
84 | }
85 |
86 | @Override
87 | public boolean equals(Object obj) {
88 | if (!(obj instanceof AttributeMembersEntity))
89 | return false;
90 | AttributeMembersEntity entity = (AttributeMembersEntity) obj;
91 | return entity.getName().equals(name) && entity.getAttributeGroupId() == attributeGroupId && entity.getAttributeMemberId() == attributeMemberId;
92 | }
93 |
94 | public int getStatus() {
95 | return status;
96 | }
97 |
98 | public void setStatus(int status) {
99 | this.status = status;
100 | }
101 |
102 | public int getAttributeGroupId() {
103 | return attributeGroupId;
104 | }
105 |
106 | public void setAttributeGroupId(int attributeGroupId) {
107 | this.attributeGroupId = attributeGroupId;
108 | }
109 |
110 | public int getAttributeMemberId() {
111 | return attributeMemberId;
112 | }
113 |
114 | public void setAttributeMemberId(int attributeMemberId) {
115 | this.attributeMemberId = attributeMemberId;
116 | }
117 |
118 | public String getName() {
119 | return name;
120 | }
121 |
122 | public void setName(String name) {
123 | this.name = name;
124 | }
125 |
126 | }
127 | }
128 |
129 | }
130 |
--------------------------------------------------------------------------------
/app/src/main/java/com/sennie/sku/UiData.java:
--------------------------------------------------------------------------------
1 | package com.sennie.sku;
2 |
3 | import android.support.design.widget.BottomSheetDialog;
4 |
5 | import com.sennie.sku.adapter.SkuAdapter;
6 | import com.sennie.skulib.model.BaseSkuModel;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 | import java.util.Map;
11 |
12 | /**
13 | * 项目名称:ZHIZHEN
14 | * 类描述:
15 | * 创建人:N.Sun
16 | * 创建时间:2016/11/21 下午5:06
17 | * 修改人:N.Sun
18 | * 修改时间:2016/11/21 下午5:06
19 | * 修改备注:
20 | */
21 | public class UiData {
22 |
23 | BottomSheetDialog mBottomSheetDialog;
24 |
25 | // 保存多组adapter
26 | List adapters = new ArrayList<>();
27 |
28 | //存放被选中的按钮对应的数据
29 | List selectedEntities = new ArrayList<>();
30 |
31 | //存放计算结果
32 | Map result;
33 |
34 | public List getAdapters() {
35 | return adapters;
36 | }
37 |
38 | public void setAdapters(List adapters) {
39 | this.adapters = adapters;
40 | }
41 |
42 | public Map getResult() {
43 | return result;
44 | }
45 |
46 | public void setResult(Map result) {
47 | this.result = result;
48 | }
49 |
50 | public BottomSheetDialog getBottomSheetDialog() {
51 | return mBottomSheetDialog;
52 | }
53 |
54 | public void setBottomSheetDialog(BottomSheetDialog bottomSheetDialog) {
55 | mBottomSheetDialog = bottomSheetDialog;
56 | }
57 |
58 | public List getSelectedEntities() {
59 | return selectedEntities;
60 | }
61 |
62 | public void setSelectedEntities(List selectedEntities) {
63 | this.selectedEntities = selectedEntities;
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/app/src/main/java/com/sennie/sku/adapter/SkuAdapter.java:
--------------------------------------------------------------------------------
1 | package com.sennie.sku.adapter;
2 |
3 | import android.support.v7.widget.RecyclerView;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.TextView;
8 |
9 | import com.sennie.sku.ProductModel;
10 | import com.sennie.sku.R;
11 |
12 | import java.util.List;
13 |
14 | /**
15 | * 项目名称:Sku
16 | * 类描述:
17 | * 创建人:N.Sun
18 | * 创建时间:2016/11/24 下午4:38
19 | * 修改人:N.Sun
20 | * 修改时间:2016/11/24 下午4:38
21 | * 修改备注:
22 | */
23 | public class SkuAdapter extends RecyclerView.Adapter {
24 |
25 | private List mAttributeMembersEntities;
26 | OnClickListener mOnClickListener;
27 | private ProductModel.AttributesEntity.AttributeMembersEntity currentSelectedItem;
28 |
29 | public SkuAdapter(List attributeMembersEntities) {
30 | this.mAttributeMembersEntities = attributeMembersEntities;
31 | }
32 |
33 | public ProductModel.AttributesEntity.AttributeMembersEntity getCurrentSelectedItem() {
34 | return currentSelectedItem;
35 | }
36 |
37 | public void setCurrentSelectedItem(ProductModel.AttributesEntity.AttributeMembersEntity currentSelectedItem) {
38 | this.currentSelectedItem = currentSelectedItem;
39 | }
40 |
41 | public List getAttributeMembersEntities() {
42 | return mAttributeMembersEntities;
43 | }
44 |
45 | public OnClickListener getOnClickListener() {
46 | return mOnClickListener;
47 | }
48 |
49 | public void setOnClickListener(OnClickListener onClickListener) {
50 | mOnClickListener = onClickListener;
51 | }
52 |
53 | @Override
54 | public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
55 | View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.sku_item_layout, parent, false);
56 | return new ViewHolder(v);
57 | }
58 |
59 | @Override
60 | public void onBindViewHolder(ViewHolder holder, int position) {
61 | holder.setData(mAttributeMembersEntities.get(position));
62 | holder.setClick(position);
63 | }
64 |
65 | @Override
66 | public int getItemCount() {
67 | return mAttributeMembersEntities.size();
68 | }
69 |
70 | class ViewHolder extends RecyclerView.ViewHolder {
71 |
72 | private TextView mTextView;
73 |
74 | public ViewHolder(View itemView) {
75 | super(itemView);
76 | mTextView = (TextView) itemView.findViewById(R.id.tv);
77 | }
78 |
79 | public void setData(ProductModel.AttributesEntity.AttributeMembersEntity entity) {
80 | mTextView.setText(entity.getName());
81 | switch (entity.getStatus()) {
82 | case 0:
83 | mTextView.setAlpha(1f);
84 | mTextView.setBackgroundResource(android.R.color.darker_gray);
85 | break;
86 | case 1:
87 | mTextView.setAlpha(1f);
88 | mTextView.setBackgroundResource(android.R.color.holo_red_light);
89 | break;
90 | case 2:
91 | mTextView.setAlpha(0.4f);
92 | mTextView.setBackgroundResource(android.R.color.darker_gray);
93 | break;
94 | }
95 | }
96 |
97 | public void setClick(final int position) {
98 | mTextView.setOnClickListener(new View.OnClickListener() {
99 | @Override
100 | public void onClick(View v) {
101 | if (mOnClickListener != null)
102 | mOnClickListener.onItemClickListener(position);
103 | }
104 | });
105 | }
106 | }
107 |
108 | public interface OnClickListener {
109 | void onItemClickListener(int position);
110 | }
111 |
112 | }
113 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/bottom_sheet.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
15 |
16 |
17 |
25 |
26 |
32 |
33 |
34 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/bottom_sheet_group.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
17 |
18 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/sku_item_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Sku
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/sennie/sku/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.sennie.sku;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.2.2'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/build/generated/mockable-android-24.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/build/generated/mockable-android-24.jar
--------------------------------------------------------------------------------
/build/intermediates/dex-cache/cache.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
11 |
12 |
13 | -
20 |
21 |
22 | -
29 |
30 |
31 | -
38 |
39 |
40 | -
47 |
48 |
49 | -
56 |
57 |
58 | -
65 |
66 |
67 | -
74 |
75 |
76 | -
83 |
84 |
85 | -
92 |
93 |
94 | -
101 |
102 |
103 | -
110 |
111 |
112 | -
119 |
120 |
121 | -
128 |
129 |
130 | -
137 |
138 |
139 | -
146 |
147 |
148 | -
155 |
156 |
157 | -
164 |
165 |
166 | -
173 |
174 |
175 | -
182 |
183 |
184 |
185 |
186 |
--------------------------------------------------------------------------------
/build/jrebel/timings.json:
--------------------------------------------------------------------------------
1 | {
2 | "timings": [
3 | {
4 | "start": 1480036541593,
5 | "type": "Configuration",
6 | "report": true,
7 | "finish": 1480036543076,
8 | "project": null,
9 | "name": null
10 | },
11 | {
12 | "start": 1480036541593,
13 | "type": "Total",
14 | "report": true,
15 | "finish": 1480036561348,
16 | "project": null,
17 | "name": null
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DesignPCode/Sku/e128a99c4cb4131babe5dd9c8cc150fa2cfccd5f/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Dec 28 10:00:20 PST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | #Thu Nov 24 14:33:34 CST 2016
11 | ndk.dir=/Users/niesen918/Library/Android/sdk/ndk-bundle
12 | sdk.dir=/Users/niesen918/Library/Android/sdk
13 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':SkuLib'
2 |
--------------------------------------------------------------------------------