Skip to content

Commit df18c37

Browse files
committed
frist commit
frist commit
0 parents  commit df18c37

File tree

67 files changed

+2371
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2371
-0
lines changed

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.gradle
2+
/local.properties
3+
/.idea/workspace.xml
4+
/.idea/libraries
5+
.DS_Store
6+
/build
7+
/captures

MyApplication.iml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module external.linked.project.id="MyApplication" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="java-gradle" name="Java-Gradle">
5+
<configuration>
6+
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
7+
<option name="BUILDABLE" value="false" />
8+
</configuration>
9+
</facet>
10+
</component>
11+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
12+
<exclude-output />
13+
<content url="file://$MODULE_DIR$">
14+
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
15+
</content>
16+
<orderEntry type="inheritedJdk" />
17+
<orderEntry type="sourceFolder" forTests="false" />
18+
</component>
19+
</module>

app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/app.iml

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="MyApplication" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="android-gradle" name="Android-Gradle">
5+
<configuration>
6+
<option name="GRADLE_PROJECT_PATH" value=":app" />
7+
</configuration>
8+
</facet>
9+
<facet type="android" name="Android">
10+
<configuration>
11+
<option name="SELECTED_BUILD_VARIANT" value="debug" />
12+
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
13+
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
14+
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
15+
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
16+
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
17+
<afterSyncTasks>
18+
<task>generateDebugAndroidTestSources</task>
19+
<task>generateDebugSources</task>
20+
</afterSyncTasks>
21+
<option name="ALLOW_USER_CONFIGURATION" value="false" />
22+
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
23+
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
24+
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
25+
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
26+
</configuration>
27+
</facet>
28+
</component>
29+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
30+
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
31+
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
32+
<exclude-output />
33+
<content url="file://$MODULE_DIR$">
34+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
35+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
36+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
37+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
38+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
39+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" />
40+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
41+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
42+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
43+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
44+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
45+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/androidTest/debug" type="java-test-resource" />
46+
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
47+
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
48+
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
49+
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
50+
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
51+
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
52+
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
53+
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
54+
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
55+
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
56+
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
57+
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
58+
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
59+
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
60+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
61+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
62+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
63+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
64+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
65+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
66+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
67+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
68+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
69+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
70+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
71+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
72+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
73+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
74+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/jars" />
75+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.0/jars" />
76+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
77+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
78+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
79+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
80+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
81+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
82+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
83+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
84+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
85+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
86+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
87+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
88+
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
89+
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
90+
</content>
91+
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
92+
<orderEntry type="sourceFolder" forTests="false" />
93+
<orderEntry type="library" exported="" name="support-v4-22.2.0" level="project" />
94+
<orderEntry type="library" exported="" name="support-annotations-22.2.0" level="project" />
95+
<orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" />
96+
<orderEntry type="library" exported="" name="library-2.4.0" level="project" />
97+
<orderEntry type="module" module-name="sweetsheet" exported="" />
98+
</component>
99+
</module>

app/build.gradle

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 22
5+
buildToolsVersion "22.0.1"
6+
7+
defaultConfig {
8+
applicationId "com.mingle.myapplication"
9+
minSdkVersion 14
10+
targetSdkVersion 22
11+
versionCode 1
12+
versionName "1.0"
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 'com.android.support:appcompat-v7:22.2.0'
24+
compile project(':sweetsheet')
25+
}

app/proguard-rules.pro

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/zzz40500/Documents/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+
#}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.mingle.myapplication;
2+
3+
import android.app.Application;
4+
import android.test.ApplicationTestCase;
5+
6+
/**
7+
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
8+
*/
9+
public class ApplicationTest extends ApplicationTestCase<Application> {
10+
public ApplicationTest() {
11+
super(Application.class);
12+
}
13+
}

