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


Java DashboardActivity类代码示例

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


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

示例1: onProgramSelected

import org.eyeseetea.malariacare.DashboardActivity; //导入依赖的package包/类
public void onProgramSelected(Program program) {
    Log.d(TAG, "onProgramSelected");
    if (DashboardActivity.dashboardActivity.findViewById(R.id.dashboard_planning_orgunit).getVisibility() == View.VISIBLE) {
        //hide plannedFragment layout and show plannedOrgUnitsFragment
        orgUnitVisibility(View.GONE);
        programVisibility(View.VISIBLE);


        if (fragment == null)
            fragment = new PlannedFragment();

        FragmentTransaction ft = getFragmentTransaction();
        ft.replace(R.id.dashboard_planning_init, fragment);
        ft.commit();
        if(program!=null){
            ((PlannedFragment)fragment).reloadFilter();
        }
    }
    else
        ((PlannedFragment)fragment).reloadFilter();

}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:23,代码来源:PlanModuleController.java

示例2: confirmSendCompleteSurvey

import org.eyeseetea.malariacare.DashboardActivity; //导入依赖的package包/类
/**
 * This dialog is called to confirm before set a survey as complete
 */
private void confirmSendCompleteSurvey() {
    //if you select complete_option, this dialog will showed.
    new AlertDialog.Builder(dashboardActivity)
            .setMessage(R.string.dialog_are_you_sure_complete_survey)
            .setNegativeButton(android.R.string.no, null)
            .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int arg1) {
                    Survey survey = Session.getSurveyByModule(getSimpleName());
                    survey.setCompleteSurveyState(getSimpleName());
                    alertOnComplete(survey);
                    dashboardController.setNavigatingBackwards(true);
                    closeSurveyFragment();
                    if(DashboardOrientation.VERTICAL.equals(dashboardController.getOrientation())){
                        dashboardController.reloadVertical();
                    }
                    dashboardController.setNavigatingBackwards(false);
                    DashboardActivity.dashboardActivity.reloadSentData();
                }
            }).create().show();
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:24,代码来源:AssessModuleController.java

示例3: setActionBarTitleForSurvey

