File tree Expand file tree Collapse file tree 6 files changed +20
-0
lines changed
java/com/addev/listaspam/adapter Expand file tree Collapse file tree 6 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,11 @@ class CallLogAdapter(
199199 true
200200 }
201201
202+ R .id.add_to_contacts_action -> {
203+ addToContacts(number)
204+ true
205+ }
206+
202207 R .id.whitelist_action -> {
203208 if (isWhitelisted) {
204209 removeWhitelistNumber(context, number)
@@ -309,6 +314,14 @@ class CallLogAdapter(
309314 context.startActivity(intent)
310315 }
311316
317+ private fun addToContacts (number : String ) {
318+ val intent = Intent (Intent .ACTION_INSERT ).apply {
319+ type = ContactsContract .Contacts .CONTENT_TYPE
320+ putExtra(ContactsContract .Intents .Insert .PHONE , number)
321+ }
322+ context.startActivity(intent)
323+ }
324+
312325 private fun searchAction (number : String ) {
313326 val url = String .format(GOOGLE_URL_TEMPLATE , number)
314327 val intent = Intent (Intent .ACTION_VIEW , Uri .parse(url))
Original file line number Diff line number Diff line change 1515 <item
1616 android : id =" @+id/open_in_whatsapp_action"
1717 android : title =" @string/open_in_whatsapp" />
18+ <item
19+ android : id =" @+id/add_to_contacts_action"
20+ android : title =" @string/add_to_contacts" />
1821 <item
1922 android : id =" @+id/block_action"
2023 android : title =" @string/block" />
Original file line number Diff line number Diff line change 100100 <string name =" open_in_unknown_phone_com" >Abrir en UnknownPhone</string >
101101 <string name =" search_in_google" >Buscar en Google</string >
102102 <string name =" open_in_whatsapp" >Abrir en WhatsApp</string >
103+ <string name =" add_to_contacts" >Añadir a contactos</string >
103104 <string name =" block" >Bloquear</string >
104105 <string name =" add_to_whitelist" >Añadir a lista blanca</string >
105106 <string name =" unblock" >Desbloquear</string >
Original file line number Diff line number Diff line change 9393 <string name =" open_in_unknown_phone_com" >Apri in UnknownPhone</string >
9494 <string name =" search_in_google" >Cerca su Google</string >
9595 <string name =" open_in_whatsapp" >Apri in WhatsApp</string >
96+ <string name =" add_to_contacts" >Aggiungi ai contatti</string >
9697 <string name =" block" >Blocca</string >
9798 <string name =" add_to_whitelist" >Aggiungi alla lista bianca</string >
9899 <string name =" unblock" >Sblocca</string >
Original file line number Diff line number Diff line change 8686 <string name =" open_in_unknown_phone_com" >Abrir no UnknownPhone</string >
8787 <string name =" search_in_google" >Pesquisar no Google</string >
8888 <string name =" open_in_whatsapp" >Abrir no WhatsApp</string >
89+ <string name =" add_to_contacts" >Adicionar a contatos</string >
8990 <string name =" block" >Bloquear</string >
9091 <string name =" add_to_whitelist" >Adicionar à lista branca</string >
9192 <string name =" unblock" >Desbloquear</string >
Original file line number Diff line number Diff line change 100100 <string name =" open_in_unknown_phone_com" >Open in UnknownPhone</string >
101101 <string name =" search_in_google" >Search in Google</string >
102102 <string name =" open_in_whatsapp" >Open in WhatsApp</string >
103+ <string name =" add_to_contacts" >Add to contacts</string >
103104 <string name =" block" >Block</string >
104105 <string name =" add_to_whitelist" >Add to whitelist</string >
105106 <string name =" unblock" >Unblock</string >
You can’t perform that action at this time.
0 commit comments