Browse Source

Merge branch 'master' into ldap

Tobias Kaminsky 7 years ago
parent
commit
9765897509

+ 0 - 1
.gitignore

@@ -18,7 +18,6 @@ target/
 # Local configuration files (sdk path, etc)
 # Local configuration files (sdk path, etc)
 local.properties
 local.properties
 tests/local.properties
 tests/local.properties
-lint.xml
 
 
 # Mac .DS_Store files
 # Mac .DS_Store files
 .DS_Store
 .DS_Store

+ 6 - 0
lint.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<lint>
+    <issue id="InvalidPackage">
+        <ignore path="**/freemarker-2.3.23.jar"/>
+    </issue>
+</lint>

+ 1 - 1
scripts/lint/lint-results.txt

@@ -1,2 +1,2 @@
 DO NOT TOUCH; GENERATED BY DRONE
 DO NOT TOUCH; GENERATED BY DRONE
-      <span class="mdl-layout-title">Lint Report: 32 errors and 676 warnings</span>
+      <span class="mdl-layout-title">Lint Report: 10 errors and 676 warnings</span>

+ 1 - 1
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java

@@ -563,7 +563,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
         /// step 2 - set properties of UI elements (text, visibility, enabled...)
         /// step 2 - set properties of UI elements (text, visibility, enabled...)
         Button welcomeLink = (Button) findViewById(R.id.welcome_link);
         Button welcomeLink = (Button) findViewById(R.id.welcome_link);
         welcomeLink.setVisibility(isWelcomeLinkVisible ? View.VISIBLE : View.GONE);
         welcomeLink.setVisibility(isWelcomeLinkVisible ? View.VISIBLE : View.GONE);
