|
@@ -21,6 +21,8 @@ import android.widget.AdapterView;
|
|
|
import android.widget.RelativeLayout;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
+import androidx.annotation.ColorInt;
|
|
|
+import androidx.annotation.ColorRes;
|
|
|
import androidx.annotation.Nullable;
|
|
|
import androidx.lifecycle.Lifecycle;
|
|
|
|
|
@@ -616,6 +618,9 @@ public class PopMenu extends BaseDialog {
|
|
|
} else {
|
|
|
boxRoot.setClickable(false);
|
|
|
}
|
|
|
+ if (backgroundColor != null) {
|
|
|
+ tintColor(boxBody, backgroundColor);
|
|
|
+ }
|
|
|
|
|
|
if (backgroundRadius > -1) {
|
|
|
if (boxBody.getBackground() instanceof GradientDrawable) {
|
|
@@ -1508,4 +1513,20 @@ public class PopMenu extends BaseDialog {
|
|
|
}
|
|
|
return enabled;
|
|
|
}
|
|
|
+
|
|
|
+ public int getBackgroundColor() {
|
|
|
+ return backgroundColor;
|
|
|
+ }
|
|
|
+
|
|
|
+ public PopMenu setBackgroundColor(@ColorInt int backgroundColor) {
|
|
|
+ this.backgroundColor = backgroundColor;
|
|
|
+ refreshUI();
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public PopMenu setBackgroundColorRes(@ColorRes int backgroundColorResId) {
|
|
|
+ this.backgroundColor = getColor(backgroundColorResId);
|
|
|
+ refreshUI();
|
|
|
+ return this;
|
|
|
+ }
|
|
|
}
|