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


Java AppBarLayout.LayoutParams方法代码示例

本文整理汇总了Java中android.support.design.widget.AppBarLayout.LayoutParams方法的典型用法代码示例。如果您正苦于以下问题:Java AppBarLayout.LayoutParams方法的具体用法?Java AppBarLayout.LayoutParams怎么用?Java AppBarLayout.LayoutParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.design.widget.AppBarLayout的用法示例。


在下文中一共展示了AppBarLayout.LayoutParams方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showVideoStartTip

import android.support.design.widget.AppBarLayout; //导入方法依赖的package包/类
private void showVideoStartTip() {
    mRlVideoTip.setVisibility(View.VISIBLE);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        Animator circularReveal = ViewAnimationUtils.createCircularReveal(mRlVideoTip,
                mIvCover.getWidth() - ArmsUtils.dip2px(VideoDetailActivity.this, mAnchorX),
                mIvCover.getHeight() - ArmsUtils.dip2px(VideoDetailActivity.this, mAnchorY),
                0,
                ((float) Math.hypot(mIvCover.getWidth(), mIvCover.getHeight())));
        circularReveal.setDuration(800);
        circularReveal.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                mIvCover.setVisibility(View.GONE);
                mPresenter.loadPlayUrl(aid);
            }
        });
        circularReveal.start();
    } else {
        mPresenter.loadPlayUrl(aid);
    }
    // 锁定AppBarLayout
    AppBarLayout.LayoutParams layoutParams = (AppBarLayout.LayoutParams) mAppbar.getChildAt(0).getLayoutParams();
    layoutParams.setScrollFlags(0);
    mAppbar.getChildAt(0).setLayoutParams(layoutParams);
}
 
开发者ID:GitLqr,项目名称:LQRBiliBlili,代码行数:27,代码来源:VideoDetailActivity.java

示例2: onConfigurationChanged

import android.support.design.widget.AppBarLayout; //导入方法依赖的package包/类
@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
    StyledAttributesHelper ta = StyledAttributesHelper.obtainStyledAttributes(this,
            new int[] { R.attr.actionBarSize });
    ViewGroup.LayoutParams params = mFakeToolbar.getLayoutParams();
    params.height = ta.getDimensionPixelSize(R.attr.actionBarSize, 0);
    mFakeToolbar.setLayoutParams(params);
    ta.recycle();
    if (mToolbar != null) {
        ViewGroup group = (ViewGroup) mToolbar.getParent();
        int i = group.indexOfChild(mToolbar);
        group.removeViewAt(i);
        Toolbar replacement = new Toolbar(group.getContext());
        replacement.setPopupTheme(mToolbar.getPopupTheme());
        AppBarLayout.LayoutParams toolbarParams = new AppBarLayout.LayoutParams(
                AppBarLayout.LayoutParams.MATCH_PARENT, params.height);
        replacement.setLayoutParams(toolbarParams);
        group.addView(replacement, i);
        setSupportActionBar(replacement);
        addActionBarDrawerToggle(replacement);
    }
}
 
开发者ID:MCMrARM,项目名称:revolution-irc,代码行数:24,代码来源:MainActivity.java

示例3: ScrollFlag

import android.support.design.widget.AppBarLayout; //导入方法依赖的package包/类
public ScrollFlag(AppBarLayout layout) {
  if (layout != null) {
    int i = 0;
    for (int z = layout.getChildCount(); i < z; ++i) {
      View child = layout.getChildAt(i);
      ViewGroup.LayoutParams layoutParams = child.getLayoutParams();
      if (layoutParams instanceof AppBarLayout.LayoutParams) {
        AppBarLayout.LayoutParams childLp = (AppBarLayout.LayoutParams) layoutParams;
        int flags = childLp.getScrollFlags();
        if ((flags & AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL) != 0) {
          vView = child;
          mFlags = flags;
          break;
        }
      }
    }
  }
}
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:19,代码来源:ScrollFlag.java

示例4: findViews

import android.support.design.widget.AppBarLayout; //导入方法依赖的package包/类
private void findViews() {
    fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(this);
    mLayout = (RelativeLayout) findViewById(R.id.layout_chat_empty);
    mTabLayout = (TabLayout) findViewById(R.id.tabLayout);
    mTabLayout.addTab(mTabLayout.newTab().setText("Public"));
    mTabLayout.addTab(mTabLayout.newTab().setText("Private"));
    mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    mToolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar_layout);
    toolbarParams = (AppBarLayout.LayoutParams) toolbarLayout.getLayoutParams();
    setSupportActionBar(mToolbar);
    mTextOnToolbar = (TextView) findViewById(R.id.chat_toolbar_title);
    mNavigationView = (NavigationView) findViewById(R.id.nav_view);
    progressBar = (ProgressBar) findViewById(R.id.main_progress_bar);
    progressBar.getIndeterminateDrawable()
            .setColorFilter(getResources().getColor(R.color.colorPrimary), android.graphics.PorterDuff.Mode.MULTIPLY);
}
 