-        welcomeLink.setText(String.format(getString(R.string.auth_register), getString(R.string.app_name)));
+        welcomeLink.setText(getString(R.string.auth_register));
 
 
         TextView instructionsView = (TextView) findViewById(R.id.instructions_message);
         TextView instructionsView = (TextView) findViewById(R.id.instructions_message);
         if (instructionsMessageText != null) {
         if (instructionsMessageText != null) {

+ 4 - 7
src/main/java/com/owncloud/android/authentication/PassCodeManager.java

@@ -23,6 +23,7 @@ import android.app.Activity;
 import android.content.Context;
 import android.content.Context;
 import android.content.Intent;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.content.SharedPreferences;
+import android.os.Build;
 import android.os.PowerManager;
 import android.os.PowerManager;
 import android.preference.PreferenceManager;
 import android.preference.PreferenceManager;
 import android.view.WindowManager;
 import android.view.WindowManager;
@@ -71,26 +72,22 @@ public class PassCodeManager {
     }
     }
 
 
     public void onActivityStarted(Activity activity) {
     public void onActivityStarted(Activity activity) {
-        if (!sExemptOfPasscodeActivites.contains(activity.getClass()) &&
-                passCodeShouldBeRequested()
-                ){
+        if (!sExemptOfPasscodeActivites.contains(activity.getClass()) && passCodeShouldBeRequested()) {
 
 
             Intent i = new Intent(MainApp.getAppContext(), PassCodeActivity.class);
             Intent i = new Intent(MainApp.getAppContext(), PassCodeActivity.class);
             i.setAction(PassCodeActivity.ACTION_CHECK);
             i.setAction(PassCodeActivity.ACTION_CHECK);
             i.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
             i.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
             activity.startActivity(i);
             activity.startActivity(i);
-
         }
         }
 
 
         if (!sExemptOfPasscodeActivites.contains(activity.getClass()) &&
         if (!sExemptOfPasscodeActivites.contains(activity.getClass()) &&
-                fingerprintShouldBeRequested() && FingerprintActivity.isFingerprintReady(MainApp.getAppContext())
-                ){
+                Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
+                fingerprintShouldBeRequested() && FingerprintActivity.isFingerprintReady(MainApp.getAppContext())) {
 
 
             Intent i = new Intent(MainApp.getAppContext(), FingerprintActivity.class);
             Intent i = new Intent(MainApp.getAppContext(), FingerprintActivity.class);
             i.setAction(PassCodeActivity.ACTION_CHECK);
             i.setAction(PassCodeActivity.ACTION_CHECK);
             i.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
             i.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
             activity.startActivity(i);
             activity.startActivity(i);
-
         }
         }
 
 
         mVisibleActivitiesCounter++;    // keep it AFTER passCodeShouldBeRequested was checked
         mVisibleActivitiesCounter++;    // keep it AFTER passCodeShouldBeRequested was checked

+ 2 - 2
src/main/java/com/owncloud/android/media/MediaService.java

@@ -224,7 +224,7 @@ public class MediaService extends Service implements OnCompletionListener, OnPre
         super.onCreate();
         super.onCreate();
         Log_OC.d(TAG, "Creating ownCloud media service");
         Log_OC.d(TAG, "Creating ownCloud media service");
 
 
-        mWifiLock = ((WifiManager) getSystemService(Context.WIFI_SERVICE)).
+        mWifiLock = ((WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE)).
                 createWifiLock(WifiManager.WIFI_MODE_FULL, MEDIA_WIFI_LOCK_TAG);
                 createWifiLock(WifiManager.WIFI_MODE_FULL, MEDIA_WIFI_LOCK_TAG);
 
 
         mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
         mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
@@ -499,7 +499,7 @@ public class MediaService extends Service implements OnCompletionListener, OnPre
 
 
     /** Called when media player is done playing current song. */
     /** Called when media player is done playing current song. */
     public void onCompletion(MediaPlayer player) {
     public void onCompletion(MediaPlayer player) {
-        Toast.makeText(this, String.format(getString(R.string.media_event_done, mFile.getFileName())), Toast.LENGTH_LONG).show();
+        Toast.makeText(this, String.format(getString(R.string.media_event_done), mFile.getFileName()), Toast.LENGTH_LONG).show();
         if (mMediaController != null) {
         if (mMediaController != null) {
             // somebody is still bound to the service
             // somebody is still bound to the service
             player.seekTo(0);
             player.seekTo(0);

+ 1 - 1
src/main/java/com/owncloud/android/ui/activity/ConflictsResolveActivity.java

@@ -95,7 +95,7 @@ public class ConflictsResolveActivity extends FileActivity implements OnConflict
                 // current Account
                 // current Account
                 if (file != null) {
                 if (file != null) {
                     setFile(file);
                     setFile(file);
-                    ConflictsResolveDialog d = ConflictsResolveDialog.newInstance(file.getRemotePath(), this);
+                    ConflictsResolveDialog d = ConflictsResolveDialog.newInstance(this);
                     d.showDialog(this);
                     d.showDialog(this);
 
 
                 } else {
                 } else {

+ 2 - 2
src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java

@@ -237,7 +237,7 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
                 if (mIsAccountChooserActive) {
                 if (mIsAccountChooserActive) {
                     toggleAccountList();
                     toggleAccountList();
                 }
                 }
-                invalidateOptionsMenu();
+                supportInvalidateOptionsMenu();
                 mDrawerToggle.setDrawerIndicatorEnabled(isDrawerIndicatorAvailable());
                 mDrawerToggle.setDrawerIndicatorEnabled(isDrawerIndicatorAvailable());
 
 
                 if (pendingRunnable != null) {
                 if (pendingRunnable != null) {
@@ -250,7 +250,7 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
             public void onDrawerOpened(View drawerView) {
             public void onDrawerOpened(View drawerView) {
                 super.onDrawerOpened(drawerView);
                 super.onDrawerOpened(drawerView);
                 mDrawerToggle.setDrawerIndicatorEnabled(true);
                 mDrawerToggle.setDrawerIndicatorEnabled(true);
-                invalidateOptionsMenu();
+                supportInvalidateOptionsMenu();
             }
             }
         };
         };
 
 

+ 1 - 1
src/main/java/com/owncloud/android/ui/activity/FileActivity.java

@@ -453,7 +453,7 @@ public abstract class FileActivity extends DrawerActivity
                         operation, getResources()), Toast.LENGTH_LONG);
                         operation, getResources()), Toast.LENGTH_LONG);
                 msg.show();
                 msg.show();
             }
             }
-            invalidateOptionsMenu();
+            supportInvalidateOptionsMenu();
         }
         }
     }
     }
 
 

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

@@ -99,7 +99,6 @@ import com.owncloud.android.ui.preview.PreviewMediaFragment;
 import com.owncloud.android.ui.preview.PreviewTextFragment;
 import com.owncloud.android.ui.preview.PreviewTextFragment;
 import com.owncloud.android.ui.preview.PreviewVideoActivity;
 import com.owncloud.android.ui.preview.PreviewVideoActivity;
 import com.owncloud.android.utils.DataHolderUtil;
 import com.owncloud.android.utils.DataHolderUtil;
