mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 17:46:37 +03:00
Reduce dodgy code
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
ec3be74a37
commit
10c564dc86
2 changed files with 19 additions and 9 deletions
|
@ -60,6 +60,7 @@ import android.os.Bundle;
|
|||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AndroidRuntimeException;
|
||||
import android.view.KeyEvent;
|
||||
|
@ -144,6 +145,7 @@ import androidx.annotation.ColorInt;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
@ -287,11 +289,12 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
|||
|
||||
// Workaround, for fixing a problem with Android Library Support v7 19
|
||||
//getWindow().requestFeature(Window.FEATURE_NO_TITLE);
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().hide();
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
|
||||
getSupportActionBar().setDisplayShowHomeEnabled(false);
|
||||
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.hide();
|
||||
actionBar.setDisplayHomeAsUpEnabled(false);
|
||||
actionBar.setDisplayShowHomeEnabled(false);
|
||||
actionBar.setDisplayShowTitleEnabled(false);
|
||||
}
|
||||
|
||||
mIsFirstAuthAttempt = true;
|
||||
|
@ -766,9 +769,11 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
|||
|
||||
private void checkOcServer() {
|
||||
String uri;
|
||||
if (accountSetupBinding != null && accountSetupBinding.hostUrlInput.getText() != null &&
|
||||
!accountSetupBinding.hostUrlInput.getText().toString().isEmpty()) {
|
||||
uri = accountSetupBinding.hostUrlInput.getText().toString().trim();
|
||||
Editable hostUrlInput = accountSetupBinding.hostUrlInput.getText();
|
||||
|
||||
if (accountSetupBinding != null && hostUrlInput != null &&
|
||||
!hostUrlInput.toString().isEmpty()) {
|
||||
uri = hostUrlInput.toString().trim();
|
||||
} else {
|
||||
uri = mServerInfo.mBaseUrl;
|
||||
}
|
||||
|
|
|
@ -1208,7 +1208,12 @@ public class FileDataStorageManager {
|
|||
ContentValues contentValues = new ContentValues();
|
||||
contentValues.put(ProviderTableMeta.OCSHARES_FILE_SOURCE, share.getFileSource());
|
||||
contentValues.put(ProviderTableMeta.OCSHARES_ITEM_SOURCE, share.getItemSource());
|
||||
contentValues.put(ProviderTableMeta.OCSHARES_SHARE_TYPE, share.getShareType().getValue());
|
||||
|
||||
ShareType shareType = share.getShareType();
|
||||
if (shareType != null) {
|
||||
contentValues.put(ProviderTableMeta.OCSHARES_SHARE_TYPE, shareType.getValue());
|
||||
}
|
||||
|
||||
contentValues.put(ProviderTableMeta.OCSHARES_SHARE_WITH, share.getShareWith());
|
||||
contentValues.put(ProviderTableMeta.OCSHARES_PATH, share.getPath());
|
||||
contentValues.put(ProviderTableMeta.OCSHARES_PERMISSIONS, share.getPermissions());
|
||||
|
|
Loading…
Reference in a new issue