0
我試圖使用GuidedStepFragment來組織我的電視應用程序的設置。我遇到了問題,那個步驟選項像EditText字段一樣工作,但我不使用GuidedAction.Builder.editable()方法。GuidedStepFragment選項默認是可編輯的
設置片段代碼
public static class SettingsFragment extends GuidedStepSupportFragment {
@Override
public GuidanceStylist.Guidance onCreateGuidance(Bundle savedInstanceState) {
String title = "Настройки1";
String description = "Настройки2";
String breadcrumb = "Настройки3";
Drawable icon = getActivity().getResources().getDrawable(R.drawable.app_icon_quantum);
return new GuidanceStylist.Guidance(title, description, breadcrumb, icon);
}
@Override
public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {
actions.add(new GuidedAction.Builder()
.id(1)
.infoOnly(true)
.title("Адрес сервера")
.build());
}
}
我如何添加片段
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
GuidedStepSupportFragment.add(getSupportFragmentManager(), new SettingsFragment());
}
- 的Android Studio版本:Beta 4的
- 搖籃插件版本:2.0.0-BETA4
- 構建工具版本:23.0.2