diff options
author | calderwoodra <calderwoodra@google.com> | 2018-01-09 10:38:37 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-01-09 11:27:25 -0800 |
commit | c07d6bee10c8d50c41d1513e6b8c8e9f85d3107e (patch) | |
tree | 771ed64a8ebe0d1427c92fd42a4341c2fe46292c | |
parent | 8c19b0ac8f79eb7f653ee3e07018ca7342f4e190 (diff) |
Implemented Bottom Nav in Dialer NUI.
Bug: 64655802
Test: existing
PiperOrigin-RevId: 181339724
Change-Id: I05c48d0a046010baf6b6593de3b934fdaf3e9f08
14 files changed, 514 insertions, 69 deletions
diff --git a/assets/quantum/res/drawable/quantum_ic_people_vd_theme_24.xml b/assets/quantum/res/drawable/quantum_ic_people_vd_theme_24.xml new file mode 100644 index 000000000..c31e20dce --- /dev/null +++ b/assets/quantum/res/drawable/quantum_ic_people_vd_theme_24.xml @@ -0,0 +1,25 @@ +<!-- + ~ 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 + --> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?attr/colorControlNormal"> + <path + android:fillColor="@android:color/white" + android:pathData="M16,11c1.66,0 2.99,-1.34 2.99,-3S17.66,5 16,5c-1.66,0 -3,1.34 -3,3s1.34,3 3,3zM8,11c1.66,0 2.99,-1.34 2.99,-3S9.66,5 8,5C6.34,5 5,6.34 5,8s1.34,3 3,3zM8,13c-2.33,0 -7,1.17 -7,3.5L1,19h14v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5zM16,13c-0.29,0 -0.62,0.02 -0.97,0.05 1.16,0.84 1.97,1.97 1.97,3.45L17,19h6v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5z"/> +</vector>
\ No newline at end of file diff --git a/assets/quantum/res/drawable/quantum_ic_star_vd_theme_24.xml b/assets/quantum/res/drawable/quantum_ic_star_vd_theme_24.xml new file mode 100644 index 000000000..d937d291e --- /dev/null +++ b/assets/quantum/res/drawable/quantum_ic_star_vd_theme_24.xml @@ -0,0 +1,25 @@ +<!-- + ~ 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 + --> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?attr/colorControlNormal"> + <path + android:fillColor="@android:color/white" + android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/> +</vector> diff --git a/java/com/android/dialer/main/impl/BottomNavBar.java b/java/com/android/dialer/main/impl/BottomNavBar.java new file mode 100644 index 000000000..9aaa988e8 --- /dev/null +++ b/java/com/android/dialer/main/impl/BottomNavBar.java @@ -0,0 +1,136 @@ +/* + * 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 + */ + +package com.android.dialer.main.impl; + +import android.content.Context; +import android.support.annotation.IntDef; +import android.support.annotation.Nullable; +import android.util.AttributeSet; +import android.view.View; +import android.widget.LinearLayout; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** Dialer Bottom Nav Bar for {@link MainActivity}. */ +final class BottomNavBar extends LinearLayout { + + /** Index for each tab in the bottom nav. */ + @Retention(RetentionPolicy.SOURCE) + @IntDef({ + TabIndex.SPEED_DIAL, + TabIndex.HISTORY, + TabIndex.CONTACTS, + TabIndex.VOICEMAIL, + }) + public @interface TabIndex { + int SPEED_DIAL = 0; + int HISTORY = 1; + int CONTACTS = 2; + int VOICEMAIL = 3; + } + + private BottomNavItem speedDial; + private BottomNavItem callLog; + private BottomNavItem contacts; + private BottomNavItem voicemail; + private OnBottomNavTabSelectedListener listener; + + public BottomNavBar(Context context, @Nullable AttributeSet attrs) { + super(context, attrs); + } + + @Override + protected void onFinishInflate() { + super.onFinishInflate(); + speedDial = findViewById(R.id.speed_dial_tab); + callLog = findViewById(R.id.call_log_tab); + contacts = findViewById(R.id.contacts_tab); + voicemail = findViewById(R.id.voicemail_tab); + + speedDial.setup(R.string.tab_title_speed_dial, R.drawable.quantum_ic_star_vd_theme_24); + callLog.setup(R.string.tab_title_call_history, R.drawable.quantum_ic_history_vd_theme_24); + contacts.setup(R.string.tab_title_contacts, R.drawable.quantum_ic_people_vd_theme_24); + voicemail.setup(R.string.tab_title_voicemail, R.drawable.quantum_ic_voicemail_vd_theme_24); + + speedDial.setOnClickListener( + v -> { + setSelected(speedDial); + listener.onSpeedDialSelected(); + }); + callLog.setOnClickListener( + v -> { + setSelected(callLog); + listener.onCallLogSelected(); + }); + contacts.setOnClickListener( + v -> { + setSelected(contacts); + listener.onContactsSelected(); + }); + voicemail.setOnClickListener( + v -> { + setSelected(voicemail); + listener.onVoicemailSelected(); + }); + } + + private void setSelected(View view) { + speedDial.setSelected(view == speedDial); + callLog.setSelected(view == callLog); + contacts.setSelected(view == contacts); + voicemail.setSelected(view == voicemail); + } + + /** + * Calls {@link View#performClick()} on the desired tab. + * + * @param tab {@link TabIndex} + */ + void selectTab(@TabIndex int tab) { + if (tab == TabIndex.SPEED_DIAL) { + speedDial.performClick(); + } else if (tab == TabIndex.HISTORY) { + callLog.performClick(); + } else if (tab == TabIndex.CONTACTS) { + contacts.performClick(); + } else if (tab == TabIndex.VOICEMAIL) { + voicemail.performClick(); + } else { + throw new IllegalStateException("Invalid tab: " + tab); + } + } + + void setOnTabSelectedListener(OnBottomNavTabSelectedListener listener) { + this.listener = listener; + } + + /** Listener for bottom nav tab's on click events. */ + public interface OnBottomNavTabSelectedListener { + + /** Speed dial tab was clicked. */ + void onSpeedDialSelected(); + + /** Call Log tab was clicked. */ + void onCallLogSelected(); + + /** Contacts tab was clicked. */ + void onContactsSelected(); + + /** Voicemail tab was clicked. */ + void onVoicemailSelected(); + } +} diff --git a/java/com/android/dialer/main/impl/BottomNavItem.java b/java/com/android/dialer/main/impl/BottomNavItem.java new file mode 100644 index 000000000..14706ab34 --- /dev/null +++ b/java/com/android/dialer/main/impl/BottomNavItem.java @@ -0,0 +1,59 @@ +/* + * 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 + */ + +package com.android.dialer.main.impl; + +import android.content.Context; +import android.content.res.ColorStateList; +import android.support.annotation.DrawableRes; +import android.support.annotation.Nullable; +import android.support.annotation.StringRes; +import android.util.AttributeSet; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +/** Navigation item in a bottom nav. */ +final class BottomNavItem extends LinearLayout { + + private ImageView image; + private TextView text; + + public BottomNavItem(Context context, @Nullable AttributeSet attrs) { + super(context, attrs); + } + + @Override + protected void onFinishInflate() { + super.onFinishInflate(); + image = findViewById(R.id.bottom_nav_item_image); + text = findViewById(R.id.bottom_nav_item_text); + } + + @Override + public void setSelected(boolean selected) { + super.setSelected(selected); + int colorId = selected ? R.color.bottom_nav_icon_selected : R.color.bottom_nav_icon_deselected; + int color = getContext().getColor(colorId); + image.setImageTintList(ColorStateList.valueOf(color)); + text.setTextColor(color); + } + + void setup(@StringRes int stringRes, @DrawableRes int drawableRes) { + text.setText(stringRes); + image.setImageResource(drawableRes); + } +} diff --git a/java/com/android/dialer/main/impl/MainActivity.java b/java/com/android/dialer/main/impl/MainActivity.java index 52b39f0e9..87bd8dd58 100644 --- a/java/com/android/dialer/main/impl/MainActivity.java +++ b/java/com/android/dialer/main/impl/MainActivity.java @@ -18,19 +18,29 @@ package com.android.dialer.main.impl; import android.content.Context; import android.content.Intent; +import android.net.Uri; import android.os.Bundle; -import android.support.design.widget.TabLayout; -import android.support.v4.view.ViewPager; +import android.provider.ContactsContract.QuickContact; +import android.support.v4.app.FragmentTransaction; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.view.View; +import android.widget.ImageView; import android.widget.Toast; +import com.android.dialer.calllog.ui.NewCallLogFragment; import com.android.dialer.common.LogUtil; +import com.android.dialer.contactsfragment.ContactsFragment; +import com.android.dialer.contactsfragment.ContactsFragment.Header; +import com.android.dialer.contactsfragment.ContactsFragment.OnContactSelectedListener; +import com.android.dialer.main.impl.BottomNavBar.OnBottomNavTabSelectedListener; +import com.android.dialer.speeddial.SpeedDialFragment; +import com.android.dialer.voicemail.listui.NewVoicemailFragment; /** This is the main activity for dialer. It hosts favorites, call log, search, dialpad, etc... */ -public final class MainActivity extends AppCompatActivity implements View.OnClickListener { +public final class MainActivity extends AppCompatActivity + implements View.OnClickListener, OnContactSelectedListener { /** * @param context Context of the application package implementing MainActivity class. @@ -53,12 +63,9 @@ public final class MainActivity extends AppCompatActivity implements View.OnClic private void initLayout() { findViewById(R.id.fab).setOnClickListener(this); - ViewPager pager = findViewById(R.id.pager); - MainPagerAdapter pagerAdapter = new MainPagerAdapter(this, getSupportFragmentManager()); - pager.setAdapter(pagerAdapter); - - TabLayout tabLayout = findViewById(R.id.tab_layout); - tabLayout.setupWithViewPager(pager); + BottomNavBar navBar = findViewById(R.id.bottom_nav_bar); + navBar.setOnTabSelectedListener(new MainBottomNavBarBottomNavTabListener()); + navBar.selectTab(BottomNavBar.TabIndex.SPEED_DIAL); Toolbar toolbar = findViewById(R.id.toolbar); toolbar.setPopupTheme(android.R.style.Theme_Material_Light); @@ -77,9 +84,6 @@ public final class MainActivity extends AppCompatActivity implements View.OnClic if (item.getItemId() == R.id.search) { // open search return true; - } else if (item.getItemId() == R.id.contacts) { - // open contacts - return true; } else { // TODO(calderwoodra) handle other menu items return super.onOptionsItemSelected(item); @@ -92,4 +96,107 @@ public final class MainActivity extends AppCompatActivity implements View.OnClic // open dialpad search } } + + @Override + public void onContactSelected(ImageView photo, Uri contactUri, long contactId) { + // TODO(calderwoodra): Add impression logging + QuickContact.showQuickContact( + this, photo, contactUri, QuickContact.MODE_LARGE, null /* excludeMimes */); + } + + /** + * Implementation of {@link OnBottomNavTabSelectedListener} that handles logic for showing each of + * the main tabs. + */ + private final class MainBottomNavBarBottomNavTabListener + implements OnBottomNavTabSelectedListener { + + private static final String SPEED_DIAL_TAG = "speed_dial"; + private static final String CALL_LOG_TAG = "call_log"; + private static final String CONTACTS_TAG = "contacts"; + private static final String VOICEMAIL_TAG = "voicemail"; + + @Override + public void onSpeedDialSelected() { + hideAllFragments(); + SpeedDialFragment fragment = + (SpeedDialFragment) getFragmentManager().findFragmentByTag(SPEED_DIAL_TAG); + if (fragment == null) { + getFragmentManager() + .beginTransaction() + .add(R.id.fragment_container, SpeedDialFragment.newInstance(), SPEED_DIAL_TAG) + .commit(); + } else { + getFragmentManager().beginTransaction().show(fragment).commit(); + } + } + + @Override + public void onCallLogSelected() { + hideAllFragments(); + NewCallLogFragment fragment = + (NewCallLogFragment) getSupportFragmentManager().findFragmentByTag(CALL_LOG_TAG); + if (fragment == null) { + getSupportFragmentManager() + .beginTransaction() + .add(R.id.fragment_container, new NewCallLogFragment(), CALL_LOG_TAG) + .commit(); + } else { + getSupportFragmentManager().beginTransaction().show(fragment).commit(); + } + } + + @Override + public void onContactsSelected() { + hideAllFragments(); + ContactsFragment fragment = + (ContactsFragment) getFragmentManager().findFragmentByTag(CONTACTS_TAG); + if (fragment == null) { + getFragmentManager() + .beginTransaction() + .add( + R.id.fragment_container, + ContactsFragment.newInstance(Header.ADD_CONTACT), + CONTACTS_TAG) + .commit(); + } else { + getFragmentManager().beginTransaction().show(fragment).commit(); + } + } + + @Override + public void onVoicemailSelected() { + hideAllFragments(); + NewVoicemailFragment fragment = + (NewVoicemailFragment) getSupportFragmentManager().findFragmentByTag(VOICEMAIL_TAG); + if (fragment == null) { + getSupportFragmentManager() + .beginTransaction() + .add(R.id.fragment_container, new NewVoicemailFragment(), VOICEMAIL_TAG) + .commit(); + } else { + getSupportFragmentManager().beginTransaction().show(fragment).commit(); + } + } + + private void hideAllFragments() { + FragmentTransaction supportTransaction = getSupportFragmentManager().beginTransaction(); + if (getSupportFragmentManager().findFragmentByTag(CALL_LOG_TAG) != null) { + supportTransaction.hide(getSupportFragmentManager().findFragmentByTag(CALL_LOG_TAG)); + } + if (getSupportFragmentManager().findFragmentByTag(VOICEMAIL_TAG) != null) { + supportTransaction.hide(getSupportFragmentManager().findFragmentByTag(VOICEMAIL_TAG)); + } + supportTransaction.commit(); + + android.app.FragmentTransaction transaction = getFragmentManager().beginTransaction(); + if (getFragmentManager().findFragmentByTag(SPEED_DIAL_TAG) != null) { + transaction.hide(getFragmentManager().findFragmentByTag(SPEED_DIAL_TAG)); + } + if (getFragmentManager().findFragmentByTag(CONTACTS_TAG) != null) { + transaction.hide(getFragmentManager().findFragmentByTag(CONTACTS_TAG)); + } + transaction.commit(); + } + } } diff --git a/java/com/android/dialer/main/impl/res/layout/bottom_nav_bar_layout.xml b/java/com/android/dialer/main/impl/res/layout/bottom_nav_bar_layout.xml new file mode 100644 index 000000000..67c1a20df --- /dev/null +++ b/java/com/android/dialer/main/impl/res/layout/bottom_nav_bar_layout.xml @@ -0,0 +1,52 @@ +<?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 + --> +<com.android.dialer.main.impl.BottomNavBar + xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="horizontal" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/dialer_theme_color" + android:elevation="8dp"> + + <include + android:id="@+id/speed_dial_tab" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + layout="@layout/bottom_nav_item"/> + + <include + android:id="@+id/call_log_tab" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + layout="@layout/bottom_nav_item"/> + + <include + android:id="@+id/contacts_tab" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + layout="@layout/bottom_nav_item"/> + + <include + android:id="@+id/voicemail_tab" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + layout="@layout/bottom_nav_item"/> +</com.android.dialer.main.impl.BottomNavBar>
\ No newline at end of file diff --git a/java/com/android/dialer/main/impl/res/layout/bottom_nav_item.xml b/java/com/android/dialer/main/impl/res/layout/bottom_nav_item.xml new file mode 100644 index 000000000..28ad964dd --- /dev/null +++ b/java/com/android/dialer/main/impl/res/layout/bottom_nav_item.xml @@ -0,0 +1,41 @@ +<?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 + --> +<com.android.dialer.main.impl.BottomNavItem + xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:minWidth="80dp" + android:paddingTop="8dp" + android:paddingBottom="10dp" + android:paddingStart="12dp" + android:paddingEnd="12dp" + android:gravity="center" + android:background="?android:selectableItemBackgroundBorderless"> + + <ImageView + android:id="@+id/bottom_nav_item_image" + android:layout_width="24dp" + android:layout_height="24dp" + android:layout_marginBottom="6dp"/> + + <TextView + android:id="@+id/bottom_nav_item_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textSize="12sp"/> +</com.android.dialer.main.impl.BottomNavItem>
\ No newline at end of file diff --git a/java/com/android/dialer/main/impl/res/layout/main_activity.xml b/java/com/android/dialer/main/impl/res/layout/main_activity.xml index 73b2eae33..969bbe413 100644 --- a/java/com/android/dialer/main/impl/res/layout/main_activity.xml +++ b/java/com/android/dialer/main/impl/res/layout/main_activity.xml @@ -14,55 +14,44 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> -<FrameLayout +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" - android:id="@+id/container" + android:id="@+id/root_layout" android:layout_width="match_parent" android:layout_height="match_parent"> - <TextView + <android.support.v7.widget.Toolbar + android:id="@+id/toolbar" + android:layout_height="wrap_content" android:layout_width="match_parent" - android:layout_height="match_parent" - android:textColor="@android:color/secondary_text_dark_nodisable"/> + android:minHeight="?attr/actionBarSize" + android:background="@color/dialer_theme_color" + app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" + app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/> - <android.support.design.widget.CoordinatorLayout + <FrameLayout + android:id="@+id/fragment_container" android:layout_width="match_parent" - android:layout_height="match_parent"> - - <android.support.design.widget.AppBarLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:theme="@style/AppBarTheme"> - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_height="wrap_content" - android:layout_width="match_parent" - android:background="?android:attr/colorPrimary"/> - - <android.support.design.widget.TabLayout - android:id="@+id/tab_layout" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="?android:attr/colorPrimary" - app:tabIndicatorColor="?android:attr/colorAccent" - app:layout_scrollFlags="enterAlwaysCollapsed"/> - </android.support.design.widget.AppBarLayout> + android:layout_height="match_parent" + android:layout_below="@+id/toolbar" + android:layout_above="@+id/bottom_nav_bar"/> - <android.support.v4.view.ViewPager - android:id="@+id/pager" - android:layout_width="match_parent" - android:layout_height="match_parent" - app:layout_behavior="@string/appbar_scrolling_view_behavior"/> + <include + android:id="@+id/bottom_nav_bar" + layout="@layout/bottom_nav_bar_layout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:layout_alignParentBottom="true"/> - <android.support.design.widget.FloatingActionButton - android:id="@+id/fab" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="bottom|end" - android:layout_margin="16dp" - android:src="@drawable/quantum_ic_dialpad_white_24" - app:backgroundTint="?android:attr/colorAccent"/> - </android.support.design.widget.CoordinatorLayout> -</FrameLayout>
\ No newline at end of file + <android.support.design.widget.FloatingActionButton + android:id="@+id/fab" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_above="@+id/bottom_nav_bar" + android:layout_alignParentEnd="true" + android:layout_margin="16dp" + android:src="@drawable/quantum_ic_dialpad_white_24" + app:backgroundTint="?android:attr/colorAccent"/> +</RelativeLayout>
\ No newline at end of file diff --git a/java/com/android/dialer/main/impl/res/menu/main_menu.xml b/java/com/android/dialer/main/impl/res/menu/main_menu.xml index 09bcbf823..08d711eb1 100644 --- a/java/com/android/dialer/main/impl/res/menu/main_menu.xml +++ b/java/com/android/dialer/main/impl/res/menu/main_menu.xml @@ -24,13 +24,6 @@ app:showAsAction="always"/> <item - android:id="@+id/contacts" - android:icon="@drawable/quantum_ic_person_white_24" - android:title="@string/contacts" - android:contentDescription="@string/description_contacts" - app:showAsAction="always"/> - - <item android:id="@+id/call_history" android:title="@string/tab_title_call_history" app:showAsAction="collapseActionView"/> diff --git a/java/com/android/dialer/main/impl/res/values/colors.xml b/java/com/android/dialer/main/impl/res/values/colors.xml new file mode 100644 index 000000000..3d348653c --- /dev/null +++ b/java/com/android/dialer/main/impl/res/values/colors.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2017 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 + --> +<resources> + <color name="bottom_nav_icon_selected">#FFFFFF</color> + <color name="bottom_nav_icon_deselected">#B2FFFFFF</color> +</resources> diff --git a/java/com/android/dialer/main/impl/res/values/strings.xml b/java/com/android/dialer/main/impl/res/values/strings.xml index d3eb6d73e..abf44ddae 100644 --- a/java/com/android/dialer/main/impl/res/values/strings.xml +++ b/java/com/android/dialer/main/impl/res/values/strings.xml @@ -41,6 +41,8 @@ <string name="tab_title_speed_dial">Speed Dial</string> <!-- Tab text to show users their voicemails [CHAR LIMIT=10] --> <string name="tab_title_voicemail">Voicemail</string> + <!-- Tab text to show users their contacts [CHAR LIMIT=10] --> + <string name="tab_title_contacts">Contacts</string> <!-- Show users their settings [CHAR LIMIT=20] --> <string name="settings">Settings</string> diff --git a/java/com/android/dialer/main/impl/res/values/styles.xml b/java/com/android/dialer/main/impl/res/values/styles.xml index 38c50081b..f94897a8b 100644 --- a/java/com/android/dialer/main/impl/res/values/styles.xml +++ b/java/com/android/dialer/main/impl/res/values/styles.xml @@ -20,9 +20,4 @@ <item name="android:colorPrimaryDark">@color/dialer_theme_color_dark</item> <item name="android:colorAccent">@color/dialer_secondary_color</item> </style> - - <style name="AppBarTheme" parent="Theme.AppCompat"> - <item name="android:colorPrimary">@color/dialtacts_theme_color</item> - <item name="android:colorAccent">@color/dialer_secondary_color</item> - </style> </resources> diff --git a/java/com/android/dialer/speeddial/StrequentContactsCursorLoader.java b/java/com/android/dialer/speeddial/StrequentContactsCursorLoader.java index e9e3e32da..40d03846f 100644 --- a/java/com/android/dialer/speeddial/StrequentContactsCursorLoader.java +++ b/java/com/android/dialer/speeddial/StrequentContactsCursorLoader.java @@ -26,7 +26,7 @@ import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.ContactsContract.Contacts; /** Cursor Loader for strequent contacts. */ -final class StrequentContactsCursorLoader extends CursorLoader { +public final class StrequentContactsCursorLoader extends CursorLoader { static final int PHONE_ID = 0; static final int PHONE_DISPLAY_NAME = 1; @@ -41,7 +41,7 @@ final class StrequentContactsCursorLoader extends CursorLoader { static final int PHONE_PINNED = 10; static final int PHONE_CONTACT_ID = 11; - static final String[] PHONE_PROJECTION = + public static final String[] PHONE_PROJECTION = new String[] { Phone._ID, // 0 Phone.DISPLAY_NAME, // 1 diff --git a/java/com/android/dialer/speeddial/res/layout/fragment_speed_dial.xml b/java/com/android/dialer/speeddial/res/layout/fragment_speed_dial.xml index d432f097b..ecbb95193 100644 --- a/java/com/android/dialer/speeddial/res/layout/fragment_speed_dial.xml +++ b/java/com/android/dialer/speeddial/res/layout/fragment_speed_dial.xml @@ -21,4 +21,5 @@ android:layout_height="match_parent" android:paddingStart="16dp" android:paddingEnd="16dp" - android:clipToPadding="false"/> + android:clipToPadding="false" + android:background="@color/background_dialer_light"/> |