当前位置: 首页>>代码示例>>Java>>正文


Java FloatingActionButton.attachToScrollView方法代码示例

本文整理汇总了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);
}
 
开发者ID:championswimmer,项目名称:Bookd_Android_App,代码行数:20,代码来源:AddBookLibraryActivity.java

示例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));
    }
}
 
开发者ID:ediTLJ,项目名称:novelty,代码行数:52,代码来源:NewsInfoActivity.java

示例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);

        }
    });


}
 
开发者ID:Technologx,项目名称:Fire-Bird-Dashboard-for-Zooper,代码行数:46,代码来源:BaseActivity.java


注:本文中的com.melnykov.fab.FloatingActionButton.attachToScrollView方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。