Posts

Android FIngerprint Authentication

 Implement  implementation 'androidx.biometric:biometric:1.1.0' BiometricManager biometricManager = BiometricManager. from ( this ) ; switch (biometricManager.canAuthenticate()) { case BiometricManager. BIOMETRIC_ERROR_NO_HARDWARE : Toast. makeText (getApplicationContext() , "Failed To Authenticate FingerPrint." , Toast. LENGTH_SHORT ).show() ; break; case BiometricManager. BIOMETRIC_ERROR_HW_UNAVAILABLE : Toast. makeText (getApplicationContext() , "Failed To Authenticate FingerPrint." , Toast. LENGTH_SHORT ).show() ; break; case BiometricManager. BIOMETRIC_ERROR_NONE_ENROLLED : Toast. makeText (getApplicationContext() , "Failed To Authenticate FingerPrint." , Toast. LENGTH_SHORT ).show() ; break; } Executor executor = ContextCompat. getMainExecutor ( this ) ; biometricPrompt = new BiometricPrompt( this, executor , new BiometricPrompt.AuthenticationCallback() { @Override public vo...

Android Auto Transition

  // Apply animation if required TransitionSet autoTransition = new AutoTransition() ; autoTransition.setDuration( 300 ) ; TransitionManager. beginDelayedTransition (holder. mv_mainCardView , autoTransition) ;

Custom Bottom Sheet Bottom Slider Dialog Android Studio

public static void addBottomSheetDialog (Context context) { BottomSheetDialog dialog = new BottomSheetDialog(context , R.style. Transparent ) ; dialog.setContentView(R.layout. activity_home_add_file_dialog ) ; dialog.setCancelable( true ) ; dialog.setCanceledOnTouchOutside( true ) ; dialog.setDismissWithAnimation( true ) ; LinearLayout ll_captureDocument = dialog.findViewById(R.id. ll_captureDocument ) ; LinearLayout ll_fromFiles = dialog.findViewById(R.id. ll_fromFiles ) ; ll_captureDocument.setOnClickListener( new View.OnClickListener() { @Override public void onClick (View view) { context .startActivity( new Intent( context , DocumentCapturingActivity. class )) ; dialog .dismiss() ; } }) ; ll_fromFiles.setOnClickListener( new View.OnClickListener() { @Override public void onClick (View view) { context .startActivity( new Intent( context , FromFilesActivity. class )) ; ...

Custom Slider Drawer Android Studio

  <? xml version ="1.0" encoding ="utf-8" ?> <!--<?xml version="1.0" encoding="utf-8"?>--> <androidx.drawerlayout.widget.DrawerLayout xmlns: android ="http://schemas.android.com/apk/res/android" xmlns: app ="http://schemas.android.com/apk/res-auto" xmlns: tools ="http://schemas.android.com/tools" android :id ="@+id/drawer_layout" android :layout_width ="match_parent" android :layout_height ="match_parent" tools :context =".AppMainScreen" tools :openDrawer ="left" > <!-- Main Content --> <RelativeLayout android :layout_width ="match_parent" android :layout_height ="match_parent" > </RelativeLayout> <!-- Drawer Design Starts Here --> <androidx.core.widget.NestedScrollView android :layout_width ="@dimen/_230sdp" ...

Create Dialogs

public static void createShareDialog (Context context , String fileName , Uri uri) { Dialog dialog = new Dialog(context) ; dialog.setContentView(R.layout. dialog_sharefile ) ; dialog.getWindow().setLayout(ViewGroup.LayoutParams. WRAP_CONTENT , ViewGroup.LayoutParams. WRAP_CONTENT ) ; dialog.getWindow().setBackgroundDrawable(context.getDrawable(R.drawable. drawable_round_corners )) ; dialog.findViewById(R.id. iv_close ).setOnClickListener( new View.OnClickListener() { @Override public void onClick (View view) { dialog .dismiss() ; } }) ; dialog.findViewById(R.id. mb_addPassword ).setOnClickListener( new View.OnClickListener() { @Override public void onClick (View view) { editFileSettings ( context , uri , fileName ,false ) ; dialog .dismiss() ; } }) ; dialog.findViewById(R.id. tv_shareWithoutPassword ).setOnClickListener( new View.OnClickListener() { @Override ...

Creating RecyclerView and adjusting its margins

  public class RecylerView_ScannedDocumentAdapter extends RecyclerView.Adapter<RecylerView_ScannedDocumentAdapter.ViewHolder> { private Context context ; private List<Uri> imageUris ; public RecylerView_ScannedDocumentAdapter (Context context , List<Uri>imageUris) { this . context =context ; this . imageUris =imageUris ; } @NonNull // for adding the layout inflater @Override public ViewHolder onCreateViewHolder ( @NonNull ViewGroup parent , int viewType) { View view= LayoutInflater. from ( context ).inflate(R.layout. rv_item_scanned_images , parent ,false ) ; return new ViewHolder(view) ; } //adding the data to the files @Override public void onBindViewHolder ( @NonNull ViewHolder holder , int position) { Uri imageUri= imageUris .get(position) ; holder. iv_scannedImages .setImageURI(imageUri) ; } //for running the recyclerview for specific length @Override ...