本文整理汇总了Java中com.pivotallabs.R类的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
R类属于com.pivotallabs包,在下文中一共展示了R类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.pivotallabs.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sign_in_dialog);
final EditText usernameEditText = (EditText) findViewById(R.id.username);
final EditText passwordEditText = (EditText) findViewById(R.id.password);
signInButton = findViewById(R.id.sign_in_button);
new ViewEnablingTextWatcher(signInButton, usernameEditText, passwordEditText);
signInButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
signInButton.setEnabled(false);
authenticationGateway.signIn(
usernameEditText.getText().toString(),
passwordEditText.getText().toString(),
new SignInCallbacks());
}
});
}
示例2: onCreate
import com.pivotallabs.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.recent_activity_layout);
authenticationGateway = new AuthenticationGateway(apiGateway, this);
recentActivities = new RecentActivities(apiGateway, authenticationGateway);
ListView recentActivityListView = (ListView) findViewById(R.id.recent_activity_list);
View loadingView = getLayoutInflater().inflate(R.layout.loading_view, recentActivityListView, false);
recentActivityListView.addFooterView(loadingView, null, false);
recentActivityListView.setFooterDividersEnabled(false);
RecentActivityAdapter recentActivityAdapter = new RecentActivityAdapter(recentActivities, getLayoutInflater());
recentActivityListView.setAdapter(recentActivityAdapter);
showLoadingWhileOutstanding = new ViewVisibleWhileOutstandingCallbacks(loadingView);
notifyDataSetChangedCallbacks = new NotifyDataSetChangedCallbacks(recentActivityAdapter);
updateOrSignIn();
}
示例3: stopLoadingAndSetText
import com.pivotallabs.R; //导入依赖的package包/类
public void stopLoadingAndSetText(int text_res_id) {
TextView textView = (TextView) findViewById(R.id.loading_text_text_view);
textView.setText(text_res_id);
textView.setVisibility(View.VISIBLE);
findViewById(R.id.loading_text_spinner).setVisibility(View.GONE);
}
示例4: onCreate
import com.pivotallabs.R; //导入依赖的package包/类
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.injected);
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.LONG, Locale.US);
String formattedDate = dateFormat.format(date);
injectedTextView.setText(caption + " - " + formattedDate);
}
示例5: onFailure
import com.pivotallabs.R; //导入依赖的package包/类
@Override
public void onFailure() {
Resources resources = getContext().getResources();
new AlertDialog.Builder(getContext())
.setTitle(resources.getString(R.string.error))
.setMessage(resources.getString(R.string.unknown_user_pass))
.setPositiveButton(resources.getString(R.string.ok), new EmptyOnClickListener())
.show();
}
示例6: setUp
import com.pivotallabs.R; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
Activity activity = Robolectric.buildActivity(Activity.class).create().get();
loadingTextView = (LoadingTextView) LayoutInflater.from(activity).inflate(R.layout.loading_text, null);
loadingSpinner = loadingTextView.findViewById(R.id.loading_text_spinner);
loadingTextTextView = (TextView) loadingTextView.findViewById(R.id.loading_text_text_view);
}
示例7: testStopLoadingAndSetTextShouldHideTheSpinnerAndShowTheTextView
import com.pivotallabs.R; //导入依赖的package包/类
@Test
public void testStopLoadingAndSetTextShouldHideTheSpinnerAndShowTheTextView() throws Exception {
assertThat(loadingSpinner.getVisibility(), equalTo(View.VISIBLE));
assertThat(loadingTextTextView.getVisibility(), equalTo(View.INVISIBLE));
loadingTextView.stopLoadingAndSetText(R.string.unit_tests_ftw);
assertThat(loadingSpinner.getVisibility(), equalTo(View.GONE));
assertThat(loadingTextTextView.getVisibility(), equalTo(View.VISIBLE));
}
示例8: setUp
import com.pivotallabs.R; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
RecentActivity recentActivity = new RecentActivity().setDescription("foo");
ArrayList<RecentActivity> recentActivities = new ArrayList<RecentActivity>();
recentActivities.add(new RecentActivity().setDescription("bar"));
recentActivities.add(recentActivity);
LayoutInflater layoutInflater = Robolectric.buildActivity(Activity.class).create().get().getLayoutInflater();
parent = new LinearLayout(Robolectric.application);
recycleView = (TextView) layoutInflater.inflate(R.layout.activity_summary, parent, false);
adapter = new RecentActivityAdapter(recentActivities, layoutInflater);
}
示例9: setUp
import com.pivotallabs.R; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
apiGateway = new TestApiGateway();
Activity context = Robolectric.buildActivity(Activity.class).create().get();
signInDialog = new SignInDialog(context, new AuthenticationGateway(apiGateway, context));
signInDialog.show();
usernameEditText = (TextView) signInDialog.findViewById(R.id.username);
passwordEditText = (TextView) signInDialog.findViewById(R.id.password);
signInButton = signInDialog.findViewById(R.id.sign_in_button);
}
示例10: setUp
import com.pivotallabs.R; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
signIn();
createActivity();
authenticationGateway = new AuthenticationGateway(apiGateway, activity);
activityListView = (ListView) activity.findViewById(R.id.recent_activity_list);
}
示例11: signInThroughDialog
import com.pivotallabs.R; //导入依赖的package包/类
private void signInThroughDialog() throws Exception {
assertThat(activity.signInDialog.isShowing(), equalTo(true));
((EditText) activity.signInDialog.findViewById(R.id.username)).setText("user");
((EditText) activity.signInDialog.findViewById(R.id.password)).setText("pass");
activity.signInDialog.findViewById(R.id.sign_in_button).performClick();
apiGateway.simulateResponse(200, TestResponses.AUTH_SUCCESS);
assertThat(activity.signInDialog.isShowing(), equalTo(false));
}
示例12: shouldAssignStringToTextView
import com.pivotallabs.R; //导入依赖的package包/类
@Test
public void shouldAssignStringToTextView() throws Exception {
injectedActivity.onCreate(null);
TextView injectedTextView = (TextView) injectedActivity.findViewById(R.id.injected_text_view);
assertThat(injectedTextView.getText().toString(),
equalTo("Roboguice Activity tested with Robolectric - December 8, 2010"));
}
示例13: setUp
import com.pivotallabs.R; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
RecentActivity recentActivity = new RecentActivity().setDescription("foo");
ArrayList<RecentActivity> recentActivities = new ArrayList<RecentActivity>();
recentActivities.add(new RecentActivity().setDescription("bar"));
recentActivities.add(recentActivity);
LayoutInflater layoutInflater = new Activity().getLayoutInflater();
parent = new LinearLayout(null);
recycleView = (TextView) layoutInflater.inflate(R.layout.activity_summary, parent);
adapter = new RecentActivityAdapter(recentActivities, layoutInflater);
}
示例14: setUp
import com.pivotallabs.R; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
apiGateway = new TestApiGateway();
signInDialog = new SignInDialog(new Activity(), new AuthenticationGateway(apiGateway, new Activity()));
signInDialog.show();
usernameEditText = (TextView) signInDialog.findViewById(R.id.username);
passwordEditText = (TextView) signInDialog.findViewById(R.id.password);
signInButton = signInDialog.findViewById(R.id.sign_in_button);
}
示例15: getView
import com.pivotallabs.R; //导入依赖的package包/类
@Override
public View getView(RecentActivity item, View recycleView, ViewGroup parent) {
TextView view = (TextView) (recycleView == null ? layoutInflater.inflate(R.layout.activity_summary, parent, false) : recycleView);
view.setText(item.getDescription());
return view;
}