fix(lint): Fix 80 character line issues

Signed-off-by: Stefan Niedermann <info@niedermann.it>
This commit is contained in:
Stefan Niedermann 2024-01-20 11:19:10 +01:00 committed by Andy Scherzinger
parent fc827d71b8
commit beaf01442f
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
6 changed files with 24 additions and 13 deletions

View file

@ -35,9 +35,12 @@ public class AboutActivity extends LockedActivity {
// generate title based on given position
new TabLayoutMediator(binding.tabs, binding.pager, (tab, position) -> {
switch (position) { // Fall-through to credits tab
default -> tab.setText(R.string.about_credits_tab_title);
case POS_CONTRIB -> tab.setText(R.string.about_contribution_tab_title);
case POS_LICENSE -> tab.setText(R.string.about_license_tab_title);
default ->
tab.setText(R.string.about_credits_tab_title);
case POS_CONTRIB ->
tab.setText(R.string.about_contribution_tab_title);
case POS_LICENSE ->
tab.setText(R.string.about_license_tab_title);
}
}).attach();
}

View file

@ -8,7 +8,7 @@ import android.view.Menu;
import androidx.annotation.ColorInt;
import androidx.appcompat.app.AppCompatActivity;
import it.niedermann.owncloud.notes.R;
import com.google.android.material.R;
public abstract class BrandedActivity extends AppCompatActivity implements Branded {
@ -20,7 +20,7 @@ public abstract class BrandedActivity extends AppCompatActivity implements Brand
super.onStart();
final var typedValue = new TypedValue();
getTheme().resolveAttribute(com.google.android.material.R.attr.colorAccent, typedValue, true);
getTheme().resolveAttribute(R.attr.colorAccent, typedValue, true);
colorAccent = typedValue.data;
readBrandMainColorLiveData(this).observe(this, this::applyBrand);

View file

@ -14,6 +14,7 @@ import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.SearchView;
import androidx.core.content.ContextCompat;
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
@ -47,7 +48,7 @@ public abstract class SearchableBaseNoteFragment extends BaseNoteFragment {
@Override
public void onStart() {
this.color = getResources().getColor(R.color.defaultBrand);
this.color = ContextCompat.getColor(requireContext(), R.color.defaultBrand);
super.onStart();
}
@ -117,7 +118,8 @@ public abstract class SearchableBaseNoteFragment extends BaseNoteFragment {
searchMenuItem.collapseActionView();
final var searchEditFrame = searchView.findViewById(androidx.appcompat.R.id.search_edit_frame);
final var searchEditFrame = searchView.findViewById(
androidx.appcompat.R.id.search_edit_frame);
searchEditFrame.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
int oldVisibility = -1;

View file

@ -52,7 +52,9 @@ public class CategoryAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
switch (category.id) {
case addItemId -> {
final var wrapDrawable = DrawableCompat.wrap(Objects.requireNonNull(ContextCompat.getDrawable(context, category.icon)));
final var wrapDrawable = DrawableCompat.wrap(
Objects.requireNonNull(ContextCompat.getDrawable(
context, category.icon)));
DrawableCompat.setTint(wrapDrawable, ContextCompat.getColor(context, R.color.icon_color_default));
categoryViewHolder.getIcon().setImageDrawable(wrapDrawable);
categoryViewHolder.getCategoryWrapper().setOnClickListener((v) -> listener.onCategoryAdded());

View file

@ -144,7 +144,9 @@ public class ItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> i
switch (getItemViewType(position)) {
case TYPE_SECTION ->
((SectionViewHolder) holder).bind((SectionItem) itemList.get(position));
case TYPE_NOTE_WITH_EXCERPT, TYPE_NOTE_WITHOUT_EXCERPT, TYPE_NOTE_ONLY_TITLE ->
case TYPE_NOTE_WITH_EXCERPT,
TYPE_NOTE_WITHOUT_EXCERPT,
TYPE_NOTE_ONLY_TITLE ->
((NoteViewHolder) holder).bind(isSelected, (Note) itemList.get(position), showCategory, color, searchQuery);
}
}

View file

@ -142,8 +142,10 @@ public class NoteListWidgetFactory implements RemoteViewsService.RemoteViewsFact
@NonNull
private static String getCategoryTitle(@NonNull Context context, int displayMode, String category) {
return switch (displayMode) {
case MODE_DISPLAY_STARRED -> context.getString(R.string.label_favorites);
case MODE_DISPLAY_CATEGORY -> "".equals(category)
case MODE_DISPLAY_STARRED ->
context.getString(R.string.label_favorites);
case MODE_DISPLAY_CATEGORY ->
"".equals(category)
? context.getString(R.string.action_uncategorized)
: category;
default -> context.getString(R.string.app_name);