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


Java ConstraintLayout.findViewById方法代码示例

本文整理汇总了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;
}
 
开发者ID:Esri,项目名称:mapbook-android,代码行数:42,代码来源:MapbookFragment.java

示例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();
}
 
开发者ID:kflauri2312lffds,项目名称:Android_watch_magpie,代码行数:18,代码来源:FragmentHome.java

示例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;
}
 
开发者ID:jcolladosp,项目名称:ePills,代码行数:9,代码来源:AddPillSetTime.java

示例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;
}
 
开发者ID:jcolladosp,项目名称:ePills,代码行数:15,代码来源:AddPillSetTime.java

示例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;
}
 
开发者ID:jcolladosp,项目名称:ePills,代码行数:16,代码来源:AddPillSetTime.java

示例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);
}
 
开发者ID:Wootric,项目名称:WootricSDK-Android,代码行数:15,代码来源:SurveyLayoutPhone.java


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