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


Java R类代码示例

本文整理汇总了Java中org.researchstack.skin.R的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


R类属于org.researchstack.skin包,在下文中一共展示了R类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initProgressChart

import org.researchstack.skin.R; //导入依赖的package包/类
private void initProgressChart(View view)
{
    BarChartCard barCard = (BarChartCard) view.findViewById(R.id.dashboard_chart_bar);
    barCard.setTitle("Bathroom Use Frequency");
    barCard.setData(createBarChartData(), false);
    barCard.setExpandAction(o -> {
        Snackbar.make(view, "Expand Action", Snackbar.LENGTH_SHORT).show();
    });
    barCard.getChart().setVisibleXRangeMaximum(16);
    barCard.getChart().moveViewToX(mDashboardHelper.findBeaconStartDayOfMonth());

    LineChartCard lineCard = (LineChartCard) view.findViewById(R.id.dashboard_chart_line);
    lineCard.setTitle("Bathroom Use Total Duration");
    lineCard.setData(createLineChartData());
    lineCard.setExpandAction(o -> {
        Snackbar.make(view, "Expand Action", Snackbar.LENGTH_SHORT).show();
    });
    lineCard.getChart().getAxisLeft().setAxisMinValue(0f);
    lineCard.getChart().setVisibleXRangeMaximum(16);
    lineCard.getChart().moveViewToX(mDashboardHelper.findBeaconStartDayOfMonth());

    //TODO add line chart for longest single bathroom duration per day
}
 
开发者ID:daviszhou,项目名称:BeaconTrackerAndroid,代码行数:24,代码来源:DashboardFragment.java

示例2: shareConsentForm

import org.researchstack.skin.R; //导入依赖的package包/类
@Deprecated
public static void shareConsentForm(Context context) {
    Observable.create(subscriber -> {
        File consentFile = ConsentFormUtils.getConsentFormFileFromExternalStorage(context);
        subscriber.onNext(consentFile);
    }).compose(ObservableUtils.applyDefault()).subscribe(o -> {
        int stringId = context.getApplicationInfo().labelRes;
        String appName = context.getString(stringId);
        String emailSubject = context.getResources()
                .getString(R.string.rss_study_overview_email_subject, appName);

        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.setType("message/rfc822");
        intent.putExtra(Intent.EXTRA_SUBJECT, emailSubject);
        intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile((File) o));

        String title = context.getString(R.string.rss_send_email);
        context.startActivity(Intent.createChooser(intent, title));
    });
}
 
开发者ID:ResearchStack,项目名称:ResearchStack,代码行数:21,代码来源:ConsentFormUtils.java

示例3: onCreatePreferences

import org.researchstack.skin.R; //导入依赖的package包/类
@Override
public void onCreatePreferences(Bundle bundle, String s) {
    super.addPreferencesFromResource(R.xml.rss_settings);

    // Get our screen which is created in Skin SettingsFragment
    PreferenceScreen screen = getPreferenceScreen();
    screen.getSharedPreferences().registerOnSharedPreferenceChangeListener(this);

    profileCategory = (PreferenceCategory) screen.findPreference(KEY_PROFILE);

    privacyCategory = (PreferenceCategory) screen.findPreference(KEY_PRIVACY);
    sharingScope = privacyCategory.findPreference(KEY_SHARING_OPTIONS);

    generalCategory = (PreferenceCategory) screen.findPreference(KEY_GENERAL);
    leaveStudy = generalCategory.findPreference(KEY_LEAVE_STUDY);
    joinStudy = generalCategory.findPreference(KEY_JOIN_STUDY);

    // Set version string
    screen.findPreference(KEY_VERSION).setSummary(getVersionString());
}
 
开发者ID:ResearchStack,项目名称:ResearchStack,代码行数:21,代码来源:SettingsFragment.java

示例4: formatSharingOption

import org.researchstack.skin.R; //导入依赖的package包/类
public String formatSharingOption(String option) {
    if (option.equals("sponsors_and_partners")) {
        String investigatorLongDesc = data.getDocumentProperties()
                .getInvestigatorLongDescription();

        return getString(R.string.rsb_consent_share_widely, investigatorLongDesc);
    } else if (option.equals("all_qualified_researchers")) {
        String investigatorShortDesc = data.getDocumentProperties()
                .getInvestigatorShortDescription();

        return getString(R.string.rsb_consent_share_only, investigatorShortDesc);
    } else if (option.equals("no_sharing")) {
        return getString(R.string.rsb_consent_share_no);
    } else {
        // If you want to add another sharing option, feel free, you just need to override this
        // method in your SettingsFragment
        throw new RuntimeException("Sharing option " + option + " not supported");
    }
}
 
开发者ID:ResearchStack,项目名称:ResearchStack,代码行数:20,代码来源:SettingsFragment.java

示例5: getVersionString

