diff options
author | Eric Erfanian <erfanian@google.com> | 2017-08-31 06:57:16 -0700 |
---|---|---|
committer | Roland Levillain <rpl@google.com> | 2017-09-04 18:05:19 +0100 |
commit | fc0eb8ccebcc7846db5e8b5c5430070055679bfa (patch) | |
tree | a8a23c3202e4161ffd57a71095a404db1bcf5735 /java/com/android/dialer/main/impl | |
parent | ea7b4dc89590ffa3332766a531e0eab6ffb9aebd (diff) |
Update Dialer source to latest internal Google revision.
Previously, Android's Dialer app was developed in an internal Google
source control system and only exported to public during AOSP drops.
The Dialer team is now switching to a public development model similar
to the telephony team.
This CL represents all internal Google changes that were committed to
Dialer between the public O release and today's tip of tree on internal
master. This CL squashes those changes into a single commit.
In subsequent changes, changes will be exported on a per-commit basis.
(cherry picked from commit 2ca4318cc1ee57dda907ba2069bd61d162b1baef
and amended to match paths of dependencies under
prebuilts/maven_repo/bumptech/com/github/bumptech/glide/.)
This CL was generated using these commands from a repository at
stage-stage-master at revision ea7b4dc89590ffa3332766a531e0eab6ffb9aebd
("Merge "Update Dialer source to latest internal Google revision." am: c39ea3c55f -s ours"):
git diff --binary 2ca4318cc1ee57dda907ba2069bd61d162b1baef | git apply -R --index
git commit -c 2ca4318cc1ee57dda907ba2069bd61d162b1baef
Test: make, flash install, run
Change-Id: I529aaeb88535b9533c0ae4ef4e6c1222d4e0f1c8
PiperOrigin-RevId: 167068436
Diffstat (limited to 'java/com/android/dialer/main/impl')
4 files changed, 25 insertions, 12 deletions
diff --git a/java/com/android/dialer/main/impl/MainActivity.java b/java/com/android/dialer/main/impl/MainActivity.java index 4b2bd2e05..52b39f0e9 100644 --- a/java/com/android/dialer/main/impl/MainActivity.java +++ b/java/com/android/dialer/main/impl/MainActivity.java @@ -32,7 +32,11 @@ import com.android.dialer.common.LogUtil; /** This is the main activity for dialer. It hosts favorites, call log, search, dialpad, etc... */ public final class MainActivity extends AppCompatActivity implements View.OnClickListener { - static Intent getIntent(Context context) { + /** + * @param context Context of the application package implementing MainActivity class. + * @return intent for MainActivity.class + */ + public static Intent getIntent(Context context) { return new Intent(context, MainActivity.class) .setAction(Intent.ACTION_VIEW) .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); @@ -77,7 +81,7 @@ public final class MainActivity extends AppCompatActivity implements View.OnClic // open contacts return true; } else { - // TODO handle other menu items + // TODO(calderwoodra) handle other menu items return super.onOptionsItemSelected(item); } } diff --git a/java/com/android/dialer/main/impl/MainImpl.java b/java/com/android/dialer/main/impl/MainImpl.java index d29e8c0a5..675533c04 100644 --- a/java/com/android/dialer/main/impl/MainImpl.java +++ b/java/com/android/dialer/main/impl/MainImpl.java @@ -21,11 +21,11 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; +import android.os.Build; import android.os.Build.VERSION_CODES; import android.support.v4.content.pm.ShortcutInfoCompat; import android.support.v4.content.pm.ShortcutManagerCompat; import android.support.v4.graphics.drawable.IconCompat; -import android.support.v4.os.BuildCompat; import com.android.dialer.buildtype.BuildType; import com.android.dialer.common.LogUtil; import com.android.dialer.main.Main; @@ -36,7 +36,7 @@ final class MainImpl implements Main { private static final String SHORTCUT_KEY = "nui_launcher_shortcut"; @Inject - public MainImpl() {} + MainImpl() {} @Override public boolean isNewUiEnabled(Context context) { @@ -46,7 +46,7 @@ final class MainImpl implements Main { @Override public void createNewUiLauncherShortcut(Context context) { enableComponent(context); - if (BuildCompat.isAtLeastO()) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { createLauncherShortcutO(context); } else { createLauncherShortcutPreO(context); diff --git a/java/com/android/dialer/main/impl/MainPagerAdapter.java b/java/com/android/dialer/main/impl/MainPagerAdapter.java index 19cf4e7b1..10256a128 100644 --- a/java/com/android/dialer/main/impl/MainPagerAdapter.java +++ b/java/com/android/dialer/main/impl/MainPagerAdapter.java @@ -21,7 +21,9 @@ import android.support.annotation.IntDef; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentStatePagerAdapter; +import com.android.dialer.calllog.ui.NewCallLogFragment; import com.android.dialer.common.Assert; +import com.android.dialer.voicemail.listui.VoicemailFragment; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -49,14 +51,21 @@ final class MainPagerAdapter extends FragmentStatePagerAdapter { @Override public int getCount() { - // TODO: add logic to hide/show voicemail tab + // TODO(calderwoodra): add logic to hide/show voicemail tab return 3; } @Override - public Fragment getItem(int position) { - // TODO: implement tabs - return new StubFragment(); + public Fragment getItem(@TabIndex int position) { + // TODO(calderwoodra): implement tabs + switch (position) { + case TabIndex.VOICEMAIL: + return new VoicemailFragment(); + case TabIndex.HISTORY: + return new NewCallLogFragment(); + default: + return new StubFragment(); + } } @Override 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 ba8a20b51..d3eb6d73e 100644 --- a/java/com/android/dialer/main/impl/res/values/strings.xml +++ b/java/com/android/dialer/main/impl/res/values/strings.xml @@ -14,16 +14,16 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> -<resources> +<resources xmlns:tools="http://schemas.android.com/tools"> <!-- Name of the main activity. --> - <string name="main_activity_label">Phone</string> + <string name="main_activity_label" tools:ignore="UnusedResources">Phone</string> <!-- Name of launcher shortcut for the new UI main activity. TODO(38502365): Remove this once we're ready to launch the new UI. --> <string name="nui_shortcut_name">Phone NUI</string> <!-- The description text for the call log tab. --> - <string name="main_call_history_tab_description">Call history</string> + <string name="main_call_history_tab_description" tools:ignore="UnusedResources">Call history</string> <!-- Text for a toolbar button that shows the user their contacts [CHAR LIMIT=NONE] --> <string name="search">@android:string/search_go</string> |