Posts

Navigation and status bar color

Image
  Code:- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } getWindow().setNavigationBarColor(Color.parseColor("#FFFFFF")); getWindow().setStatusBarColor(Color.parseColor("#FFCDD2"));

Overlay view over another view

Image
  Code: RelativeLayout rl = new RelativeLayout(this); RelativeLayout.LayoutParams lparams = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT); rl.setLayoutParams(lparams); background.removeAllViews(); rl.addView(view2); rl.addView(view1); background.addView(rl);

Round corner with shadow and ripple effect

Image
  Code1: android.graphics.drawable.GradientDrawable gd = new android.graphics.drawable.GradientDrawable(); gd.setColor(Color.parseColor(_color)); gd.setCornerRadius((int)_radius); _view.setElevation((int)_shadow); android.content.res.ColorStateList clrb = new android.content.res.ColorStateList(new int[][]{new int[]{}}, new int[]{Color.parseColor("#212121")}); a ndroid.graphics.drawable.RippleDrawable ripdrb = new android.graphics.drawable.RippleDrawable(clrb , gd, null); _view.setClickable(true); _view.setBackground(ripdrb); Code2: android.graphics.drawable.GradientDrawable gd = new android.graphics.drawable.GradientDrawable(); gd.setColor(Color.parseColor(_color)); gd.setCornerRadius((int)_radius); _view.setBackground(gd); _view.setElevation((int)_shadow);

Animator in Sketchware

 Code:- ObjectAnimator anim = new ObjectAnimator(); anim.setTarget(_view); anim.setPropertyName(_propertyName); anim.setFloatValues((float)_value); anim.setDuration((long)_duration); anim.setInterpolator(new android.view.animation.AccelerateDecelerateInterpolator()); anim.start();

Background video in Sketchware

Image
 code:  final VideoView vd = new VideoView(MainActivity.this); vd.setLayoutParams(new LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT, android.widget.LinearLayout.LayoutParams.MATCH_PARENT)); vd.setVideoURI(Uri.parse(your video path)); vd.requestFocus(); vd.start(); RelativeLayout rl = new RelativeLayout(this); RelativeLayout rl2 = new RelativeLayout(this); rl2.addView(vd, -1,-1); linear1.removeAllViews(); rl.addView(rl2, -1,-1); rl.addView(linear2, -1,-1); linear1.addView(rl,-1,-1); //this property will all the video to be played in full screen DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); android.widget.RelativeLayout.LayoutParams params = (android.widget.RelativeLayout.LayoutParams) vd.getLayoutParams();  params.addRule(android.widget.RelativeLayout.ALIGN_PARENT_TOP, android.widget.RelativeLayout.TRUE); params.addRule(android.widget.RelativeLayout.ALIGN_PARENT_START, android...

Phone verification in Sketchware

Image
 Code in to send code: com.google.firebase.auth.PhoneAuthProvider.getInstance().verifyPhoneNumber(phone, 60, java.util.concurrent.TimeUnit.SECONDS, this, mCallbacks); } com.google.firebase.auth.PhoneAuthProvider.OnVerificationStateChangedCallbacks mCallbacks = new com.google.firebase.auth.PhoneAuthProvider.OnVerificationStateChangedCallbacks() { @Override public void onVerificationCompleted(com.google.firebase.auth.PhoneAuthCredential phoneAuthCredential) { showMessage("Verification completed"); } @Override public void onVerificationFailed(com.google.firebase.FirebaseException e) { showMessage(e.toString()); } @Override public void onCodeSent(String s, com.google.firebase.auth.PhoneAuthProvider.ForceResendingToken forceResendingToken) { super.onCodeSent(s, forceResendingToken); codeSent = s; } }; { Code to verify: com.google.firebase.auth.PhoneAuthCredential credential = com.google.firebase.auth.PhoneAuthProvider.getCredential(codeSent, code); signInWithPhoneAuthCredential(cr...