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


Java R类代码示例

本文整理汇总了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());
        }
    });
}
 
开发者ID:friederbluemle,项目名称:robolectric-ant-sample,代码行数:24,代码来源:SignInDialog.java

示例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();
}
 
开发者ID:friederbluemle,项目名称:robolectric-ant-sample,代码行数:23,代码来源:RecentActivityActivity.java

示例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);
}
 
开发者ID:friederbluemle,项目名称:robolectric-ant-sample,代码行数:8,代码来源:LoadingTextView.java

示例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);
}
 
开发者ID:friederbluemle,项目名称:robolectric-ant-sample,代码行数:9,代码来源:InjectedActivity.java

示例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();
}
 
开发者ID:friederbluemle,项目名称:robolectric-ant-sample,代码行数:10,代码来源:SignInDialog.java

示例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);
}
 
开发者ID:friederbluemle,项目名称:robolectric-ant-sample,代码行数:8,代码来源:LoadingTextViewTest.java

示例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));
}
 
开发者ID:friederbluemle,项目名称:robolectric-ant-sample,代码行数:11,代码来源:LoadingTextViewTest.java

示例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);
}
 
开发者ID:friederbluemle,项目名称:robolectric-ant-sample,代码行数:13,代码来源:RecentActivityAdapterTest.java

示例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);
}
 
开发者ID:friederbluemle,项目名称:robolectric-ant-sample,代码行数:13,代码来源:SignInDialogTest.java

示例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);
}
 
开发者ID:friederbluemle,项目名称:robolectric-ant-sample,代码行数:9,代码来源:RecentActivityActivityTest.java

示例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));
}
 
开发者ID:friederbluemle,项目名称:robolectric-ant-sample,代码行数:10,代码来源:RecentActivityActivityTest.java

示例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"));
}
 
开发者ID:android10,项目名称:Inside_Android_Testing,代码行数:8,代码来源:InjectedActivityTest.java

示例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);
}
 
开发者ID:android10,项目名称:Inside_Android_Testing,代码行数:13,代码来源:RecentActivityAdapterTest.java

示例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);
}
 
开发者ID:android10,项目名称:Inside_Android_Testing,代码行数:12,代码来源:SignInDialogTest.java

示例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;
}
 
开发者ID:friederbluemle,项目名称:robolectric-ant-sample,代码行数:7,代码来源:RecentActivityAdapter.java


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