Loading java/com/android/dialer/speeddial/DisambigDialog.java +29 −3 Original line number Diff line number Diff line Loading @@ -25,12 +25,14 @@ import android.support.annotation.WorkerThread; import android.support.v4.app.DialogFragment; import android.support.v4.app.FragmentManager; import android.support.v7.app.AlertDialog; import android.text.TextUtils; import android.util.ArraySet; import android.view.LayoutInflater; import android.view.View; import android.widget.CheckBox; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.LinearLayout.LayoutParams; import android.widget.TextView; import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.callintent.CallIntentBuilder; Loading Loading @@ -84,6 +86,16 @@ public class DisambigDialog extends DialogFragment { return new AlertDialog.Builder(getActivity()).setView(view).create(); } @Override public void onResume() { super.onResume(); getDialog() .getWindow() .setLayout( getContext().getResources().getDimensionPixelSize(R.dimen.disambig_dialog_width), LayoutParams.WRAP_CONTENT); } @Override public void onPause() { super.onPause(); Loading @@ -105,19 +117,33 @@ public class DisambigDialog extends DialogFragment { for (Channel channel : channels) { // TODO(calderwoodra): use fuzzy number matcher if (phoneNumbers.add(channel.number())) { if (phoneNumbers.size() != 1) { insertDivider(container); } insertHeader(container, channel.number(), channel.label()); } insertOption(container, channel); } } private void insertHeader(LinearLayout container, String number, String phoneType) { private void insertDivider(LinearLayout container) { View view = getActivity() .getLayoutInflater() .inflate(R.layout.disambig_dialog_divider, container, false); container.addView(view); } private void insertHeader(LinearLayout container, String number, String label) { View view = getActivity() .getLayoutInflater() .inflate(R.layout.disambig_option_header_layout, container, false); ((TextView) view.findViewById(R.id.disambig_header_phone_type)).setText(phoneType); ((TextView) view.findViewById(R.id.disambig_header_phone_number)).setText(number); String secondaryInfo = TextUtils.isEmpty(label) ? number : getContext().getString(R.string.call_subject_type_and_number, label, number); ((TextView) view.findViewById(R.id.disambig_header_phone_label)).setText(secondaryInfo); container.addView(view); } Loading java/com/android/dialer/speeddial/res/layout/disambig_dialog_divider.xml 0 → 100644 +23 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2018 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License --> <View xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="1dp" android:layout_marginTop="8dp" android:layout_marginBottom="8dp" android:background="#12000000"/> No newline at end of file java/com/android/dialer/speeddial/res/layout/disambig_dialog_layout.xml +7 −5 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:minHeight="64dp" android:minHeight="56dp" android:paddingStart="24dp" android:paddingEnd="24dp" android:elevation="1dp" Loading @@ -40,7 +40,8 @@ android:id="@+id/disambig_scrollview" android:layout_width="match_parent" android:layout_height="wrap_content" app:maxHeight="240dp"> android:minHeight="168dp" app:maxHeight="256dp"> <LinearLayout android:id="@+id/communication_avenue_container" Loading @@ -54,8 +55,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:minHeight="56dp" android:padding="12dp" android:minHeight="64dp" android:elevation="4dp" android:background="@android:color/white"> Loading @@ -63,6 +63,8 @@ android:id="@+id/remember_this_choice_checkbox" android:layout_width="match_parent" android:layout_height="48dp" android:text="@string/speed_dial_remember_this_choice"/> android:textSize="14sp" android:text="@string/speed_dial_remember_this_choice" style="@style/DialerCheckboxStyle"/> </FrameLayout> </LinearLayout> No newline at end of file java/com/android/dialer/speeddial/res/layout/disambig_option_header_layout.xml +7 −19 Original line number Diff line number Diff line Loading @@ -14,27 +14,15 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> <LinearLayout <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/disambig_header_container" android:orientation="vertical" android:id="@+id/disambig_header_phone_label" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="8dp" android:minHeight="56dp" android:gravity="center_vertical" android:minHeight="48dp" android:paddingStart="24dp" android:paddingEnd="24dp"> <TextView android:id="@+id/disambig_header_phone_type" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingEnd="24dp" android:textSize="14sp" android:textColor="#757575" style="@style/PrimaryText"/> <TextView android:id="@+id/disambig_header_phone_number" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/SecondaryText"/> </LinearLayout> java/com/android/dialer/speeddial/res/layout/disambig_option_layout.xml +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ android:id="@+id/disambig_option_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="12dp" android:layout_marginStart="16dp" android:layout_gravity="center_vertical" style="@style/PrimaryText"/> </LinearLayout> No newline at end of file Loading
java/com/android/dialer/speeddial/DisambigDialog.java +29 −3 Original line number Diff line number Diff line Loading @@ -25,12 +25,14 @@ import android.support.annotation.WorkerThread; import android.support.v4.app.DialogFragment; import android.support.v4.app.FragmentManager; import android.support.v7.app.AlertDialog; import android.text.TextUtils; import android.util.ArraySet; import android.view.LayoutInflater; import android.view.View; import android.widget.CheckBox; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.LinearLayout.LayoutParams; import android.widget.TextView; import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.callintent.CallIntentBuilder; Loading Loading @@ -84,6 +86,16 @@ public class DisambigDialog extends DialogFragment { return new AlertDialog.Builder(getActivity()).setView(view).create(); } @Override public void onResume() { super.onResume(); getDialog() .getWindow() .setLayout( getContext().getResources().getDimensionPixelSize(R.dimen.disambig_dialog_width), LayoutParams.WRAP_CONTENT); } @Override public void onPause() { super.onPause(); Loading @@ -105,19 +117,33 @@ public class DisambigDialog extends DialogFragment { for (Channel channel : channels) { // TODO(calderwoodra): use fuzzy number matcher if (phoneNumbers.add(channel.number())) { if (phoneNumbers.size() != 1) { insertDivider(container); } insertHeader(container, channel.number(), channel.label()); } insertOption(container, channel); } } private void insertHeader(LinearLayout container, String number, String phoneType) { private void insertDivider(LinearLayout container) { View view = getActivity() .getLayoutInflater() .inflate(R.layout.disambig_dialog_divider, container, false); container.addView(view); } private void insertHeader(LinearLayout container, String number, String label) { View view = getActivity() .getLayoutInflater() .inflate(R.layout.disambig_option_header_layout, container, false); ((TextView) view.findViewById(R.id.disambig_header_phone_type)).setText(phoneType); ((TextView) view.findViewById(R.id.disambig_header_phone_number)).setText(number); String secondaryInfo = TextUtils.isEmpty(label) ? number : getContext().getString(R.string.call_subject_type_and_number, label, number); ((TextView) view.findViewById(R.id.disambig_header_phone_label)).setText(secondaryInfo); container.addView(view); } Loading
java/com/android/dialer/speeddial/res/layout/disambig_dialog_divider.xml 0 → 100644 +23 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2018 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License --> <View xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="1dp" android:layout_marginTop="8dp" android:layout_marginBottom="8dp" android:background="#12000000"/> No newline at end of file
java/com/android/dialer/speeddial/res/layout/disambig_dialog_layout.xml +7 −5 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:minHeight="64dp" android:minHeight="56dp" android:paddingStart="24dp" android:paddingEnd="24dp" android:elevation="1dp" Loading @@ -40,7 +40,8 @@ android:id="@+id/disambig_scrollview" android:layout_width="match_parent" android:layout_height="wrap_content" app:maxHeight="240dp"> android:minHeight="168dp" app:maxHeight="256dp"> <LinearLayout android:id="@+id/communication_avenue_container" Loading @@ -54,8 +55,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:minHeight="56dp" android:padding="12dp" android:minHeight="64dp" android:elevation="4dp" android:background="@android:color/white"> Loading @@ -63,6 +63,8 @@ android:id="@+id/remember_this_choice_checkbox" android:layout_width="match_parent" android:layout_height="48dp" android:text="@string/speed_dial_remember_this_choice"/> android:textSize="14sp" android:text="@string/speed_dial_remember_this_choice" style="@style/DialerCheckboxStyle"/> </FrameLayout> </LinearLayout> No newline at end of file
java/com/android/dialer/speeddial/res/layout/disambig_option_header_layout.xml +7 −19 Original line number Diff line number Diff line Loading @@ -14,27 +14,15 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> <LinearLayout <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/disambig_header_container" android:orientation="vertical" android:id="@+id/disambig_header_phone_label" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="8dp" android:minHeight="56dp" android:gravity="center_vertical" android:minHeight="48dp" android:paddingStart="24dp" android:paddingEnd="24dp"> <TextView android:id="@+id/disambig_header_phone_type" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingEnd="24dp" android:textSize="14sp" android:textColor="#757575" style="@style/PrimaryText"/> <TextView android:id="@+id/disambig_header_phone_number" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/SecondaryText"/> </LinearLayout>
java/com/android/dialer/speeddial/res/layout/disambig_option_layout.xml +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ android:id="@+id/disambig_option_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="12dp" android:layout_marginStart="16dp" android:layout_gravity="center_vertical" style="@style/PrimaryText"/> </LinearLayout> No newline at end of file