Loading app/build.gradle +1 −1 Original line number Original line Diff line number Diff line Loading @@ -4,7 +4,7 @@ apply plugin: 'io.fabric' // Manifest version information! // Manifest version information! def versionMajor = 1 def versionMajor = 1 def versionMinor = 2 def versionMinor = 2 def versionPatch = 2 def versionPatch = 3 android { android { compileSdkVersion rootProject.ext.compileSdkVersion compileSdkVersion rootProject.ext.compileSdkVersion Loading app/src/main/java/foundation/e/blisslauncher/core/customviews/HorizontalPager.java +15 −31 Original line number Original line Diff line number Diff line Loading @@ -39,7 +39,6 @@ public class HorizontalPager extends ViewGroup { private boolean firstLayout = true; private boolean firstLayout = true; private int currentPage; private int currentPage; private int nextPage = INVALID_SCREEN; private Scroller mScroller; private Scroller mScroller; private VelocityTracker mVelocityTracker; private VelocityTracker mVelocityTracker; Loading Loading @@ -131,12 +130,17 @@ public class HorizontalPager extends ViewGroup { @Override @Override public void computeScroll() { public void computeScroll() { if (mScroller.computeScrollOffset()) { if (!mScroller.isFinished() && mScroller.computeScrollOffset()) { scrollTo(mScroller.getCurrX(), mScroller.getCurrY()); int oldX = getScrollX(); postInvalidate(); int oldY = getScrollY(); } else if (nextPage != INVALID_SCREEN) { int x = mScroller.getCurrX(); currentPage = nextPage; int y = mScroller.getCurrY(); nextPage = INVALID_SCREEN; if (oldX != x || oldY != y) { scrollTo(x, y); } postInvalidateOnAnimation(); return; } } } } Loading Loading @@ -209,11 +213,7 @@ public class HorizontalPager extends ViewGroup { return false; return false; } } int focusableScreen; int focusableScreen; if (nextPage != INVALID_SCREEN) { focusableScreen = nextPage; } else { focusableScreen = currentPage; focusableScreen = currentPage; } getChildAt(focusableScreen).requestFocus(direction, previouslyFocusedRect); getChildAt(focusableScreen).requestFocus(direction, previouslyFocusedRect); return false; return false; } } Loading Loading @@ -454,7 +454,6 @@ public class HorizontalPager extends ViewGroup { } else if (getScrollX() > startX + getWidth() / 8) { } else if (getScrollX() > startX + getWidth() / 8) { whichPage = Math.min(getChildCount() - 1, whichPage + 1); whichPage = Math.min(getChildCount() - 1, whichPage + 1); } } snapToPage(whichPage); snapToPage(whichPage); } } Loading @@ -462,8 +461,7 @@ public class HorizontalPager extends ViewGroup { enableChildrenCache(); enableChildrenCache(); boolean changingPages = whichPage != currentPage; boolean changingPages = whichPage != currentPage; currentPage = whichPage; nextPage = whichPage; View focusedChild = getFocusedChild(); View focusedChild = getFocusedChild(); if (focusedChild != null && changingPages && focusedChild == getChildAt(currentPage)) { if (focusedChild != null && changingPages && focusedChild == getChildAt(currentPage)) { Loading @@ -472,7 +470,6 @@ public class HorizontalPager extends ViewGroup { final int newX = getScrollXForPage(whichPage); final int newX = getScrollXForPage(whichPage); final int delta = newX - getScrollX(); final int delta = newX - getScrollX(); //mScroller.startScroll(getScrollX(), 0, delta, 0, Math.abs(delta) * 2); mScroller.startScroll(getScrollX(), 0, delta, 0, duration); mScroller.startScroll(getScrollX(), 0, delta, 0, duration); invalidate(); invalidate(); } } Loading @@ -497,27 +494,14 @@ public class HorizontalPager extends ViewGroup { } } } } public void scrollLeft() { if (nextPage == INVALID_SCREEN && currentPage > 0 && mScroller.isFinished()) { snapToPage(currentPage - 1); } } public void scrollLeft(int duration) { public void scrollLeft(int duration) { if (nextPage == INVALID_SCREEN && currentPage > 0 && mScroller.isFinished()) { if (currentPage > 0 && mScroller.isFinished()) { snapToPage(currentPage - 1, duration); snapToPage(currentPage - 1, duration); } } } } public void scrollRight() { if (nextPage == INVALID_SCREEN && currentPage < getChildCount() - 1 && mScroller.isFinished()) { snapToPage(currentPage + 1); } } public void scrollRight(int duration) { public void scrollRight(int duration) { if (nextPage == INVALID_SCREEN && currentPage < getChildCount() - 1 if (currentPage < getChildCount() - 1 && mScroller.isFinished()) { && mScroller.isFinished()) { snapToPage(currentPage + 1, duration); snapToPage(currentPage + 1, duration); } } Loading app/src/main/java/foundation/e/blisslauncher/features/launcher/LauncherActivity.java +60 −38 Original line number Original line Diff line number Diff line Loading @@ -51,7 +51,6 @@ import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView; import android.text.Editable; import android.text.Editable; import android.text.TextWatcher; import android.text.TextWatcher; import android.util.Log; import android.view.DragEvent; import android.view.DragEvent; import android.view.Gravity; import android.view.Gravity; import android.view.LayoutInflater; import android.view.LayoutInflater; Loading Loading @@ -243,7 +242,6 @@ public class LauncherActivity extends AppCompatActivity implements @Override @Override protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.onCreate(savedInstanceState); Log.d(TAG, "onCreate() called with: savedInstanceState = [" + savedInstanceState + "]"); appProvider = BlissLauncher.getApplication(this).getAppProvider(); appProvider = BlissLauncher.getApplication(this).getAppProvider(); prepareBroadcastReceivers(); prepareBroadcastReceivers(); Loading Loading @@ -449,7 +447,6 @@ public class LauncherActivity extends AppCompatActivity implements @Override @Override protected void onDestroy() { protected void onDestroy() { super.onDestroy(); super.onDestroy(); Log.d(TAG, "onDestroy() called"); TimeChangeBroadcastReceiver.unregister(this, timeChangedReceiver); TimeChangeBroadcastReceiver.unregister(this, timeChangedReceiver); ManagedProfileBroadcastReceiver.unregister(this, managedProfileReceiver); ManagedProfileBroadcastReceiver.unregister(this, managedProfileReceiver); LocalBroadcastManager.getInstance(this).unregisterReceiver(mWeatherReceiver); LocalBroadcastManager.getInstance(this).unregisterReceiver(mWeatherReceiver); Loading Loading @@ -486,7 +483,6 @@ public class LauncherActivity extends AppCompatActivity implements updateOrAddShortcut(shortcutAddEvent.getShortcutItem()); updateOrAddShortcut(shortcutAddEvent.getShortcutItem()); DatabaseManager.getManager(this).saveLayouts(pages, mDock); DatabaseManager.getManager(this).saveLayouts(pages, mDock); Toast.makeText(this, "Shortcut has been added", Toast.LENGTH_SHORT).show(); Toast.makeText(this, "Shortcut has been added", Toast.LENGTH_SHORT).show(); Log.i(TAG, "onShortcutAddEvent: " + moveTo); if (moveTo != -1) { if (moveTo != -1) { mHorizontalPager.setCurrentPage(moveTo); mHorizontalPager.setCurrentPage(moveTo); moveTo = -1; moveTo = -1; Loading Loading @@ -705,15 +701,43 @@ public class LauncherActivity extends AppCompatActivity implements } } } } updateFolderInGrid(grid, folderItem, j); updateFolderInGrid(grid, folderItem, j); if (grid.getChildCount() == 0) { pages.remove(i); mHorizontalPager.removeViewAt(i + 1); if (i == pages.size()) { mHorizontalPager.scrollLeft(100); } mIndicator.removeViewAt(i); updateIndicator(); } } else if (launcherItem.itemType == Constants.ITEM_TYPE_APPLICATION) { } else if (launcherItem.itemType == Constants.ITEM_TYPE_APPLICATION) { ApplicationItem applicationItem = (ApplicationItem) launcherItem; ApplicationItem applicationItem = (ApplicationItem) launcherItem; if (applicationItem.packageName.equalsIgnoreCase(packageName) && applicationItem.user.isSameUser(userHandle)) { if (applicationItem.packageName.equalsIgnoreCase(packageName) && applicationItem.user.isSameUser(userHandle)) { grid.removeViewAt(j); grid.removeViewAt(j); if (grid.getChildCount() == 0) { pages.remove(i); mHorizontalPager.removeViewAt(i + 1); if (i == pages.size()) { mHorizontalPager.scrollLeft(100); } mIndicator.removeViewAt(i); updateIndicator(); } } } } else if (launcherItem.itemType == Constants.ITEM_TYPE_SHORTCUT) { } else if (launcherItem.itemType == Constants.ITEM_TYPE_SHORTCUT) { ShortcutItem shortcutItem = (ShortcutItem) launcherItem; ShortcutItem shortcutItem = (ShortcutItem) launcherItem; if (shortcutItem.packageName.equalsIgnoreCase(packageName)) { if (shortcutItem.packageName.equalsIgnoreCase(packageName)) { grid.removeViewAt(j); grid.removeViewAt(j); if (grid.getChildCount() == 0) { pages.remove(i); mHorizontalPager.removeViewAt(i + 1); if (i == pages.size()) { mHorizontalPager.scrollLeft(100); } mIndicator.removeViewAt(i); updateIndicator(); } } } } } } } Loading Loading @@ -1943,8 +1967,7 @@ public class LauncherActivity extends AppCompatActivity implements if (mWobblingCountDownTimer != null) { if (mWobblingCountDownTimer != null) { mWobblingCountDownTimer.cancel(); mWobblingCountDownTimer.cancel(); } } } } else if (dragEvent.getAction() == DragEvent.ACTION_DRAG_LOCATION) { if (dragEvent.getAction() == DragEvent.ACTION_DRAG_LOCATION) { // Don't offer rearrange functionality when app is being dragged // Don't offer rearrange functionality when app is being dragged // out of folder window // out of folder window if (getAppDetails(movingApp).container != Constants.CONTAINER_DESKTOP if (getAppDetails(movingApp).container != Constants.CONTAINER_DESKTOP Loading Loading @@ -2039,21 +2062,21 @@ public class LauncherActivity extends AppCompatActivity implements } else { } else { createOrUpdateFolder(true); createOrUpdateFolder(true); } } } folderInterest = false; folderInterest = false; } } else { } else { cX = dragEvent.getX() - dragShadowBuilder.xOffset; cX = dragEvent.getX() - dragShadowBuilder.xOffset; cY = mDock.getY() + dragEvent.getY() - dragShadowBuilder.yOffset; cY = mDock.getY() + dragEvent.getY() - dragShadowBuilder.yOffset; // Drop functionality when the folder window is visible // Drop functionality when the folder window is visible Rect bounds = new Rect((int) mFolderAppsViewPager.getX(), int[] topLeftCorner = new int[2]; (int) mFolderAppsViewPager.getY(), mFolderAppsViewPager.getLocationOnScreen(topLeftCorner); (int) (mFolderAppsViewPager.getWidth() int left = topLeftCorner[0]; + mFolderAppsViewPager.getX()), int top = topLeftCorner[1]; (int) (mFolderAppsViewPager.getHeight() int right = left + mFolderAppsViewPager.getWidth(); + mFolderAppsViewPager.getY())); int bottom = top + mFolderAppsViewPager.getHeight(); if (!bounds.contains((int) cX, (int) cY)) { if (!(left < right && top < bottom && cX >= left && cX < right && cY >= top && cY < bottom)) { removeAppFromFolder(); removeAppFromFolder(); } else { } else { movingApp.setVisibility(View.VISIBLE); movingApp.setVisibility(View.VISIBLE); Loading @@ -2065,6 +2088,7 @@ public class LauncherActivity extends AppCompatActivity implements } } return true; return true; } } return true; return true; } } }); }); Loading @@ -2082,9 +2106,7 @@ public class LauncherActivity extends AppCompatActivity implements if (mWobblingCountDownTimer != null) { if (mWobblingCountDownTimer != null) { mWobblingCountDownTimer.cancel(); mWobblingCountDownTimer.cancel(); } } } } else if (dragEvent.getAction() == DragEvent.ACTION_DRAG_LOCATION) { if (dragEvent.getAction() == DragEvent.ACTION_DRAG_LOCATION) { cX = dragEvent.getX() - dragShadowBuilder.xOffset; cX = dragEvent.getX() - dragShadowBuilder.xOffset; cY = mHorizontalPager.getY() + dragEvent.getY() cY = mHorizontalPager.getY() + dragEvent.getY() - dragShadowBuilder.yOffset; - dragShadowBuilder.yOffset; Loading Loading @@ -2219,22 +2241,23 @@ public class LauncherActivity extends AppCompatActivity implements } else { } else { createOrUpdateFolder(true); createOrUpdateFolder(true); } } } folderInterest = false; folderInterest = false; } } else { } else { cX = dragEvent.getX() - dragShadowBuilder.xOffset; cX = dragEvent.getX() - dragShadowBuilder.xOffset; cY = mHorizontalPager.getY() + dragEvent.getY() cY = mHorizontalPager.getY() + dragEvent.getY() - dragShadowBuilder.yOffset; - dragShadowBuilder.yOffset; // Drop functionality when the folder window is visible // Drop functionality when the folder window is visible Rect bounds = new Rect((int) mFolderAppsViewPager.getX(), int[] topLeftCorner = new int[2]; (int) mFolderAppsViewPager.getY(), mFolderAppsViewPager.getLocationOnScreen(topLeftCorner); (int) (mFolderAppsViewPager.getWidth() int left = topLeftCorner[0]; + mFolderAppsViewPager.getX()), int top = topLeftCorner[1]; (int) (mFolderAppsViewPager.getHeight() int right = left + mFolderAppsViewPager.getWidth(); + mFolderAppsViewPager.getY())); int bottom = top + mFolderAppsViewPager.getHeight(); if (!bounds.contains((int) cX, (int) cY)) { if (!(left < right && top < bottom && cX >= left && cX < right && cY >= top && cY < bottom)) { removeAppFromFolder(); removeAppFromFolder(); } else { } else { movingApp.setVisibility(View.VISIBLE); movingApp.setVisibility(View.VISIBLE); Loading @@ -2247,10 +2270,13 @@ public class LauncherActivity extends AppCompatActivity implements } else if (dragEvent.getAction() == DragEvent.ACTION_DRAG_ENDED) { } else if (dragEvent.getAction() == DragEvent.ACTION_DRAG_ENDED) { if (isDragging) { if (isDragging) { isDragging = false; isDragging = false; } if (movingApp.getVisibility() != VISIBLE) { movingApp.setVisibility(View.VISIBLE); } } if (!dragEvent.getResult()) { if (!dragEvent.getResult()) { movingApp.setVisibility(View.VISIBLE); if (mFolderWindowContainer.getVisibility() == View.VISIBLE) { if (mFolderWindowContainer.getVisibility() == View.VISIBLE) { int currentItem = mFolderAppsViewPager.getCurrentItem(); int currentItem = mFolderAppsViewPager.getCurrentItem(); makeAppWobble(movingApp, true, makeAppWobble(movingApp, true, Loading Loading @@ -2285,17 +2311,18 @@ public class LauncherActivity extends AppCompatActivity implements for (int i = 0; i < pages.size(); i++) { for (int i = 0; i < pages.size(); i++) { if (pages.get(i).getChildCount() <= 0) { if (pages.get(i).getChildCount() <= 0) { pages.remove(i); pages.remove(i); int current = getCurrentAppsPageNumber(); mHorizontalPager.removeViewAt(i + 1); mHorizontalPager.removeViewAt(i + 1); mIndicator.removeViewAt(i); if (i == pages.size()) { if (current > i) { mHorizontalPager.scrollLeft(100); mHorizontalPager.scrollLeft(1); } } mIndicator.removeViewAt(i); updateIndicator(); i--; i--; } } } } DatabaseManager.getManager(LauncherActivity.this).saveLayouts(pages, mDock); DatabaseManager.getManager(LauncherActivity.this).saveLayouts(pages, mDock); } } return true; return true; } } }); }); Loading Loading @@ -2806,8 +2833,6 @@ public class LauncherActivity extends AppCompatActivity implements protected void onNewIntent(Intent intent) { protected void onNewIntent(Intent intent) { super.onNewIntent(intent); super.onNewIntent(intent); Log.d(TAG, "onNewIntent() called with: intent = [" + intent + "]"); final boolean alreadyOnHome = hasWindowFocus() && final boolean alreadyOnHome = hasWindowFocus() && ((intent.getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) ((intent.getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT); != Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT); Loading Loading @@ -3104,9 +3129,6 @@ public class LauncherActivity extends AppCompatActivity implements seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { Log.d(TAG, "onProgressChanged() called with: seekBar = [" + seekBar + "], progress = [" + progress + "], fromUser = [" + fromUser + "]"); int newHeight = minHeight + (normalisedDifference * progress); int newHeight = minHeight + (normalisedDifference * progress); LinearLayout.LayoutParams layoutParams = LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) activeRoundedWidgetView.getLayoutParams(); (LinearLayout.LayoutParams) activeRoundedWidgetView.getLayoutParams(); Loading Loading
app/build.gradle +1 −1 Original line number Original line Diff line number Diff line Loading @@ -4,7 +4,7 @@ apply plugin: 'io.fabric' // Manifest version information! // Manifest version information! def versionMajor = 1 def versionMajor = 1 def versionMinor = 2 def versionMinor = 2 def versionPatch = 2 def versionPatch = 3 android { android { compileSdkVersion rootProject.ext.compileSdkVersion compileSdkVersion rootProject.ext.compileSdkVersion Loading
app/src/main/java/foundation/e/blisslauncher/core/customviews/HorizontalPager.java +15 −31 Original line number Original line Diff line number Diff line Loading @@ -39,7 +39,6 @@ public class HorizontalPager extends ViewGroup { private boolean firstLayout = true; private boolean firstLayout = true; private int currentPage; private int currentPage; private int nextPage = INVALID_SCREEN; private Scroller mScroller; private Scroller mScroller; private VelocityTracker mVelocityTracker; private VelocityTracker mVelocityTracker; Loading Loading @@ -131,12 +130,17 @@ public class HorizontalPager extends ViewGroup { @Override @Override public void computeScroll() { public void computeScroll() { if (mScroller.computeScrollOffset()) { if (!mScroller.isFinished() && mScroller.computeScrollOffset()) { scrollTo(mScroller.getCurrX(), mScroller.getCurrY()); int oldX = getScrollX(); postInvalidate(); int oldY = getScrollY(); } else if (nextPage != INVALID_SCREEN) { int x = mScroller.getCurrX(); currentPage = nextPage; int y = mScroller.getCurrY(); nextPage = INVALID_SCREEN; if (oldX != x || oldY != y) { scrollTo(x, y); } postInvalidateOnAnimation(); return; } } } } Loading Loading @@ -209,11 +213,7 @@ public class HorizontalPager extends ViewGroup { return false; return false; } } int focusableScreen; int focusableScreen; if (nextPage != INVALID_SCREEN) { focusableScreen = nextPage; } else { focusableScreen = currentPage; focusableScreen = currentPage; } getChildAt(focusableScreen).requestFocus(direction, previouslyFocusedRect); getChildAt(focusableScreen).requestFocus(direction, previouslyFocusedRect); return false; return false; } } Loading Loading @@ -454,7 +454,6 @@ public class HorizontalPager extends ViewGroup { } else if (getScrollX() > startX + getWidth() / 8) { } else if (getScrollX() > startX + getWidth() / 8) { whichPage = Math.min(getChildCount() - 1, whichPage + 1); whichPage = Math.min(getChildCount() - 1, whichPage + 1); } } snapToPage(whichPage); snapToPage(whichPage); } } Loading @@ -462,8 +461,7 @@ public class HorizontalPager extends ViewGroup { enableChildrenCache(); enableChildrenCache(); boolean changingPages = whichPage != currentPage; boolean changingPages = whichPage != currentPage; currentPage = whichPage; nextPage = whichPage; View focusedChild = getFocusedChild(); View focusedChild = getFocusedChild(); if (focusedChild != null && changingPages && focusedChild == getChildAt(currentPage)) { if (focusedChild != null && changingPages && focusedChild == getChildAt(currentPage)) { Loading @@ -472,7 +470,6 @@ public class HorizontalPager extends ViewGroup { final int newX = getScrollXForPage(whichPage); final int newX = getScrollXForPage(whichPage); final int delta = newX - getScrollX(); final int delta = newX - getScrollX(); //mScroller.startScroll(getScrollX(), 0, delta, 0, Math.abs(delta) * 2); mScroller.startScroll(getScrollX(), 0, delta, 0, duration); mScroller.startScroll(getScrollX(), 0, delta, 0, duration); invalidate(); invalidate(); } } Loading @@ -497,27 +494,14 @@ public class HorizontalPager extends ViewGroup { } } } } public void scrollLeft() { if (nextPage == INVALID_SCREEN && currentPage > 0 && mScroller.isFinished()) { snapToPage(currentPage - 1); } } public void scrollLeft(int duration) { public void scrollLeft(int duration) { if (nextPage == INVALID_SCREEN && currentPage > 0 && mScroller.isFinished()) { if (currentPage > 0 && mScroller.isFinished()) { snapToPage(currentPage - 1, duration); snapToPage(currentPage - 1, duration); } } } } public void scrollRight() { if (nextPage == INVALID_SCREEN && currentPage < getChildCount() - 1 && mScroller.isFinished()) { snapToPage(currentPage + 1); } } public void scrollRight(int duration) { public void scrollRight(int duration) { if (nextPage == INVALID_SCREEN && currentPage < getChildCount() - 1 if (currentPage < getChildCount() - 1 && mScroller.isFinished()) { && mScroller.isFinished()) { snapToPage(currentPage + 1, duration); snapToPage(currentPage + 1, duration); } } Loading
app/src/main/java/foundation/e/blisslauncher/features/launcher/LauncherActivity.java +60 −38 Original line number Original line Diff line number Diff line Loading @@ -51,7 +51,6 @@ import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView; import android.text.Editable; import android.text.Editable; import android.text.TextWatcher; import android.text.TextWatcher; import android.util.Log; import android.view.DragEvent; import android.view.DragEvent; import android.view.Gravity; import android.view.Gravity; import android.view.LayoutInflater; import android.view.LayoutInflater; Loading Loading @@ -243,7 +242,6 @@ public class LauncherActivity extends AppCompatActivity implements @Override @Override protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.onCreate(savedInstanceState); Log.d(TAG, "onCreate() called with: savedInstanceState = [" + savedInstanceState + "]"); appProvider = BlissLauncher.getApplication(this).getAppProvider(); appProvider = BlissLauncher.getApplication(this).getAppProvider(); prepareBroadcastReceivers(); prepareBroadcastReceivers(); Loading Loading @@ -449,7 +447,6 @@ public class LauncherActivity extends AppCompatActivity implements @Override @Override protected void onDestroy() { protected void onDestroy() { super.onDestroy(); super.onDestroy(); Log.d(TAG, "onDestroy() called"); TimeChangeBroadcastReceiver.unregister(this, timeChangedReceiver); TimeChangeBroadcastReceiver.unregister(this, timeChangedReceiver); ManagedProfileBroadcastReceiver.unregister(this, managedProfileReceiver); ManagedProfileBroadcastReceiver.unregister(this, managedProfileReceiver); LocalBroadcastManager.getInstance(this).unregisterReceiver(mWeatherReceiver); LocalBroadcastManager.getInstance(this).unregisterReceiver(mWeatherReceiver); Loading Loading @@ -486,7 +483,6 @@ public class LauncherActivity extends AppCompatActivity implements updateOrAddShortcut(shortcutAddEvent.getShortcutItem()); updateOrAddShortcut(shortcutAddEvent.getShortcutItem()); DatabaseManager.getManager(this).saveLayouts(pages, mDock); DatabaseManager.getManager(this).saveLayouts(pages, mDock); Toast.makeText(this, "Shortcut has been added", Toast.LENGTH_SHORT).show(); Toast.makeText(this, "Shortcut has been added", Toast.LENGTH_SHORT).show(); Log.i(TAG, "onShortcutAddEvent: " + moveTo); if (moveTo != -1) { if (moveTo != -1) { mHorizontalPager.setCurrentPage(moveTo); mHorizontalPager.setCurrentPage(moveTo); moveTo = -1; moveTo = -1; Loading Loading @@ -705,15 +701,43 @@ public class LauncherActivity extends AppCompatActivity implements } } } } updateFolderInGrid(grid, folderItem, j); updateFolderInGrid(grid, folderItem, j); if (grid.getChildCount() == 0) { pages.remove(i); mHorizontalPager.removeViewAt(i + 1); if (i == pages.size()) { mHorizontalPager.scrollLeft(100); } mIndicator.removeViewAt(i); updateIndicator(); } } else if (launcherItem.itemType == Constants.ITEM_TYPE_APPLICATION) { } else if (launcherItem.itemType == Constants.ITEM_TYPE_APPLICATION) { ApplicationItem applicationItem = (ApplicationItem) launcherItem; ApplicationItem applicationItem = (ApplicationItem) launcherItem; if (applicationItem.packageName.equalsIgnoreCase(packageName) && applicationItem.user.isSameUser(userHandle)) { if (applicationItem.packageName.equalsIgnoreCase(packageName) && applicationItem.user.isSameUser(userHandle)) { grid.removeViewAt(j); grid.removeViewAt(j); if (grid.getChildCount() == 0) { pages.remove(i); mHorizontalPager.removeViewAt(i + 1); if (i == pages.size()) { mHorizontalPager.scrollLeft(100); } mIndicator.removeViewAt(i); updateIndicator(); } } } } else if (launcherItem.itemType == Constants.ITEM_TYPE_SHORTCUT) { } else if (launcherItem.itemType == Constants.ITEM_TYPE_SHORTCUT) { ShortcutItem shortcutItem = (ShortcutItem) launcherItem; ShortcutItem shortcutItem = (ShortcutItem) launcherItem; if (shortcutItem.packageName.equalsIgnoreCase(packageName)) { if (shortcutItem.packageName.equalsIgnoreCase(packageName)) { grid.removeViewAt(j); grid.removeViewAt(j); if (grid.getChildCount() == 0) { pages.remove(i); mHorizontalPager.removeViewAt(i + 1); if (i == pages.size()) { mHorizontalPager.scrollLeft(100); } mIndicator.removeViewAt(i); updateIndicator(); } } } } } } } Loading Loading @@ -1943,8 +1967,7 @@ public class LauncherActivity extends AppCompatActivity implements if (mWobblingCountDownTimer != null) { if (mWobblingCountDownTimer != null) { mWobblingCountDownTimer.cancel(); mWobblingCountDownTimer.cancel(); } } } } else if (dragEvent.getAction() == DragEvent.ACTION_DRAG_LOCATION) { if (dragEvent.getAction() == DragEvent.ACTION_DRAG_LOCATION) { // Don't offer rearrange functionality when app is being dragged // Don't offer rearrange functionality when app is being dragged // out of folder window // out of folder window if (getAppDetails(movingApp).container != Constants.CONTAINER_DESKTOP if (getAppDetails(movingApp).container != Constants.CONTAINER_DESKTOP Loading Loading @@ -2039,21 +2062,21 @@ public class LauncherActivity extends AppCompatActivity implements } else { } else { createOrUpdateFolder(true); createOrUpdateFolder(true); } } } folderInterest = false; folderInterest = false; } } else { } else { cX = dragEvent.getX() - dragShadowBuilder.xOffset; cX = dragEvent.getX() - dragShadowBuilder.xOffset; cY = mDock.getY() + dragEvent.getY() - dragShadowBuilder.yOffset; cY = mDock.getY() + dragEvent.getY() - dragShadowBuilder.yOffset; // Drop functionality when the folder window is visible // Drop functionality when the folder window is visible Rect bounds = new Rect((int) mFolderAppsViewPager.getX(), int[] topLeftCorner = new int[2]; (int) mFolderAppsViewPager.getY(), mFolderAppsViewPager.getLocationOnScreen(topLeftCorner); (int) (mFolderAppsViewPager.getWidth() int left = topLeftCorner[0]; + mFolderAppsViewPager.getX()), int top = topLeftCorner[1]; (int) (mFolderAppsViewPager.getHeight() int right = left + mFolderAppsViewPager.getWidth(); + mFolderAppsViewPager.getY())); int bottom = top + mFolderAppsViewPager.getHeight(); if (!bounds.contains((int) cX, (int) cY)) { if (!(left < right && top < bottom && cX >= left && cX < right && cY >= top && cY < bottom)) { removeAppFromFolder(); removeAppFromFolder(); } else { } else { movingApp.setVisibility(View.VISIBLE); movingApp.setVisibility(View.VISIBLE); Loading @@ -2065,6 +2088,7 @@ public class LauncherActivity extends AppCompatActivity implements } } return true; return true; } } return true; return true; } } }); }); Loading @@ -2082,9 +2106,7 @@ public class LauncherActivity extends AppCompatActivity implements if (mWobblingCountDownTimer != null) { if (mWobblingCountDownTimer != null) { mWobblingCountDownTimer.cancel(); mWobblingCountDownTimer.cancel(); } } } } else if (dragEvent.getAction() == DragEvent.ACTION_DRAG_LOCATION) { if (dragEvent.getAction() == DragEvent.ACTION_DRAG_LOCATION) { cX = dragEvent.getX() - dragShadowBuilder.xOffset; cX = dragEvent.getX() - dragShadowBuilder.xOffset; cY = mHorizontalPager.getY() + dragEvent.getY() cY = mHorizontalPager.getY() + dragEvent.getY() - dragShadowBuilder.yOffset; - dragShadowBuilder.yOffset; Loading Loading @@ -2219,22 +2241,23 @@ public class LauncherActivity extends AppCompatActivity implements } else { } else { createOrUpdateFolder(true); createOrUpdateFolder(true); } } } folderInterest = false; folderInterest = false; } } else { } else { cX = dragEvent.getX() - dragShadowBuilder.xOffset; cX = dragEvent.getX() - dragShadowBuilder.xOffset; cY = mHorizontalPager.getY() + dragEvent.getY() cY = mHorizontalPager.getY() + dragEvent.getY() - dragShadowBuilder.yOffset; - dragShadowBuilder.yOffset; // Drop functionality when the folder window is visible // Drop functionality when the folder window is visible Rect bounds = new Rect((int) mFolderAppsViewPager.getX(), int[] topLeftCorner = new int[2]; (int) mFolderAppsViewPager.getY(), mFolderAppsViewPager.getLocationOnScreen(topLeftCorner); (int) (mFolderAppsViewPager.getWidth() int left = topLeftCorner[0]; + mFolderAppsViewPager.getX()), int top = topLeftCorner[1]; (int) (mFolderAppsViewPager.getHeight() int right = left + mFolderAppsViewPager.getWidth(); + mFolderAppsViewPager.getY())); int bottom = top + mFolderAppsViewPager.getHeight(); if (!bounds.contains((int) cX, (int) cY)) { if (!(left < right && top < bottom && cX >= left && cX < right && cY >= top && cY < bottom)) { removeAppFromFolder(); removeAppFromFolder(); } else { } else { movingApp.setVisibility(View.VISIBLE); movingApp.setVisibility(View.VISIBLE); Loading @@ -2247,10 +2270,13 @@ public class LauncherActivity extends AppCompatActivity implements } else if (dragEvent.getAction() == DragEvent.ACTION_DRAG_ENDED) { } else if (dragEvent.getAction() == DragEvent.ACTION_DRAG_ENDED) { if (isDragging) { if (isDragging) { isDragging = false; isDragging = false; } if (movingApp.getVisibility() != VISIBLE) { movingApp.setVisibility(View.VISIBLE); } } if (!dragEvent.getResult()) { if (!dragEvent.getResult()) { movingApp.setVisibility(View.VISIBLE); if (mFolderWindowContainer.getVisibility() == View.VISIBLE) { if (mFolderWindowContainer.getVisibility() == View.VISIBLE) { int currentItem = mFolderAppsViewPager.getCurrentItem(); int currentItem = mFolderAppsViewPager.getCurrentItem(); makeAppWobble(movingApp, true, makeAppWobble(movingApp, true, Loading Loading @@ -2285,17 +2311,18 @@ public class LauncherActivity extends AppCompatActivity implements for (int i = 0; i < pages.size(); i++) { for (int i = 0; i < pages.size(); i++) { if (pages.get(i).getChildCount() <= 0) { if (pages.get(i).getChildCount() <= 0) { pages.remove(i); pages.remove(i); int current = getCurrentAppsPageNumber(); mHorizontalPager.removeViewAt(i + 1); mHorizontalPager.removeViewAt(i + 1); mIndicator.removeViewAt(i); if (i == pages.size()) { if (current > i) { mHorizontalPager.scrollLeft(100); mHorizontalPager.scrollLeft(1); } } mIndicator.removeViewAt(i); updateIndicator(); i--; i--; } } } } DatabaseManager.getManager(LauncherActivity.this).saveLayouts(pages, mDock); DatabaseManager.getManager(LauncherActivity.this).saveLayouts(pages, mDock); } } return true; return true; } } }); }); Loading Loading @@ -2806,8 +2833,6 @@ public class LauncherActivity extends AppCompatActivity implements protected void onNewIntent(Intent intent) { protected void onNewIntent(Intent intent) { super.onNewIntent(intent); super.onNewIntent(intent); Log.d(TAG, "onNewIntent() called with: intent = [" + intent + "]"); final boolean alreadyOnHome = hasWindowFocus() && final boolean alreadyOnHome = hasWindowFocus() && ((intent.getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) ((intent.getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT); != Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT); Loading Loading @@ -3104,9 +3129,6 @@ public class LauncherActivity extends AppCompatActivity implements seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { Log.d(TAG, "onProgressChanged() called with: seekBar = [" + seekBar + "], progress = [" + progress + "], fromUser = [" + fromUser + "]"); int newHeight = minHeight + (normalisedDifference * progress); int newHeight = minHeight + (normalisedDifference * progress); LinearLayout.LayoutParams layoutParams = LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) activeRoundedWidgetView.getLayoutParams(); (LinearLayout.LayoutParams) activeRoundedWidgetView.getLayoutParams(); Loading