本文整理汇总了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);
}
示例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);
}
}
示例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();
}
示例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);
}