show a WhatsApp logo at WhatsApp sources
This commit is contained in:
parent
0ddfbeb38b
commit
7fe3a96f6a
|
@ -534,6 +534,14 @@ class ViewContactActivity : ContactActivity() {
|
|||
contact_source.setOnClickListener {
|
||||
launchEditContact(key)
|
||||
}
|
||||
|
||||
if (value.toLowerCase() == WHATSAPP) {
|
||||
contact_source_image.setImageResource(R.drawable.ic_logo_whatsapp)
|
||||
contact_source_image.beVisible()
|
||||
contact_source_image.setOnClickListener {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -107,6 +107,8 @@ const val TELEGRAM_PACKAGE = "org.telegram.messenger"
|
|||
const val SIGNAL_PACKAGE = "org.thoughtcrime.securesms"
|
||||
const val WHATSAPP_PACKAGE = "com.whatsapp"
|
||||
|
||||
const val WHATSAPP = "whatsapp"
|
||||
|
||||
fun getEmptyLocalContact() = LocalContact(0, "", "", "", "", "", "", null, "", ArrayList(), ArrayList(), ArrayList(), 0, ArrayList(), "", ArrayList(), "", "", ArrayList(), ArrayList())
|
||||
|
||||
fun getProperText(text: String, shouldNormalize: Boolean) = if (shouldNormalize) text.normalizeString() else text
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="96dp"
|
||||
android:height="96dp"
|
||||
android:viewportWidth="96"
|
||||
android:viewportHeight="96">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="m61.6549,53.1352c0.0275,0.2478 0.0551,0.4681 0.0551,0.6746 0,2.1064 -0.9637,3.6621 -2.9049,4.6671 -1.2391,0.6195 -2.4093,0.9362 -3.4831,0.9362l-0.6195,0c-1.9412,-0.3166 -4.199,-1.0876 -6.801,-2.3404 -3.3868,-1.5832 -6.5395,-4.4055 -9.4444,-8.4531 -2.0789,-2.9737 -3.1114,-5.4518 -3.1114,-7.4206 0,-3.4556 1.1289,-5.5069 3.373,-6.1264 0.4819,-0.0688 0.9499,-0.1101 1.4043,-0.1101 0.4543,0 0.8536,0.0688 1.1978,0.2065 0.2753,0.1377 0.826,1.1289 1.6658,2.96 0.8673,2.1064 1.2941,3.2353 1.2941,3.373 0,0.5232 -0.3304,1.1289 -0.9912,1.8173l-1.1978,1.5557c0,0.413 0.592,1.4043 1.7622,2.96 1.4869,1.8999 3.0976,3.3179 4.8323,4.2541 1.5557,0.8673 2.602,1.2941 3.1114,1.2941l0.1101,0c0.2753,-0.0413 0.8398,-0.6058 1.7071,-1.7071 0.8673,-1.0738 1.4318,-1.6108 1.7071,-1.6108 0.3855,0 1.5144,0.4681 3.4281,1.4043 1.5557,0.7572 2.3404,1.1427 2.3404,1.1427 0,0 0.1927,0.179 0.5645,0.5232z" />
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="m74.899,45.219 l0,3.2629c-0.8949,9.2379 -5.1627,16.2041 -12.7623,20.9125 -3.8411,2.3542 -8.2053,3.6346 -13.0789,3.8411l-0.826,0c-4.1164,0 -8.3705,-1.1289 -12.7623,-3.373 -0.9362,0.3167 -3.3592,1.0876 -7.2691,2.3405 -3.015,0.9362 -5.4243,1.7347 -7.2691,2.3817 -0.0688,0 -0.1239,-0.0688 -0.1514,-0.2065l-0.2065,0.3167c0,-0.0688 1.4318,-4.2403 4.3092,-12.5145 0.179,-0.5232 0.2616,-1.0739 0.2616,-1.6659 0,-0.4819 -0.1101,-1.005 -0.3166,-1.5557 -2.0789,-4.1164 -3.1114,-8.2329 -3.1114,-12.3493 0.1101,-6.746 2.6296,-12.7898 7.572,-18.1178 4.2816,-4.5983 10.1052,-7.2691 17.4294,-7.9988l3.2215,0c6.9938,0.6195 12.6934,3.1665 17.1265,7.6271 4.557,4.5845 7.1728,10.2842 7.8336,17.099zM69.8602,53.1077c0.592,-2.3129 0.8811,-4.5294 0.8811,-6.6496 0,-5.0113 -1.8311,-9.6371 -5.5069,-13.8499 -4.3918,-5.3004 -10.0364,-7.9437 -16.92,-7.9437 -0.592,0 -1.1978,0.0137 -1.8173,0.0551 -4.0476,0.2478 -7.7648,1.5695 -11.1515,3.9925 -6.2641,4.5707 -9.3893,10.4769 -9.3893,17.746 0,0.8673 0.0551,1.7071 0.1514,2.547 0.3166,3.015 1.1978,5.8649 2.6433,8.5632 0.9637,1.5557 1.4731,2.3404 1.5006,2.3404l-0.826,2.0789c-1.2115,3.6621 -1.8724,5.6721 -1.9687,6.0163l8.5082,-2.6984c3.4556,2.0376 6.7184,3.2353 9.761,3.5795 0.7985,0.1101 1.597,0.1514 2.3817,0.1514 3.1802,0 6.1953,-0.6333 9.0313,-1.9137 6.4706,-2.8774 10.711,-7.5445 12.721,-14.0151z" />
|
||||
<path
|
||||
android:fillColor="#12AF0A"
|
||||
android:pathData="m90.3206,30.5045c2.2959,5.5494 3.45,11.3813 3.45,17.4955 0,6.1142 -1.1541,11.946 -3.45,17.4955 -2.2959,5.5494 -5.6231,10.5096 -9.9693,14.8558 -4.3462,4.3462 -9.3064,7.6734 -14.8558,9.9693 -5.5494,2.2959 -11.3813,3.45 -17.4955,3.45 -6.1142,0 -11.946,-1.1541 -17.4955,-3.45 -5.5494,-2.2959 -10.5096,-5.6231 -14.8558,-9.9693C11.3025,76.005 7.9753,71.0449 5.6794,65.4955 3.3712,59.946 2.2294,54.1142 2.2294,48c0,-6.1142 1.1541,-11.946 3.45,-17.4955 2.2959,-5.5494 5.6231,-10.5096 9.9693,-14.8558 4.3462,-4.3462 9.3064,-7.6734 14.8558,-9.9694 5.5494,-2.2959 11.3813,-3.45 17.4955,-3.45 6.1142,0 11.946,1.1541 17.4955,3.45 5.5494,2.2959 10.5096,5.6231 14.8558,9.9694 4.3462,4.3462 7.6734,9.3063 9.9693,14.8558zM75.094,48.413 L75.094,45.1364c-0.6608,-6.8148 -3.2766,-12.5007 -7.8336,-17.0714 -4.4331,-4.4606 -10.1327,-7.0076 -17.1265,-7.6271l-3.2215,0c-7.338,0.7297 -13.1478,3.3867 -17.4294,7.9988 -4.9425,5.3279 -7.4756,11.3718 -7.572,18.1178 0,4.1164 1.0325,8.2328 3.1114,12.3493 0.2065,0.5507 0.3166,1.0739 0.3166,1.5557 0,0.592 -0.0826,1.1427 -0.2616,1.6658 -2.8774,8.2742 -4.3092,12.4456 -4.3092,12.5145l0.2065,-0.3166c0.0275,0.1377 0.0826,0.2065 0.1514,0.2065 1.8311,-0.6608 4.2541,-1.4456 7.2691,-2.3817 3.9099,-1.2391 6.333,-2.0238 7.2691,-2.3405 4.3918,2.2441 8.6459,3.373 12.7623,3.373l0.826,0c4.8736,-0.2065 9.2379,-1.4869 13.0789,-3.8411 7.5995,-4.7084 11.8536,-11.6884 12.7623,-20.9263z" />
|
||||
<path
|
||||
android:fillColor="#12AF0A"
|
||||
android:pathData="m70.6564,46.3892c0,2.1064 -0.2891,4.3229 -0.8811,6.6496 -2.01,6.4706 -6.2504,11.1377 -12.721,14.0151 -2.8361,1.2804 -5.8511,1.9137 -9.0313,1.9137 -0.7985,0 -1.597,-0.0551 -2.3817,-0.1514 -3.0426,-0.3442 -6.2917,-1.5419 -9.761,-3.5795l-8.5082,2.6984c0.1101,-0.3442 0.7572,-2.3542 1.9687,-6.0163l0.826,-2.0789c-0.0413,0 -0.5369,-0.7847 -1.5006,-2.3404 -1.4593,-2.6984 -2.3404,-5.5482 -2.6433,-8.5632 -0.1101,-0.826 -0.1514,-1.6796 -0.1514,-2.547 0,-7.2691 3.1252,-13.1753 9.3893,-17.746 3.3868,-2.423 7.1039,-3.7585 11.1515,-3.9925 0.6195,-0.0413 1.2253,-0.0551 1.8173,-0.0551 6.8836,0 12.5282,2.6433 16.92,7.9437 3.6759,4.2128 5.5069,8.8386 5.5069,13.8499zM61.625,53.5482c0,-0.2065 -0.0138,-0.4268 -0.0551,-0.6746 -0.3855,-0.3442 -0.5645,-0.5232 -0.5645,-0.5232 0,0 -0.771,-0.3855 -2.3404,-1.1427 -1.8999,-0.9362 -3.0426,-1.4043 -3.4281,-1.4043 -0.2753,0 -0.8536,0.5369 -1.7071,1.6108 -0.8673,1.1014 -1.4318,1.6796 -1.7071,1.7071l-0.1101,0c-0.5232,0 -1.5557,-0.4268 -3.1114,-1.2941 -1.7347,-0.9362 -3.3455,-2.3542 -4.8323,-4.2541 -1.1702,-1.5557 -1.7622,-2.547 -1.7622,-2.96l1.1978,-1.5557c0.6608,-0.6884 0.9912,-1.2941 0.9912,-1.8173 0,-0.1377 -0.4268,-1.2666 -1.2941,-3.373 -0.826,-1.8311 -1.3767,-2.8223 -1.6658,-2.96 -0.3442,-0.1377 -0.7434,-0.2065 -1.1978,-0.2065 -0.4543,0 -0.9224,0.0414 -1.4043,0.1101 -2.2441,0.6195 -3.373,2.6708 -3.373,6.1264 0,1.9687 1.0325,4.4468 3.1114,7.4206 2.9049,4.0476 6.0576,6.8699 9.4444,8.4531 2.602,1.2528 4.8599,2.0238 6.801,2.3405l0.6195,0c1.0738,0 2.2303,-0.3167 3.4831,-0.9362 1.9412,-0.9912 2.9049,-2.5469 2.9049,-4.6671z" />
|
||||
</vector>
|
|
@ -1,16 +1,37 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.simplemobiletools.commons.views.MyTextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/contact_source"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/contact_source_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="@dimen/small_margin"
|
||||
android:paddingTop="@dimen/normal_margin"
|
||||
android:paddingEnd="@dimen/normal_margin"
|
||||
android:paddingBottom="@dimen/normal_margin"
|
||||
android:singleLine="true"
|
||||
android:textSize="@dimen/bigger_text_size" />
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/contact_source"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toStartOf="@+id/contact_source_image"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="@dimen/small_margin"
|
||||
android:paddingTop="@dimen/normal_margin"
|
||||
android:paddingEnd="@dimen/normal_margin"
|
||||
android:paddingBottom="@dimen/normal_margin"
|
||||
android:singleLine="true"
|
||||
android:textSize="@dimen/bigger_text_size" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_source_image"
|
||||
android:layout_width="@dimen/normal_icon_size"
|
||||
android:layout_height="@dimen/normal_icon_size"
|
||||
android:layout_alignTop="@+id/contact_source"
|
||||
android:layout_alignBottom="@+id/contact_source"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="@dimen/normal_margin"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:padding="@dimen/small_margin"
|
||||
tools:src="@drawable/ic_logo_whatsapp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
Loading…
Reference in New Issue