當前位置: 首頁>>代碼示例>>Java>>正文


Java R類代碼示例

本文整理匯總了Java中com.example.android.wizardpager.R的典型用法代碼示例。如果您正苦於以下問題:Java R類的具體用法?Java R怎麽用?Java R使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


R類屬於com.example.android.wizardpager包,在下文中一共展示了R類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: StepPagerStrip

import com.example.android.wizardpager.R; //導入依賴的package包/類
public StepPagerStrip(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    final TypedArray a = context.obtainStyledAttributes(attrs, ATTRS);
    mGravity = a.getInteger(0, mGravity);
    a.recycle();

    final Resources res = getResources();
    mTabWidth = res.getDimensionPixelSize(R.dimen.step_pager_tab_width);
    mTabHeight = res.getDimensionPixelSize(R.dimen.step_pager_tab_height);
    mTabSpacing = res.getDimensionPixelSize(R.dimen.step_pager_tab_spacing);

    mPrevTabPaint = new Paint();
    mPrevTabPaint.setColor(res.getColor(R.color.step_pager_previous_tab_color));

    mSelectedTabPaint = new Paint();
    mSelectedTabPaint.setColor(res.getColor(R.color.step_pager_selected_tab_color));

    mSelectedLastTabPaint = new Paint();
    mSelectedLastTabPaint.setColor(res.getColor(R.color.step_pager_selected_last_tab_color));

    mNextTabPaint = new Paint();
    mNextTabPaint.setColor(res.getColor(R.color.step_pager_next_tab_color));
}
 
開發者ID:gmccowey,項目名稱:CalabashAndroidExample,代碼行數:25,代碼來源:StepPagerStrip.java

示例2: onCreateView

import com.example.android.wizardpager.R; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_page, container, false);
    ((TextView) rootView.findViewById(android.R.id.title)).setText(mPage.getTitle());

    final ListView listView = (ListView) rootView.findViewById(android.R.id.list);
    setListAdapter(new ArrayAdapter<String>(getActivity(),
            android.R.layout.simple_list_item_multiple_choice,
            android.R.id.text1,
            mChoices));
    listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

    // Pre-select currently selected items.
    new Handler().post(new Runnable() {
        @Override
        public void run() {
            ArrayList<String> selectedItems = mPage.getData().getStringArrayList(
                    Page.SIMPLE_DATA_KEY);
            if (selectedItems == null || selectedItems.size() == 0) {
                return;
            }

            Set<String> selectedSet = new HashSet<String>(selectedItems);

            for (int i = 0; i < mChoices.size(); i++) {
                if (selectedSet.contains(mChoices.get(i))) {
                    listView.setItemChecked(i, true);
                }
            }
        }
    });

    return rootView;
}
 
開發者ID:gmccowey,項目名稱:CalabashAndroidExample,代碼行數:36,代碼來源:MultipleChoiceFragment.java

示例3: onCreateView

import com.example.android.wizardpager.R; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_page_customer_info, container, false);
    ((TextView) rootView.findViewById(android.R.id.title)).setText(mPage.getTitle());

    mNameView = ((TextView) rootView.findViewById(R.id.your_name));
    mNameView.setText(mPage.getData().getString(CustomerInfoPage.NAME_DATA_KEY));

    mEmailView = ((TextView) rootView.findViewById(R.id.your_email));
    mEmailView.setText(mPage.getData().getString(CustomerInfoPage.EMAIL_DATA_KEY));
    return rootView;
}
 
開發者ID:gmccowey,項目名稱:CalabashAndroidExample,代碼行數:14,代碼來源:CustomerInfoFragment.java

示例4: onCreateView

import com.example.android.wizardpager.R; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_page, container, false);
    ((TextView) rootView.findViewById(android.R.id.title)).setText(mPage.getTitle());

    final ListView listView = (ListView) rootView.findViewById(android.R.id.list);
    setListAdapter(new ArrayAdapter<String>(getActivity(),
            android.R.layout.simple_list_item_single_choice,
            android.R.id.text1,
            mChoices));
    listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);

    // Pre-select currently selected item.
    new Handler().post(new Runnable() {
        @Override
        public void run() {
            String selection = mPage.getData().getString(Page.SIMPLE_DATA_KEY);
            for (int i = 0; i < mChoices.size(); i++) {
                if (mChoices.get(i).equals(selection)) {
                    listView.setItemChecked(i, true);
                    break;
                }
            }
        }
    });

    return rootView;
}
 
開發者ID:gmccowey,項目名稱:CalabashAndroidExample,代碼行數:30,代碼來源:SingleChoiceFragment.java

示例5: onCreateView

import com.example.android.wizardpager.R; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_page, container, false);

    TextView titleView = (TextView) rootView.findViewById(android.R.id.title);
    titleView.setText(R.string.review);
    titleView.setTextColor(getResources().getColor(R.color.review_green));

    ListView listView = (ListView) rootView.findViewById(android.R.id.list);
    setListAdapter(mReviewAdapter);
    listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    return rootView;
}
 
開發者ID:gmccowey,項目名稱:CalabashAndroidExample,代碼行數:15,代碼來源:ReviewFragment.java

示例6: getView

import com.example.android.wizardpager.R; //導入依賴的package包/類
@Override
public View getView(int position, View view, ViewGroup container) {
    LayoutInflater inflater = LayoutInflater.from(getActivity());
    View rootView = inflater.inflate(R.layout.list_item_review, container, false);

    ReviewItem reviewItem = mCurrentReviewItems.get(position);
    String value = reviewItem.getDisplayValue();
    if (TextUtils.isEmpty(value)) {
        value = "(None)";
    }
    ((TextView) rootView.findViewById(android.R.id.text1)).setText(reviewItem.getTitle());
    ((TextView) rootView.findViewById(android.R.id.text2)).setText(value);
    return rootView;
}
 
開發者ID:gmccowey,項目名稱:CalabashAndroidExample,代碼行數:15,代碼來源:ReviewFragment.java

示例7: onCreateView

import com.example.android.wizardpager.R; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_page_customer_info, container, false);
    ((TextView) rootView.findViewById(android.R.id.title)).setText(mPage.getTitle());

    mNameView = ((TextView) rootView.findViewById(R.id.your_name));
    mNameView.setText(mPage.getData().getString(CustomerInfoPage.NAME_DATA_KEY));

    mEmailView = ((TextView) rootView.findViewById(R.id.your_email));
    mEmailView.setText(mPage.getData().getString(CustomerInfoPage.EMAIL_DATA_KEY));
    return rootView;
}
 
開發者ID:TechFreak,項目名稱:WizardPager,代碼行數:14,代碼來源:CustomerInfoFragment.java


注:本文中的com.example.android.wizardpager.R類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。