开发者ID:ukevgen,项目名称:BizareChat,代码行数:19,代码来源:MainActivity.java

示例5: CollapsingToolbarLayoutView

import android.support.design.widget.AppBarLayout; //导入方法依赖的package包/类
public CollapsingToolbarLayoutView(Context context) {
    super(context);

    int width  = AppBarLayout.LayoutParams.MATCH_PARENT;
    int height = AppBarLayout.LayoutParams.MATCH_PARENT;

    AppBarLayout.LayoutParams params = new AppBarLayout.LayoutParams(width, height);

    this.setScrimsShown(false, true);
    this.setLayoutParams(params);
    this.setFitsSystemWindows(true);
}
 
开发者ID:cesardeazevedo,项目名称:react-native-collapsing-toolbar,代码行数:13,代码来源:CollapsingToolbarLayoutView.java

示例6: setExpandedTitleGravity

import android.support.design.widget.AppBarLayout; //导入方法依赖的package包/类
@ReactProp(name = "scrollFlags")
public void setExpandedTitleGravity(CollapsingToolbarLayoutView view, int flags) {
    AppBarLayout.LayoutParams params = new AppBarLayout.LayoutParams(
        AppBarLayout.LayoutParams.MATCH_PARENT,
        AppBarLayout.LayoutParams.MATCH_PARENT
    );

    params.setScrollFlags(flags);
    view.setLayoutParams(params);
}
 
开发者ID:cesardeazevedo,项目名称:react-native-collapsing-toolbar,代码行数:11,代码来源:CollapsingToolbarLayoutManager.java

示例7: initView

import android.support.design.widget.AppBarLayout; //导入方法依赖的package包/类
@Override
protected void initView(Bundle savedInstanceState) {
    super.initView(savedInstanceState);
    //微信精选内部已经有Title等信息,直接显示webview内容
    //tvDetailTitle.setText(mTitle);
    //tvDetailcopyright.setText(mCopyright);
    //Glide.with(mContext).load(mImageUrl).crossFade().into(ivDetail);
    AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) appBar.getChildAt(0)
            .getLayoutParams();
    // 控件的高强制设成56dp+状态栏高度
    params.height = DisplayUtils.dp2px(56) + StatusBarUtils.getStatusBarHeight
            (mContext);
}
 
开发者ID:Horrarndoo,项目名称:YiZhi,代码行数:14,代码来源:WeixinChoiceDetailActivity.java

示例8: initView

import android.support.design.widget.AppBarLayout; //导入方法依赖的package包/类
@Override
protected void initView(Bundle savedInstanceState) {
    super.initView(savedInstanceState);
    AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) appBar.getChildAt(0)
            .getLayoutParams();
    // 控件的高强制设成56dp+状态栏高度
    params.height = DisplayUtils.dp2px(56) + StatusBarUtils.getStatusBarHeight
            (mContext);
}
 
开发者ID:Horrarndoo,项目名称:YiZhi,代码行数:10,代码来源:WebViewLoadActivity.java

示例9: initCreate

import android.support.design.widget.AppBarLayout; //导入方法依赖的package包/类
@Override
protected void initCreate(Bundle savedInstanceState) {
    layoutParams = (AppBarLayout.LayoutParams) appBarLayout.getChildAt(0).getLayoutParams();
    navigationView.setNavigationItemSelectedListener(this);
    toolbar.setTitle(getString(R.string.dbmz_title));
    setSupportActionBar(toolbar);
    mPresenter.switchId(MainPresenterImpl.FIRST_FRAGMENT);
}
 
开发者ID:7449,项目名称:JsoupSample,代码行数:9,代码来源:MainActivity.java

示例10: setAppBarExpandEnabled

import android.support.design.widget.AppBarLayout; //导入方法依赖的package包/类
private void setAppBarExpandEnabled(boolean enabled) {
    mAppBar.setActivated(enabled);
    final AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) mToolbar.getLayoutParams();
    if (enabled) {
        params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS);
    } else {
        params.setScrollFlags(0);
    }
    mToolbar.setLayoutParams(params);
}
 
开发者ID:nfdz,项目名称:foco,代码行数:11,代码来源:EditDocActivity.java

