Skip to content

Commit beaf014

Browse files
stefan-niedermannAndyScherzinger
authored andcommitted
fix(lint): Fix 80 character line issues
Signed-off-by: Stefan Niedermann <info@niedermann.it>
1 parent fc827d7 commit beaf014

File tree

6 files changed

+24
-13
lines changed

6 files changed

+24
-13
lines changed

app/src/main/java/it/niedermann/owncloud/notes/about/AboutActivity.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ protected void onCreate(Bundle savedInstanceState) {
3535
// generate title based on given position
3636
new TabLayoutMediator(binding.tabs, binding.pager, (tab, position) -> {
3737
switch (position) { // Fall-through to credits tab
38-
default -> tab.setText(R.string.about_credits_tab_title);
39-
case POS_CONTRIB -> tab.setText(R.string.about_contribution_tab_title);
40-
case POS_LICENSE -> tab.setText(R.string.about_license_tab_title);
38+
default ->
39+
tab.setText(R.string.about_credits_tab_title);
40+
case POS_CONTRIB ->
41+
tab.setText(R.string.about_contribution_tab_title);
42+
case POS_LICENSE ->
43+
tab.setText(R.string.about_license_tab_title);
4144
}
4245
}).attach();
4346
}

app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import androidx.annotation.ColorInt;
99
import androidx.appcompat.app.AppCompatActivity;
1010

11-
import it.niedermann.owncloud.notes.R;
11+
import com.google.android.material.R;
1212

1313
public abstract class BrandedActivity extends AppCompatActivity implements Branded {
1414

@@ -20,7 +20,7 @@ protected void onStart() {
2020
super.onStart();
2121

2222
final var typedValue = new TypedValue();
23-
getTheme().resolveAttribute(com.google.android.material.R.attr.colorAccent, typedValue, true);
23+
getTheme().resolveAttribute(R.attr.colorAccent, typedValue, true);
2424
colorAccent = typedValue.data;
2525

2626
readBrandMainColorLiveData(this).observe(this, this::applyBrand);

app/src/main/java/it/niedermann/owncloud/notes/edit/SearchableBaseNoteFragment.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import androidx.annotation.NonNull;
1515
import androidx.annotation.Nullable;
1616
import androidx.appcompat.widget.SearchView;
17+
import androidx.core.content.ContextCompat;
1718

1819
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
1920
import com.google.android.material.floatingactionbutton.FloatingActionButton;
@@ -47,7 +48,7 @@ public abstract class SearchableBaseNoteFragment extends BaseNoteFragment {
4748

4849
@Override
4950
public void onStart() {
50-
this.color = getResources().getColor(R.color.defaultBrand);
51+
this.color = ContextCompat.getColor(requireContext(), R.color.defaultBrand);
5152
super.onStart();
5253
}
5354

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

118119
searchMenuItem.collapseActionView();
119120

120-
final var searchEditFrame = searchView.findViewById(androidx.appcompat.R.id.search_edit_frame);
121+
final var searchEditFrame = searchView.findViewById(
122+
androidx.appcompat.R.id.search_edit_frame);
121123

122124
searchEditFrame.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
123125
int oldVisibility = -1;

app/src/main/java/it/niedermann/owncloud/notes/edit/category/CategoryAdapter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int positi
5252

5353
switch (category.id) {
5454
case addItemId -> {
55-
final var wrapDrawable = DrawableCompat.wrap(Objects.requireNonNull(ContextCompat.getDrawable(context, category.icon)));
55+
final var wrapDrawable = DrawableCompat.wrap(
56+
Objects.requireNonNull(ContextCompat.getDrawable(
57+
context, category.icon)));
5658
DrawableCompat.setTint(wrapDrawable, ContextCompat.getColor(context, R.color.icon_color_default));
5759
categoryViewHolder.getIcon().setImageDrawable(wrapDrawable);
5860
categoryViewHolder.getCategoryWrapper().setOnClickListener((v) -> listener.onCategoryAdded());

app/src/main/java/it/niedermann/owncloud/notes/main/items/ItemAdapter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder holder, int
144144
switch (getItemViewType(position)) {
145145
case TYPE_SECTION ->
146146
((SectionViewHolder) holder).bind((SectionItem) itemList.get(position));
147-
case TYPE_NOTE_WITH_EXCERPT, TYPE_NOTE_WITHOUT_EXCERPT, TYPE_NOTE_ONLY_TITLE ->
147+
case TYPE_NOTE_WITH_EXCERPT,
148+
TYPE_NOTE_WITHOUT_EXCERPT,
149+
TYPE_NOTE_ONLY_TITLE ->
148150
((NoteViewHolder) holder).bind(isSelected, (Note) itemList.get(position), showCategory, color, searchQuery);
149151
}
150152
}

app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListWidgetFactory.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,12 @@ public RemoteViews getViewAt(int position) {
142142
@NonNull
143143
private static String getCategoryTitle(@NonNull Context context, int displayMode, String category) {
144144
return switch (displayMode) {
145-
case MODE_DISPLAY_STARRED -> context.getString(R.string.label_favorites);
146-
case MODE_DISPLAY_CATEGORY -> "".equals(category)
147-
? context.getString(R.string.action_uncategorized)
148-
: category;
145+
case MODE_DISPLAY_STARRED ->
146+
context.getString(R.string.label_favorites);
147+
case MODE_DISPLAY_CATEGORY ->
148+
"".equals(category)
149+
? context.getString(R.string.action_uncategorized)
150+
: category;
149151
default -> context.getString(R.string.app_name);
150152
};
151153
}

0 commit comments

Comments
 (0)