當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。