當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。