-import com.owncloud.android.utils.DisplayUtils;
 import com.owncloud.android.utils.ErrorMessageAdapter;
 import com.owncloud.android.utils.ErrorMessageAdapter;
 import com.owncloud.android.utils.MimeTypeUtil;
 import com.owncloud.android.utils.MimeTypeUtil;
 import com.owncloud.android.utils.PermissionUtil;
 import com.owncloud.android.utils.PermissionUtil;
@@ -1036,6 +1035,7 @@ public class FileDisplayActivity extends HookActivity
             //if PreviewImageActivity called this activity and mDualPane==false  then calls PreviewImageActivity again
             //if PreviewImageActivity called this activity and mDualPane==false  then calls PreviewImageActivity again
             if((getIntent().getAction()!=null && getIntent().getAction().equalsIgnoreCase(ACTION_DETAILS)) && !mDualPane){
             if((getIntent().getAction()!=null && getIntent().getAction().equalsIgnoreCase(ACTION_DETAILS)) && !mDualPane){
                     getIntent().setAction(null);
                     getIntent().setAction(null);
+                    getIntent().putExtra(EXTRA_FILE, (OCFile) null);
                     startImagePreview(getFile());
                     startImagePreview(getFile());
             }
             }
 
 
@@ -1244,11 +1244,9 @@ public class FileDisplayActivity extends HookActivity
                         }
                         }
 
 
                         mSyncInProgress = (!FileSyncAdapter.EVENT_FULL_SYNC_END.equals(event) &&
                         mSyncInProgress = (!FileSyncAdapter.EVENT_FULL_SYNC_END.equals(event) &&
-                                !RefreshFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED
-                                        .equals(event));
+                                !RefreshFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED.equals(event));
 
 
-                        if (RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED.
-                                equals(event) &&
+                        if (RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED.equals(event) &&
                                 synchResult != null && !synchResult.isSuccess()) {
                                 synchResult != null && !synchResult.isSuccess()) {
 
 
                             /// TODO refactor and make common
                             /// TODO refactor and make common
@@ -1301,10 +1299,10 @@ public class FileDisplayActivity extends HookActivity
     private void setBackgroundText() {
     private void setBackgroundText() {
         final OCFileListFragment ocFileListFragment = getListOfFilesFragment();
         final OCFileListFragment ocFileListFragment = getListOfFilesFragment();
         if (ocFileListFragment != null) {
         if (ocFileListFragment != null) {
-            if (!mSyncInProgress) {
-                ocFileListFragment.setEmptyListMessage(ExtendedListFragment.SearchType.NO_SEARCH);
-            } else {
+            if (mSyncInProgress) {
                 ocFileListFragment.setEmptyListLoadingMessage();
                 ocFileListFragment.setEmptyListLoadingMessage();
+            } else {
+                ocFileListFragment.setEmptyListMessage(ExtendedListFragment.SearchType.NO_SEARCH);
             }
             }
         } else {
         } else {
             Log_OC.e(TAG, "OCFileListFragment is null");
             Log_OC.e(TAG, "OCFileListFragment is null");
@@ -1650,7 +1648,7 @@ public class FileDisplayActivity extends HookActivity
                     showDetails(file);
                     showDetails(file);
                 }
                 }
             }
             }
-            invalidateOptionsMenu();
+            supportInvalidateOptionsMenu();
         }
         }
     }
     }
 
 
@@ -1681,7 +1679,7 @@ public class FileDisplayActivity extends HookActivity
             if (getStorageManager().getFileById(removedFile.getParentId()).equals(getCurrentDir())) {
             if (getStorageManager().getFileById(removedFile.getParentId()).equals(getCurrentDir())) {
                 refreshListOfFilesFragment(false);
                 refreshListOfFilesFragment(false);
             }
             }
