How to have a transparent ImageButton: Android?
android:background=”@null”
For Ripple effect:
android:background=”?attr/selectableItemBackgroundBorderless”
Shortcut Keys
https://developer.android.com/studio/intro/keyboard-shortcuts
EditText
EditText1.requestFocus(); // this will focus the cursor on the edittext
TextInputLayout
implementation 'com.google.android.material:material:1.1.0'
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/enterTextWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_marginTop="4dp">-
<EditText
android:id="@+id/txtText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Your Text"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
final TextInputLayout enterTextWrapper = (TextInputLayout) findViewById(R.id.enterTextWrapper);
enterTextWrapper.setHint("Enter Your Text");
String strUsername = enterTextWrapper.getEditText().getText().toString();
if(!TextUtils.isEmpty(txtText.getText())) {
enterTextWrapper.setErrorEnabled(false);
} else {
enterTextWrapper.setError("Input required");
enterTextWrapper.setErrorEnabled(true);
enterTextWrapper.setFocusable(true);
txtText.requestFocus();
return;
}
Share
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType(“text/plain”);
String shareBody = etSMS.getText().toString();
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, “Cash Receipt ” + etSerial.getText());
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
startActivity(Intent.createChooser(sharingIntent, “Share via”));