import org.researchstack.skin.R; //导入依赖的package包/类
public String getVersionString() {
    int versionCode;
    String versionName;
    PackageManager manager = getActivity().getPackageManager();

    try {
        PackageInfo info = manager.getPackageInfo(getActivity().getPackageName(), 0);
        versionCode = info.versionCode;
        versionName = info.versionName;
    } catch (PackageManager.NameNotFoundException e) {
        LogExt.e(getClass(), "Could not find package version info");
        versionCode = 0;
        versionName = getString(R.string.rss_settings_version_unknown);
    }
    return getString(R.string.rss_settings_version, versionName, versionCode);
}
 
开发者ID:ResearchStack,项目名称:ResearchStack,代码行数:17,代码来源:SettingsFragment.java

示例6: onBindViewHolder

import org.researchstack.skin.R; //导入依赖的package包/类
@Override
public void onBindViewHolder(TaskAdapter.ViewHolder holder, int position) {
    SchedulesAndTasksModel.TaskScheduleModel task = tasks.get(position);
    boolean isOneTime = taskScheduleType.get(task.taskID);

    Resources res = holder.itemView.getResources();
    int tintColor = res.getColor(isOneTime
            ? R.color.rss_recurring_color
            : R.color.rss_one_time_color);

    holder.title.setText(Html.fromHtml("<b>" + task.taskTitle + "</b>"));
    holder.title.append("\n" + task.taskCompletionTime);
    holder.title.setTextColor(tintColor);

    Drawable drawable = holder.dailyIndicator.getDrawable();
    drawable = DrawableCompat.wrap(drawable);
    DrawableCompat.setTint(drawable, tintColor);
    holder.dailyIndicator.setImageDrawable(drawable);

    holder.itemView.setOnClickListener(v -> {
        LogExt.d(getClass(), "Item clicked: " + task.taskID);
        publishSubject.onNext(task);
    });
}
 
开发者ID:ResearchStack,项目名称:ResearchStack,代码行数:25,代码来源:ActivitiesFragment.java

示例7: showPager

import org.researchstack.skin.R; //导入依赖的package包/类
private void showPager(int index) {
    pagerFrame.animate().alpha(1)
            .setDuration(150)
            .withStartAction(() -> pagerFrame.setVisibility(View.VISIBLE))
            .withEndAction(() -> {
                pagerContainer.animate()
                        .translationY(0)
                        .setDuration(100)
                        .alpha(1)
                        .scaleX(1)
                        .scaleY(1);
            });
    tabStrip.getTabAt(index).select();
    skip.setActivated(true);
    signUp.setActivated(true);

    int colorFrom = ContextCompat.getColor(this, android.R.color.black);
    int colorTo = ContextCompat.getColor(this, android.R.color.white);
    ValueAnimator colorAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), colorFrom, colorTo);
    colorAnimation.setDuration(150);
    colorAnimation.addUpdateListener(animator -> signIn.setTextColor((int) animator.getAnimatedValue()));
    colorAnimation.start();
}
 
开发者ID:ResearchStack,项目名称:ResearchStack,代码行数:24,代码来源:OnboardingActivity.java

示例8: hidePager

import org.researchstack.skin.R; //导入依赖的package包/类
private void hidePager() {
    pagerContainer.animate()
            .translationY(48)
            .alpha(0)
            .setDuration(100)
            .scaleX(.9f)
            .scaleY(.9f)
            .withEndAction(() -> {
                pagerFrame.animate()
                        .alpha(0)
                        .setDuration(150)
                        .withEndAction(() -> pagerFrame.setVisibility(View.GONE));
                skip.setActivated(false);
                signUp.setActivated(false);
            });

    int colorFrom = ContextCompat.getColor(this, android.R.color.white);
    int colorTo = ContextCompat.getColor(this, android.R.color.black);
    ValueAnimator colorAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), colorFrom, colorTo);
    colorAnimation.setDuration(150);
    colorAnimation.addUpdateListener(animator -> signIn.setTextColor((int) animator.getAnimatedValue()));
    colorAnimation.start();
}
 
开发者ID:ResearchStack,项目名称:ResearchStack,代码行数:24,代码来源:OnboardingActivity.java

示例9: onDataReady

import org.researchstack.skin.R; //导入依赖的package包/类
@Override
public void onDataReady() {
    super.onDataReady();

    email = getIntent().getStringExtra(EXTRA_EMAIL);
    password = getIntent().getStringExtra(EXTRA_PASSWORD);

    updateEmailText();

    RxView.clicks(findViewById(R.id.email_verification_wrong_email))
            .subscribe(v -> changeEmail());

    SubmitBar submitBar = (SubmitBar) findViewById(R.id.submit_bar);
    submitBar.setPositiveAction(v -> attemptSignIn());
    submitBar.setNegativeAction(v -> resendVerificationEmail());
}
 
开发者ID:ResearchStack,项目名称:ResearchStack,代码行数:17,代码来源:EmailVerificationActivity.java

示例10: getSnackBarMessageView

import org.researchstack.skin.R; //导入依赖的package包/类
/**
 * Method is not safe and assumes tv-id or tv-index wont change.
 *
 * @return Snackbar message TextView
 */