-            invalidateOptionsMenu();
+            supportInvalidateOptionsMenu();
         } else {
         } else {
             if (result.isSslRecoverableException()) {
             if (result.isSslRecoverableException()) {
                 mLastSslUntrustedServerResult = result;
                 mLastSslUntrustedServerResult = result;
@@ -1799,7 +1797,7 @@ public class FileDisplayActivity extends HookActivity
         if (result.isSuccess() && operation.transferWasRequested()) {
         if (result.isSuccess() && operation.transferWasRequested()) {
             OCFile syncedFile = operation.getLocalFile();
             OCFile syncedFile = operation.getLocalFile();
             onTransferStateChanged(syncedFile, true, true);
             onTransferStateChanged(syncedFile, true, true);
-            invalidateOptionsMenu();
+            supportInvalidateOptionsMenu();
             refreshShowDetails();
             refreshShowDetails();
         }
         }
     }
     }

+ 5 - 14
src/main/java/com/owncloud/android/ui/activity/FingerprintActivity.java

@@ -20,8 +20,6 @@
 package com.owncloud.android.ui.activity;
 package com.owncloud.android.ui.activity;
 
 
 import android.Manifest;
 import android.Manifest;
-import android.annotation.SuppressLint;
-import android.annotation.TargetApi;
 import android.app.KeyguardManager;
 import android.app.KeyguardManager;
 import android.content.Context;
 import android.content.Context;
 import android.content.Intent;
 import android.content.Intent;
@@ -71,7 +69,7 @@ import javax.crypto.SecretKey;
 /**
 /**
  * Activity to handle access to the app based on the fingerprint.
  * Activity to handle access to the app based on the fingerprint.
  */
  */
-@TargetApi(Build.VERSION_CODES.M)
+@RequiresApi(Build.VERSION_CODES.M)
 public class FingerprintActivity extends AppCompatActivity {
 public class FingerprintActivity extends AppCompatActivity {
 
 
     private static final String TAG = FingerprintActivity.class.getSimpleName();
     private static final String TAG = FingerprintActivity.class.getSimpleName();
@@ -274,28 +272,21 @@ public class FingerprintActivity extends AppCompatActivity {
         return false;
         return false;
     }
     }
 
 
-    @RequiresApi(api = Build.VERSION_CODES.M)
     static public boolean isFingerprintReady(Context context) {
     static public boolean isFingerprintReady(Context context) {
         try {
         try {
             FingerprintManager fingerprintManager =
             FingerprintManager fingerprintManager =
                     (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
                     (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
 
 
-            if (ActivityCompat.checkSelfPermission(context, Manifest.permission.USE_FINGERPRINT)
-                    != PackageManager.PERMISSION_GRANTED) {
-                return false;
-            }
-            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
-                return fingerprintManager.isHardwareDetected() && fingerprintManager.hasEnrolledFingerprints();
-            }
+            return ActivityCompat.checkSelfPermission(context, Manifest.permission.USE_FINGERPRINT) ==
+                    PackageManager.PERMISSION_GRANTED && fingerprintManager.isHardwareDetected() &&
+                    fingerprintManager.hasEnrolledFingerprints();
         } catch (Exception e) {
         } catch (Exception e) {
             return false;
             return false;
         }
         }
-
-        return false;
     }
     }
 }
 }
 
 
-@SuppressLint("NewApi")
+@RequiresApi(Build.VERSION_CODES.M)
 class FingerprintHandler extends FingerprintManager.AuthenticationCallback {
 class FingerprintHandler extends FingerprintManager.AuthenticationCallback {
 
 
     private TextView text;
     private TextView text;

+ 82 - 24
src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java

@@ -38,9 +38,13 @@ import android.graphics.PorterDuff;
 import android.graphics.drawable.ColorDrawable;
 import android.graphics.drawable.ColorDrawable;
 import android.graphics.drawable.Drawable;
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.os.Bundle;
+import android.os.Handler;
+import android.os.Looper;
 import android.os.Parcelable;
 import android.os.Parcelable;
+import android.support.annotation.DrawableRes;
 import android.support.annotation.NonNull;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
 import android.support.annotation.Nullable;
+import android.support.annotation.StringRes;
 import android.support.v4.app.DialogFragment;
 import android.support.v4.app.DialogFragment;
 import android.support.v4.app.FragmentManager;
 import android.support.v4.app.FragmentManager;
 import android.support.v4.content.ContextCompat;
 import android.support.v4.content.ContextCompat;
@@ -60,7 +64,10 @@ import android.widget.AdapterView.OnItemClickListener;
 import android.widget.ArrayAdapter;
 import android.widget.ArrayAdapter;
 import android.widget.Button;
 import android.widget.Button;
 import android.widget.EditText;
 import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
 import android.widget.ListView;
 import android.widget.ListView;
+import android.widget.ProgressBar;
 import android.widget.Spinner;
 import android.widget.Spinner;
 import android.widget.TextView;
 import android.widget.TextView;
 import android.widget.Toast;
 import android.widget.Toast;
@@ -143,6 +150,12 @@ public class ReceiveExternalFilesActivity extends FileActivity
 
 
     private final static String FILENAME_ENCODING = "UTF-8";
     private final static String FILENAME_ENCODING = "UTF-8";
 
 
+    private LinearLayout mEmptyListContainer;
+    private TextView mEmptyListMessage;
+    private TextView mEmptyListHeadline;
+    private ImageView mEmptyListIcon;
+    private ProgressBar mEmptyListProgress;
+
     @Override
     @Override
     protected void onCreate(Bundle savedInstanceState) {
     protected void onCreate(Bundle savedInstanceState) {
         prepareStreamsToUpload();
         prepareStreamsToUpload();
@@ -711,6 +724,7 @@ public class ReceiveExternalFilesActivity extends FileActivity
 
 
     private void populateDirectoryList() {
     private void populateDirectoryList() {
         setContentView(R.layout.uploader_layout);
         setContentView(R.layout.uploader_layout);
+        setupEmptyList();
         setupToolbar();
         setupToolbar();
         ActionBar actionBar = getSupportActionBar();
         ActionBar actionBar = getSupportActionBar();
 
 
@@ -735,41 +749,85 @@ public class ReceiveExternalFilesActivity extends FileActivity
         mFile = getStorageManager().getFileByPath(full_path);
         mFile = getStorageManager().getFileByPath(full_path);
         if (mFile != null) {
         if (mFile != null) {
             Vector<OCFile> files = getStorageManager().getFolderContent(mFile, false);
             Vector<OCFile> files = getStorageManager().getFolderContent(mFile, false);
-            sortFileList(files);
 
 
-            List<HashMap<String, Object>> data = new LinkedList<>();
-            for (OCFile f : files) {
-                HashMap<String, Object> h = new HashMap<>();
-                h.put("dirname", f);
-                data.add(h);
-            }
+            if (files.size() == 0) {
+                setMessageForEmptyList(
+                        R.string.file_list_empty_headline,
+                        R.string.empty,
+                        R.drawable.ic_list_empty_upload,
+                        true
+                );
+            } else {
+                mEmptyListContainer.setVisibility(View.GONE);
 
 
-            UploaderAdapter sa = new UploaderAdapter(this,
-                                                data,
-                                                R.layout.uploader_list_item_layout,
-                                                new String[] {"dirname"},
-                                                new int[] {R.id.filename},
-                                                getStorageManager(), getAccount());
+                sortFileList(files);
+
+                List<HashMap<String, Object>> data = new LinkedList<>();
+                for (OCFile f : files) {
+                    HashMap<String, Object> h = new HashMap<>();
+                    h.put("dirname", f);
+                    data.add(h);
+                }
 
 
-            mListView.setAdapter(sa);
-            Button btnChooseFolder = (Button) findViewById(R.id.uploader_choose_folder);
-            btnChooseFolder.setOnClickListener(this);
-            btnChooseFolder.getBackground().setColorFilter(ThemeUtils.primaryColor(getAccount()),
-                    PorterDuff.Mode.SRC_ATOP);
+                UploaderAdapter sa = new UploaderAdapter(this,
+                        data,
+                        R.layout.uploader_list_item_layout,
+                        new String[]{"dirname"},
+                        new int[]{R.id.filename},
+                        getStorageManager(), getAccount());
 
 
-            getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ThemeUtils.primaryColor(getAccount())));
+                mListView.setAdapter(sa);
+                Button btnChooseFolder = (Button) findViewById(R.id.uploader_choose_folder);
+                btnChooseFolder.setOnClickListener(this);
+                btnChooseFolder.getBackground().setColorFilter(ThemeUtils.primaryColor(getAccount()),
+                        PorterDuff.Mode.SRC_ATOP);
 
 
-            ThemeUtils.colorStatusBar(this, ThemeUtils.primaryDarkColor(getAccount()));
+                getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ThemeUtils.primaryColor(getAccount())));
 
 
-            ThemeUtils.colorToolbarProgressBar(this, ThemeUtils.primaryColor(getAccount()));
+                ThemeUtils.colorStatusBar(this, ThemeUtils.primaryDarkColor(getAccount()));
 
 
-            Button btnNewFolder = (Button) findViewById(R.id.uploader_cancel);
-            btnNewFolder.setOnClickListener(this);
+                ThemeUtils.colorToolbarProgressBar(this, ThemeUtils.primaryColor(getAccount()));
 
 
-            mListView.setOnItemClickListener(this);
+                Button btnNewFolder = (Button) findViewById(R.id.uploader_cancel);
+                btnNewFolder.setOnClickListener(this);
+
+                mListView.setOnItemClickListener(this);
+            }
         }
         }
     }
     }
 
 
+    protected void setupEmptyList() {
+        mEmptyListContainer = (LinearLayout) findViewById(R.id.empty_list_view);
+        mEmptyListMessage = (TextView) findViewById(R.id.empty_list_view_text);
+        mEmptyListHeadline = (TextView) findViewById(R.id.empty_list_view_headline);
+        mEmptyListIcon = (ImageView) findViewById(R.id.empty_list_icon);
+        mEmptyListProgress = (ProgressBar) findViewById(R.id.empty_list_progress);
+        mEmptyListProgress.getIndeterminateDrawable().setColorFilter(ThemeUtils.primaryColor(),
+                PorterDuff.Mode.SRC_IN);
+    }
+
+    public void setMessageForEmptyList(@StringRes final int headline, @StringRes final int message,
+                                       @DrawableRes final int icon, final boolean tintIcon) {
+        new Handler(Looper.getMainLooper()).post(new Runnable() {
+            @Override
+            public void run() {
+
+                if (mEmptyListContainer != null && mEmptyListMessage != null) {
+                    mEmptyListHeadline.setText(headline);
+                    mEmptyListMessage.setText(message);
+
+                    if (tintIcon) {
+                        mEmptyListIcon.setImageDrawable(ThemeUtils.tintDrawable(icon, ThemeUtils.primaryColor()));
+                    }
+
+                    mEmptyListIcon.setVisibility(View.VISIBLE);
+                    mEmptyListProgress.setVisibility(View.GONE);
+                    mEmptyListMessage.setVisibility(View.VISIBLE);
+                }
+            }
+        });
+    }
+
     @Override
     @Override
     public void onSavedCertificate() {
     public void onSavedCertificate() {
         startSyncFolderOperation(getCurrentDir());
         startSyncFolderOperation(getCurrentDir());

+ 31 - 33
src/main/java/com/owncloud/android/ui/dialog/ConflictsResolveDialog.java

@@ -1,4 +1,4 @@
-/**
+/*
  *   ownCloud Android client application
  *   ownCloud Android client application
  *
  *
  *   @author Bartek Przybylski
  *   @author Bartek Przybylski
@@ -24,6 +24,7 @@ package com.owncloud.android.ui.dialog;
 import android.app.Dialog;
 import android.app.Dialog;
 import android.content.DialogInterface;
 import android.content.DialogInterface;
 import android.os.Bundle;
 import android.os.Bundle;
+import android.support.annotation.NonNull;
 import android.support.v4.app.DialogFragment;
 import android.support.v4.app.DialogFragment;
 import android.support.v4.app.Fragment;
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentTransaction;
 import android.support.v4.app.FragmentTransaction;
@@ -38,7 +39,7 @@ import com.owncloud.android.R;
  */
  */
 public class ConflictsResolveDialog extends DialogFragment {
 public class ConflictsResolveDialog extends DialogFragment {
 
 
-    public static enum Decision { 
+    public enum Decision {
         CANCEL,
         CANCEL,
         KEEP_BOTH,
         KEEP_BOTH,
         OVERWRITE,
         OVERWRITE,
@@ -46,35 +47,32 @@ public class ConflictsResolveDialog extends DialogFragment {
     }
     }
     
     
     OnConflictDecisionMadeListener mListener;
     OnConflictDecisionMadeListener mListener;
-    
-    public static ConflictsResolveDialog newInstance(String path, OnConflictDecisionMadeListener listener) {
+
+    public static ConflictsResolveDialog newInstance(OnConflictDecisionMadeListener listener) {
         ConflictsResolveDialog f = new ConflictsResolveDialog();
         ConflictsResolveDialog f = new ConflictsResolveDialog();
-        Bundle args = new Bundle();
-        args.putString("remotepath", path);
-        f.setArguments(args);
         f.mListener = listener;
         f.mListener = listener;
         return f;
         return f;
     }
     }
-    
+
+    @NonNull
     @Override
     @Override
     public Dialog onCreateDialog(Bundle savedInstanceState) {
     public Dialog onCreateDialog(Bundle savedInstanceState) {
-        String remotepath = getArguments().getString("remotepath");
         return new AlertDialog.Builder(getActivity(), R.style.Theme_ownCloud_Dialog)
         return new AlertDialog.Builder(getActivity(), R.style.Theme_ownCloud_Dialog)
-                   .setIcon(R.drawable.ic_warning)
-                   .setTitle(R.string.conflict_title)
-                   .setMessage(String.format(getString(R.string.conflict_message), remotepath))
-                   .setPositiveButton(R.string.conflict_use_local_version,
-                       new DialogInterface.OnClickListener() {
+                .setIcon(R.drawable.ic_warning)
+                .setTitle(R.string.conflict_title)
+                .setMessage(getString(R.string.conflict_message))
+                .setPositiveButton(R.string.conflict_use_local_version,
+                        new DialogInterface.OnClickListener() {
 
 
-                           @Override
-                           public void onClick(DialogInterface dialog, int which) {
-                               if (mListener != null) {
-                                   mListener.conflictDecisionMade(Decision.OVERWRITE);
-                               }
-                           }
-                       })
-                   .setNeutralButton(R.string.conflict_keep_both,
-                       new DialogInterface.OnClickListener() {
+                            @Override
+                            public void onClick(DialogInterface dialog, int which) {
+                                if (mListener != null) {
+                                    mListener.conflictDecisionMade(Decision.OVERWRITE);
+                                }
+                            }
+                        })
+                .setNeutralButton(R.string.conflict_keep_both,
+                        new DialogInterface.OnClickListener() {
                             @Override
                             @Override
                             public void onClick(DialogInterface dialog, int which) {
                             public void onClick(DialogInterface dialog, int which) {
                                 if (mListener != null) {
                                 if (mListener != null) {
@@ -82,16 +80,16 @@ public class ConflictsResolveDialog extends DialogFragment {
                                 }
                                 }
                             }
                             }
                         })
                         })
-                   .setNegativeButton(R.string.conflict_use_server_version,
-                       new DialogInterface.OnClickListener() {
-                           @Override
-                           public void onClick(DialogInterface dialog, int which) {
-                               if (mListener != null) {
-                                   mListener.conflictDecisionMade(Decision.SERVER);
+                .setNegativeButton(R.string.conflict_use_server_version,
+                        new DialogInterface.OnClickListener() {
+                            @Override
+                            public void onClick(DialogInterface dialog, int which) {
+                                if (mListener != null) {
+                                    mListener.conflictDecisionMade(Decision.SERVER);
                                 }
                                 }
-                           }
-                   })
-                   .create();
+                            }
+                        })
+                .create();
     }
     }
     
     
     public void showDialog(AppCompatActivity activity) {
     public void showDialog(AppCompatActivity activity) {
@@ -120,6 +118,6 @@ public class ConflictsResolveDialog extends DialogFragment {
     }
     }
     
     
     public interface OnConflictDecisionMadeListener {
     public interface OnConflictDecisionMadeListener {
-        public void conflictDecisionMade(Decision decision);
+        void conflictDecisionMade(Decision decision);
     }
     }
 }
 }

+ 1 - 2
src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java

@@ -75,7 +75,6 @@ import com.owncloud.android.ui.activity.UploadFilesActivity;
 import com.owncloud.android.ui.adapter.FileListListAdapter;
 import com.owncloud.android.ui.adapter.FileListListAdapter;
 import com.owncloud.android.ui.adapter.LocalFileListAdapter;
 import com.owncloud.android.ui.adapter.LocalFileListAdapter;
 import com.owncloud.android.ui.events.SearchEvent;
 import com.owncloud.android.ui.events.SearchEvent;
-import com.owncloud.android.utils.DisplayUtils;
 import com.owncloud.android.utils.ThemeUtils;
 import com.owncloud.android.utils.ThemeUtils;
 
 
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.EventBus;
@@ -788,7 +787,7 @@ public class ExtendedListFragment extends Fragment
             @Override
             @Override
             public void run() {
             public void run() {
 
 
-                if (searchType == SearchType.NO_SEARCH && mEmptyListProgress.getVisibility() == View.GONE) {
+                if (searchType == SearchType.NO_SEARCH) {
                     setMessageForEmptyList(
                     setMessageForEmptyList(
                             R.string.file_list_empty_headline,
                             R.string.file_list_empty_headline,
                             R.string.file_list_empty,
                             R.string.file_list_empty,

+ 1 - 1
src/main/java/com/owncloud/android/ui/preview/PreviewImageActivity.java

@@ -195,7 +195,7 @@ public class PreviewImageActivity extends FileActivity implements
     private void onSynchronizeFileOperationFinish(SynchronizeFileOperation operation,
     private void onSynchronizeFileOperationFinish(SynchronizeFileOperation operation,
                                                   RemoteOperationResult result) {
                                                   RemoteOperationResult result) {
         if (result.isSuccess()) {
         if (result.isSuccess()) {
-            invalidateOptionsMenu();
+            supportInvalidateOptionsMenu();
         }
         }
 
 
     }
     }

+ 2 - 0
src/main/res/layout/uploader_layout.xml

@@ -38,6 +38,8 @@
 			android:dividerHeight="1dip">
 			android:dividerHeight="1dip">
 		</ListView>
 		</ListView>
 
 
+		<include layout="@layout/empty_list"/>
+
 	</FrameLayout>
 	</FrameLayout>
 
 
 	<LinearLayout
 	<LinearLayout

+ 2 - 0
src/main/res/values-is/strings.xml

@@ -157,6 +157,7 @@ Smelltu hér til að fá þér einn frá þjónustuaðila.</string>
     <string name="about_title">Um hugbúnaðinn</string>
     <string name="about_title">Um hugbúnaðinn</string>
     <string name="change_password">Breyta lykilorði</string>
     <string name="change_password">Breyta lykilorði</string>
     <string name="delete_account">Fjarlægja notandaaðgang</string>
     <string name="delete_account">Fjarlægja notandaaðgang</string>
+    <string name="delete_account_warning">Eyða aðgangnum %s ásamt öllum tilheyrandi skrám á tölvunni?\n\nEyðingu er ekki hægt að afturkalla.</string>
     <string name="create_account">Stofna aðgang</string>
     <string name="create_account">Stofna aðgang</string>
     <string name="upload_chooser_title">Senda inn frá &#8230;</string>
     <string name="upload_chooser_title">Senda inn frá &#8230;</string>
     <string name="uploader_info_dirname">Nafn möppu</string>
     <string name="uploader_info_dirname">Nafn möppu</string>
@@ -567,6 +568,7 @@ Smelltu hér til að fá þér einn frá þjónustuaðila.</string>
     <string name="participate_beta_headline">Prófaðu þróunarútgáfuna</string>
     <string name="participate_beta_headline">Prófaðu þróunarútgáfuna</string>
     <string name="participate_beta_text">Þetta inniheldur alla væntanlega eiginleika og er alveg á jaðrinum hvað varðar stöðugleika. Villur geta komið upp, og ef slíkt gerist, endilega tilkynntu um þær.</string>
     <string name="participate_beta_text">Þetta inniheldur alla væntanlega eiginleika og er alveg á jaðrinum hvað varðar stöðugleika. Villur geta komið upp, og ef slíkt gerist, endilega tilkynntu um þær.</string>
     <string name="participate_release_candidate_headline">Forútgáfa</string>
     <string name="participate_release_candidate_headline">Forútgáfa</string>
+    <string name="participate_release_candidate_text">Prófunarútgáfan (RC) er skyndisamsetning verðandi útgáfu en er þó vænst að sé tiltölulega stöðug. Það að þú prófir uppsetninguna þína ætti að hjálpa til við að ná því markmiði. Skráðu þig til prófana í Play hugbúnaðarsafninu eða gerðu það handvirkt með því að fara í \"Útgáfa\"-hlutann í F-Droid.</string>
     <string name="participate_contribute_headline">Vertu virkur þáttakandi</string>
     <string name="participate_contribute_headline">Vertu virkur þáttakandi</string>
     <string name="participate_contribute_irc_text">Taktu þátt í umræðum á IRC:</string>
     <string name="participate_contribute_irc_text">Taktu þátt í umræðum á IRC:</string>
     <string name="participate_contribute_forum_text">Hjálpaðu öðrum á</string>
     <string name="participate_contribute_forum_text">Hjálpaðu öðrum á</string>