本文整理汇总了Java中com.melnykov.fab.FloatingActionButton.attachToScrollView方法的典型用法代码示例。如果您正苦于以下问题:Java FloatingActionButton.attachToScrollView方法的具体用法?Java FloatingActionButton.attachToScrollView怎么用?Java FloatingActionButton.attachToScrollView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.melnykov.fab.FloatingActionButton
的用法示例。
在下文中一共展示了FloatingActionButton.attachToScrollView方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.melnykov.fab.FloatingActionButton; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_book_library);
addBookContainer = (ObservableScrollView) findViewById(R.id.add_book_container);
imageBook = (SimpleDraweeView) findViewById(R.id.image_book);
tvBookTitle = (TextView) findViewById(R.id.tv_book_title);
tvBookAuthor = (TextView) findViewById(R.id.tv_book_author);
tvBookPublisher = (TextView) findViewById(R.id.tv_book_publisher);
tvBookSummary = (TextView) findViewById(R.id.tv_book_summary);
addLibraryButton = (FloatingActionButton) findViewById(R.id.btn_addlibrary);
addLibraryButton.attachToScrollView(addBookContainer);
Intent scan = new Intent(this, ScannerActivity.class);
startActivityForResult(scan, ADD_BOOK_LIBRARY_RESULT);
}
示例2: initUI
import com.melnykov.fab.FloatingActionButton; //导入方法依赖的package包/类
@Override
protected void initUI() {
super.initUI();
Intent intent = getIntent();
StringBuilder txtCaption = new StringBuilder(128);
String author = intent.getStringExtra(EXTRA_AUTHOR);
if (!TextUtils.isEmpty(author)) {
txtCaption.append(author);
txtCaption.append('\n');
}
txtCaption.append(DateTime.formatDateTime(this, intent.getLongExtra(EXTRA_DATE, 0), ", "));
TextView tvDate = (TextView) findViewById(R.id.news_caption);
tvDate.setText(txtCaption);
TextView tvTitle = (TextView) findViewById(R.id.news_title);
tvTitle.setText(intent.getStringExtra(EXTRA_TITLE));
TextView tvContent = (TextView) findViewById(R.id.news_content);
String txt = intent.getStringExtra(EXTRA_CONTENT_VALUES);
tvContent.setText(Html.fromHtml(txt, null, new HtmlTagHandler()));
// tvContent.setText(Html.fromHtml("Hello € <b>world</b>!<br>This is only a <a href=\"http://www.google.com\">test</a>."));
tvContent.setMovementMethod(LinkMovementMethod.getInstance());
// Log.i("NOVELTY", "types: ", intent.getStringExtra(EXTRA_CONTENT_TYPES));
Log.i("NOVELTY", "values: ", txt);
// Log.i("NOVELTY", "url: ", intent.getStringExtra(EXTRA_URL));
// Log.i("NOVELTY", "id: ", intent.getStringExtra(EXTRA_ID));
final String url = getIntent().getStringExtra(EXTRA_URL);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab_open_in_browser);
if (TextUtils.isEmpty(url)) {
fab.setVisibility(View.GONE);
} else {
fab.setVisibility(View.VISIBLE);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent iBrowser = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
iBrowser.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(iBrowser);
}
});
fab.attachToScrollView((ObservableScrollView) findViewById(R.id.news_container));
}
}
示例3: onCreate
import com.melnykov.fab.FloatingActionButton; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(getLayoutResource());
toolbar = (Toolbar) findViewById(R.id.toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
YoYo.with(Techniques.RotateIn)
.duration(600)
.playOn(findViewById(R.id.imageView4));
YoYo.with(Techniques.FadeIn)
.duration(1800)
.playOn(findViewById(R.id.imageView3));
YoYo.with(Techniques.Shake)
.delay(800)
.interpolate(new AccelerateDecelerateInterpolator())
.duration(2100)
.playOn(findViewById(R.id.imageView3));
}
ScrollView scrollView = (ScrollView) findViewById(R.id.scroll);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.attachToScrollView((com.melnykov.fab.ObservableScrollView) scrollView);
fab.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
//For example: Start Wallpaper Home Activity
Intent intent = new Intent(v.getContext(), com.antonioleiva.materialeverywhere.HomeActivity.class);
startActivity(intent);
}
});
}