private TextView getSnackBarMessageView(Snackbar snackbar) {
    // Try id for app level snackbar id
    int id = org.researchstack.skin.R.id.snackbar_text;
    TextView tv = (TextView) snackbar.getView().findViewById(id);
    if (tv != null) {
        return tv;
    }

    // Try id for lib level snackbar id
    id = android.support.design.R.id.snackbar_text;
    tv = (TextView) snackbar.getView().findViewById(id);
    if (tv != null) {
        return tv;
    }

    // Lastly, get item at pos 0 and check if its a TextView. We don't use instanceOf since the
    // action is a Button who's super-type is also TextView.
    ViewGroup snackBarContainer = (ViewGroup) snackbar.getView();
    View childZero = snackBarContainer.getChildAt(0);
    if (childZero.getClass() == TextView.class) {
        return (TextView) childZero;
    }

    return null;
}
 
开发者ID:ResearchStack,项目名称:ResearchStack,代码行数:31,代码来源:BaseActivity.java

示例11: updatePermissionItems

import org.researchstack.skin.R; //导入依赖的package包/类
private void updatePermissionItems() {
    List<PermissionRequestManager.PermissionRequest> items = PermissionRequestManager.getInstance()
            .getPermissionRequests();

    for (PermissionRequestManager.PermissionRequest item : items) {
        boolean isGranted = PermissionRequestManager.getInstance().hasPermission(getContext(), item.getId());

        View parent = findViewWithTag(item.getId());

        TextView action = (TextView) parent.findViewById(R.id.permission_button);
        action.setText(isGranted
                ? R.string.rss_granted
                : item.isBlockingPermission() ? R.string.rss_allow : R.string.rss_optional);
        action.setEnabled(!isGranted);
    }
}
 
开发者ID:ResearchStack,项目名称:ResearchStack,代码行数:17,代码来源:PermissionStepLayout.java

示例12: isAnswerValid

import org.researchstack.skin.R; //导入依赖的package包/类
public boolean isAnswerValid() {
    List<PermissionRequestManager.PermissionRequest> items = PermissionRequestManager.getInstance()
            .getPermissionRequests();

    for (PermissionRequestManager.PermissionRequest item : items) {
        boolean isGranted = PermissionRequestManager.getInstance().hasPermission(getContext(), item.getId());

        if (!isGranted && item.isBlockingPermission()) {
            String permissionName = getResources().getString(item.getTitle());
            String formattedError = getResources().getString(
                    R.string.rss_permission_continue_invalid, permissionName.toLowerCase());
            Toast.makeText(getContext(), formattedError, Toast.LENGTH_SHORT).show();
            return false;
        }
    }

    return true;
}
 
开发者ID:ResearchStack,项目名称:ResearchStack,代码行数:19,代码来源:PermissionStepLayout.java

示例13: getChoices

import org.researchstack.skin.R; //导入依赖的package包/类
@NonNull
private List<Choice<String>> getChoices(ConsentQuizModel.QuizQuestion question) {
    List<Choice<String>> choices = new ArrayList<>();

    if (question.getType().equals("boolean")) {
        // json expected answer is a string of either "true" or "false"
        choices.add(new Choice<>(getContext().getString(R.string.rss_btn_true), "true"));
        choices.add(new Choice<>(getContext().getString(R.string.rss_btn_false), "false"));
    } else if (question.getType().equals("singleChoiceText")) {
        // json expected answer is a string of the index ("0" for the first choice)
        List<String> textChoices = question.getTextChoices();
        for (int i = 0; i < textChoices.size(); i++) {
            choices.add(new Choice<>(textChoices.get(i), String.valueOf(i)));
        }
    }
    return choices;
}
 
开发者ID:ResearchStack,项目名称:ResearchStack,代码行数:18,代码来源:ConsentQuizQuestionStepLayout.java

示例14: initVisualSteps

import org.researchstack.skin.R; //导入依赖的package包/类
private static void initVisualSteps(Context ctx, ConsentDocument doc, List<Step> steps) {
    for (int i = 0, size = doc.getSections().size(); i < size; i++) {
        ConsentSection section = doc.getSections().get(i);

        if (!TextUtils.isEmpty(section.getHtmlContent())) {
            String htmlFilePath = ResourceManager.getInstance()
                    .generatePath(ResourceManager.Resource.TYPE_HTML, section.getHtmlContent());
            section.setHtmlContent(ResourceManager.getResourceAsString(ctx, htmlFilePath));
        }

        ConsentVisualStep step = new ConsentVisualStep("consent_" + i);
        step.setSection(section);

        String nextString = ctx.getString(R.string.rsb_next);
        if (section.getType() == ConsentSection.Type.Overview) {
            nextString = ctx.getString(R.string.rsb_get_started);
        } else if (i == size - 1) {
            nextString = ctx.getString(R.string.rsb_done);
        }
        step.setNextButtonString(nextString);

        steps.add(step);
    }
}
 
开发者ID:ResearchStack,项目名称:ResearchStack,代码行数:25,代码来源:ConsentTask.java

示例15: onViewCreated

import org.researchstack.skin.R; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
{
    super.onViewCreated(view, savedInstanceState);

    emptyView = view.findViewById(R.id.dashboard_empty);

    initProgressChart(view);
}
 
开发者ID:daviszhou,项目名称:BeaconTrackerAndroid,代码行数:10,代码来源:DashboardFragment.java


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