diff --git a/qqslidingmenu/build.gradle b/qqslidingmenu/build.gradle deleted file mode 100644 index b42d03b..0000000 --- a/qqslidingmenu/build.gradle +++ /dev/null @@ -1,25 +0,0 @@ -apply plugin: 'com.android.application' - -android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" - - defaultConfig { - applicationId "com.gpl.qqslidingmenu" - minSdkVersion 14 - targetSdkVersion 23 - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' - } - } -} - -dependencies { - compile files('libs/nineoldandroids-2.4.0.jar') - compile 'com.android.support:support-v4:23.3.0' - compile 'com.android.support:appcompat-v7:23.3.0' -} diff --git a/qqslidingmenu/libs/nineoldandroids-2.4.0.jar b/qqslidingmenu/libs/nineoldandroids-2.4.0.jar deleted file mode 100644 index 220c505..0000000 Binary files a/qqslidingmenu/libs/nineoldandroids-2.4.0.jar and /dev/null differ diff --git a/qqslidingmenu/lint.xml b/qqslidingmenu/lint.xml deleted file mode 100644 index 8423c0e..0000000 --- a/qqslidingmenu/lint.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/qqslidingmenu/qqslidingmenu.iml b/qqslidingmenu/qqslidingmenu.iml deleted file mode 100644 index 790e3f5..0000000 --- a/qqslidingmenu/qqslidingmenu.iml +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/qqslidingmenu/src/main/AndroidManifest.xml b/qqslidingmenu/src/main/AndroidManifest.xml deleted file mode 100644 index 401746a..0000000 --- a/qqslidingmenu/src/main/AndroidManifest.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/qqslidingmenu/src/main/java/com/gpl/qqslidingmenu/ColorUtil.java b/qqslidingmenu/src/main/java/com/gpl/qqslidingmenu/ColorUtil.java deleted file mode 100644 index 5560eb7..0000000 --- a/qqslidingmenu/src/main/java/com/gpl/qqslidingmenu/ColorUtil.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.gpl.qqslidingmenu; - -public class ColorUtil { - public static Object evaluateColor(float fraction, Object startValue, - Object endValue) { - int startInt = (Integer) startValue; - int startA = (startInt >> 24) & 0xff; - int startR = (startInt >> 16) & 0xff; - int startG = (startInt >> 8) & 0xff; - int startB = startInt & 0xff; - - int endInt = (Integer) endValue; - int endA = (endInt >> 24) & 0xff; - int endR = (endInt >> 16) & 0xff; - int endG = (endInt >> 8) & 0xff; - int endB = endInt & 0xff; - - return (int) ((startA + (int) (fraction * (endA - startA))) << 24) - | (int) ((startR + (int) (fraction * (endR - startR))) << 16) - | (int) ((startG + (int) (fraction * (endG - startG))) << 8) - | (int) ((startB + (int) (fraction * (endB - startB)))); - } -} diff --git a/qqslidingmenu/src/main/java/com/gpl/qqslidingmenu/Constant.java b/qqslidingmenu/src/main/java/com/gpl/qqslidingmenu/Constant.java deleted file mode 100644 index d584531..0000000 --- a/qqslidingmenu/src/main/java/com/gpl/qqslidingmenu/Constant.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.gpl.qqslidingmenu; - - -public interface Constant { - public static final String[] sCheeseStrings = { - "Abbaye de Belloc", "Abbaye du Mont des Cats", "Abertam", "Abondance", "Ackawi", - "Acorn", "Adelost", "Affidelice au Chablis", "Afuega'l Pitu", "Airag", "Airedale", - "Aisy Cendre", "Allgauer Emmentaler", "Alverca", "Ambert", "American Cheese", - "Ami du Chambertin", "Anejo Enchilado", "Anneau du Vic-Bilh", "Anthoriro", "Appenzell", - "Aragon", "Ardi Gasna", "Ardrahan", "Armenian String", "Aromes au Gene de Marc", - "Cougar Gold", "Coulommiers", "Coverdale", "Crayeux de Roncq", "Cream Cheese", - "Cream Havarti", "Crema Agria", "Crema Mexicana", "Creme Fraiche", "Crescenza", - "Croghan", "Crottin de Chavignol", "Crottin du Chavignol", "Crowdie", "Crowley", - "Zamorano", "Zanetti Grana Padano", "Zanetti Parmigiano Reggiano" -}; - -public static final String[] NAMES = new String[] { "宋江", "卢俊义", "吴用", - "公孙胜", "关胜", "林冲", "秦明", "呼延灼", "花荣", "柴进", "李应", "朱仝", "鲁智深", - "武松", "董平", "张清", "杨志", "徐宁", "索超", "戴宗", "刘唐", "李逵", "史进", "穆弘", - "雷横", "李俊", "阮小二", "张横", "阮小五", " 张顺", "阮小七", "杨雄", "石秀", "解珍", - " 解宝", "燕青", "朱武", "黄信", "孙立", "宣赞", "郝思文", "韩滔", "彭玘", "单廷珪", - "魏定国", "萧让", "裴宣", "欧鹏", "邓飞", " 燕顺", "杨林", "凌振", "蒋敬", "吕方", - "郭 盛", "安道全", "皇甫端", "王英", "扈三娘", "鲍旭", "樊瑞", "孔明", "孔亮", "项充", - "李衮", "金大坚", "马麟", "童威", "童猛", "孟康", "侯健", "陈达", "杨春", "郑天寿", - "陶宗旺", "宋清", "乐和", "龚旺", "丁得孙", "穆春", "曹正", "宋万", "杜迁", "薛永", "施恩", - }; -} diff --git a/qqslidingmenu/src/main/java/com/gpl/qqslidingmenu/MainActivity.java b/qqslidingmenu/src/main/java/com/gpl/qqslidingmenu/MainActivity.java deleted file mode 100644 index 5f47c2a..0000000 --- a/qqslidingmenu/src/main/java/com/gpl/qqslidingmenu/MainActivity.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.gpl.qqslidingmenu; - -import java.util.Random; - -import com.gpl.qqslidingmenu.view.SlidingMenu; -import com.gpl.qqslidingmenu.view.SlidingMenu.OnDragStateChangeListener; - -import com.nineoldandroids.view.ViewHelper; -import com.nineoldandroids.view.ViewPropertyAnimator; - -import android.app.Activity; -import android.graphics.Color; -import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.view.View; -import android.view.ViewGroup; -import android.view.Window; -import android.view.animation.CycleInterpolator; -import android.view.animation.Interpolator; -import android.widget.ArrayAdapter; -import android.widget.ImageView; -import android.widget.ListView; -import android.widget.TextView; - -public class MainActivity extends Activity{ - - @Override - protected void onCreate(Bundle savedInstanceState) { - requestWindowFeature(Window.FEATURE_NO_TITLE); - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - final ListView menu_listview = (ListView) findViewById(R.id.menu_listview); - ListView main_listview = (ListView) findViewById(R.id.main_listview); - SlidingMenu slideMenu = (SlidingMenu) findViewById(R.id.slideMenu); - final ImageView iv_head = (ImageView) findViewById(R.id.iv_head); - slideMenu.setOnDragStateChangeListener(new OnDragStateChangeListener() { - - @Override - public void onOpen() { - - menu_listview.smoothScrollToPosition(new Random().nextInt(menu_listview.getCount())); - } - - @Override - public void onDrag(float fraction) { - ViewHelper.setAlpha(iv_head, 1-fraction); - - } - - @Override - public void onClose() { - ViewPropertyAnimator.animate(iv_head).translationX(15) - .setInterpolator(new CycleInterpolator(4)).setDuration(300).start(); - - } - }); - //填充数据 - menu_listview.setAdapter(new ArrayAdapter(this,android.R.layout.simple_list_item_1,Constant.sCheeseStrings){ - @Override - public View getView(int position, View convertView, ViewGroup parent) { - TextView view = (TextView) super.getView(position, convertView, parent); - view.setTextColor(Color.WHITE); - return view; - } - - }); - main_listview.setAdapter(new ArrayAdapter(this,android.R.layout.simple_list_item_1,Constant.NAMES)); - - } - -} diff --git a/qqslidingmenu/src/main/java/com/gpl/qqslidingmenu/view/SlidingMenu.java b/qqslidingmenu/src/main/java/com/gpl/qqslidingmenu/view/SlidingMenu.java deleted file mode 100644 index 9423d1b..0000000 --- a/qqslidingmenu/src/main/java/com/gpl/qqslidingmenu/view/SlidingMenu.java +++ /dev/null @@ -1,252 +0,0 @@ -package com.gpl.qqslidingmenu.view; - -import com.gpl.qqslidingmenu.ColorUtil; -import com.nineoldandroids.animation.FloatEvaluator; -import com.nineoldandroids.view.ViewHelper; - -import android.content.Context; -import android.graphics.Color; -import android.graphics.PorterDuff.Mode; -import android.support.v4.view.ViewCompat; -import android.support.v4.widget.ViewDragHelper; -import android.support.v4.widget.ViewDragHelper.Callback; -import android.util.AttributeSet; -import android.view.MotionEvent; -import android.view.View; -import android.widget.FrameLayout; - -public class SlidingMenu extends FrameLayout { - - private View menuView; - private View mainView; - private int mainViewWidth; - private int mainViewHeight; - private int menuViewHeight; - private int menuViewWidth; - private int dragRange; - private float fraction; - private FloatEvaluator floatEvaluator; - private ViewDragHelper mViewDragHelper; - private DragState dragState = DragState.CLOSE; - - public enum DragState { - CLOSE, OPEN; - } - - public SlidingMenu(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - init(); - } - - public SlidingMenu(Context context, AttributeSet attrs) { - this(context, attrs, 0); - } - - public SlidingMenu(Context context) { - this(context, null, 0); - } - - /** - * 初始化 - */ - private void init() { - floatEvaluator = new FloatEvaluator(); - mViewDragHelper = ViewDragHelper.create(this, 1f,cb); - } - - public DragState getDragState() { - return dragState; - } - - /** - * 在xml文件解析完成后调用 - */ - @Override - protected void onFinishInflate() { - if (getChildCount() != 2) { - throw new IllegalArgumentException( - "slidingMenu must have and only support 2 children!"); - } - menuView = (View) getChildAt(0); - mainView = (View) getChildAt(1); - super.onFinishInflate(); - } - - /** - * 在该方法中可以准确获取父窗体宽高 - */ - @Override - protected void onSizeChanged(int w, int h, int oldw, int oldh) { - dragRange = (int) (getMeasuredWidth() * 0.6f); - super.onSizeChanged(w, h, oldw, oldh); - } - - @Override - protected void onLayout(boolean changed, int left, int top, int right, - int bottom) { - menuViewWidth = menuView.getMeasuredWidth(); - menuViewHeight = menuView.getMeasuredHeight(); - menuView.layout(-menuViewWidth, 0, 0, menuViewHeight); - mainViewWidth = mainView.getMeasuredWidth(); - mainViewHeight = mainView.getMeasuredHeight(); - mainView.layout(0, 0, mainViewWidth, mainViewHeight); - super.onLayout(changed, left, top, right, bottom); - } - - /** - * 自处理触摸事件 - */ - @Override - public boolean onInterceptTouchEvent(MotionEvent ev) { - boolean result = mViewDragHelper.shouldInterceptTouchEvent(ev); - return result; - } - - /** - * 让mViewDragHelper处理触摸事件 - */ - @Override - public boolean onTouchEvent(MotionEvent event) { - mViewDragHelper.processTouchEvent(event); - return true; - } - - - @Override - public void computeScroll() { - if (mViewDragHelper.continueSettling(true)) { - ViewCompat.postInvalidateOnAnimation(SlidingMenu.this); - } - } - - - private Callback cb = new Callback() { - - /** 捕获所有子View的触摸事件 */ - @Override - public boolean tryCaptureView(View child, int pointerId) { - return true; - } - - @Override - public void onViewDragStateChanged(int state) { - super.onViewDragStateChanged(state); - } - - @Override - public void onViewReleased(View releasedChild, float xvel, float yvel) { - super.onViewReleased(releasedChild, xvel, yvel); - if (mainView.getLeft() > dragRange / 2) { - open(); - } else { - close(); - } - - if (xvel > 200) { - open(); - } else if (xvel < -200) { - close(); - } - } - /** 关闭侧拉菜单 */ - private void close() { - mViewDragHelper.smoothSlideViewTo(mainView, 0, 0); - - ViewCompat.postInvalidateOnAnimation(SlidingMenu.this); - } - /** 打开侧拉菜单 */ - private void open() { - mViewDragHelper.smoothSlideViewTo(mainView, dragRange, 0); - ViewCompat.postInvalidateOnAnimation(SlidingMenu.this); - } - - @Override - public int getViewHorizontalDragRange(View child) { - - return dragRange; - } - - @Override - public int clampViewPositionHorizontal(View child, int left, int dx) { - if (child == mainView) { - //限制左边 - if (left < 0) { - left = 0; - } - //限制右边 - else if (left > dragRange) { - left = dragRange; - } - } - return left; - } - @Override - public void onViewPositionChanged(View changedView, int left, int top, - int dx, int dy) { - if (changedView == menuView) { -// menuView.layout(0, 0, menuView.getMeasuredWidth(), -// menuView.getMeasuredHeight()); - int newLeft = mainView.getLeft() + dx; - if (newLeft < 0) { - newLeft = 0; - - } else if (newLeft > dragRange) { - newLeft = dragRange; - } - //让mianview做跟随移动 - mainView.layout(newLeft, 0, newLeft + mainViewWidth, - mainViewHeight); - } - //执行伴随动画 - fraction = mainView.getLeft() * 1f / dragRange; - executeAnimation(fraction); - - //根据fraction的值和dragState回调监听器方法 - if (fraction == 1 && dragState != DragState.OPEN) { - dragState = DragState.OPEN; - listener.onOpen(); - } else if (fraction == 0 && dragState != DragState.CLOSE) { - dragState = DragState.CLOSE; - listener.onClose(); - } - listener.onDrag(fraction); - } - - private void executeAnimation(float fraction) { - // 主界面缩放 - ViewHelper.setScaleX(mainView, - floatEvaluator.evaluate(fraction, 1, 0.8f)); - ViewHelper.setScaleY(mainView, - floatEvaluator.evaluate(fraction, 1, 0.8f)); - // 菜单界面缩放 - ViewHelper.setScaleX(menuView, - floatEvaluator.evaluate(fraction, 0.8f, 1)); - ViewHelper.setScaleY(menuView, - floatEvaluator.evaluate(fraction, 0.8f, 1)); - // 平移 - ViewHelper.setTranslationX(menuView, - floatEvaluator.evaluate(fraction, -menuViewWidth / 2, 0)); - // 透明度 - ViewHelper.setAlpha(menuView, - floatEvaluator.evaluate(fraction, 0, 1)); - - //遮罩 - getBackground().setColorFilter((Integer) ColorUtil.evaluateColor(fraction, Color.DKGRAY, Color.TRANSPARENT), Mode.SRC_OVER); - } - - }; - - private OnDragStateChangeListener listener; - - public void setOnDragStateChangeListener(OnDragStateChangeListener listener) { - this.listener = listener; - } - - public interface OnDragStateChangeListener { - void onOpen(); - - void onClose(); - - void onDrag(float fraction); - } -} diff --git a/qqslidingmenu/src/main/res/drawable-hdpi/bg.png b/qqslidingmenu/src/main/res/drawable-hdpi/bg.png deleted file mode 100644 index 02bfd8b..0000000 Binary files a/qqslidingmenu/src/main/res/drawable-hdpi/bg.png and /dev/null differ diff --git a/qqslidingmenu/src/main/res/drawable-hdpi/ic_launcher.png b/qqslidingmenu/src/main/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index 288b665..0000000 Binary files a/qqslidingmenu/src/main/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/qqslidingmenu/src/main/res/drawable-mdpi/ic_launcher.png b/qqslidingmenu/src/main/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index 6ae570b..0000000 Binary files a/qqslidingmenu/src/main/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/qqslidingmenu/src/main/res/drawable-xhdpi/head.png b/qqslidingmenu/src/main/res/drawable-xhdpi/head.png deleted file mode 100644 index e4aebfc..0000000 Binary files a/qqslidingmenu/src/main/res/drawable-xhdpi/head.png and /dev/null differ diff --git a/qqslidingmenu/src/main/res/drawable-xhdpi/ic_launcher.png b/qqslidingmenu/src/main/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index d4fb7cd..0000000 Binary files a/qqslidingmenu/src/main/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/qqslidingmenu/src/main/res/drawable-xxhdpi/ic_launcher.png b/qqslidingmenu/src/main/res/drawable-xxhdpi/ic_launcher.png deleted file mode 100644 index 85a6081..0000000 Binary files a/qqslidingmenu/src/main/res/drawable-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/qqslidingmenu/src/main/res/layout/activity_main.xml b/qqslidingmenu/src/main/res/layout/activity_main.xml deleted file mode 100644 index 523f617..0000000 --- a/qqslidingmenu/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - \ No newline at end of file diff --git a/qqslidingmenu/src/main/res/layout/layout_main.xml b/qqslidingmenu/src/main/res/layout/layout_main.xml deleted file mode 100644 index 6b16a18..0000000 --- a/qqslidingmenu/src/main/res/layout/layout_main.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/qqslidingmenu/src/main/res/layout/layout_menu.xml b/qqslidingmenu/src/main/res/layout/layout_menu.xml deleted file mode 100644 index 5bf5f00..0000000 --- a/qqslidingmenu/src/main/res/layout/layout_menu.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/qqslidingmenu/src/main/res/menu/main.xml b/qqslidingmenu/src/main/res/menu/main.xml deleted file mode 100644 index d227c49..0000000 --- a/qqslidingmenu/src/main/res/menu/main.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - \ No newline at end of file diff --git a/qqslidingmenu/src/main/res/values-sw600dp/dimens.xml b/qqslidingmenu/src/main/res/values-sw600dp/dimens.xml deleted file mode 100644 index 1ba777d..0000000 --- a/qqslidingmenu/src/main/res/values-sw600dp/dimens.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/qqslidingmenu/src/main/res/values-sw720dp-land/dimens.xml b/qqslidingmenu/src/main/res/values-sw720dp-land/dimens.xml deleted file mode 100644 index eee741a..0000000 --- a/qqslidingmenu/src/main/res/values-sw720dp-land/dimens.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - 128dp - - \ No newline at end of file diff --git a/qqslidingmenu/src/main/res/values-v11/styles.xml b/qqslidingmenu/src/main/res/values-v11/styles.xml deleted file mode 100644 index 541752f..0000000 --- a/qqslidingmenu/src/main/res/values-v11/styles.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/qqslidingmenu/src/main/res/values-v14/styles.xml b/qqslidingmenu/src/main/res/values-v14/styles.xml deleted file mode 100644 index f20e015..0000000 --- a/qqslidingmenu/src/main/res/values-v14/styles.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/qqslidingmenu/src/main/res/values/dimens.xml b/qqslidingmenu/src/main/res/values/dimens.xml deleted file mode 100644 index a6dd140..0000000 --- a/qqslidingmenu/src/main/res/values/dimens.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - 16dp - 16dp - - \ No newline at end of file diff --git a/qqslidingmenu/src/main/res/values/strings.xml b/qqslidingmenu/src/main/res/values/strings.xml deleted file mode 100644 index 8039377..0000000 --- a/qqslidingmenu/src/main/res/values/strings.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - QQ5.0 - Settings - Hello world! - - \ No newline at end of file diff --git a/qqslidingmenu/src/main/res/values/styles.xml b/qqslidingmenu/src/main/res/values/styles.xml deleted file mode 100644 index 4a10ca4..0000000 --- a/qqslidingmenu/src/main/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - \ No newline at end of file