Browse Source

removed duplicated sort/switch grid buttons

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 4 năm trước cách đây
mục cha
commit
a9dc3f5787

+ 3 - 3
src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -280,10 +280,10 @@ public class FileDisplayActivity extends FileActivity
             if (PermissionUtil.shouldShowRequestPermissionRationale(this,
                     Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
                 // Show explanation to the user and then request permission
-                Snackbar snackbar = Snackbar.make(binding.ListLayout,
+                Snackbar snackbar = Snackbar.make(binding.rootLayout,
                                                   R.string.permission_storage_access,
-                        Snackbar.LENGTH_INDEFINITE)
-                        .setAction(R.string.common_ok, v -> PermissionUtil.requestWriteExternalStoreagePermission(this));
+                                                  Snackbar.LENGTH_INDEFINITE)
+                    .setAction(R.string.common_ok, v -> PermissionUtil.requestWriteExternalStoreagePermission(this));
                 ThemeUtils.colorSnackbar(this, snackbar);
                 snackbar.show();
             } else {

+ 3 - 0
src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java

@@ -715,6 +715,9 @@ public class ReceiveExternalFilesActivity extends FileActivity
 
         ListView mListView = findViewById(android.R.id.list);
 
+        findViewById(R.id.sort_list_button_group).setVisibility(View.VISIBLE);
+        findViewById(R.id.switch_grid_view_button).setVisibility(View.GONE);
+
         String current_dir = mParents.peek();
         boolean notRoot = mParents.size() > 1;
 

+ 2 - 0
src/main/java/com/owncloud/android/ui/trashbin/TrashbinActivity.java

@@ -116,6 +116,8 @@ public class TrashbinActivity extends FileActivity implements
         setContentView(R.layout.trashbin_activity);
         unbinder = ButterKnife.bind(this);
         setupToolbar();
+        findViewById(R.id.sort_list_button_group).setVisibility(View.VISIBLE);
+        findViewById(R.id.switch_grid_view_button).setVisibility(View.GONE);
         updateActionBarTitleAndHomeButtonByString(getString(R.string.trashbin_activity_title));
         setupDrawer(R.id.nav_trashbin);
     }

+ 15 - 24
src/main/res/layout/files.xml

@@ -35,34 +35,25 @@
             android:id="@+id/root_layout"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:orientation="vertical"
+            android:background="@color/bg_default"
+            android:baselineAligned="false"
+            android:contentDescription="@string/list_layout"
+            android:orientation="horizontal"
             app:layout_behavior="@string/appbar_scrolling_view_behavior">
 
-            <LinearLayout
-                android:id="@+id/ListLayout"
-                android:layout_width="match_parent"
+            <FrameLayout
+                android:id="@+id/left_fragment_container"
+                android:layout_width="@dimen/zero"
                 android:layout_height="match_parent"
-                android:background="@color/bg_default"
-                android:baselineAligned="false"
-                android:contentDescription="@string/list_layout"
-                android:orientation="horizontal"
-                app:layout_behavior="@string/appbar_scrolling_view_behavior">
-
-                <FrameLayout
-                    android:id="@+id/left_fragment_container"
-                    android:layout_width="@dimen/zero"
-                    android:layout_height="match_parent"
-                    android:layout_weight="1"
-                    app:layout_behavior="@string/appbar_scrolling_view_behavior" />
-
-                <FrameLayout
-                    android:id="@+id/right_fragment_container"
-                    android:layout_width="@dimen/zero"
-                    android:layout_height="match_parent"
-                    android:layout_weight="2"
-                    app:layout_behavior="@string/appbar_scrolling_view_behavior" />
-            </LinearLayout>
+                android:layout_weight="1"
+                app:layout_behavior="@string/appbar_scrolling_view_behavior" />
 
+            <FrameLayout
+                android:id="@+id/right_fragment_container"
+                android:layout_width="@dimen/zero"
+                android:layout_height="match_parent"
+                android:layout_weight="2"
+                app:layout_behavior="@string/appbar_scrolling_view_behavior" />
         </LinearLayout>
 
         <com.google.android.material.floatingactionbutton.FloatingActionButton

+ 0 - 35
src/main/res/layout/receive_external_files.xml

@@ -32,41 +32,6 @@
         android:layout_height="0dp"
         android:layout_weight="1">
 
-        <com.google.android.material.appbar.AppBarLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:background="@color/bg_default"
-            app:elevation="0dp">
-
-            <androidx.constraintlayout.widget.ConstraintLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                app:layout_scrollFlags="scroll|enterAlways|snap">
-
-                <com.google.android.material.button.MaterialButton
-                    android:id="@+id/sort_button"
-                    style="@style/Widget.MaterialComponents.Button.TextButton"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginStart="8dp"
-                    android:contentDescription="@string/actionbar_sort"
-                    android:minWidth="0dp"
-                    android:text="@string/menu_item_sort_by_date_newest_first"
-                    android:textAlignment="textStart"
-                    android:textAllCaps="false"
-                    android:textColor="@color/fontAppbar"
-                    android:textSize="14sp"
-                    app:icon="@drawable/ic_keyboard_arrow_down"
-                    app:iconGravity="textEnd"
-                    app:iconSize="16dp"
-                    app:iconTint="@color/fontAppbar"
-                    app:layout_constraintBottom_toBottomOf="parent"
-                    app:layout_constraintStart_toStartOf="parent"
-                    app:layout_constraintTop_toTopOf="parent" />
-            </androidx.constraintlayout.widget.ConstraintLayout>
-
-        </com.google.android.material.appbar.AppBarLayout>
-
         <ListView
             android:id="@android:id/list"
             android:layout_width="match_parent"

+ 0 - 35
src/main/res/layout/trashbin_activity.xml

@@ -21,7 +21,6 @@
 -->
 <androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools"
     android:id="@+id/drawer_layout"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
@@ -42,40 +41,6 @@
             android:layout_height="match_parent"
             android:layout_below="@id/appbar">
 
-            <com.google.android.material.appbar.AppBarLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:background="@color/bg_default"
-                app:elevation="0dp">
-
-                <androidx.constraintlayout.widget.ConstraintLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    app:layout_scrollFlags="scroll|enterAlways|snap">
-
-                    <com.google.android.material.button.MaterialButton
-                        android:id="@+id/sort_button"
-                        style="@style/Widget.MaterialComponents.Button.TextButton"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_marginStart="8dp"
-                        android:contentDescription="@string/actionbar_sort"
-                        android:minWidth="0dp"
-                        android:text="@string/menu_item_sort_by_date_newest_first"
-                        android:textAlignment="textStart"
-                        android:textAllCaps="false"
-                        android:textColor="@color/fontAppbar"
-                        android:textSize="14sp"
-                        app:icon="@drawable/ic_keyboard_arrow_down"
-                        app:iconGravity="textEnd"
-                        app:iconSize="16dp"
-                        app:iconTint="@color/fontAppbar"
-                        app:layout_constraintBottom_toBottomOf="parent"
-                        app:layout_constraintStart_toStartOf="parent"
-                        app:layout_constraintTop_toTopOf="parent" />
-                </androidx.constraintlayout.widget.ConstraintLayout>
-            </com.google.android.material.appbar.AppBarLayout>
-
             <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
                 android:id="@+id/swipe_containing_list"
                 android:layout_width="match_parent"