Commit 67266bac authored by Christophe Henry's avatar Christophe Henry

Fix lint warning

parent 58165e86
......@@ -22,6 +22,11 @@ android {
}
}
}
lintOptions {
disable "AllowBackup", "VectorPath"
}
sourceSets {
androidTest.assets.srcDirs += files(schema_location)
}
......@@ -65,7 +70,7 @@ dependencies {
def test_runnner_version = "1.1.1"
def promise_version = "3.3.0"
def android_support_version = "28.0.0"
def android_navigation = "1.0.0-rc02"
def android_navigation = "1.0.0"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation fileTree(include: ["*.jar"], dir: "libs")
......@@ -83,7 +88,7 @@ dependencies {
implementation "com.android.support:support-core-ui:$android_support_version"
// AndroidX layout
implementation "androidx.appcompat:appcompat:1.1.0-alpha03"
implementation "androidx.appcompat:appcompat:1.1.0-alpha04"
implementation "androidx.core:core-ktx:1.1.0-alpha05"
implementation "com.google.android.material:material:1.1.0-alpha05"
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
......
......@@ -26,9 +26,7 @@ class MainActivity: AppCompatActivity() {
restoreState()
setContentView(R.layout.activity_main)
setupActionBarWithNavController(navigation, appBarConfiguration)
FreshRSSApplication.application.refresherService.value.whenNotNull {
it.refresh()
}
FreshRSSApplication.application.refresherService.value.whenNotNull {it.refresh()}
}
override fun onResume() {
......
......@@ -52,8 +52,6 @@ class StartActivity: AppCompatActivity() {
FreshRSSApplication.getStringR(R.string.hello_user, userName)
else -> FreshRSSApplication.getStringR(R.string.good_evening_user, userName)
}
}
override fun onResume() {
......
......@@ -112,9 +112,11 @@ class MainSubscriptionFragment: Fragment(), BottomNavigationView.OnNavigationIte
val arguments = MainNavDirections
.actionGlobalSubscriptionsFragment(VoidCategory, subscriptionSection)
.arguments
return childFragmentManager
.fragmentFactory
.instantiate(activity!!.classLoader, SubscriptionsFragment::class.qualifiedName!!, arguments)
.instantiate(activity!!.classLoader, SubscriptionsFragment::class.qualifiedName!!)
.apply {setArguments(arguments)}
}
}
}
......@@ -2,36 +2,31 @@ package fr.chenry.android.freshrss.utils
import android.app.ActionBar.LayoutParams
import android.content.Context
import android.content.res.Resources.Theme
import android.util.AttributeSet
import android.view.*
import android.widget.ImageView
import org.w3c.dom.Attr
import androidx.appcompat.widget.AppCompatImageView
import kotlin.math.max
class SquaredImageView(context: Context, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int):
ImageView(context, attrs, defStyleAttr, defStyleRes)
{
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int): this(context, attrs, defStyleAttr, 0)
constructor(context: Context, attrs: AttributeSet?): this(context, attrs, 0, 0)
constructor(context: Context): this(context, null, 0, 0)
class SquaredImageView(context: Context, attrs: AttributeSet?, defStyleAttr: Int):
AppCompatImageView(context, attrs, defStyleAttr) {
constructor(context: Context, attrs: AttributeSet?): this(context, attrs, 0)
constructor(context: Context): this(context, null, 0)
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec)
val widthSpecMode = View.MeasureSpec.getMode(widthMeasureSpec)
val heightSpecMode = View.MeasureSpec.getMode(heightMeasureSpec)
val widthSpecMode = MeasureSpec.getMode(widthMeasureSpec)
val heightSpecMode = MeasureSpec.getMode(heightMeasureSpec)
if(widthSpecMode == View.MeasureSpec.EXACTLY) return setMeasuredDimension(measuredWidth, measuredWidth)
if(heightSpecMode == View.MeasureSpec.EXACTLY) return setMeasuredDimension(measuredHeight, measuredHeight)
if(widthSpecMode == MeasureSpec.EXACTLY) return setMeasuredDimension(measuredWidth, measuredWidth)
if(heightSpecMode == MeasureSpec.EXACTLY) return setMeasuredDimension(measuredHeight, measuredHeight)
if(layoutParams.height == LayoutParams.MATCH_PARENT && layoutParams.width == LayoutParams.MATCH_PARENT)
return max(measuredWidth, maxWidth).let{setMeasuredDimension(it, it)}
return max(measuredWidth, maxWidth).let {setMeasuredDimension(it, it)}
if(layoutParams.height == LayoutParams.MATCH_PARENT) return setMeasuredDimension(measuredHeight, measuredHeight)
if(layoutParams.width == LayoutParams.MATCH_PARENT) return setMeasuredDimension(measuredWidth, measuredWidth)
return max(measuredWidth, maxWidth).let{setMeasuredDimension(it, it)}
return max(measuredWidth, maxWidth).let {setMeasuredDimension(it, it)}
}
}
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M1,21h4L5,9L1,9v12zM23,10c0,-1.1 -0.9,-2 -2,-2h-6.31l0.95,-4.57 0.03,-0.32c0,-0.41 -0.17,-0.79 -0.44,-1.06L14.17,1 7.59,7.59C7.22,7.95 7,8.45 7,9v10c0,1.1 0.9,2 2,2h9c0.83,0 1.54,-0.5 1.84,-1.22l3.02,-7.05c0.09,-0.23 0.14,-0.47 0.14,-0.73v-1.91l-0.01,-0.01L23,10z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
......@@ -39,7 +39,7 @@
<com.google.android.material.textfield.TextInputLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="100" >
android:layout_weight="100">
<EditText
android:id="@+id/instance"
android:layout_width="match_parent"
......@@ -48,26 +48,22 @@
android:maxLines="1"
android:singleLine="true"
android:inputType="textUri"
android:autoLink="web|none" />
android:autoLink="web|none"
android:autofillHints="url"
tools:ignore="UnusedAttribute" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
<LinearLayout
<TextView
android:id="@+id/reified_instance_url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingTop="@dimen/subscription_section_h_padding"
android:paddingBottom="@dimen/subscription_section_h_padding"
android:orientation="horizontal"
>
<TextView
android:id="@+id/reified_instance_url"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/instance_exemple"
/>
</LinearLayout>
android:text="@string/instance_exemple"
/>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
......@@ -80,14 +76,15 @@
android:hint="@string/prompt_login"
android:maxLines="1"
android:singleLine="true"
android:inputType="text" />
android:inputType="text"
android:autofillHints="username"
tools:ignore="UnusedAttribute" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
......@@ -98,7 +95,9 @@
android:imeOptions="actionUnspecified"
android:inputType="textPassword"
android:maxLines="1"
android:singleLine="true" />
android:singleLine="true"
android:autofillHints="password"
tools:ignore="UnusedAttribute" />
</com.google.android.material.textfield.TextInputLayout>
......@@ -110,7 +109,6 @@
android:layout_marginTop="16dp"
android:text="@string/action_sign_in"
android:textStyle="bold" />
</LinearLayout>
</ScrollView>
......
......@@ -7,8 +7,7 @@
android:orientation="vertical"
android:layout_gravity="center"
android:gravity="center"
tools:context=".activities.StartActivity"
android:background="@color/logo_obsidian">
tools:context=".activities.StartActivity">
<TextView
android:id="@+id/activity_start_welcome_text"
android:layout_width="match_parent"
......
......@@ -5,10 +5,4 @@
android:id="@+id/fast_scroller"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_alignTop="@+id/subcription_pull_to_refresh"
android:layout_alignBottom="@+id/subcription_pull_to_refresh"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
tools:visibility="visible"
tools:ignore="RtlHardcoded" />
\ No newline at end of file
tools:visibility="visible" />
\ No newline at end of file
......@@ -14,4 +14,4 @@
android:paddingBottom="@dimen/subscription_section_v_padding"
android:paddingStart="@dimen/subscription_section_h_padding"
android:paddingEnd="@dimen/subscription_section_h_padding"
tools:ignore="HardcodedText" />
\ No newline at end of file
tools:ignore="HardcodedText,Overdraw" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_gravity="center"
android:gravity="center">
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<TextView
android:id="@+id/menu_counter_badge_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base colors -->
<color name="color_primary">#00574B</color>
<color name="color_accent">#008577</color>
<color name="black">#000</color>
<color name="grey">#666666</color>
<color name="error">#A00</color>
<color name="light_grey">#9E9E9E</color>
......@@ -11,8 +10,8 @@
<color name="logo_grey">#c5c6ca</color>
<!-- Overrides -->
<color name="fast_scroller_bar">@color/grey</color>
<color name="fast_scroller_handle_idle">@color/color_accent</color>
<color name="fast_scroller_bar" tools:ignore="UnusedResources">@color/grey</color>
<color name="fast_scroller_handle_idle" tools:ignore="UnusedResources">@color/color_accent</color>
<color name="color_primary_dark">@color/color_primary</color>
<color name="alert_inactive">@color/grey</color>
<color name="alert">@color/error</color>
......
......@@ -6,11 +6,8 @@
<dimen name="icon_size">20dp</dimen>
<dimen name="subscription_section_v_padding">4dp</dimen>
<dimen name="subscription_section_h_padding">8dp</dimen>
<dimen name="hline_weight">2dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="badge_inactive_text_size">12sp</dimen>
<dimen name="badge_active_text_size">14sp</dimen>
<dimen name="small_text_size">10sp</dimen>
<dimen name="badge_height">@dimen/badge_active_text_size</dimen>
<dimen name="badge_width">22sp</dimen>
<dimen name="badge_radius">@dimen/badge_width</dimen>
......
......@@ -12,10 +12,7 @@
<string name="error_field_required">This field is required</string>
<string name="prompt_instance">Your FreshRSS instance</string>
<string name="error_instance">This url is not correct</string>
<string name="protocol_default">https://</string>
<string name="instance_exemple">your-instance.com</string>
<string name="api_endpoint">/api/greader</string>
<string name="full_instance_exemple">@string/protocol_default</string>
<string name="login_progress_text">Login to instance %s</string>
<!-- Subscriptions activity menu-->
......@@ -33,20 +30,13 @@
<!-- Strings related to subscriptions -->
<string name="subscription_title_label">Title</string>
<string name="subscription_unread_count_label">0</string>
<string name="subscription_url">www.example.com</string>
<string name="please_wait">Please wait…</string>
<string name="rss_icon">RSS icon</string>
<string name="back">Back</string>
<string name="share">Share</string>
<string name="title">Title</string>
<string name="next">Next</string>
<string name="error_invalid_password">This password is too short</string>
<string name="original_page">Open</string>
<string name="refresh">Refresh</string>
<string name="mark_read">Mark read</string>
<string name="mark_unread">Mark unread</string>
<string name="cannot_make_post_requests">You are not authorized to %s for now</string>
<string name="mark_read_status_authorization">mark this article as %s</string>
<string name="read">read</string>
<string name="unread">unread</string>
......@@ -70,11 +60,9 @@
<string name="human_time_grouping_this_year">This year</string>
<string name="human_time_grouping_old_articles">Old articles</string>
<string name="title_activity_start">StartActivity</string>
<string name="hello_user">Hello%s</string>
<string name="good_morning_user">Good morning%s</string>
<string name="good_evening_user">Good evening%s</string>
<string name="splash_screen">Splash screen</string>
<string name="subscription_categories">Categories</string>
<string name="share_article">Share article of %s</string>
<string name="this_feed">this feed</string>
......
......@@ -10,9 +10,8 @@
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:backgroundTint">@color/logo_obsidian</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="AppTheme.ExtendedFloatingActionButton" parent="Widget.MaterialComponents.ExtendedFloatingActionButton">
<item name="backgroundTint">@color/color_primary</item>
<item name="android:textColor">@color/design_default_color_on_primary</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment