本文整理汇总了Java中org.sufficientlysecure.htmltextview.HtmlTextView.setHtmlFromString方法的典型用法代码示例。如果您正苦于以下问题:Java HtmlTextView.setHtmlFromString方法的具体用法?Java HtmlTextView.setHtmlFromString怎么用?Java HtmlTextView.setHtmlFromString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.sufficientlysecure.htmltextview.HtmlTextView
的用法示例。
在下文中一共展示了HtmlTextView.setHtmlFromString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import org.sufficientlysecure.htmltextview.HtmlTextView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Set fragment layout
View rootView = inflater.inflate(R.layout.fragment_pager,container,false);
// Connect HTMLTextView object with view id in xml
HtmlTextView mTxtContent = (HtmlTextView) rootView.findViewById(R.id.txtContent);
// Set data to HTMLTextView
mTxtContent.setHtmlFromString(mContent, true);
return rootView;
}
示例2: addContent
import org.sufficientlysecure.htmltextview.HtmlTextView; //导入方法依赖的package包/类
private void addContent(String html) {
HtmlTextView textView = new HtmlTextView(getActivity());
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
textView.setLayoutParams(layoutParams);
textView.setTextAppearance(getActivity(), fontSize.getContentText());
textView.setLineSpacing(0.0f, 1.2f);
textView.setHtmlFromString(html, htmlOptions);
mainContent.addView(textView);
}
示例3: onCreate
import org.sufficientlysecure.htmltextview.HtmlTextView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.dialog_episode_details);
streamButton = (ImageButton)findViewById(R.id.button_stream);
playDownloadButton = (ImageButton)findViewById(R.id.button_download_play);
deleteFileButton = (ImageButton)findViewById(R.id.button_trash);
goToProgramButton = (Button)findViewById(R.id.button_go_to_program);
websiteButton = (ImageButton)findViewById(R.id.button_website);
titleTextView = (TextView)findViewById(R.id.episode_title);
descriptionTextView = (HtmlTextView)findViewById(R.id.episode_description);
addToPlaylistButton = (ImageButton)findViewById(R.id.button_add_to_playlist);
titleTextView.setText(episode.name);
if (episode.description.length() <= 5) {
descriptionTextView.setHtmlFromString(getContext().getString(R.string.episode_no_description), false);
} else {
descriptionTextView.setHtmlFromString(episode.description, false);
}
addToPlaylistButton.setOnClickListener(this);
streamButton.setOnClickListener(this);
websiteButton.setOnClickListener(this);
goToProgramButton.setOnClickListener(this);
playDownloadButton.setOnClickListener(this);
deleteFileButton.setOnClickListener(this);
updateUI();
}
示例4: onCreate
import org.sufficientlysecure.htmltextview.HtmlTextView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.dialog_program_details);
titleTextView = (TextView)findViewById(R.id.program_title);
descriptionTextView = (HtmlTextView)findViewById(R.id.program_description);
titleTextView.setText(program.name);
descriptionTextView.setHtmlFromString(program.description, true);
//int programId = getArguments().getInt(IntentManager.EXTRA_PROGRAM_ID);
//program = Enklawa.current().db.programs.find(programId);
}