Эх сурвалжийг харах

changes due to CR

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 7 жил өмнө
parent
commit
b7a45a8ce8

+ 0 - 9
src/main/java/com/owncloud/android/db/PreferenceManager.java

@@ -62,7 +62,6 @@ public abstract class PreferenceManager {
     private static final String PREF__AUTO_UPLOAD_INIT = "autoUploadInit";
     private static final String PREF__AUTO_UPLOAD_INIT = "autoUploadInit";
     private static final String PREF__FOLDER_SORT_ORDER = "folder_sort_order";
     private static final String PREF__FOLDER_SORT_ORDER = "folder_sort_order";
     private static final String PREF__FOLDER_LAYOUT = "folder_layout";
     private static final String PREF__FOLDER_LAYOUT = "folder_layout";
-    private static final String KEY_FAB_EVER_CLICKED = "FAB_EVER_CLICKED";
 
 
     public static void setKeysReInit(Context context) {
     public static void setKeysReInit(Context context) {
         saveBooleanPreference(context, PREF__KEYS_REINIT, true);
         saveBooleanPreference(context, PREF__KEYS_REINIT, true);
@@ -117,14 +116,6 @@ public abstract class PreferenceManager {
         return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("show_hidden_files_pref", false);
         return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("show_hidden_files_pref", false);
     }
     }
 
 
-    public static long getFABClicked(Context context) {
-        return getDefaultSharedPreferences(context).getLong(KEY_FAB_EVER_CLICKED, 0);
-    }
-
-    public static void setFABClicked(Context context) {
-        getDefaultSharedPreferences(context).edit().putLong(KEY_FAB_EVER_CLICKED, 1).apply();
-    }
-
     /**
     /**
      * Gets the selected file extension position the user selected to do the last upload of a url file shared from other
      * Gets the selected file extension position the user selected to do the last upload of a url file shared from other
      * app.
      * app.

+ 7 - 7
src/main/java/com/owncloud/android/ui/fragment/OCFileListBottomSheetActions.java

@@ -5,17 +5,17 @@
  * Copyright (C) 2018 Andy Scherzinger
  * Copyright (C) 2018 Andy Scherzinger
  *
  *
  * This program is free software: you can redistribute it and/or modify
  * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
+ * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * the Free Software Foundation, either version 3 of the License, or
- * at your option) any later version.
+ * (at your option) any later version.
  *
  *
  * This program is distributed in the hope that it will be useful,
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
  *
  *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
  */
 
 
 package com.owncloud.android.ui.fragment;
 package com.owncloud.android.ui.fragment;
@@ -26,7 +26,7 @@ package com.owncloud.android.ui.fragment;
  */
  */
 public interface OCFileListBottomSheetActions {
 public interface OCFileListBottomSheetActions {
     /**
     /**
-     * creates a folde rwithin the actual folder.
+     * creates a folder within the actual folder.
      */
      */
     void createFolder();
     void createFolder();
 
 

+ 33 - 45
src/main/java/com/owncloud/android/ui/fragment/OCFileListBottomSheetDialog.java

@@ -5,17 +5,17 @@
  * Copyright (C) 2018 Andy Scherzinger
  * Copyright (C) 2018 Andy Scherzinger
  *
  *
  * This program is free software: you can redistribute it and/or modify
  * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
+ * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * the Free Software Foundation, either version 3 of the License, or
- * at your option) any later version.
+ * (at your option) any later version.
  *
  *
  * This program is distributed in the hope that it will be useful,
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
  *
  *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
  */
 
 
 package com.owncloud.android.ui.fragment;
 package com.owncloud.android.ui.fragment;
@@ -28,7 +28,6 @@ import android.support.design.widget.BottomSheetDialog;
 import android.view.View;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewGroup;
 import android.widget.ImageView;
 import android.widget.ImageView;
-import android.widget.LinearLayout;
 import android.widget.TextView;
 import android.widget.TextView;
 
 
 import com.owncloud.android.R;
 import com.owncloud.android.R;
@@ -36,6 +35,7 @@ import com.owncloud.android.utils.ThemeUtils;
 
 
 import butterknife.BindView;
 import butterknife.BindView;
 import butterknife.ButterKnife;
 import butterknife.ButterKnife;
+import butterknife.OnClick;
 import butterknife.Unbinder;
 import butterknife.Unbinder;
 
 
 /**
 /**
@@ -43,76 +43,64 @@ import butterknife.Unbinder;
  */
  */
 public class OCFileListBottomSheetDialog extends BottomSheetDialog {
 public class OCFileListBottomSheetDialog extends BottomSheetDialog {
     @BindView(R.id.menu_icon_upload_files)
     @BindView(R.id.menu_icon_upload_files)
-    ImageView mIconUploadFiles;
+    public ImageView iconUploadFiles;
     @BindView(R.id.menu_icon_upload_from_app)
     @BindView(R.id.menu_icon_upload_from_app)
-    ImageView mIconUploadFromApp;
+    public ImageView iconUploadFromApp;
     @BindView(R.id.menu_icon_mkdir)
     @BindView(R.id.menu_icon_mkdir)
-    ImageView mIconMakeDir;
-
+    public ImageView iconMakeDir;
     @BindView(R.id.add_to_cloud)
     @BindView(R.id.add_to_cloud)
-    TextView mHeadline;
-
-    @BindView(R.id.menu_upload_files)
-    LinearLayout mMenuUploadFiles;
-    @BindView(R.id.menu_upload_from_app)
-    LinearLayout mMenuUploadFromApp;
-    @BindView(R.id.menu_mkdir)
-    LinearLayout mMenuMakeDir;
+    public TextView headline;
 
 
     private Unbinder unbinder;
     private Unbinder unbinder;
 
 
-    private OCFileListBottomSheetActions mActions;
+    private OCFileListBottomSheetActions actions;
 
 
 
 
-    public OCFileListBottomSheetDialog(@NonNull Context context, OCFileListBottomSheetActions
-            actions) {
+    public OCFileListBottomSheetDialog(@NonNull Context context, OCFileListBottomSheetActions actions) {
         super(context);
         super(context);
-        mActions = actions;
+        this.actions = actions;
     }
     }
 
 
     @Override
     @Override
     protected void onCreate(Bundle savedInstanceState) {
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         super.onCreate(savedInstanceState);
-        final View view = getLayoutInflater()
-                .inflate(R.layout.file_list_actions_bottom_sheet_fragment, null);
+        final View view = getLayoutInflater().inflate(R.layout.file_list_actions_bottom_sheet_fragment, null);
         setContentView(view);
         setContentView(view);
+
         if (getWindow() != null) {
         if (getWindow() != null) {
-            getWindow().setLayout(
-                    ViewGroup.LayoutParams.MATCH_PARENT,
-                    ViewGroup.LayoutParams.WRAP_CONTENT
-            );
+            getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
         }
         }
 
 
         unbinder = ButterKnife.bind(this, view);
         unbinder = ButterKnife.bind(this, view);
-        ThemeUtils.tintDrawable(mIconUploadFiles.getDrawable(), ThemeUtils.primaryColor());
-        ThemeUtils.tintDrawable(mIconUploadFromApp.getDrawable(), ThemeUtils.primaryColor());
-        ThemeUtils.tintDrawable(mIconMakeDir.getDrawable(), ThemeUtils.primaryColor());
 
 
-        mHeadline.setText(getContext().getResources().getString(R.string.add_to_cloud,
-                ThemeUtils.getDefaultDisplayNameForRootFolder()));
+        int primaryColor = ThemeUtils.primaryColor();
+        ThemeUtils.tintDrawable(iconUploadFiles.getDrawable(), primaryColor);
+        ThemeUtils.tintDrawable(iconUploadFromApp.getDrawable(), primaryColor);
+        ThemeUtils.tintDrawable(iconMakeDir.getDrawable(), primaryColor);
 
 
-        mMenuUploadFiles.setOnClickListener(v -> uploadFiles());
-        mMenuUploadFromApp.setOnClickListener(v -> uploadFromApp());
-        mMenuMakeDir.setOnClickListener(v -> createFolder());
+        headline.setText(getContext().getResources().getString(R.string.add_to_cloud,
+                ThemeUtils.getDefaultDisplayNameForRootFolder()));
 
 
         setOnShowListener(d ->
         setOnShowListener(d ->
-                BottomSheetBehavior.from((View) view.getParent())
-                        .setPeekHeight(view.getMeasuredHeight())
+                BottomSheetBehavior.from((View) view.getParent()).setPeekHeight(view.getMeasuredHeight())
         );
         );
     }
     }
 
 
-    private void createFolder() {
-        mActions.createFolder();
+    @OnClick(R.id.menu_mkdir)
+    public void createFolder() {
+        actions.createFolder();
         dismiss();
         dismiss();
     }
     }
 
 
-    private void uploadFromApp() {
-        mActions.uploadFromApp();
+    @OnClick(R.id.menu_upload_from_app)
+    public void uploadFromApp() {
+        actions.uploadFromApp();
         dismiss();
         dismiss();
     }
     }
 
 
-    private void uploadFiles() {
-        mActions.uploadFiles();
+    @OnClick(R.id.menu_upload_files)
+    public void uploadFiles() {
+        actions.uploadFiles();
         dismiss();
         dismiss();
     }
     }
 
 

+ 17 - 1
src/main/res/drawable/ic_plus.xml

@@ -1,4 +1,20 @@
-<!-- drawable/plus.xml -->
+<!--
+    @author Andy Scherzinger
+    Copyright (C) 2018 Andy Scherzinger
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
     android:height="24dp"
     android:height="24dp"
     android:width="24dp"
     android:width="24dp"