mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-23 14:31:30 +01:00
NOP dummy action
This commit is contained in:
parent
51c0f31700
commit
e06e62c771
9 changed files with 40 additions and 42 deletions
|
@ -117,10 +117,8 @@ var vibrantColor = 0
|
||||||
|
|
||||||
/* REQUEST CODES */
|
/* REQUEST CODES */
|
||||||
|
|
||||||
const val REQUEST_PICK_IMAGE = 1
|
const val REQUEST_CHOOSE_APP = 1
|
||||||
const val REQUEST_CHOOSE_APP = 2
|
const val REQUEST_UNINSTALL = 2
|
||||||
const val REQUEST_UNINSTALL = 3
|
|
||||||
const val REQUEST_PERMISSION_STORAGE = 4
|
|
||||||
|
|
||||||
/* Animate */
|
/* Animate */
|
||||||
|
|
||||||
|
@ -174,6 +172,7 @@ fun launch(
|
||||||
"nextTrack" -> audioNextTrack(activity)
|
"nextTrack" -> audioNextTrack(activity)
|
||||||
"previousTrack" -> audioPreviousTrack(activity)
|
"previousTrack" -> audioPreviousTrack(activity)
|
||||||
"tutorial" -> openTutorial(activity)
|
"tutorial" -> openTutorial(activity)
|
||||||
|
"nop" -> {}
|
||||||
}
|
}
|
||||||
else launchApp(data, activity) // app
|
else launchApp(data, activity) // app
|
||||||
|
|
||||||
|
|
|
@ -78,23 +78,25 @@ class OtherRecyclerAdapter(val activity: Activity):
|
||||||
"launcher:volumeDown",
|
"launcher:volumeDown",
|
||||||
R.drawable.baseline_volume_down_24)
|
R.drawable.baseline_volume_down_24)
|
||||||
)
|
)
|
||||||
|
othersList.add(
|
||||||
if (Build.VERSION.SDK_INT >= 19) { // requires Android KitKat +
|
OtherInfo(
|
||||||
othersList.add(
|
activity.getString(R.string.list_other_track_next),
|
||||||
OtherInfo(
|
"launcher:nextTrack",
|
||||||
activity.getString(R.string.list_other_track_next),
|
R.drawable.baseline_skip_next_24
|
||||||
"launcher:nextTrack",
|
|
||||||
R.drawable.baseline_skip_next_24
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
othersList.add(
|
)
|
||||||
OtherInfo(
|
othersList.add(
|
||||||
activity.getString(R.string.list_other_track_previous),
|
OtherInfo(
|
||||||
"launcher:previousTrack",
|
activity.getString(R.string.list_other_track_previous),
|
||||||
R.drawable.baseline_skip_previous_24
|
"launcher:previousTrack",
|
||||||
)
|
R.drawable.baseline_skip_previous_24
|
||||||
)
|
)
|
||||||
}
|
)
|
||||||
|
othersList.add(
|
||||||
|
OtherInfo(activity.getString(R.string.list_other_nop),
|
||||||
|
"launcher:nop",
|
||||||
|
R.drawable.baseline_not_interested_24)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun returnChoiceIntent(forApp: String, value: String) {
|
private fun returnChoiceIntent(forApp: String, value: String) {
|
||||||
|
|
|
@ -59,7 +59,6 @@ class ActionsRecyclerAdapter(val activity: Activity):
|
||||||
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView),
|
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView),
|
||||||
View.OnClickListener {
|
View.OnClickListener {
|
||||||
var textView: TextView = itemView.findViewById(R.id.settings_actions_row_name)
|
var textView: TextView = itemView.findViewById(R.id.settings_actions_row_name)
|
||||||
var actionIcon: ImageView = itemView.findViewById(R.id.settings_actions_row_icon)
|
|
||||||
var img: ImageView = itemView.findViewById(R.id.settings_actions_row_icon_img)
|
var img: ImageView = itemView.findViewById(R.id.settings_actions_row_icon_img)
|
||||||
var chooseButton: Button = itemView.findViewById(R.id.settings_actions_row_button_choose)
|
var chooseButton: Button = itemView.findViewById(R.id.settings_actions_row_button_choose)
|
||||||
var removeAction: ImageView = itemView.findViewById(R.id.settings_actions_row_remove)
|
var removeAction: ImageView = itemView.findViewById(R.id.settings_actions_row_remove)
|
||||||
|
@ -84,7 +83,6 @@ class ActionsRecyclerAdapter(val activity: Activity):
|
||||||
|
|
||||||
loadSettings() // apply new settings to the app
|
loadSettings() // apply new settings to the app
|
||||||
|
|
||||||
viewHolder.actionIcon.visibility = View.INVISIBLE
|
|
||||||
viewHolder.img.visibility = View.INVISIBLE
|
viewHolder.img.visibility = View.INVISIBLE
|
||||||
viewHolder.removeAction.visibility = View.GONE
|
viewHolder.removeAction.visibility = View.GONE
|
||||||
viewHolder.chooseButton.visibility = View.VISIBLE
|
viewHolder.chooseButton.visibility = View.VISIBLE
|
||||||
|
@ -94,23 +92,25 @@ class ActionsRecyclerAdapter(val activity: Activity):
|
||||||
}
|
}
|
||||||
|
|
||||||
if (content.startsWith("launcher")) {
|
if (content.startsWith("launcher")) {
|
||||||
// Set fontAwesome icon
|
|
||||||
viewHolder.actionIcon.visibility = View.VISIBLE
|
viewHolder.img.visibility = View.VISIBLE
|
||||||
viewHolder.actionIcon.setOnClickListener{ chooseApp(actionName.toString()) }
|
viewHolder.img.setOnClickListener{ chooseApp(actionName.toString()) }
|
||||||
|
|
||||||
when (content.split(":")[1]) {
|
when (content.split(":")[1]) {
|
||||||
"settings" ->
|
"settings" ->
|
||||||
viewHolder.actionIcon.setImageResource(R.drawable.baseline_settings_24)
|
viewHolder.img.setImageResource(R.drawable.baseline_settings_24)
|
||||||
"choose" ->
|
"choose" ->
|
||||||
viewHolder.actionIcon.setImageResource(R.drawable.baseline_menu_24)
|
viewHolder.img.setImageResource(R.drawable.baseline_menu_24)
|
||||||
"volumeUp" ->
|
"volumeUp" ->
|
||||||
viewHolder.actionIcon.setImageResource(R.drawable.baseline_volume_up_24)
|
viewHolder.img.setImageResource(R.drawable.baseline_volume_up_24)
|
||||||
"volumeDown" ->
|
"volumeDown" ->
|
||||||
viewHolder.actionIcon.setImageResource(R.drawable.baseline_volume_down_24)
|
viewHolder.img.setImageResource(R.drawable.baseline_volume_down_24)
|
||||||
"nextTrack" ->
|
"nextTrack" ->
|
||||||
viewHolder.actionIcon.setImageResource(R.drawable.baseline_skip_next_24)
|
viewHolder.img.setImageResource(R.drawable.baseline_skip_next_24)
|
||||||
"previousTrack" ->
|
"previousTrack" ->
|
||||||
viewHolder.actionIcon.setImageResource(R.drawable.baseline_skip_previous_24)
|
viewHolder.img.setImageResource(R.drawable.baseline_skip_previous_24)
|
||||||
|
"nop" ->
|
||||||
|
viewHolder.img.setImageResource(R.drawable.baseline_not_interested_24)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Set image icon (by packageName)
|
// Set image icon (by packageName)
|
||||||
|
|
5
app/src/main/res/drawable/baseline_not_interested_24.xml
Normal file
5
app/src/main/res/drawable/baseline_not_interested_24.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
|
||||||
|
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.42,0 -8,-3.58 -8,-8 0,-1.85 0.63,-3.55 1.69,-4.9L16.9,18.31C15.55,19.37 13.85,20 12,20zM18.31,16.9L7.1,5.69C8.45,4.63 10.15,4 12,4c4.42,0 8,3.58 8,8 0,1.85 -0.63,3.55 -1.69,4.9z"/>
|
||||||
|
|
||||||
|
</vector>
|
|
@ -32,18 +32,6 @@
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/settings_actions_row_icon"
|
|
||||||
android:layout_width="@dimen/app_icon_side"
|
|
||||||
android:layout_height="@dimen/app_icon_side"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="30sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="@id/settings_actions_row_button_choose"
|
|
||||||
app:layout_constraintHorizontal_bias="0.2"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/settings_actions_row_button_choose"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/settings_actions_row_icon_img"
|
android:id="@+id/settings_actions_row_icon_img"
|
||||||
android:layout_width="@dimen/app_icon_side"
|
android:layout_width="@dimen/app_icon_side"
|
||||||
|
|
|
@ -133,6 +133,7 @@
|
||||||
<string name="list_other_volume_down">Musik: Leiser</string>
|
<string name="list_other_volume_down">Musik: Leiser</string>
|
||||||
<string name="list_other_track_next">Musik: Weiter</string>
|
<string name="list_other_track_next">Musik: Weiter</string>
|
||||||
<string name="list_other_track_previous">Musik: Zurück</string>
|
<string name="list_other_track_previous">Musik: Zurück</string>
|
||||||
|
<string name="list_other_nop">Nichts tun</string>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
-
|
-
|
||||||
|
|
|
@ -156,6 +156,7 @@
|
||||||
<string name="list_other_volume_down">Música: Bajar</string>
|
<string name="list_other_volume_down">Música: Bajar</string>
|
||||||
<string name="list_other_track_next">Música: Siguiente</string>
|
<string name="list_other_track_next">Música: Siguiente</string>
|
||||||
<string name="list_other_track_previous">Música: Anterior</string>
|
<string name="list_other_track_previous">Música: Anterior</string>
|
||||||
|
<string name="list_other_nop">Nada</string>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
-
|
-
|
||||||
|
|
|
@ -135,6 +135,7 @@
|
||||||
<string name="list_other_volume_down">Musique: plus calme</string>
|
<string name="list_other_volume_down">Musique: plus calme</string>
|
||||||
<string name="list_other_track_next">Musique: suivant</string>
|
<string name="list_other_track_next">Musique: suivant</string>
|
||||||
<string name="list_other_track_previous">Musique: dernier</string>
|
<string name="list_other_track_previous">Musique: dernier</string>
|
||||||
|
<string name="list_other_nop">Rien</string>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
-
|
-
|
||||||
|
|
|
@ -161,6 +161,7 @@
|
||||||
<string name="list_other_volume_down">Music: Quieter</string>
|
<string name="list_other_volume_down">Music: Quieter</string>
|
||||||
<string name="list_other_track_next">Music: Next</string>
|
<string name="list_other_track_next">Music: Next</string>
|
||||||
<string name="list_other_track_previous">Music: Previous</string>
|
<string name="list_other_track_previous">Music: Previous</string>
|
||||||
|
<string name="list_other_nop">Do nothing</string>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
-
|
-
|
||||||
|
|
Loading…
Add table
Reference in a new issue