From 886e2e8e993167b716b09e33b17a498683acf035 Mon Sep 17 00:00:00 2001 From: Tom Kliethermes Date: Wed, 29 Aug 2018 10:00:29 -0500 Subject: [PATCH] hide the buttons before fully started --- .../com/quaap/launchtime/MainActivity.java | 19 +++++++++---------- .../java/com/quaap/launchtime/ui/Style.java | 4 ++-- app/src/main/res/layout/activity_main.xml | 4 +++- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/quaap/launchtime/MainActivity.java b/app/src/main/java/com/quaap/launchtime/MainActivity.java index 973e889..a9fdce8 100644 --- a/app/src/main/java/com/quaap/launchtime/MainActivity.java +++ b/app/src/main/java/com/quaap/launchtime/MainActivity.java @@ -254,14 +254,11 @@ protected void onCreate(Bundle savedInstanceState) { mActionMenu = new ActionMenu(this); + mStyle = GlobState.getStyle(this); //Load resources and init the form members initUI(); - mIconSheetHolder.setOnDragListener(iconSheetDropRedirector); - - mIconsArea.setOnDragListener(iconSheetDropRedirector); - mSearchBox = new SearchBox(this, mIconSheetScroller); mLaunchApp = new LaunchApp(this); @@ -600,7 +597,6 @@ private void init(boolean progress) { mCategory = mPrefs.getString("category", getTopCategory()); latestCategory = mCategory; - mStyle = GlobState.getStyle(this); GlobState.getBadger(this).setBadgerCountChangeListener(this); mAppPreferences.registerOnSharedPreferenceChangeListener(this); @@ -3793,6 +3789,10 @@ private void initUI() { mOpenPrefsButton = findViewById(R.id.btn_prefs); mOpenPrefs2Button = findViewById(R.id.btn_prefs2); + itemClickedAnim = new ScaleAnimation(.85f,1,.85f,1,Animation.RELATIVE_TO_SELF,.5f,Animation.RELATIVE_TO_SELF,.5f); + itemClickedAnim.setDuration(200); + itemClickedAnim.setInterpolator(new AccelerateDecelerateInterpolator()); + mLinkDropzone.setOnDragListener(mMainDragListener); @@ -3887,9 +3887,9 @@ public void onPositionChanged(float percentUp, float percentDown, int distFromTo mIconSheetScroller.setHSwipeListener(mHSwipeListener); mCategoriesScroller.setHSwipeListener(mHSwipeListener); - itemClickedAnim = new ScaleAnimation(.85f,1,.85f,1,Animation.RELATIVE_TO_SELF,.5f,Animation.RELATIVE_TO_SELF,.5f); - itemClickedAnim.setDuration(200); - itemClickedAnim.setInterpolator(new AccelerateDecelerateInterpolator()); + mIconSheetHolder.setOnDragListener(iconSheetDropRedirector); + + mIconsArea.setOnDragListener(iconSheetDropRedirector); } @@ -3920,7 +3920,6 @@ public static void openSettings(Activity activity) { public void showButtonBar(boolean makevisible, boolean hideCats) { if (mChildLock) return; - // StackTraceElement from = Thread.currentThread().getStackTrace()[3]; // // Log.d(TAG,"showButtonBar(" + makevisible + ", " + hideCats + ") from " + from.getMethodName() + " line " + from.getLineNumber()); @@ -3929,7 +3928,7 @@ public void showButtonBar(boolean makevisible, boolean hideCats) { mActionCategory = mCategory; showHiddenCategories(); if (!mActionMenu.useExtraActions()) { - if (mCategory.equals(Categories.CAT_SEARCH)) { + if (mCategory!=null && mCategory.equals(Categories.CAT_SEARCH)) { mSortCategoryButton.setVisibility(View.INVISIBLE); mEditWidgetsButton.setVisibility(View.INVISIBLE); } else { diff --git a/app/src/main/java/com/quaap/launchtime/ui/Style.java b/app/src/main/java/com/quaap/launchtime/ui/Style.java index 63750f9..c3aabbc 100644 --- a/app/src/main/java/com/quaap/launchtime/ui/Style.java +++ b/app/src/main/java/com/quaap/launchtime/ui/Style.java @@ -222,8 +222,8 @@ public void onAnimationCancel(Animator animation) { lp.topMargin=2; lp.bottomMargin=2; } else { - lp.topMargin=4; - lp.bottomMargin=5; + lp.topMargin=3; + lp.bottomMargin=3; } categoryTab.setLayoutParams(lp); diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 7660dae..e1afc94 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -76,6 +76,7 @@ android:gravity="end" android:padding="1dp" android:src="@android:drawable/arrow_up_float" + android:visibility="gone" tools:ignore="RtlHardcoded" /> @@ -121,7 +122,8 @@ android:contentDescription="@string/config" android:focusable="true" android:gravity="end" - android:src="@android:drawable/arrow_up_float" /> + android:src="@android:drawable/arrow_up_float" + android:visibility="gone" />