Skip to content
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion scripts/analysis/findbugs-results.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
340
339
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ private void setupContent() {
getString(R.string.contributing_link)))));

MaterialButton reportButton = findViewById(R.id.community_testing_report);
reportButton.setBackgroundColor(ThemeUtils.primaryColor(this,true));
reportButton.setTextColor(ThemeUtils.fontColor(this, false));
ThemeUtils.colorPrimaryButton(reportButton, this);
reportButton.setOnClickListener(v -> DisplayUtils.startLinkIntent(this, R.string.report_issue_link));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ protected void setDrawerMenuItemChecked(int menuItemId) {
mCheckedMenuItem = menuItemId;
MenuItem currentItem = mNavigationView.getMenu().findItem(menuItemId);
int drawerColor = getResources().getColor(R.color.drawer_text_color);
int activeColor = ThemeUtils.elementColor(this);
int activeColor = ThemeUtils.primaryColor(null, true, true, this);

currentItem.setChecked(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.ColorStateList;
import android.content.res.Resources.NotFoundException;
import android.graphics.PorterDuff;
import android.os.Bundle;
import android.os.Parcelable;
import android.util.Log;
Expand Down Expand Up @@ -401,13 +399,16 @@ private void initControls() {
mChooseBtn = findViewById(R.id.folder_picker_btn_choose);

if (mChooseBtn != null) {
mChooseBtn.setBackgroundTintMode(PorterDuff.Mode.SRC_ATOP);
mChooseBtn.setBackgroundTintList(ColorStateList.valueOf(ThemeUtils.primaryColor(this, true)));
ThemeUtils.colorPrimaryButton(mChooseBtn, this);
mChooseBtn.setOnClickListener(this);
}

if (mCancelBtn != null) {
mCancelBtn.setTextColor(ThemeUtils.primaryColor(this, true));
if (this instanceof FilePickerActivity) {
ThemeUtils.colorPrimaryButton(mCancelBtn, this);
} else {
mCancelBtn.setTextColor(ThemeUtils.primaryColor(this, true));
}
mCancelBtn.setOnClickListener(this);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.passcodelock);

int elementColor = ThemeUtils.elementColor(this);
int elementColor = ThemeUtils.primaryColor(this);

mBCancel = findViewById(R.id.cancel);
mBCancel.setBackgroundColor(ThemeUtils.primaryColor(this));
ThemeUtils.colorPrimaryButton(mBCancel, this);

mPassCodeHdr = findViewById(R.id.header);
mPassCodeHdrExplanation = findViewById(R.id.explanation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,19 +765,15 @@ private void populateDirectoryList() {
mListView.setAdapter(sa);
}
MaterialButton btnChooseFolder = findViewById(R.id.uploader_choose_folder);
btnChooseFolder.setBackgroundTintMode(PorterDuff.Mode.SRC_ATOP);
btnChooseFolder.setBackgroundTintList(ColorStateList.valueOf(ThemeUtils.primaryColor(this, true)));
ThemeUtils.colorPrimaryButton(btnChooseFolder, this);
btnChooseFolder.setOnClickListener(this);
btnChooseFolder.setTextColor(ThemeUtils.fontColor(this));

if (mFile.canWrite()) {
btnChooseFolder.setEnabled(true);
btnChooseFolder.setBackgroundTintList(ColorStateList.valueOf(ThemeUtils.primaryColor(getAccount(),
true,
this)));
ThemeUtils.colorPrimaryButton(btnChooseFolder, this);
} else {
btnChooseFolder.setEnabled(false);
btnChooseFolder.setBackgroundTintList(ColorStateList.valueOf(Color.GRAY));
btnChooseFolder.setBackgroundColor(Color.GRAY);
}

ThemeUtils.colorStatusBar(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,7 @@ private void setupContent() {
adapter = new SyncedFolderAdapter(this, clock, gridWidth, this, lightVersion);
syncedFolderProvider = new SyncedFolderProvider(getContentResolver(), preferences, clock);
emptyContentIcon.setImageResource(R.drawable.nav_synced_folders);
emptyContentActionButton.setBackgroundColor(ThemeUtils.primaryColor(this));
emptyContentActionButton.setTextColor(ThemeUtils.fontColor(this));
ThemeUtils.colorPrimaryButton(emptyContentActionButton, this);

final GridLayoutManager lm = new GridLayoutManager(this, gridWidth);
adapter.setLayoutManager(lm);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,7 @@ public void onCreate(Bundle savedInstanceState) {
cancelButton.setOnClickListener(this);

MaterialButton uploadButton = findViewById(R.id.upload_files_btn_upload);
uploadButton.setBackgroundTintMode(PorterDuff.Mode.SRC_ATOP);
uploadButton.setBackgroundTintList(ColorStateList.valueOf(ThemeUtils.primaryColor(this, true)));
uploadButton.setTextColor(ThemeUtils.fontColor(this, false));
ThemeUtils.colorPrimaryButton(uploadButton, this);
uploadButton.setOnClickListener(this);

sortButton = findViewById(R.id.sort_button);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ public void setButtons(NotificationViewHolder holder, Notification notification)
int primaryColor = ThemeUtils.primaryColor(notificationsActivity);

if (action.primary) {
button.setBackgroundColor(primaryColor);
button.setTextColor(ThemeUtils.fontColor(notificationsActivity));
ThemeUtils.colorPrimaryButton(button, notificationsActivity);
button.setTypeface(button.getTypeface(), Typeface.BOLD);
} else {
button.setBackgroundColor(resources.getColor(R.color.grey_200));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ private void requestPasswordForShareViaLink() {
}

private void themeShareButtonImage(ImageView shareImageView) {
shareImageView.getBackground().setColorFilter(ThemeUtils.elementColor(getContext()), PorterDuff.Mode.SRC_IN);
shareImageView.getBackground().setColorFilter(ThemeUtils.primaryColor(getContext()), PorterDuff.Mode.SRC_IN);
shareImageView.getDrawable().mutate().setColorFilter(ThemeUtils.fontColor(getContext()),
PorterDuff.Mode.SRC_IN);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private void setupDialogElements(View view) {
* tints the icon reflecting the actual sorting choice in the apps primary color.
*/
private void setupActiveOrderSelection() {
final int color = ThemeUtils.elementColor(getContext());
final int color = ThemeUtils.primaryColor(null, true, true, getContext());
for (View view: mTaggedViews) {
if (!((FileSortOrder) view.getTag()).name.equals(mCurrentSortOrderName)) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
mFabMain = requireActivity().findViewById(R.id.fab_main);

if (mFabMain != null) { // is not available in FolderPickerActivity
ThemeUtils.tintFloatingActionButton(mFabMain, requireContext());
ThemeUtils.drawableFloatingActionButton(mFabMain, R.drawable.ic_plus, requireContext());
ThemeUtils.colorFloatingActionButton(mFabMain, R.drawable.ic_plus, requireContext());
}

Log_OC.i(TAG, "onCreateView() end");
Expand Down Expand Up @@ -1770,7 +1769,7 @@ void setFabVisible(final boolean visible) {
getActivity().runOnUiThread(() -> {
if (visible) {
mFabMain.show();
ThemeUtils.tintFloatingActionButton(mFabMain, requireContext());
ThemeUtils.colorFloatingActionButton(mFabMain, requireContext());
} else {
mFabMain.hide();
}
Expand Down Expand Up @@ -1820,11 +1819,10 @@ public void setFabEnabled(final boolean enabled) {
getActivity().runOnUiThread(() -> {
if (enabled) {
mFabMain.setEnabled(true);
ThemeUtils.tintFloatingActionButton(mFabMain, requireContext());
ThemeUtils.colorFloatingActionButton(mFabMain, requireContext());
} else {
mFabMain.setEnabled(false);
mFabMain.setBackgroundTintList(ColorStateList.valueOf(Color.GRAY));
mFabMain.setRippleColor(Color.GRAY);
ThemeUtils.colorFloatingActionButton(mFabMain, requireContext(), Color.GRAY);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,8 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
calendarPickerOpen = true;
}

int primaryColor = ThemeUtils.primaryColor(getContext());
int fontColor = ThemeUtils.fontColor(getContext());

backupNow.setBackgroundColor(primaryColor);
backupNow.setTextColor(fontColor);

contactsDatePickerBtn.setBackgroundColor(primaryColor);
contactsDatePickerBtn.setTextColor(fontColor);
ThemeUtils.colorPrimaryButton(backupNow, getContext());
ThemeUtils.colorPrimaryButton(contactsDatePickerBtn, getContext());

return view;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
fabMain.setVisibility(View.VISIBLE);
fabMain.setEnabled(true);
fabMain.setOnClickListener(v -> edit());
ThemeUtils.tintFloatingActionButton(fabMain, requireContext());
ThemeUtils.drawableFloatingActionButton(fabMain, R.drawable.ic_edit, requireContext());
ThemeUtils.colorFloatingActionButton(fabMain, R.drawable.ic_edit, requireContext());
}

return view;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/owncloud/android/utils/MimeTypeUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public static Drawable getFolderTypeIcon(boolean isSharedViaUsers, boolean isSha
drawableId = R.drawable.folder;
}

return ThemeUtils.tintDrawable(drawableId, ThemeUtils.elementColor(account, context, true));
return ThemeUtils.tintDrawable(drawableId, ThemeUtils.primaryColor(account, true, context));
}

public static Drawable getDefaultFolderIcon(Context context) {
Expand Down
Loading