app/src/main/AndroidManifest.xml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.mingle.myapplication" >
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:theme="@style/AppTheme" >
10+
<activity
11+
android:name=".MainActivity"
12+
android:label="@string/app_name" >
13+
<intent-filter>
14+
<action android:name="android.intent.action.MAIN" />
15+
16+
<category android:name="android.intent.category.LAUNCHER" />
17+
</intent-filter>
18+
</activity>
19+
</application>
20+
21+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
package com.mingle.myapplication;
2+
3+
import android.support.v7.app.AppCompatActivity;
4+
import android.os.Bundle;
5+
import android.view.Menu;
6+
import android.view.MenuItem;
7+
import android.widget.RelativeLayout;
8+
import android.widget.Toast;
9+
import com.mingle.entity.MenuEntity;
10+
import com.mingle.sweetpick.SweetSheet;
11+
import java.util.ArrayList;
12+
13+
public class MainActivity extends AppCompatActivity {
14+
15+
private SweetSheet mSweetSheet;
16+
private SweetSheet mSweetSheet2;
17+
@Override
18+
protected void onCreate(Bundle savedInstanceState) {
19+
super.onCreate(savedInstanceState);
20+
setContentView(R.layout.activity_main);
21+
RelativeLayout rl = (RelativeLayout) findViewById(R.id.rl);
22+
23+
final ArrayList<MenuEntity> list=new ArrayList<>();
24+
25+
MenuEntity menuEntity=new MenuEntity();
26+
menuEntity.resId=R.drawable.ic_account_child;
27+
menuEntity.name="QQ";
28+
list.add(menuEntity);
29+
list.add(menuEntity);
30+
list.add(menuEntity);
31+
list.add(menuEntity);
32+
list.add(menuEntity);
33+
list.add(menuEntity);
34+
list.add(menuEntity);
35+
list.add(menuEntity);
36+
list.add(menuEntity);
37+
list.add(menuEntity);
38+
list.add(menuEntity);
39+
list.add(menuEntity);
40+
list.add(menuEntity);
41+
42+
mSweetSheet = new SweetSheet(rl, SweetSheet.Type.RecyclerView);
43+
mSweetSheet.setMenuList(getSupportFragmentManager(), list);
44+
mSweetSheet2 = new SweetSheet(rl, SweetSheet.Type.Viewpager);
45+
mSweetSheet2.setMenuList(getSupportFragmentManager(),list);
46+
mSweetSheet.setBackgroundDim(0.8f);
47+
mSweetSheet2.setBackgroundDim(0.4f);
48+
mSweetSheet.setOnMenuItemClickListener(new SweetSheet.OnMenuItemClickListener() {
49+
@Override
50+
public boolean onItemClick(int position) {
51+
52+
Toast.makeText(MainActivity.this,list.get(position).name+" "+position,Toast.LENGTH_SHORT).show();
53+
return true;
54+
}
55+
});
56+
mSweetSheet2.setOnMenuItemClickListener(new SweetSheet.OnMenuItemClickListener() {
57+
@Override
58+
public boolean onItemClick(int position) {
59+
60+
Toast.makeText(MainActivity.this,list.get(position).name+" "+position,Toast.LENGTH_SHORT).show();
61+
return true;
62+
}
63+
});
64+
}
65+
66+
@Override
67+
public boolean onCreateOptionsMenu(Menu menu) {
68+
getMenuInflater().inflate(R.menu.menu_main, menu);
69+
return true;
70+
}
71+
72+
@Override
73+
public void onBackPressed() {
74+
75+
if(mSweetSheet.isShow() || mSweetSheet2.isShow()){
76+
if(mSweetSheet.isShow()){
77+
mSweetSheet.dismiss();
78+
}
79+
if(mSweetSheet2.isShow()){
80+
mSweetSheet2.dismiss();
81+
}
82+
}else{
83+
super.onBackPressed();
84+
}
85+
86+
87+
}
88+
89+
@Override
90+
public boolean onOptionsItemSelected(MenuItem item) {
91+
int id = item.getItemId();
92+
if (id == R.id.action_recyclerView) {
93+
mSweetSheet.toggle();
94+
return true;
95+
}
96+
if (id == R.id.action_viewpager) {
97+
mSweetSheet2.toggle();
98+
return true;
99+
}
100+
return super.onOptionsItemSelected(item);
101+
}
102+
}
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<item android:drawable="@drawable/ic_public_blue_grey_200_24dp" android:state_pressed="true"/>
5+
<item android:drawable="@drawable/ic_public_blue_grey_500_24dp"/>
6+
</selector>
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
android:background="#ff8b90af"
6+
android:id="@+id/rl"
7+
tools:context=".MainActivity">
8+
9+
10+
11+
</RelativeLayout>

app/src/main/res/menu/menu_main.xml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<menu xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:app="http://schemas.android.com/apk/res-auto"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
tools:context=".MainActivity">
5+
<item android:id="@+id/action_recyclerView"
6+
android:title="recyclerView"
7+
android:orderInCategory="100"
8+
app:showAsAction="always"/>
9+
<item android:id="@+id/action_viewpager"
10+
android:title="viewpager"
11+
android:orderInCategory="100"
12+
app:showAsAction="always"/>
13+
</menu>
3.34 KB
Loading
2.15 KB
Loading
4.73 KB
Loading
7.54 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<resources>
2+
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
3+
(such as screen margins) for screens with more than 820dp of available width. This
4+
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
5+
<dimen name="activity_horizontal_margin">64dp</dimen>
6+
</resources>

app/src/main/res/values/dimens.xml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<resources>
2+
<!-- Default screen margins, per the Android Design guidelines. -->
3+
<dimen name="activity_horizontal_margin">16dp</dimen>
4+
<dimen name="activity_vertical_margin">16dp</dimen>
5+
</resources>

app/src/main/res/values/strings.xml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<resources>
2+
<string name="app_name">dim</string>
3+
4+
<string name="hello_world">Hello world!</string>
5+
<string name="action_settings">Settings</string>
6+
</resources>

app/src/main/res/values/styles.xml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<resources>
2+
3+
<!-- Base application theme. -->
4+
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
5+
<!-- Customize your theme here. -->
6+
</style>
7+
8+
</resources>

build.gradle

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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:1.2.3'
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+
}

0 commit comments

Comments
 (0)