本文整理汇总了Java中android.support.constraint.ConstraintLayout.findViewById方法的典型用法代码示例。如果您正苦于以下问题:Java ConstraintLayout.findViewById方法的具体用法?Java ConstraintLayout.findViewById怎么用?Java ConstraintLayout.findViewById使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.constraint.ConstraintLayout
的用法示例。
在下文中一共展示了ConstraintLayout.findViewById方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import android.support.constraint.ConstraintLayout; //导入方法依赖的package包/类
/**
* Set up the view components and attach a listener
* to the map book adapter
* @param inflater - LayoutInflater
* @param container - ViewGroup
* @param savedInstanceState - Bundle
* @return the View (can be null)
*/
@Override
final public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
final Bundle savedInstanceState) {
mRoot = (ConstraintLayout) container;
final RecyclerView mRecyclerView = (RecyclerView) mRoot.findViewById(R.id.recyclerView);
final LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
mRecyclerView.setLayoutManager( layoutManager);
mapAdapter = new MapbookAdapter(new MapbookAdapter.OnItemClickListener() {
@Override public void onItemClick(final ImageView image, final String title, final int position) {
final Intent intent = new Intent(getContext(), MapActivity.class);
intent.putExtra(getString(R.string.index), position);
intent.putExtra(getString(R.string.map_title), title);
intent.putExtra(MapbookFragment.FILE_PATH, mPresenter.getMapbookPath());
startActivity(intent);
}
});
mRecyclerView.setAdapter(mapAdapter);
layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
// Set on click listener for download button
final ImageView downloadBtn = (ImageView) getActivity().findViewById(R.id.imageDownloadBtn);
downloadBtn.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(final View v) {
Log.i(TAG, "Download button clicked");
downloadMapbook(mPresenter.getMapbookPath());
}
});
// Enable fragment to have options menu
setHasOptionsMenu(true);
return null;
}
示例2: setLevel
import android.support.constraint.ConstraintLayout; //导入方法依赖的package包/类
/**
* this methode is used to set the level of the cursor (set the current statuts)
* @param layout
* @param value
*/
private void setLevel(ConstraintLayout layout, float value) {
//get the element we want to change the constraint
ImageView cursor=(ImageView) layout.findViewById(R.id.cursor);
//get the actual constraint
ConstraintSet set = new ConstraintSet();
set.clone(layout);
//change actual constraint
set.setVerticalBias(cursor.getId(), value);
// Apply the changes
set.applyTo(layout);
layout.refreshDrawableState();
}
示例3: createQuantityStep
import android.support.constraint.ConstraintLayout; //导入方法依赖的package包/类
private View createQuantityStep() {
LayoutInflater inflater = LayoutInflater.from(getBaseContext());
quantityContent = (ConstraintLayout) inflater.inflate(R.layout.stepper_quantity, null, false);
seekBar = quantityContent.findViewById(R.id.seekbar);
seekBar.setProgress(1);
return quantityContent;
}
示例4: createTimeStep
import android.support.constraint.ConstraintLayout; //导入方法依赖的package包/类
private View createTimeStep() {
LayoutInflater inflater = LayoutInflater.from(getBaseContext());
ConstraintLayout timeStepContent =
(ConstraintLayout) inflater.inflate(R.layout.stepper_time, null, false);
timeTextView = timeStepContent.findViewById(R.id.time_label);
timeTextView.setText(getTimeString());
timeTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
timePicker.show();
}
});
return timeStepContent;
}
示例5: createDateStep
import android.support.constraint.ConstraintLayout; //导入方法依赖的package包/类
private View createDateStep() {
LayoutInflater inflater = LayoutInflater.from(getBaseContext());
ConstraintLayout dateStepContent =
(ConstraintLayout) inflater.inflate(R.layout.stepper_time,null, false);
startDateTextView = dateStepContent.findViewById(R.id.time_label);
startDateTextView.setText(getDateString(startDate));
startDateTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startDatePicker.show();
}
});
return dateStepContent;
}
示例6: initSurveyViewElements
import android.support.constraint.ConstraintLayout; //导入方法依赖的package包/类
private void initSurveyViewElements() {
mLayoutBody = (ConstraintLayout) findViewById(R.id.wootric_survey_layout_body);
mScoreLayout = (LinearLayout) mLayoutBody.findViewById(R.id.wootric_score_layout);
mAnchorLikely = (TextView) mLayoutBody.findViewById(R.id.wootric_anchor_likely);
mAnchorNotLikely = (TextView) mLayoutBody.findViewById(R.id.wootric_anchor_not_likely);
mRatingBar = (RatingBar) mLayoutBody.findViewById(R.id.wootric_rating_bar);
mSurveyViews = new View[]{ mRatingBar, mScoreLayout, mAnchorLikely, mAnchorNotLikely };
initScoreLayout();
initViews();
mRatingBar.setOnScoreChangedListener(this);
}