diff options
author | stefan-niedermann <info@niedermann.it> | 2019-10-19 21:41:21 +0300 |
---|---|---|
committer | stefan-niedermann <info@niedermann.it> | 2019-10-19 21:41:21 +0300 |
commit | ba1f85c005d4308a6e1ccd24c5ea96764a332e12 (patch) | |
tree | 04a438eddf64827842e734fe68661ae58a9dc57b | |
parent | 4a98856d1d68fa8fc46a792ee1b7888d3cd73b0b (diff) |
Create stacks button is now always visible in stack tabs
4 files changed, 29 insertions, 16 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java index d50596b1f..c99481688 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java @@ -76,6 +76,8 @@ public class MainActivity extends DrawerActivity implements ViewPager viewPager; @BindView(R.id.no_stacks) RelativeLayout noStacks; + @BindView(R.id.add_stack) + AppCompatImageButton addStackButton; @BindString(R.string.shared_preference_last_board_for_account_) String sharedPreferencesLastBoardForAccount_; @@ -382,8 +384,10 @@ public class MainActivity extends DrawerActivity implements currentBoardHasEditPermission = board.isPermissionEdit(); if (currentBoardHasEditPermission) { fab.show(); + addStackButton.setOnClickListener((v) -> EditStackDialogFragment.newInstance(NO_STACK_ID).show(getSupportFragmentManager(), addColumn)); } else { fab.hide(); + addStackButton.setOnClickListener(null); } syncManager.getStacksForBoard(account.getId(), board.getLocalId()).observe(MainActivity.this, (List<FullStack> fullStacks) -> { @@ -455,10 +459,6 @@ public class MainActivity extends DrawerActivity implements }) .setNegativeButton(android.R.string.cancel, null).show(); break; - case R.id.action_card_list_add_column: - EditStackDialogFragment.newInstance(NO_STACK_ID) - .show(getSupportFragmentManager(), addColumn); - break; case R.id.action_card_list_rename_column: // TODO call newInstance with old stack name EditStackDialogFragment.newInstance(stackAdapter.getItem(viewPager.getCurrentItem()).getStackId()) diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 087b3c9bd..7502ba0ba 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -82,15 +82,30 @@ android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" tools:title="Deck" /> - <com.google.android.material.tabs.TabLayout - android:id="@+id/stackLayout" + <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:theme="@style/ThemeOverlay.AppCompat.Dark" - app:tabGravity="center" - app:tabIndicatorColor="@color/accent" - app:tabMode="fixed" - app:tabTextColor="@android:color/white"/> + android:orientation="horizontal"> + + <com.google.android.material.tabs.TabLayout + android:id="@+id/stackLayout" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:theme="@style/ThemeOverlay.AppCompat.Dark" + app:tabGravity="center" + app:tabIndicatorColor="@color/accent" + app:tabMode="fixed" + app:tabTextColor="@android:color/white" /> + + <androidx.appcompat.widget.AppCompatImageButton + android:id="@+id/add_stack" + android:layout_width="48dp" + android:layout_height="match_parent" + android:background="?android:selectableItemBackground" + android:contentDescription="@null" + app:srcCompat="@drawable/ic_add_white_24dp" /> + </LinearLayout> </com.google.android.material.appbar.AppBarLayout> diff --git a/app/src/main/res/menu/card_list_menu.xml b/app/src/main/res/menu/card_list_menu.xml index 37a9a70bb..cadb0795c 100644 --- a/app/src/main/res/menu/card_list_menu.xml +++ b/app/src/main/res/menu/card_list_menu.xml @@ -3,10 +3,6 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"> <item - android:id="@+id/action_card_list_add_column" - android:title="@string/action_card_list_add_column" - app:showAsAction="never" /> - <item android:id="@+id/action_card_list_rename_column" android:title="@string/action_card_list_rename_column" app:showAsAction="never" /> diff --git a/fastlane/metadata/android/en-US/changelogs/13.txt b/fastlane/metadata/android/en-US/changelogs/13.txt index 9c56c6d9a..5077a3deb 100644 --- a/fastlane/metadata/android/en-US/changelogs/13.txt +++ b/fastlane/metadata/android/en-US/changelogs/13.txt @@ -4,4 +4,6 @@ - Move card title to toolbar when opening a card - Fix "Delete column"-menu disappears in some cases (#182) - Title field should have focus when creating a new card (#191) -- Do not show already assigned users and cards in search (#167)
\ No newline at end of file +- Do not show already assigned users and cards in search (#167) +- Make user and label assignments cancelable (#180) +- Create stacks button is now always visible in stack tabs
\ No newline at end of file |