UI Tweaks to Zen Mode Voice Activity.

Small cleanup of the UI / strings.
- Cleanup of string constant names.
- Add a specific string for ZenModeVoiceActivity label.
- Change look of list position indicators.
- Add optional header to VoiceSettingsActivity.
- Fix NPE in some cases when disabling Zen mode.

Change-Id: Ic09ee2b1b5a50891b5447c2db0e3de3c475696bf
This commit is contained in:
Barnaby James
2015-04-15 15:43:30 -07:00
parent b8e02b8bd0
commit f79e2d11f5
9 changed files with 88 additions and 38 deletions

View File

@@ -111,7 +111,7 @@ public class VoiceSelectionFragment extends ListFragment {
}
if (mOnItemSelectedListener != null) {
mOnItemSelectedListener.onItemSelected(position, getSelectionAt(position));
mOnItemSelectedListener.onItemSelected(position, getSelectionAt(position));
}
}

View File

@@ -16,11 +16,16 @@
package com.android.settings.utils;
import com.android.settings.R;
import android.app.Activity;
import android.app.Fragment;
import android.app.VoiceInteractor;
import android.app.VoiceInteractor.CompleteVoiceRequest;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.util.Log;
/**
@@ -65,10 +70,30 @@ abstract public class VoiceSettingsActivity extends Activity {
}
}
protected void setHeader(String label) {
TextView header = (TextView) findViewById(R.id.voice_fragment_header);
if (header != null) {
if (label != null) {
header.setText(label);
header.setVisibility(View.VISIBLE);
} else {
header.setVisibility(View.GONE);
}
}
}
/**
* Indicates when the setting could not be changed.
*/
protected void notifyFailure(String reason) {
getVoiceInteractor().submitRequest(new VoiceInteractor.AbortVoiceRequest(reason, null));
}
protected void showFragment(Fragment fragment, String tag) {
getFragmentManager()
.beginTransaction()
.replace(R.id.voice_fragment_root, fragment, tag)
.commit();
}
}