import org.eyeseetea.malariacare.DashboardActivity; //导入依赖的package包/类
public static void setActionBarTitleForSurvey(DashboardActivity dashboardActivity,Survey survey){
    String title="";
    String subtitle="";
    int appNameColor = dashboardActivity.getResources().getColor(R.color.appNameColor);
    String appNameColorString = String.format("%X", appNameColor).substring(2);
    Program program = survey.getProgram();
    if(survey.getOrgUnit().getName()!=null) {
        title = survey.getOrgUnit().getName();
    }
    if(program.getName()!=null) {
        subtitle = program.getName();
    }
    if(PreferencesState.getInstance().isVerticalDashboard()) {
        setActionbarVerticalSurvey(dashboardActivity,title, subtitle);
    }
    else{
        Spanned spannedTitle = Html.fromHtml(String.format("<font color=\"#%s\"><b>", appNameColorString) + title + "</b></font>");
        setActionbarTitle(dashboardActivity,spannedTitle, subtitle);
    }
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:21,代码来源:LayoutUtils.java

示例4: onClick

import org.eyeseetea.malariacare.DashboardActivity; //导入依赖的package包/类
@Override
        public void onClick(View v) {
            DashboardActivity activity = ((DashboardActivity) context);
            activity.onSurveySelected(survey);
//            if(survey.getStatus()==Constants.SURVEY_PLANNED){
//                survey=SurveyPlanner.getInstance().startSurvey(survey);
//            }
//
//            Session.setSurveyByModule(survey);
//            activity.prepareLocationListener(survey);
//            //FIXME
//
//            activity.initSurveyFromPlanning();

            // de development
//            DashboardActivity activity = ((DashboardActivity) context);
//            if(survey.getStatus()==Constants.SURVEY_PLANNED){
//                survey=SurveyPlanner.getInstance().startSurvey(survey);
//            }
//            activity.prepareLocationListener(survey);
//            //FIXME
//
//            activity.initSurveyFromPlanning(survey);
        }
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:25,代码来源:PlannedAdapter.java

示例5: onCancelled

import org.eyeseetea.malariacare.DashboardActivity; //导入依赖的package包/类
@Override
protected void onCancelled() {

    //Need to complete credentials (ack from user first time)
    if (mLastError instanceof UserRecoverableAuthIOException) {
        DashboardActivity.dashboardActivity.startActivityForResult(
                ((UserRecoverableAuthIOException) mLastError).getIntent(),
                DriveRestControllerStrategy.REQUEST_AUTHORIZATION);
        return;
    }

    //Real connection google error
    if (mLastError instanceof GooglePlayServicesAvailabilityIOException) {
        DriveRestControllerStrategy.getInstance().showGooglePlayServicesAvailabilityErrorDialog(
                ((GooglePlayServicesAvailabilityIOException) mLastError)
                        .getConnectionStatusCode());
        return;
    }

    //Other error
    Log.e(TAG, "onCancelled: " + mLastError == null ? "" : mLastError.getMessage());
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:23,代码来源:DownloadMediaTask.java

示例6: downloadFile

import org.eyeseetea.malariacare.DashboardActivity; //导入依赖的package包/类
private String downloadFile(String resourceId) throws Exception {
    Log.d(TAG, String.format("Downloading resource: %s ...", resourceId));

    Drive.Files.Get getFile = mService.files().get(resourceId);
    File fileDrive = getFile.execute();
    Log.d(TAG, "\tfilename: " + fileDrive.getName());

    if(fileDrive.getName().endsWith(QUICKTIME_NON_SUPPORTED_FORMAT)){
        throw new IllegalStateException(String.format("%s format not supported in Android",fileDrive.getName()));
    }

    java.io.File localFile = new java.io.File(DashboardActivity.dashboardActivity.getFilesDir(), fileDrive.getName());
    FileOutputStream fileOutputStream = new FileOutputStream(localFile);
    getFile.executeMediaAndDownloadTo(fileOutputStream);
    fileOutputStream.close();
    return localFile.getAbsolutePath();
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:18,代码来源:DownloadMediaTask.java

示例7: onCreate

import org.eyeseetea.malariacare.DashboardActivity; //导入依赖的package包/类
public void onCreate() {
    if (existsLoggedUser()) {
        LoadUserAndCredentialsUseCase loadUserAndCredentialsUseCase =
                new LoadUserAndCredentialsUseCase(loginActivity);

        loadUserAndCredentialsUseCase.execute();

        finishAndGo(DashboardActivity.class);
    } else {
        loginActivity.runOnUiThread(new Runnable() {
            public void run() {
                addDemoButton();
            }
        });
    }
}
 
开发者ID:EyeSeeTea,项目名称:malariapp,代码行数:17,代码来源:LoginActivityStrategy.java

示例8: setActionBarTitleForSurvey

import org.eyeseetea.malariacare.DashboardActivity; //导入依赖的package包/类
public static void setActionBarTitleForSurvey(DashboardActivity dashboardActivity,
        Survey survey) {
    String title = "";
    String subtitle = "";
    int appNameColor = dashboardActivity.getResources().getColor(R.color.appNameColor);
    String appNameColorString = String.format("%X", appNameColor).substring(2);
    Program program = survey.getProgram();
    if (survey.getOrgUnit().getName() != null) {
        title = survey.getOrgUnit().getName();
    }
    if (program.getName() != null) {
        subtitle = program.getName();
    }
    if (PreferencesState.getInstance().isVerticalDashboard()) {
        setActionbarVerticalSurvey(dashboardActivity, title, subtitle);
    } else {
        Spanned spannedTitle = Html.fromHtml(
                String.format("<font color=\"#%s\"><b>", appNameColorString) + title
                        + "</b></font>");
        setActionbarTitle(dashboardActivity, spannedTitle, subtitle);
    }
}
 
开发者ID:EyeSeeTea,项目名称:malariapp,代码行数:23,代码来源:LayoutUtils.java

示例9: onCancelled

import org.eyeseetea.malariacare.DashboardActivity; //导入依赖的package包/类
@Override
protected void onCancelled() {

    //Need to complete credentials (ack from user first time)
    if (mLastError instanceof UserRecoverableAuthIOException) {
        DashboardActivity.dashboardActivity.startActivityForResult(
                ((UserRecoverableAuthIOException) mLastError).getIntent(),
                DriveRestController.REQUEST_AUTHORIZATION);
        return;
    }

    //Real connection google error
    if (mLastError instanceof GooglePlayServicesAvailabilityIOException) {
        DriveRestController.getInstance().showGooglePlayServicesAvailabilityErrorDialog(
                ((GooglePlayServicesAvailabilityIOException) mLastError)
                        .getConnectionStatusCode());
        return;
    }

    //Other error
    Log.e(TAG, "onCancelled: " + mLastError == null ? "" : mLastError.getMessage());
}
 
开发者ID:EyeSeeTea,项目名称:malariapp,代码行数:23,代码来源:DownloadMediaTask.java

示例10: showNewReceiptBalanceFragment

import org.eyeseetea.malariacare.DashboardActivity; //导入依赖的package包/类
private void showNewReceiptBalanceFragment(int type) {
    Activity activity = getActivity();
    if (activity != null) {
        NewReceiptBalanceFragment newReceiptBalanceFragment = new NewReceiptBalanceFragment();
        Bundle bundle = new Bundle();
        bundle.putInt(NewReceiptBalanceFragment.TYPE, type);
        newReceiptBalanceFragment.setArguments(bundle);
        replaceFragment(R.id.dashboard_stock_container, newReceiptBalanceFragment);

        int headerString=R.string.fragment_new_receipt;
        if (type == Constants.SURVEY_RESET) {
            headerString=R.string.fragment_new_reset;
        }
        DashboardHeaderStrategy.getInstance().init(activity, headerString);
        if (activity instanceof DashboardActivity) {
            ((DashboardActivity) activity).initNewReceiptFragment();
        }
    }
}
 
开发者ID:EyeSeeTea,项目名称:pictureapp,代码行数:20,代码来源:StockFragment.java

示例11: showHistoricReceiptBalanceFragment

import org.eyeseetea.malariacare.DashboardActivity; //导入依赖的package包/类
private void showHistoricReceiptBalanceFragment(int type) {
    Activity activity = getActivity();
    if (activity != null) {
        HistoricReceiptBalanceFragment historicReceiptBalanceFragment =
                new HistoricReceiptBalanceFragment();
        Bundle bundle = new Bundle();
        bundle.putInt(HistoricReceiptBalanceFragment.TYPE, type);
        historicReceiptBalanceFragment.setArguments(bundle);
        replaceFragment(R.id.dashboard_stock_container, historicReceiptBalanceFragment);

        int headerString=R.string.fragment_historic_receipt_balance;
        if (type == Constants.SURVEY_RESET) {
            headerString=R.string.fragment_historic_reset;
        }
        DashboardHeaderStrategy.getInstance().init(activity,headerString);
        if (activity instanceof DashboardActivity) {
            ((DashboardActivity) activity).initNewReceiptFragment();
        }
    }
}
 
开发者ID:EyeSeeTea,项目名称:pictureapp,代码行数:21,代码来源:StockFragment.java

示例12: onCreate

import org.eyeseetea.malariacare.DashboardActivity; //导入依赖的package包/类
@Override
public void onCreate() {
    if (existsLoggedUser() && PopulateDB.hasMandatoryTables()) {
        LoadUserAndCredentialsUseCase loadUserAndCredentialsUseCase =
                new LoadUserAndCredentialsUseCase(loginActivity);

        loadUserAndCredentialsUseCase.execute();

        finishAndGo(DashboardActivity.class);
    } else {
        //TODO jsanchez, this is necessary because oncreate is called from
        //AsyncTask review Why is invoked from AsyncTask, It's not very correct
        PopulateDB.wipeDataBase();
        loginActivity.runOnUiThread(new Runnable() {
            public void run() {
                addDemoButton();
            }
        });
    }
}
 
开发者ID:EyeSeeTea,项目名称:pictureapp,代码行数:21,代码来源:LoginActivityStrategy.java

示例13: onClick

import org.eyeseetea.malariacare.DashboardActivity; //导入依赖的package包/类
/**
 * Checks if the given position points to a real survey and open it.
 */
public void onClick(ListView l, int position, List<Survey> surveys) {
    //Discard clicks on header|footer (which is attended on newSurvey via super)
    if (!isPositionASurvey(l, surveys, position)) {
        return;
    }
    //fixed the position in the list if the adapter have a header.
    int fixedPosition = getFixedPosition(l);
    //Put selected survey in session
    position = position - fixedPosition;
    if(position < 0 || position >= surveys.size()) {
        return;
    }
    Survey malariaSurvey = surveys.get(position);
    Session.setMalariaSurvey(malariaSurvey);
    if (mDashboardAdapterStrategy.hasAllComplementarySurveys(malariaSurvey)) {
        // Go to SurveyActivity
        DashboardActivity.dashboardActivity.openSentSurvey();
    }
}
 
开发者ID:EyeSeeTea,项目名称:pictureapp,代码行数:23,代码来源:AssessmentAdapter.java

示例14: createViewRow

import org.eyeseetea.malariacare.DashboardActivity; //导入依赖的package包/类
public TableRow createViewRow(TableRow rowView, Value value) {
    //Sets the value text in the row and add the question as tag.
    CustomTextView textCard = (CustomTextView) rowView.findViewById(R.id.review_content_text);
    textCard.setText((value.getInternationalizedName() != null) ? value.getInternationalizedName()
            : value.getValue());
    if ((value.getQuestionUId() != null)) {
        textCard.setTag(value.getQuestionUId());

        //Adds click listener to hide the fragment and go to the clicked question.
        textCard.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(!DynamicTabAdapter.isClicked) {
                    DynamicTabAdapter.isClicked = true;
                    String questionUId = (String) v.getTag();

                    DashboardActivity.dashboardActivity.hideReview(questionUId);
                }
            }
        });
        textCard.setBackgroundColor(
                Color.parseColor(value.getBackgroundColor()));

    }
    return rowView;
}
 
开发者ID:EyeSeeTea,项目名称:pictureapp,代码行数:27,代码来源:ReviewFragmentStrategy.java

示例15: reloadFilter

import org.eyeseetea.malariacare.DashboardActivity; //导入依赖的package包/类
public void reloadFilter(){
    CustomSpinner programSpinner = (CustomSpinner) DashboardActivity.dashboardActivity.findViewById(R.id.dashboard_planning_spinner_program);
    Program selectedProgram=(Program) programSpinner.getSelectedItem();
    if(selectedProgram!=null) {
        loadProgram(selectedProgram);
    }
    adapter.notifyDataSetChanged();
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:9,代码来源:PlannedFragment.java


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