├── Drawer ├── .gitignore ├── .idea │ ├── .name │ ├── codeStyleSettings.xml │ ├── compiler.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── encodings.xml │ ├── gradle.xml │ ├── misc.xml │ ├── modules.xml │ ├── runConfigurations.xml │ └── vcs.xml ├── Drawer.iml ├── app │ ├── .gitignore │ ├── app.iml │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── lenovo │ │ │ └── drawer │ │ │ └── ApplicationTest.java │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── lenovo │ │ │ └── drawer │ │ │ ├── CustomAnimatorListener.java │ │ │ ├── MainActivity.java │ │ │ └── VerticalDrawerActivity.java │ │ └── res │ │ ├── drawable-xhdpi │ │ ├── guide_drawer_btn_call.png │ │ ├── guide_drawer_btn_find.png │ │ ├── guide_drawer_btn_snapshot.png │ │ ├── guide_drawer_content.9.png │ │ ├── guide_drawer_handler.9.png │ │ ├── guide_drawer_handler_arrow_close.png │ │ ├── guide_drawer_handler_arrow_open.png │ │ └── ic_launcher.png │ │ ├── layout │ │ ├── activity_drawer.xml │ │ └── activity_verticaldrawer.xml │ │ ├── menu │ │ └── menu_main.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── drawerlibrary │ ├── .gitignore │ ├── build.gradle │ ├── drawerlibrary.iml │ ├── libs │ │ └── nineoldandroids.jar │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── lenovo │ │ │ └── drawerlibrary │ │ │ └── ApplicationTest.java │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── lenovo │ │ │ └── drawerlibrary │ │ │ ├── Drawer.java │ │ │ └── DrawerLayout.java │ │ └── res │ │ ├── menu │ │ └── menu_main.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── dimens.xml │ │ ├── drawer_attrs.xml │ │ ├── drawerlayout_attrs.xml │ │ └── strings.xml ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── screen capture │ ├── GIF.gif │ ├── bottom_drawer.gif │ └── device-2015-08-18-123035.png └── settings.gradle └── README.md /Drawer/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | /captures 8 | -------------------------------------------------------------------------------- /Drawer/.idea/.name: -------------------------------------------------------------------------------- 1 | Drawer -------------------------------------------------------------------------------- /Drawer/.idea/codeStyleSettings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 229 | 231 | -------------------------------------------------------------------------------- /Drawer/.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 | -------------------------------------------------------------------------------- /Drawer/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Drawer/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Drawer/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | -------------------------------------------------------------------------------- /Drawer/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 28 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 55 | 56 | 57 | 58 | 59 | 60 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /Drawer/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Drawer/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /Drawer/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Drawer/Drawer.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Drawer/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /Drawer/app/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 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 | -------------------------------------------------------------------------------- /Drawer/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion "22.0.1" 6 | 7 | defaultConfig { 8 | applicationId "com.example.lenovo.drawer" 9 | minSdkVersion 10 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 fileTree(dir: 'libs', include: ['*.jar']) 24 | compile 'com.android.support:appcompat-v7:22.2.1' 25 | compile project(':drawerlibrary') 26 | } 27 | -------------------------------------------------------------------------------- /Drawer/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 D:\developtools\android sdk windows/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 | -------------------------------------------------------------------------------- /Drawer/app/src/androidTest/java/com/example/lenovo/drawer/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.example.lenovo.drawer; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /Drawer/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Drawer/app/src/main/java/com/example/lenovo/drawer/CustomAnimatorListener.java: -------------------------------------------------------------------------------- 1 | package com.example.lenovo.drawer; 2 | 3 | 4 | import com.nineoldandroids.animation.Animator; 5 | 6 | 7 | /** 8 | * Created by Panda Guo on 2015/11/6. 9 | * 10 | * Common Animator Listener, you need not to implement the four full animation 11 | * function. For example: ****.setListener(new CustomAnimatorListener() { 12 | * 13 | * @Override public void onAnimationEnd(Animator animator) { }) 14 | * 15 | * 16 | * 17 | */ 18 | public class CustomAnimatorListener implements Animator.AnimatorListener 19 | { 20 | @Override 21 | public void onAnimationStart(Animator animator) 22 | { 23 | 24 | } 25 | 26 | @Override 27 | public void onAnimationEnd(Animator animator) 28 | { 29 | 30 | } 31 | 32 | @Override 33 | public void onAnimationCancel(Animator animator) 34 | { 35 | 36 | } 37 | 38 | @Override 39 | public void onAnimationRepeat(Animator animator) 40 | { 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Drawer/app/src/main/java/com/example/lenovo/drawer/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.lenovo.drawer; 2 | 3 | 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.view.View; 8 | 9 | 10 | public class MainActivity extends AppCompatActivity 11 | { 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) 15 | { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.activity_drawer); 18 | 19 | findViewById(R.id.guide_call_layout).setOnClickListener( 20 | new View.OnClickListener() 21 | { 22 | @Override 23 | public void onClick(View v) 24 | { 25 | startActivity(new Intent(MainActivity.this, 26 | VerticalDrawerActivity.class)); 27 | } 28 | }); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Drawer/app/src/main/java/com/example/lenovo/drawer/VerticalDrawerActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.lenovo.drawer; 2 | 3 | 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | import android.os.Bundle; 8 | import android.support.v7.app.AppCompatActivity; 9 | import android.util.Log; 10 | import android.view.View; 11 | import android.view.animation.AccelerateInterpolator; 12 | import android.view.animation.DecelerateInterpolator; 13 | import android.widget.AdapterView; 14 | import android.widget.ArrayAdapter; 15 | import android.widget.Button; 16 | import android.widget.LinearLayout; 17 | import android.widget.ListView; 18 | import android.widget.Toast; 19 | 20 | import com.example.lenovo.drawerlibrary.DrawerLayout; 21 | import com.nineoldandroids.animation.Animator; 22 | import com.nineoldandroids.view.ViewHelper; 23 | import com.nineoldandroids.view.ViewPropertyAnimator; 24 | 25 | 26 | /** 27 | * Created by 郭攀峰 on 2015/10/31. 28 | */ 29 | public class VerticalDrawerActivity extends AppCompatActivity 30 | { 31 | 32 | private static final String tag = VerticalDrawerActivity.class.getSimpleName(); 33 | 34 | private DrawerLayout mDrawerLayout; 35 | private LinearLayout mNumberLayout; 36 | private LinearLayout mDrawerContent; 37 | private int mTranslationY = 0; 38 | private boolean isOpened = false; 39 | private boolean isClosed = false; 40 | 41 | @Override 42 | protected void onCreate(Bundle savedInstanceState) 43 | { 44 | super.onCreate(savedInstanceState); 45 | Log.d(tag, "activity onCreate function"); 46 | 47 | setContentView(R.layout.activity_verticaldrawer); 48 | 49 | findViewById(R.id.click).setOnClickListener(new View.OnClickListener() 50 | { 51 | @Override 52 | public void onClick(View v) 53 | { 54 | Toast.makeText(VerticalDrawerActivity.this, "clicked", Toast.LENGTH_SHORT) 55 | .show(); 56 | } 57 | }); 58 | 59 | mNumberLayout = (LinearLayout) findViewById(R.id.number_layout); 60 | 61 | mDrawerContent = (LinearLayout) findViewById(R.id.drawerContent); 62 | mDrawerContent.setOnClickListener(new View.OnClickListener() 63 | { 64 | @Override 65 | public void onClick(View v) 66 | { 67 | Log.d(tag, "drawer content click"); 68 | } 69 | }); 70 | Button mDelBtn = (Button) findViewById(R.id.del_click); 71 | mDelBtn.setOnClickListener(new View.OnClickListener() 72 | { 73 | @Override 74 | public void onClick(View v) 75 | { 76 | Log.d(tag, "clicked delete button"); 77 | } 78 | }); 79 | 80 | fillListView((ListView) findViewById(R.id.list_view)); 81 | 82 | mDrawerLayout = (DrawerLayout) findViewById(R.id.dial_drawer); 83 | mDrawerLayout.setInitialState(DrawerLayout.State.Open); //set drawer initial state: open or close 84 | mDrawerLayout.setDrawerListener(new DrawerLayout.DrawerListener() 85 | { 86 | @Override 87 | public void drawerOpened() 88 | { 89 | if (!isOpened) 90 | showNumberView(); 91 | } 92 | 93 | @Override 94 | public void drawerClosed() 95 | { 96 | if (!isClosed) 97 | hideNumberView(); 98 | } 99 | }); 100 | } 101 | 102 | private void fillListView(ListView view) 103 | { 104 | List list = new ArrayList(100); 105 | for (int i = 0; i < 100; i++) 106 | { 107 | list.add("Item " + i); 108 | } 109 | 110 | ArrayAdapter adapter = new ArrayAdapter(this, 111 | android.R.layout.simple_list_item_1, list); 112 | view.setAdapter(adapter); 113 | 114 | view.setOnItemClickListener(new AdapterView.OnItemClickListener() 115 | { 116 | @Override 117 | public void onItemClick(AdapterView parent, View view, int position, 118 | long id) 119 | { 120 | Log.d(tag, "ListView item clicked"); 121 | } 122 | }); 123 | } 124 | 125 | private void showNumberView() 126 | { 127 | ViewHelper.setAlpha(mNumberLayout, 0); 128 | ViewHelper.setTranslationY(mNumberLayout, 129 | mTranslationY - mNumberLayout.getHeight()); 130 | ViewPropertyAnimator.animate(mNumberLayout).alpha(1f).translationY(mTranslationY) 131 | .setInterpolator(new DecelerateInterpolator()).setDuration(300) 132 | .setStartDelay(0).setListener(new CustomAnimatorListener() 133 | { 134 | @Override 135 | public void onAnimationEnd(Animator animator) 136 | { 137 | isOpened = true; 138 | isClosed = false; 139 | } 140 | }).start(); 141 | } 142 | 143 | private void hideNumberView() 144 | { 145 | ViewPropertyAnimator.animate(mNumberLayout).alpha(0f) 146 | .translationY(-mNumberLayout.getHeight() + mTranslationY) 147 | .setInterpolator(new AccelerateInterpolator()).setDuration(300) 148 | .setListener(new CustomAnimatorListener() 149 | { 150 | @Override 151 | public void onAnimationEnd(Animator animator) 152 | { 153 | isOpened = false; 154 | isClosed = true; 155 | } 156 | }).start(); 157 | 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /Drawer/app/src/main/res/drawable-xhdpi/guide_drawer_btn_call.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpfduoduo/DrawerOnCorner/cdd4c58295c09ac4dae874ff619a6e8a6e12c3a4/Drawer/app/src/main/res/drawable-xhdpi/guide_drawer_btn_call.png -------------------------------------------------------------------------------- /Drawer/app/src/main/res/drawable-xhdpi/guide_drawer_btn_find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpfduoduo/DrawerOnCorner/cdd4c58295c09ac4dae874ff619a6e8a6e12c3a4/Drawer/app/src/main/res/drawable-xhdpi/guide_drawer_btn_find.png -------------------------------------------------------------------------------- /Drawer/app/src/main/res/drawable-xhdpi/guide_drawer_btn_snapshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpfduoduo/DrawerOnCorner/cdd4c58295c09ac4dae874ff619a6e8a6e12c3a4/Drawer/app/src/main/res/drawable-xhdpi/guide_drawer_btn_snapshot.png -------------------------------------------------------------------------------- /Drawer/app/src/main/res/drawable-xhdpi/guide_drawer_content.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpfduoduo/DrawerOnCorner/cdd4c58295c09ac4dae874ff619a6e8a6e12c3a4/Drawer/app/src/main/res/drawable-xhdpi/guide_drawer_content.9.png -------------------------------------------------------------------------------- /Drawer/app/src/main/res/drawable-xhdpi/guide_drawer_handler.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpfduoduo/DrawerOnCorner/cdd4c58295c09ac4dae874ff619a6e8a6e12c3a4/Drawer/app/src/main/res/drawable-xhdpi/guide_drawer_handler.9.png -------------------------------------------------------------------------------- /Drawer/app/src/main/res/drawable-xhdpi/guide_drawer_handler_arrow_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpfduoduo/DrawerOnCorner/cdd4c58295c09ac4dae874ff619a6e8a6e12c3a4/Drawer/app/src/main/res/drawable-xhdpi/guide_drawer_handler_arrow_close.png -------------------------------------------------------------------------------- /Drawer/app/src/main/res/drawable-xhdpi/guide_drawer_handler_arrow_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpfduoduo/DrawerOnCorner/cdd4c58295c09ac4dae874ff619a6e8a6e12c3a4/Drawer/app/src/main/res/drawable-xhdpi/guide_drawer_handler_arrow_open.png -------------------------------------------------------------------------------- /Drawer/app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpfduoduo/DrawerOnCorner/cdd4c58295c09ac4dae874ff619a6e8a6e12c3a4/Drawer/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Drawer/app/src/main/res/layout/activity_drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 14 | 27 | 28 | 35 | 36 | 42 | 43 | 49 | 50 | 55 | 56 | 57 | 58 | 63 | 64 | 71 | 72 | 78 | 79 | 80 | 84 | 85 | 92 | 93 | 99 | 100 | 101 | 105 | 106 | 113 | 114 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /Drawer/app/src/main/res/layout/activity_verticaldrawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 18 | 19 | 23 | 24 |