use of android.support.annotation.RequiresApi in project KeePassDX by Kunzisoft.
the class PasswordActivity method checkFingerprintAvailability.
@RequiresApi(api = Build.VERSION_CODES.M)
private synchronized void checkFingerprintAvailability() {
// or manually disable
if (!PreferencesUtil.isFingerprintEnable(getApplicationContext()) || !FingerPrintHelper.isFingerprintSupported(FingerprintManagerCompat.from(this))) {
setFingerPrintVisibility(View.GONE);
} else // fingerprint is available but not configured show icon but in disabled state with some information
{
// show explanations
fingerprintContainerView.setOnClickListener(view -> {
FingerPrintDialog fingerPrintDialog = new FingerPrintDialog();
fingerPrintDialog.show(getSupportFragmentManager(), "fingerprintDialog");
});
setFingerPrintVisibility(View.VISIBLE);
if (!fingerPrintHelper.hasEnrolledFingerprints()) {
// This happens when no fingerprints are registered. Listening won't start
setFingerPrintView(R.string.configure_fingerprint, true);
} else // finally fingerprint available and configured so we can use it
{
fingerprintMustBeConfigured = false;
// fingerprint available but no stored password found yet for this DB so show info don't listen
if (!prefsNoBackup.contains(getPreferenceKeyValue())) {
setFingerPrintView(R.string.no_password_stored);
// listen for encryption
initEncryptData();
} else // all is set here so we can confirm to user and start listening for fingerprints
{
// listen for decryption
initDecryptData();
}
}
}
// Show fingerprint key deletion
invalidateOptionsMenu();
}
use of android.support.annotation.RequiresApi in project easy by MehdiBenmesa.
the class ModuleDetailFragment method onCreate.
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mReceiver = new DataReceiver(new Handler());
mReceiver.setReceiver(this);
exam = (TextView) getActivity().findViewById(R.id.exam);
controle = (TextView) getActivity().findViewById(R.id.control);
intero = (TextView) getActivity().findViewById(R.id.intero);
tp = (TextView) getActivity().findViewById(R.id.tps);
SessionManager sessionManager = new SessionManager(getContext());
userID = sessionManager.getIdUser();
// String Module = sessionManager
NoteService.getNoteByStudent(getContext(), mReceiver);
if (getArguments().containsKey(ARG_ITEM_ID)) {
// load dummy item by using the passed item ID.
// accident = AppContent.ITEM_MAP.get(getArguments().getString(ARG_ITEM_ID));
}
// Toast.makeText(getContext() , moduleID , Toast.LENGTH_LONG).show();
setHasOptionsMenu(true);
}
use of android.support.annotation.RequiresApi in project easy by MehdiBenmesa.
the class RendezVousFragment method buttonPressed.
@Override
public void buttonPressed(final JSONObject rdv) {
addDialog = getActivity().getLayoutInflater().inflate(R.layout.rdv_dialog, null);
final TextView nom = (TextView) addDialog.findViewById(R.id.nomdialog);
final TextView date = (TextView) addDialog.findViewById(R.id.date);
final EditText heur = (EditText) addDialog.findViewById(R.id.heur);
final EditText value = (EditText) addDialog.findViewById(R.id.value);
dialog = new LovelyCustomDialog(getContext(), R.style.EditTextTintTheme).setTopColorRes(R.color.darkRed).setView(addDialog).setTitle(R.string.text_input_title).setIcon(R.drawable.ic_add_alert_black_24dp).setCancelable(false);
dialog.show();
Button ok = (Button) addDialog.findViewById(R.id.ok);
Button annuler = (Button) addDialog.findViewById(R.id.cancel);
date.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showDatePicker();
}
});
ok.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
accept(rdv, date.getText().toString(), heur.getText().toString(), value.getText().toString());
dialog.dismiss();
}
});
annuler.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
refuse(rdv, value.getText().toString());
dialog.dismiss();
}
});
ondate = new DatePickerDialog.OnDateSetListener() {
@RequiresApi(api = Build.VERSION_CODES.N)
@Override
public void onDateSet(android.widget.DatePicker view, int year, int monthOfYear, int dayOfMonth) {
monthOfYear = monthOfYear + 1;
date.setText(year + "-" + monthOfYear + 1 + "-" + dayOfMonth);
calender.set(year, monthOfYear, dayOfMonth);
int dayOfWeek = 0;
dayOfWeek = calender.get(Calendar.DAY_OF_WEEK);
System.out.println("DAY_OF_WEEK : +======== " + dayOfWeek);
// studentsListAdapter.notifyDataSetChanged();
}
};
}
use of android.support.annotation.RequiresApi in project easy by MehdiBenmesa.
the class RendezVousActivity method buttonPressed.
@Override
public void buttonPressed(final JSONObject module) {
addDialog = getLayoutInflater().inflate(R.layout.rdv_dialog, null);
final TextView nom = (TextView) addDialog.findViewById(R.id.nomdialog);
final TextView date = (TextView) addDialog.findViewById(R.id.date);
final EditText heur = (EditText) addDialog.findViewById(R.id.heur);
final EditText value = (EditText) addDialog.findViewById(R.id.value);
dialog = new LovelyCustomDialog(this, R.style.EditTextTintTheme).setTopColorRes(R.color.darkRed).setView(addDialog).setTitle(R.string.text_input_title).setIcon(R.drawable.ic_add_alert_black_24dp).setCancelable(false);
dialog.show();
Button ok = (Button) addDialog.findViewById(R.id.ok);
Button annuler = (Button) addDialog.findViewById(R.id.cancel);
date.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showDatePicker();
}
});
ok.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
try {
ajouterRdv(module.getString("_id"), date.getText().toString(), value.getText().toString());
} catch (JSONException e) {
e.printStackTrace();
}
dialog.dismiss();
}
});
annuler.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dialog.dismiss();
}
});
ondate = new DatePickerDialog.OnDateSetListener() {
@RequiresApi(api = Build.VERSION_CODES.N)
@Override
public void onDateSet(android.widget.DatePicker view, int year, int monthOfYear, int dayOfMonth) {
monthOfYear = monthOfYear + 1;
date.setText(year + "-" + monthOfYear + 1 + "-" + dayOfMonth);
calender.set(year, monthOfYear, dayOfMonth);
int dayOfWeek = 0;
dayOfWeek = calender.get(Calendar.DAY_OF_WEEK);
System.out.println("DAY_OF_WEEK : +======== " + dayOfWeek);
// studentsListAdapter.notifyDataSetChanged();
}
};
}
use of android.support.annotation.RequiresApi in project Sudoku by mrbananasoup.
the class Game method openSettings.
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public void openSettings(View view) {
Intent settingsIntent = new Intent(this, SettingsActivity.class);
startActivity(settingsIntent);
}
Aggregations