Skip to content

Commit

Permalink
fix: Reference drawable directly for ViewPager2
Browse files Browse the repository at this point in the history
* Also bump AppCompat version

Closes #463
  • Loading branch information
barbeau committed Dec 24, 2020
1 parent e58ee3a commit 1f868b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion GPSTest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ android {
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ import android.app.Dialog
import android.net.Uri
import android.os.Bundle
import androidx.appcompat.app.AlertDialog
import androidx.core.content.ContextCompat
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import androidx.viewpager2.widget.ViewPager2
import com.android.gpstest.Application
import com.android.gpstest.R
import com.android.gpstest.dialog.ShareLogFragment.Listener
import com.google.android.material.tabs.TabLayout
Expand Down Expand Up @@ -59,15 +57,15 @@ class ShareDialogFragment : DialogFragment() {
when (position) {
0 -> {
tab.text = getString(R.string.location)
tab.icon = ContextCompat.getDrawable(Application.get(), R.drawable.ic_baseline_location_on_24)
tab.setIcon(R.drawable.ic_baseline_location_on_24)
}
1 -> {
tab.text = getString(R.string.log)
tab.icon = ContextCompat.getDrawable(Application.get(), R.drawable.ic_baseline_list_alt_24)
tab.setIcon(R.drawable.ic_baseline_list_alt_24)
}
2 -> {
tab.text = getString(R.string.device)
tab.icon = ContextCompat.getDrawable(Application.get(), R.drawable.ic_baseline_perm_device_information_24)
tab.setIcon(R.drawable.ic_baseline_perm_device_information_24)
}
}
}.attach()
Expand Down

0 comments on commit 1f868b8

Please sign in to comment.