當前位置: 首頁>>代碼示例>>Java>>正文


Java FloatingTextButton類代碼示例

本文整理匯總了Java中ru.dimorinny.floatingtextbutton.FloatingTextButton的典型用法代碼示例。如果您正苦於以下問題:Java FloatingTextButton類的具體用法?Java FloatingTextButton怎麽用?Java FloatingTextButton使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FloatingTextButton類屬於ru.dimorinny.floatingtextbutton包,在下文中一共展示了FloatingTextButton類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onBindViewHolder

import ru.dimorinny.floatingtextbutton.FloatingTextButton; //導入依賴的package包/類
@Override
public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) {
    final Alert alert = alerts.get(position);
    final Crate crate = alert.getCrate();

    FloatingTextButton fab = holder.itemView.findViewById(R.id.delete_button);
    TextView title = holder.itemView.findViewById(R.id.crate_title);

    title.setText(crate.getName());

    fab.setOnClickListener(v -> {
        alerts.remove(holder.getAdapterPosition());
        notifyItemRemoved(holder.getAdapterPosition());
        Utility.saveData("alerts", alerts);
    });

    holder.itemView.setOnClickListener(v -> {
        Intent intent = new Intent(context, CrateActivity.class);
        intent.putExtra("crate", crate);
        context.startActivity(intent);
    });
}
 
開發者ID:TheUberCatman,項目名稱:crates-io-android,代碼行數:23,代碼來源:SubscribedAdapter.java

示例2: onDependentViewChanged

import ru.dimorinny.floatingtextbutton.FloatingTextButton; //導入依賴的package包/類
@Override
public boolean onDependentViewChanged(
        CoordinatorLayout parent,
        FloatingTextButton child,
        View dependency
) {
    if (child.getTranslationY() > 0) {
        return true;
    }
    if (animation != null) {
        animation.cancel();
        animation = null;
    }

    child.setTranslationY(
            Math.min(0f, dependency.getTranslationY() - dependency.getHeight())
    );
    return true;
}
 
開發者ID:dimorinny,項目名稱:floating-text-button,代碼行數:20,代碼來源:SnackbarBehavior.java

示例3: onDependentViewRemoved

import ru.dimorinny.floatingtextbutton.FloatingTextButton; //導入依賴的package包/類
@Override
public void onDependentViewRemoved(
        CoordinatorLayout parent,
        FloatingTextButton child,
        View dependency
) {
    if (dependency instanceof Snackbar.SnackbarLayout) {

        animation = ViewCompat.animate(child)
                .translationY(0f)
                .setInterpolator(HIDE_INTERPOLATOR)
                .setDuration(HIDE_DURATION);

        animation.start();
    }
    super.onDependentViewRemoved(parent, child, dependency);
}
 
開發者ID:dimorinny,項目名稱:floating-text-button,代碼行數:18,代碼來源:SnackbarBehavior.java

示例4: onCreate

import ru.dimorinny.floatingtextbutton.FloatingTextButton; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    final CoordinatorLayout container = (CoordinatorLayout) findViewById(R.id.container);
    FloatingTextButton callButton = (FloatingTextButton) findViewById(R.id.call_button);

    callButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Snackbar.make(container, "Call button clicked", Snackbar.LENGTH_SHORT).show();
        }
    });
}
 
開發者ID:dimorinny,項目名稱:floating-text-button,代碼行數:16,代碼來源:MainActivity.java

示例5: layoutDependsOn

import ru.dimorinny.floatingtextbutton.FloatingTextButton; //導入依賴的package包/類
@Override
public boolean layoutDependsOn(
        CoordinatorLayout parent,
        FloatingTextButton child,
        View dependency
) {
    return dependency instanceof Snackbar.SnackbarLayout;
}
 
開發者ID:dimorinny,項目名稱:floating-text-button,代碼行數:9,代碼來源:SnackbarBehavior.java


注:本文中的ru.dimorinny.floatingtextbutton.FloatingTextButton類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。