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