Remove the old color picker method

This commit is contained in:
ArtDev 2022-04-23 07:43:22 +03:00 committed by GitHub
parent d89a8325d7
commit a433d4a5de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,8 +35,6 @@ import net.kdt.pojavlaunch.customcontrols.buttons.ControlSubButton;
import androidx.appcompat.app.*;
import com.rarepebble.colorpicker.ColorPickerView;
public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListener {
private TextView mEditTextView;
@ -177,23 +175,6 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
return positionY;
}
public static void showColorPicker(Context ctx,String title, boolean showAlpha, ImageView v){
int startColor = ((ColorDrawable)v.getDrawable()).getColor();
ColorPickerView picker = new ColorPickerView(ctx);
picker.setColor(startColor);
picker.showAlpha(showAlpha);
AlertDialog.Builder dialog = new AlertDialog.Builder(ctx);
dialog.setTitle(title);
dialog.setView(picker);
dialog.setNegativeButton(android.R.string.cancel, null);
dialog.setPositiveButton(android.R.string.ok, (dialogInterface, i) -> v.setImageDrawable(new ColorDrawable(picker.getColor())));
dialog.show();
}
public static void setPercentageText(TextView textView, int progress){
textView.setText(progress + " %");
}