Fix: Hide track-controls on pre-KitKat api

This commit is contained in:
Finn M Glas 2020-10-12 18:19:51 +02:00
parent f919535173
commit 108b1f4de9
No known key found for this signature in database
GPG key ID: 902A30146014DFBF

View file

@ -2,6 +2,7 @@ package com.finnmglas.launcher.list.other
import android.app.Activity
import android.content.Intent
import android.os.Build
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@ -74,14 +75,23 @@ class OtherRecyclerAdapter(val activity: Activity):
OtherInfo(activity.getString(R.string.list_other_volume_down),
"launcher:volumeDown",
activity.getString(R.string.fas_minus)))
othersList.add(
OtherInfo(activity.getString(R.string.list_other_track_next),
"launcher:nextTrack",
activity.getString(R.string.fas_forward)))
othersList.add(
OtherInfo(activity.getString(R.string.list_other_track_previous),
"launcher:previousTrack",
activity.getString(R.string.fas_back)))
if (Build.VERSION.SDK_INT >= 19) { // requires Android KitKat +
othersList.add(
OtherInfo(
activity.getString(R.string.list_other_track_next),
"launcher:nextTrack",
activity.getString(R.string.fas_forward)
)
)
othersList.add(
OtherInfo(
activity.getString(R.string.list_other_track_previous),
"launcher:previousTrack",
activity.getString(R.string.fas_back)
)
)
}
}
private fun returnChoiceIntent(forAction: String, value: String) {