本文整理匯總了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);
}