diff options
author | Sarmad Hashmi <mhashmi@google.com> | 2016-03-07 19:18:58 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-03-07 19:18:58 +0000 |
commit | e924ab425ba6e5afc2ae3754fb12317fdb6b2438 (patch) | |
tree | 2d96eeac18406a0473f23f9d05dfda7d56f4ade6 | |
parent | 1d806d0ca72320ea35db1cf3698ae4f3e47e30c3 (diff) | |
parent | 3696bc443fcabf8e5fb8af6a99ed2f547dad050d (diff) |
Merge "Disable voicemail archive by default." into nyc-dev
am: 3696bc443f
* commit '3696bc443fcabf8e5fb8af6a99ed2f547dad050d':
Disable voicemail archive by default.
-rw-r--r-- | res/layout/voicemail_playback_layout.xml | 8 | ||||
-rw-r--r-- | res/menu/dialtacts_options.xml | 3 | ||||
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 3 | ||||
-rw-r--r-- | src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java | 12 | ||||
-rw-r--r-- | src/com/android/dialerbind/ObjectFactory.java | 4 |
5 files changed, 24 insertions, 6 deletions
diff --git a/res/layout/voicemail_playback_layout.xml b/res/layout/voicemail_playback_layout.xml index 4d5f74f2d..984a52bf1 100644 --- a/res/layout/voicemail_playback_layout.xml +++ b/res/layout/voicemail_playback_layout.xml @@ -102,16 +102,18 @@ android:tint="@color/voicemail_icon_tint" android:contentDescription="@string/call_log_trash_voicemail" /> - <Space + <Space android:id="@+id/space_before_archive_voicemail" android:layout_width="0dp" android:layout_height="match_parent" - android:layout_weight="1"/> + android:layout_weight="1" + android:visibility="gone" /> <ImageButton android:id="@+id/archive_voicemail" style="@style/VoicemailPlaybackLayoutButtonStyle" android:src="@drawable/ic_archive_white_24dp" android:tint="@color/voicemail_icon_tint" - android:contentDescription="@string/call_log_archive_voicemail" /> + android:contentDescription="@string/call_log_archive_voicemail" + android:visibility="gone" /> <Space android:layout_width="0dp" diff --git a/res/menu/dialtacts_options.xml b/res/menu/dialtacts_options.xml index 8e31026a7..0f068f505 100644 --- a/res/menu/dialtacts_options.xml +++ b/res/menu/dialtacts_options.xml @@ -21,7 +21,8 @@ android:title="@string/action_menu_call_history_description" /> <item android:id="@+id/menu_archive" - android:title="@string/voicemail_archive_activity_title" /> + android:title="@string/voicemail_archive_activity_title" + android:visible="false" /> <item android:id="@+id/menu_import_export" android:title="@string/menu_import_export" /> diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index e775b0ad1..58a0474d1 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -908,6 +908,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O protected OptionsPopupMenu buildOptionsMenu(View invoker) { final OptionsPopupMenu popupMenu = new OptionsPopupMenu(this, invoker); popupMenu.inflate(R.menu.dialtacts_options); + if (ObjectFactory.isVoicemailArchiveEnabled(this)) { + popupMenu.getMenu().findItem(R.id.menu_archive).setVisible(true); + } popupMenu.setOnMenuItemClickListener(this); return popupMenu; } diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java b/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java index 436fc7952..0cbe7f2c2 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java @@ -32,6 +32,7 @@ import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.SeekBar; import android.widget.SeekBar.OnSeekBarChangeListener; +import android.widget.Space; import android.widget.TextView; import android.widget.Toast; @@ -44,6 +45,7 @@ import com.android.dialer.database.VoicemailArchiveContract; import com.android.dialer.database.VoicemailArchiveContract.VoicemailArchive; import com.android.dialer.util.AsyncTaskExecutor; import com.android.dialer.util.AsyncTaskExecutors; +import com.android.dialerbind.ObjectFactory; import com.google.common.annotations.VisibleForTesting; import java.util.ArrayList; @@ -273,6 +275,7 @@ public class VoicemailPlaybackLayout extends LinearLayout private ImageButton mPlaybackSpeakerphone; private ImageButton mDeleteButton; private ImageButton mArchiveButton; + private Space mArchiveSpace; private TextView mStateText; private TextView mPositionText; private TextView mTotalDurationText; @@ -297,8 +300,10 @@ public class VoicemailPlaybackLayout extends LinearLayout public void setPresenter(VoicemailPlaybackPresenter presenter, Uri voicemailUri) { mPresenter = presenter; mVoicemailUri = voicemailUri; - updateArchiveUI(mVoicemailUri); - updateArchiveButton(mVoicemailUri); + if (ObjectFactory.isVoicemailArchiveEnabled(mContext)) { + updateArchiveUI(mVoicemailUri); + updateArchiveButton(mVoicemailUri); + } } @Override @@ -310,6 +315,7 @@ public class VoicemailPlaybackLayout extends LinearLayout mPlaybackSpeakerphone = (ImageButton) findViewById(R.id.playback_speakerphone); mDeleteButton = (ImageButton) findViewById(R.id.delete_voicemail); mArchiveButton =(ImageButton) findViewById(R.id.archive_voicemail); + mArchiveSpace = (Space) findViewById(R.id.space_before_archive_voicemail); mStateText = (TextView) findViewById(R.id.playback_state_text); mPositionText = (TextView) findViewById(R.id.playback_position_text); mTotalDurationText = (TextView) findViewById(R.id.total_duration_text); @@ -511,6 +517,7 @@ public class VoicemailPlaybackLayout extends LinearLayout } public void hideArchiveButton() { + mArchiveSpace.setVisibility(View.GONE); mArchiveButton.setVisibility(View.GONE); mArchiveButton.setClickable(false); mArchiveButton.setEnabled(false); @@ -582,6 +589,7 @@ public class VoicemailPlaybackLayout extends LinearLayout if (archived) { hideArchiveButton(); } else { + mArchiveSpace.setVisibility(View.VISIBLE); mArchiveButton.setVisibility(View.VISIBLE); mArchiveButton.setClickable(true); mArchiveButton.setEnabled(true); diff --git a/src/com/android/dialerbind/ObjectFactory.java b/src/com/android/dialerbind/ObjectFactory.java index 4568c1b35..935c9f73a 100644 --- a/src/com/android/dialerbind/ObjectFactory.java +++ b/src/com/android/dialerbind/ObjectFactory.java @@ -44,6 +44,10 @@ public class ObjectFactory { return "com.android.dialer.database.filterednumberprovider"; } + public static boolean isVoicemailArchiveEnabled(Context context) { + return false; + } + @Nullable public static ExtendedBlockingButtonRenderer newExtendedBlockingButtonRenderer( Context context, ExtendedBlockingButtonRenderer.Listener listener) { |