Skip to content

Commit

Permalink
Code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
rid-hrant committed Jan 18, 2021
1 parent 7840d6f commit c01653b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class WeaklyWeatherFragment : Fragment(), LocationListener {
AlertDialog.Builder(context)
.setTitle(R.string.no_location)
.setMessage(R.string.no_location_message)
.setPositiveButton(R.string.settings) { paramDialogInterface, paramInt ->
.setPositiveButton(R.string.settings) { _, _ ->
requireContext().startActivity(Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS))
}
.setNegativeButton(R.string.close, null)
Expand Down Expand Up @@ -155,10 +155,10 @@ class WeaklyWeatherFragment : Fragment(), LocationListener {
val builder = AlertDialog.Builder(context)
builder.setTitle(getString(R.string.no_internet_connection))
builder.setMessage(getString(R.string.no_internet_connection_message))
builder.setNegativeButton(getString(R.string.close)) { dialog, which ->
builder.setNegativeButton(getString(R.string.close)) { dialog, _ ->
dialog.dismiss()
}
builder.setPositiveButton(getString(R.string.settings)) { dialog, which ->
builder.setPositiveButton(getString(R.string.settings)) { dialog, _ ->
dialog.dismiss()
val intent = Intent(Settings.ACTION_WIRELESS_SETTINGS)
startActivity(intent)
Expand Down
16 changes: 8 additions & 8 deletions app/src/main/res/layout/item_weather_recycler_view.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">
<layout 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">

<data>

Expand All @@ -15,8 +16,7 @@
type="DecimalFormat" />
</data>

<androidx.cardview.widget.CardView xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="76dp"
android:layout_marginStart="16dp"
Expand Down Expand Up @@ -45,11 +45,11 @@
android:id="@+id/iconImageView"
android:layout_width="30dp"
android:layout_height="30dp"
android:contentDescription="@string/icon"
app:layout_constraintBottom_toBottomOf="@id/temperatureTextView"
app:layout_constraintEnd_toStartOf="@id/temperatureTextView"
app:layout_constraintStart_toEndOf="@id/dateTextView"
app:layout_constraintTop_toTopOf="@id/temperatureTextView"
android:contentDescription="@string/icon" />
app:layout_constraintTop_toTopOf="@id/temperatureTextView" />

<TextView
android:id="@+id/temperatureTextView"
Expand All @@ -76,8 +76,8 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/temperatureTextView"
app:layout_constraintTop_toTopOf="parent"
tools:text="rain and snow"
tools:ignore="RtlSymmetry" />
tools:ignore="RtlSymmetry"
tools:text="rain and snow" />

</androidx.constraintlayout.widget.ConstraintLayout>

Expand Down

0 comments on commit c01653b

Please sign in to comment.