@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_visit_dashboard); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); if (toolbar != null) { setSupportActionBar(toolbar); } Intent intent = getIntent(); mVisit = new VisitDAO() .getVisitsByID(intent.getLongExtra(ApplicationConstants.BundleKeys.VISIT_ID, 0)); mPatient = new PatientDAO().findPatientByID(String.valueOf(mVisit.getPatientID())); mPatientName = intent.getStringExtra(ApplicationConstants.BundleKeys.PATIENT_NAME); mVisitEncounters = mVisit.getEncounters(); mEmptyListView = (TextView) findViewById(R.id.visitDashboardEmpty); FontsUtil.setFont(mEmptyListView, FontsUtil.OpenFonts.OPEN_SANS_BOLD); mExpandableListView = (ExpandableListView) findViewById(R.id.visitDashboardExpList); mExpandableListView.setEmptyView(mEmptyListView); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login_view_layout); mUrlField = (RelativeLayout) findViewById(R.id.urlField); mUsername = (EditText) findViewById(R.id.loginUsernameField); mUsername.setText(OpenMRS.getInstance().getUsername()); mPassword = (EditText) findViewById(R.id.loginPasswordField); mLoginButton = (Button) findViewById(R.id.loginButton); mLoginButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { if (validateLoginFields()) { if ((!mOpenMRS.getUsername().equals(ApplicationConstants.EMPTY_STRING) && !mOpenMRS.getUsername().equals(mUsername.getText().toString())) || ((!mOpenMRS.getServerUrl().equals(ApplicationConstants.EMPTY_STRING) && !mOpenMRS.getServerUrl().equals(mUrlTextView.getText().toString())))) { showWarningDialog(); } else { login(); } } else { ToastUtil.showShortToast( getApplicationContext(), ToastUtil.ToastType.ERROR, R.string.login_dialog_login_or_password_empty); } } }); mSpinner = (ProgressBar) findViewById(R.id.loginLoading); mLoginFormView = (LinearLayout) findViewById(R.id.loginFormView); mDropdownLocation = (Spinner) findViewById(R.id.locationSpinner); mUrlTextView = (TextView) findViewById(R.id.urlText); if (mErrorOccurred || OpenMRS.getInstance().getServerUrl().equals(ApplicationConstants.EMPTY_STRING)) { showURLDialog(); } else { if (mLastCorrectURL.equals(ApplicationConstants.EMPTY_STRING)) { mUrlTextView.setText(OpenMRS.getInstance().getServerUrl()); mLastCorrectURL = OpenMRS.getInstance().getServerUrl(); } else { mUrlTextView.setText(mLastCorrectURL); } mUrlField.setVisibility(View.VISIBLE); hideURLDialog(); } FontsUtil.setFont((ViewGroup) findViewById(android.R.id.content)); }