Migrate to CompoundButton

Switch and SwitchCompat are both CompoundButton.

Using CompoundButton in Java will helps migration in the future.

Bug: 306658427
Test: manual - on affected pages
Change-Id: I7cdc2601879a85d33f77239e38263320d5a6984e
This commit is contained in:
Chaohui Wang
2023-10-25 14:57:16 +08:00
parent 12ea5afdf1
commit c4a3a50d58
9 changed files with 24 additions and 36 deletions

View File

@@ -32,8 +32,8 @@ import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.Switch;
import android.widget.TextView;
import androidx.annotation.VisibleForTesting;
@@ -342,8 +342,8 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
TextView pairingViewCaption = (TextView) view.findViewById(R.id.pairing_caption);
TextView pairingViewContent = (TextView) view.findViewById(R.id.pairing_subhead);
TextView messagePairing = (TextView) view.findViewById(R.id.pairing_code_message);
Switch contactSharing = (Switch) view.findViewById(
R.id.phonebook_sharing_message_confirm_pin);
CompoundButton contactSharing =
view.findViewById(R.id.phonebook_sharing_message_confirm_pin);
view.findViewById(R.id.phonebook_sharing).setVisibility(
mPairingController.isContactSharingVisible() ? View.VISIBLE : View.GONE);
mPairingController.setContactSharingState();