Explorar el Código

Fixed lint and inspection warnings

Vadik Sirekanyan hace 7 años
padre
commit
e78e0a4436

+ 0 - 21
app/src/main/java/com/sirekanyan/knigopis/common/DrawableResource.kt

@@ -1,21 +0,0 @@
-package com.sirekanyan.knigopis.common
-
-import android.graphics.drawable.Drawable
-import android.support.annotation.DrawableRes
-import android.widget.ImageView
-
-interface DrawableResource : CommonResource<ImageView> {
-    override fun setValueTo(view: ImageView)
-}
-
-class PlainDrawableResource(private val drawable: Drawable) : DrawableResource {
-    override fun setValueTo(view: ImageView) {
-        view.setImageDrawable(drawable)
-    }
-}
-
-class DrawableIdResource(@DrawableRes private val resId: Int) : DrawableResource {
-    override fun setValueTo(view: ImageView) {
-        view.setImageResource(resId)
-    }
-}

+ 1 - 1
app/src/main/java/com/sirekanyan/knigopis/common/view/header/HeaderItemDecoration.java

@@ -12,7 +12,7 @@ import android.view.ViewGroup;
  */
 public class HeaderItemDecoration extends RecyclerView.ItemDecoration {
 
-    private StickyHeaderInterface mListener;
+    private final StickyHeaderInterface mListener;
 
     public HeaderItemDecoration(@NonNull StickyHeaderInterface listener) {
         mListener = listener;

+ 1 - 1
app/src/main/java/com/sirekanyan/knigopis/feature/book/BookActivity.kt

@@ -146,7 +146,7 @@ class BookActivity : AppCompatActivity() {
             override fun onStartTrackingTouch(seekBar: SeekBar?) {}
             override fun onStopTrackingTouch(seekBar: SeekBar?) {}
             override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
-                progressText.text = "$progress%"
+                progressText.text = getString(R.string.book_progress, progress)
                 if (progress == MAX_BOOK_PRIORITY) {
                     bookDateInputGroup.showNow()
                     if (yearEditText.text.isEmpty() && monthEditText.text.isEmpty() && dayEditText.text.isEmpty()) {

+ 1 - 0
app/src/main/res/values-ru/strings.xml

@@ -24,6 +24,7 @@
     <string name="main.option.profile">Мой профиль</string>
     <string name="main.option.about">О приложении</string>
     <string name="main.option.dark">Тёмная тема</string>
+    <string name="main.option.clear">Очистить кэш</string>
 
     <!-- about -->
     <string name="about.text.idea">API:\nhttp://knigopis.com</string>

+ 1 - 0
app/src/main/res/values/no-translate.xml

@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
     <string name="note_date_delimiter" translatable="false">/</string>
+    <string name="book_progress" translatable="false">%d%%</string>
 </resources>