├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── vcs.xml └── workspace.xml ├── LICENSE ├── README.md ├── StackOverView.iml ├── app ├── app.iml ├── build.gradle ├── lint.xml └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── wirelesspienetwork │ │ └── overviewexample │ │ └── OverviewActivity.java │ └── res │ ├── layout │ ├── recents.xml │ └── recents_dummy.xml │ └── values │ └── strings.xml ├── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── import-summary.txt ├── lib ├── .gitignore ├── build.gradle ├── lib.iml ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── wirelesspienetwork │ │ └── overview │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── wirelesspienetwork │ │ └── overview │ │ ├── misc │ │ ├── OverviewConfiguration.java │ │ ├── ReferenceCountedTrigger.java │ │ └── Utilities.java │ │ ├── model │ │ ├── OverviewAdapter.java │ │ └── ViewHolder.java │ │ └── views │ │ ├── ObjectPool.java │ │ ├── Overview.java │ │ ├── OverviewCard.java │ │ ├── OverviewCardTransform.java │ │ ├── OverviewStackView.java │ │ ├── OverviewStackViewLayoutAlgorithm.java │ │ ├── OverviewStackViewScroller.java │ │ ├── OverviewStackViewTouchHandler.java │ │ ├── SwipeHelper.java │ │ └── ViewAnimation.java │ └── res │ ├── anim │ ├── recents_launch_prev_affiliated_task_target.xml │ ├── recents_return_to_launcher_enter.xml │ ├── recents_return_to_launcher_exit.xml │ ├── recents_to_launcher_enter.xml │ ├── recents_to_launcher_exit.xml │ ├── recents_to_search_launcher_enter.xml │ └── recents_to_search_launcher_exit.xml │ └── values │ ├── alias.xml │ ├── arrays.xml │ ├── attrs.xml │ ├── bools.xml │ ├── colors.xml │ ├── config.xml │ ├── defaults.xml │ ├── dimens.xml │ ├── donottranslate.xml │ ├── ids.xml │ ├── integers.xml │ ├── internal.xml │ ├── lland_config.xml │ ├── lland_strings.xml │ ├── missing.xml │ ├── strings.xml │ └── styles.xml ├── overview.iml └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | 15 | # Gradle files 16 | .gradle/ 17 | build/ 18 | /*/build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | StackOverView -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | Android API 19 Platform 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 BOSSYAO 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # StackOverView 2 | a custom widget of android,like task manager of android 5.0.(Android 5.0 任务管理器控件) 3 | 4 |  photo 2015-04-03 20_51_50_zpscduimbta.gif 5 | -------------------------------------------------------------------------------- /StackOverView.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 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 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 21 5 | buildToolsVersion "21.1.2" 6 | 7 | defaultConfig { 8 | minSdkVersion 16 9 | targetSdkVersion 21 10 | applicationId "com.wirelesspienetwork.overviewexample" 11 | } 12 | 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 17 | } 18 | } 19 | 20 | dependencies { 21 | compile project(':lib') 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 22 | 28 | 29 | 30 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/wirelesspienetwork/overviewexample/OverviewActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.wirelesspienetwork.overviewexample; 18 | 19 | import android.app.Activity; 20 | import android.app.SearchManager; 21 | import android.content.Context; 22 | import android.content.Intent; 23 | import android.content.IntentFilter; 24 | import android.graphics.Color; 25 | import android.os.Bundle; 26 | import android.os.Handler; 27 | import android.view.View; 28 | import android.view.ViewGroup; 29 | 30 | import com.wirelesspienetwork.overview.misc.Utilities; 31 | import com.wirelesspienetwork.overview.model.OverviewAdapter; 32 | import com.wirelesspienetwork.overview.model.ViewHolder; 33 | import com.wirelesspienetwork.overview.views.Overview; 34 | 35 | import java.lang.reflect.InvocationTargetException; 36 | import java.util.ArrayList; 37 | import java.util.Random; 38 | 39 | /** 40 | * The main Recents activity that is started from AlternateRecentsComponent. 41 | */ 42 | public class OverviewActivity extends Activity implements Overview.RecentsViewCallbacks 43 | { 44 | boolean mVisible; 45 | // Top level views 46 | Overview mRecentsView; 47 | 48 | /** Called with the activity is first created. */ 49 | @Override 50 | public void onCreate(Bundle savedInstanceState) { 51 | super.onCreate(savedInstanceState); 52 | // For the non-primary user, ensure that the SystemSericesProxy is initialized 53 | 54 | // Initialize the widget host (the host id is static and does not change) 55 | 56 | // Set the Recents layout 57 | setContentView(R.layout.recents); 58 | mRecentsView = (Overview) findViewById(R.id.recents_view); 59 | mRecentsView.setCallbacks(this); 60 | mRecentsView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | 61 | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | 62 | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); 63 | 64 | // Register the broadcast receiver to handle messages when the screen is turned off 65 | IntentFilter filter = new IntentFilter(); 66 | filter.addAction(Intent.ACTION_SCREEN_OFF); 67 | filter.addAction(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED); 68 | 69 | // Private API calls to make the shadows look better 70 | try { 71 | Utilities.setShadowProperty("ambientRatio", String.valueOf(1.5f)); 72 | } catch (IllegalAccessException e) { 73 | e.printStackTrace(); 74 | } catch (InvocationTargetException e) { 75 | e.printStackTrace(); 76 | } 77 | } 78 | 79 | @Override 80 | protected void onNewIntent(Intent intent) { 81 | super.onNewIntent(intent); 82 | setIntent(intent); 83 | } 84 | 85 | @Override 86 | protected void onStart() { 87 | super.onStart(); 88 | } 89 | 90 | @Override 91 | protected void onResume() { 92 | super.onResume(); 93 | 94 | // Mark Recents as visible 95 | mVisible = true; 96 | 97 | ArrayList models = new ArrayList<>(); 98 | for(int i = 0; i < 10; ++i) 99 | { 100 | Random random = new Random(); 101 | random.setSeed(i); 102 | int color = Color.argb(255, random.nextInt(255), random.nextInt(255), random.nextInt(255)); 103 | models.add(color); 104 | } 105 | 106 | final OverviewAdapter stack = new OverviewAdapter, Integer>(models) 107 | { 108 | @Override 109 | public ViewHolder onCreateViewHolder(Context context, ViewGroup parent) { 110 | View v = View.inflate(context, R.layout.recents_dummy, null); 111 | return new ViewHolder(v); 112 | } 113 | 114 | @Override 115 | public void onBindViewHolder(ViewHolder viewHolder) { 116 | viewHolder.itemView.setBackgroundColor(viewHolder.model); 117 | } 118 | }; 119 | 120 | mRecentsView.setTaskStack(stack); 121 | 122 | // new Handler().postDelayed(new Runnable() { 123 | // @Override 124 | // public void run() { 125 | // stack.notifyDataSetInserted(new Integer(1), 2); 126 | // } 127 | // },2000); 128 | 129 | 130 | } 131 | 132 | @Override 133 | protected void onStop() { 134 | super.onStop(); 135 | } 136 | 137 | @Override 138 | protected void onDestroy() { 139 | super.onDestroy(); 140 | } 141 | 142 | @Override 143 | public void onTrimMemory(int level) { 144 | } 145 | 146 | @Override 147 | public void onAllCardsDismissed() { 148 | } 149 | 150 | @Override 151 | public void onCardDismissed(int position) { 152 | 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /app/src/main/res/layout/recents.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 21 | 22 | 23 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/recents_dummy.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 22 | 23 | 29 | 30 |