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