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


Java NestedScrollView.addView方法代码示例

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


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

示例1: onCreate

import android.support.v4.widget.NestedScrollView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setTitle("Impostazioni");
    getSupportActionBar().setDefaultDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    LinearLayout container = new LinearLayout(this);
    container.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    container.setOrientation(LinearLayout.VERTICAL);

    NestedScrollView scrollView = new NestedScrollView(this);
    scrollView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    scrollView.addView(container);

    headers = new ArrayList();
    onInit();

    //Start parsing and creating the layout
    for(SettingHeader header : headers){
        CardView headerCard = (CardView) LayoutInflater.from(this).inflate(R.layout.settings_header, null);
        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        params.setMargins(0, 0, 0, 10);
        headerCard.setLayoutParams(params);

        TextView headerTitle = (TextView) headerCard.findViewById(R.id.headerTitle);
        StaticHeightListView inputsContainer = (StaticHeightListView) headerCard.findViewById(R.id.inputContainer);

        headerTitle.setText(header.title);

        inputsContainer.setAdapter(new SettingInputAdapter(this, header.inputs));

        container.addView(headerCard);
    }

    setContentView(scrollView);
}
 
开发者ID:Marplex,项目名称:Schoolbook,代码行数:39,代码来源:BaseSettingActivity.java

示例2: loadFinishScreen

import android.support.v4.widget.NestedScrollView; //导入方法依赖的package包/类
/**
 * Loads the finish screen and unloads all other screens
 */
private void loadFinishScreen() {
    // Remove anchor by resetting layout params since anchor element has been removed from the screen
    CoordinatorLayout.LayoutParams lp = new CoordinatorLayout.LayoutParams(CoordinatorLayout.LayoutParams.WRAP_CONTENT, CoordinatorLayout.LayoutParams.WRAP_CONTENT);
    mFloatingActionButton.setLayoutParams(lp);
    mFloatingActionButton.setVisibility(View.INVISIBLE);

    NestedScrollView contentLayout = (NestedScrollView) findViewById(R.id.challenge_rootcontainer);
    if (contentLayout != null) {
        contentLayout.removeAllViews();
        View view = getLayoutInflater().inflate(R.layout.fragment_finish_challenge, contentLayout, false);
        contentLayout.addView(view);
    }
}
 
开发者ID:Kamshak,项目名称:BrainPhaser,代码行数:17,代码来源:ChallengeActivity.java

示例3: initWidget

import android.support.v4.widget.NestedScrollView; //导入方法依赖的package包/类
@Override
public void initWidget() {
    super.initWidget();
    NestedScrollView nestedScrollView = get(R.id.nested_scrollview);
    LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams
            .MATCH_PARENT);
    nestedScrollView.addView(View.inflate(getActivity(), getContentLayoutId(), null), params);
    nestedScrollView.invalidate();
}
 
开发者ID:kymjs,项目名称:CoreModule,代码行数:10,代码来源:BaseDetailDelegate.java

示例4: testFindScrollingChildEnabled

import android.support.v4.widget.NestedScrollView; //导入方法依赖的package包/类
@Test
@SmallTest
public void testFindScrollingChildEnabled() {
  Context context = activityTestRule.getActivity();
  NestedScrollView disabledParent = new NestedScrollView(context);
  disabledParent.setNestedScrollingEnabled(false);
  NestedScrollView enabledChild = new NestedScrollView(context);
  enabledChild.setNestedScrollingEnabled(true);
  disabledParent.addView(enabledChild);

  View scrollingChild = getBehavior().findScrollingChild(disabledParent);
  assertThat(scrollingChild, is((View) enabledChild));
}
 
开发者ID:material-components,项目名称:material-components-android,代码行数:14,代码来源:BottomSheetBehaviorTest.java

示例5: onCreate

import android.support.v4.widget.NestedScrollView; //导入方法依赖的package包/类
@Override protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  ScrollView scrollView = new ScrollView(this);
  nestedScrollView = new NestedScrollView(this);
  emptyView = new FrameLayout(this);

  LayoutParams scrollParams = new LayoutParams(MATCH_PARENT, MATCH_PARENT);
  LayoutParams emptyParams = new LayoutParams(50000, 50000);

  nestedScrollView.addView(emptyView, emptyParams);
  scrollView.addView(nestedScrollView, scrollParams);
  setContentView(scrollView, scrollParams);
}
 
开发者ID:JakeWharton,项目名称:RxBinding,代码行数:14,代码来源:RxNestedScrollViewTestActivity.java


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