Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LinearLayout ll = new LinearLayout(mContext);
- ll.setOrientation(LinearLayout.VERTICAL);
- ll.setBackgroundColor(Color.parseColor("#DDDDDD"));
- TextView tv = new TextView(mContext);
- tv.setText(R.string.str_select_color);
- tv.setGravity(Gravity.CENTER_HORIZONTAL);
- tv.setBackgroundColor(Color.parseColor("#DDDDDD"));
- tv.setWidth(240);
- // tv.setHeight(0);
- tv.setPadding(4, 0, 4, 10);
- ll.addView(tv);
- Drawable drawableCheckboxOn = ContextCompat.getDrawable(mContext, R.drawable.ic_checkbox_on_background);
- Drawable drawableCheckboxOff = ContextCompat.getDrawable(mContext, R.drawable.ic_checkbox_off_background);
- Button b1 = new Button(mContext);
- b1.setText(R.string.str_theme_one);
- // b1.setGravity(Gravity.CENTER);
- b1.setCompoundDrawablesWithIntrinsicBounds(drawableCheckboxOff, null, null, null);
- // b1.setBackgroundColor(Color.parseColor("#757575"));
- b1.setBackgroundResource(R.drawable.rounded_btn_theme_one);
- // b1.setForeground(new ColorDrawable(ContextCompat.getColor(mContext, R.color.other_overlay))); // Color.parseColor("#757575")
- b1.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- SoundPoolPlay.playSoundPool("touch_one");
- if (editor != null) {
- Toast.makeText(v.getContext(), R.string.theme_changed, Toast.LENGTH_SHORT).show();
- editor.putString("theme", "theme1").apply();
- isApplyTheme = true;
- }
- dialog.dismiss();
- }
- });
- ll.addView(b1);
- Button b2 = new Button(mContext);
- b2.setText(R.string.str_theme_two);
- // b2.setGravity(Gravity.CENTER);
- b2.setCompoundDrawablesWithIntrinsicBounds(drawableCheckboxOff, null, null, null);
- b2.setBackgroundColor(Color.parseColor("#66808080"));
- b2.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- SoundPoolPlay.playSoundPool("touch_one");
- if (editor != null) {
- Toast.makeText(v.getContext(), R.string.theme_changed, Toast.LENGTH_SHORT).show();
- editor.putString("theme", "theme2").apply();
- isApplyTheme = true;
- }
- dialog.dismiss();
- }
- });
- ll.addView(b2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement