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