示例11: setToolbarScrollAble

import android.support.design.widget.AppBarLayout; //导入方法依赖的package包/类
protected void setToolbarScrollAble(boolean scrollAble) {
    if(toolbar == null) return;
    int flags = scrollAble ? (AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL
            | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS
            | AppBarLayout.LayoutParams.SCROLL_FLAG_SNAP) : 0;
    AppBarLayout.LayoutParams layoutParams = (AppBarLayout.LayoutParams) toolbar.getLayoutParams();
    layoutParams.setScrollFlags(flags);
    toolbar.setLayoutParams(layoutParams);
}
 
开发者ID:ThirtyDegreesRay,项目名称:OpenHub,代码行数:10,代码来源:BaseActivity.java

示例12: setHeaderScrollFlags

import android.support.design.widget.AppBarLayout; //导入方法依赖的package包/类
/**
 * Applies the supplied scroll flags to the header.
 *
 * @param flags
 * 		the flags to apply, 0 to clear all flags
 */
private void setHeaderScrollFlags(final int flags) {
	final AppBarLayout.LayoutParams layoutParams = (AppBarLayout.LayoutParams) header
			.getLayoutParams();
	layoutParams.setScrollFlags(flags);
	header.setLayoutParams(layoutParams);
}
 
开发者ID:MatthewTamlin,项目名称:Mixtape,代码行数:13,代码来源:CoordinatedMixtapeContainer.java

示例13: initView

import android.support.design.widget.AppBarLayout; //导入方法依赖的package包/类
@Override
    public void initView(View rootView) {
        ButterKnife.bind(this, rootView);
        mContentView.setVisibility(View.GONE);
        mNullView.setVisibility(View.VISIBLE);
//        initDatas(AppUtils.Constants.URL_ARTICLE);
        mAppbarParams = (AppBarLayout.LayoutParams) mAppbar.getChildAt(0).getLayoutParams();
        updateToolbarScroll(false);
    }
 
开发者ID:shenhuanet,项目名称:OpenEyesReading-android,代码行数:10,代码来源:ArticleFragment.java

示例14: onCreate

import android.support.design.widget.AppBarLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_forge);
    // Open with keyboard hidden
    this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
    // Set up toolbar
    Toolbar toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    // Set up fragment pager adapter
    forgePagerAdapter = new ForgePagerAdapter(getSupportFragmentManager(), getApplicationContext());
    // Clear all scroll flags
    AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) toolbar.getLayoutParams();
    params.setScrollFlags(0);
    // Set up viewpager
    viewPager = findViewById(R.id.container);
    viewPager.setAdapter(forgePagerAdapter);
    // Set up tab layout
    TabLayout tabLayout = findViewById(R.id.tabs);
    tabLayout.setupWithViewPager(viewPager);
    // Set up notification channel
    Notifications.setUpChannels(this);
    // Get shared preferences
    SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    // Get activity starting intent
    Intent intent = getIntent();
    if (intent.hasExtra(Notifications.NOTIFICATION_NAVIGATION)) {
        // If the activity was opened from a notification click
        // Set the current fragment viewed to the one requested
        viewPager.setCurrentItem(intent.getIntExtra(Notifications.NOTIFICATION_NAVIGATION, GENERATE_TAB));
    }
    // If the user preferences have not been set yet, set them to defaults
    if (!sharedPref.getBoolean(PreferenceManager.KEY_HAS_SET_DEFAULT_VALUES, false)) {
        PreferenceManager.setDefaultValues(getApplicationContext(), R.xml.pref_general, true);
        PreferenceManager.setDefaultValues(getApplicationContext(), R.xml.pref_password, true);
        PreferenceManager.setDefaultValues(getApplicationContext(), R.xml.pref_date_of_birth, true);
    }

    if (sharedPref.getBoolean(getString(R.string.pref_helper_key), false)) {
        Notifications.displayHelperNotification(this);
    } else {
        Notifications.removeHelperNotification(this);
    }

}
 
开发者ID:jthomperoo,项目名称:Forge,代码行数:46,代码来源:Forge.java

示例15: setHeight

import android.support.design.widget.AppBarLayout; //导入方法依赖的package包/类
@ReactProp(name = "height")
public void setHeight(AppBarLayoutView view, int height) {
    AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) view.getLayoutParams();
    params.height = (int) PixelUtil.toPixelFromDIP(height);
    view.setLayoutParams(params);
}
 
开发者ID:cesardeazevedo,项目名称:react-native-collapsing-toolbar,代码行数:7,代码来源:AppBarLayoutManager.java


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