Search in sources :

Example 31 with RequiresApi

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();
}
Also used : FingerPrintDialog(com.keepassdroid.fingerprint.FingerPrintDialog) RequiresApi(android.support.annotation.RequiresApi)

Example 32 with RequiresApi

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);
}
Also used : SessionManager(dz.easy.androidclient.Util.SessionManager) Handler(android.os.Handler) DataReceiver(dz.easy.androidclient.Services.DataReceiver) RequiresApi(android.support.annotation.RequiresApi)

Example 33 with RequiresApi

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();
        }
    };
}
Also used : EditText(android.widget.EditText) DatePickerDialog(android.app.DatePickerDialog) BindView(butterknife.BindView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) RecyclerView(android.support.v7.widget.RecyclerView) Button(android.widget.Button) LovelyCustomDialog(com.yarolegovich.lovelydialog.LovelyCustomDialog) RequiresApi(android.support.annotation.RequiresApi) TextView(android.widget.TextView)

Example 34 with RequiresApi

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();
        }
    };
}
Also used : EditText(android.widget.EditText) DatePickerDialog(android.app.DatePickerDialog) JSONException(org.json.JSONException) MaterialSearchView(com.miguelcatalan.materialsearchview.MaterialSearchView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) Button(android.widget.Button) LovelyCustomDialog(com.yarolegovich.lovelydialog.LovelyCustomDialog) RequiresApi(android.support.annotation.RequiresApi) TextView(android.widget.TextView)

Example 35 with RequiresApi

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);
}
Also used : Intent(android.content.Intent) RequiresApi(android.support.annotation.RequiresApi)

Aggregations

RequiresApi (android.support.annotation.RequiresApi)217 Intent (android.content.Intent)30 Allocation (android.renderscript.Allocation)30 NotificationChannel (android.app.NotificationChannel)27 View (android.view.View)26 Bitmap (android.graphics.Bitmap)24 Paint (android.graphics.Paint)20 Point (android.graphics.Point)20 NotificationManager (android.app.NotificationManager)17 ViewGroup (android.view.ViewGroup)15 RecyclerView (android.support.v7.widget.RecyclerView)13 Uri (android.net.Uri)12 ViewTreeObserver (android.view.ViewTreeObserver)12 WindowInsets (android.view.WindowInsets)12 SuppressLint (android.annotation.SuppressLint)11 ActionBar (android.support.v7.app.ActionBar)11 Toolbar (android.support.v7.widget.Toolbar)11 TextView (android.widget.TextView)11 IOException (java.io.IOException)10 StatFs (android.os.StatFs)9