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


Java FloatingActionMenu.setTranslationY方法代碼示例

本文整理匯總了Java中com.github.clans.fab.FloatingActionMenu.setTranslationY方法的典型用法代碼示例。如果您正苦於以下問題:Java FloatingActionMenu.setTranslationY方法的具體用法?Java FloatingActionMenu.setTranslationY怎麽用?Java FloatingActionMenu.setTranslationY使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.github.clans.fab.FloatingActionMenu的用法示例。


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

示例1: onDependentViewChanged

import com.github.clans.fab.FloatingActionMenu; //導入方法依賴的package包/類
@Override
public boolean onDependentViewChanged(
    final CoordinatorLayout parent, final FloatingActionMenu child, final View dependency) {
    log(TAG, INFO, "onDependentViewChanged: " + dependency);

    final List<View> list = parent.getDependencies(child);
    int bottomMargin = ((ViewGroup.MarginLayoutParams) child.getLayoutParams()).bottomMargin;

    float t = 0;
    boolean result = false;

    for (View dep : list) {
        if (Snackbar.SnackbarLayout.class.isInstance(dep)) {
            t += dep.getTranslationY() - dep.getHeight();
            result = true;
        } else if (BottomNavigation.class.isInstance(dep)) {
            BottomNavigation navigation = (BottomNavigation) dep;
            t += navigation.getTranslationY() - navigation.getHeight() + bottomMargin;
            result = true;
        }
    }

    child.setTranslationY(t);
    return result;
}
 
開發者ID:sephiroth74,項目名稱:Material-BottomNavigation,代碼行數:26,代碼來源:MainActivityCustomBehavior.java

示例2: onDependentViewChanged

import com.github.clans.fab.FloatingActionMenu; //導入方法依賴的package包/類
@Override
public boolean onDependentViewChanged(CoordinatorLayout parent, FloatingActionMenu child, View dependency)
{
    float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight());
    child.setTranslationY(translationY);

    return true;
}
 
開發者ID:proninyaroslav,項目名稱:libretorrent,代碼行數:9,代碼來源:SnackBarBehavior.java

示例3: onDependentViewChanged

import com.github.clans.fab.FloatingActionMenu; //導入方法依賴的package包/類
@Override
public boolean onDependentViewChanged(CoordinatorLayout parent, FloatingActionMenu child, View dependency) {
  float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight());
  child.setTranslationY(translationY);
  return true;
}
 
開發者ID:sfilmak,項目名稱:MakiLite,代碼行數:7,代碼來源:TabLayoutBehavior.java

示例4: updateFabTranslationForSnackbar

import com.github.clans.fab.FloatingActionMenu; //導入方法依賴的package包/類
private void updateFabTranslationForSnackbar(FloatingActionMenu child, View dependency) {
    float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight());
    child.setTranslationY(translationY);
}
 
開發者ID:nhocga1995s,項目名稱:MyCalendar,代碼行數:5,代碼來源:FloatingActionMenuBehavior.java


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