Skip to content

Instantly share code, notes, and snippets.

View amirul12's full-sized avatar
🏠
Software Engineer at Millennium Information Solution Ltd. (MISL)

MD. AMIRUL ISLAM amirul12

🏠
Software Engineer at Millennium Information Solution Ltd. (MISL)
View GitHub Profile
<com.google.android.material.chip.ChipGroup
android:id="@+id/group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:chipSpacing="10dp"
app:singleSelection="true">
<com.google.android.material.chip.Chip
android:id="@+id/cCasual"
style="@style/Colors_Widget.MaterialComponents.Chip.Choice"
<FrameLayout
android:layout_marginTop="@dimen/layout_margin_bottom"
android:id="@+id/flAuto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.edupointbd.bb.util.DelayAutoCompleteTextView
android:id="@+id/et_book_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.main.MainActivity">
<android.support.v7.widget.CardView
android:id="@+id/card_news"
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<receiver android:name=".IncomingCallReceiver" android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE" />
</intent-filter>
</receiver>
private void showOptionMenu(View view) {
PopupMenu popupMenu = new PopupMenu(mContext, view);
MenuInflater menuInflater = popupMenu.getMenuInflater();
menuInflater.inflate(R.menu.pizza_menu,popupMenu.getMenu());
popupMenu.setOnMenuItemClickListener(new PizzaMenuItemClickListener());
popupMenu.show();
}
public class MainActivity extends AppCompatActivity implements EasyPermissions.PermissionCallbacks{
private static final String TAG = "MainActivity";
private Button btnOpenCamera;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
<resources>
<!-- font sizes -->
<dimen name="font_larger">22sp</dimen>
<dimen name="font_large">18sp</dimen>
<dimen name="font_normal">15sp</dimen>
<dimen name="font_small">12sp</dimen>
<!-- typical spacing between two views -->
<dimen name="spacing_huge">40dp</dimen>
String s = "{menu:{\"1\":\"sql\", \"2\":\"android\", \"3\":\"mvc\"}}";
JSONObject jObject = new JSONObject(s);
JSONObject menu = jObject.getJSONObject("menu");
Map<String,String> map = new HashMap<String,String>();
Iterator iter = menu.keys();
while(iter.hasNext()){
String key = (String)iter.next();
String value = menu.getString(key);
map.put(key,value);
public static boolean emptyChecker(EditText[] editTexts, Activity activity) {
/**
* checking input field for empty or not
*/
int totalLength = 0;
for (int i = 0; i < editTexts.length; i++) {
EditText editText = editTexts[i];
if (editText.getText().toString().trim().equals("")) {
Toast.makeText(activity, editTexts[i].getTag().toString() + " " + activity.getString(R.string.is_empty), Toast.LENGTH_SHORT).show();
break;
implementation 'com.stripe:stripe-android:7.0.0'
public class MainActivity extends AppCompatActivity {
public static final String PUBLISHABLE_KEY = "pk_test_RDj9RzgYggpcUuVoLoqBKWWl";
private Card card;
private ProgressDialog progress;
private Button purchase;