Skip to content

Commit

Permalink
fix(lint): Fix 80 character line issues
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Niedermann <[email protected]>
  • Loading branch information
stefan-niedermann committed Jan 20, 2024
1 parent 2514960 commit bd232af
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ protected void onCreate(Bundle savedInstanceState) {
// 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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
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 {

Expand All @@ -20,7 +20,7 @@ protected void onStart() {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
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;
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -117,7 +118,8 @@ public void onPrepareOptionsMenu(@NonNull Menu menu) {

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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int positi

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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder holder, int
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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,12 @@ public RemoteViews getViewAt(int position) {
@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)
? context.getString(R.string.action_uncategorized)
: 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);
};
}
Expand Down

0 comments on commit bd232af

Please sign in to comment.