Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

110419 1236 pm fixing customt uiid in toast bar #2758

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions CodenameOne/src/com/codename1/components/ToastBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.codename1.io.NetworkManager;
import com.codename1.ui.Button;
import com.codename1.ui.Component;
import static com.codename1.ui.Component.CENTER;
import static com.codename1.ui.ComponentSelector.$;
import com.codename1.ui.Container;
import com.codename1.ui.Dialog;
Expand All @@ -37,7 +38,6 @@
import com.codename1.ui.Label;
import com.codename1.ui.Slider;
import com.codename1.ui.TextArea;
import com.codename1.ui.animations.CommonTransitions;
import com.codename1.ui.events.ActionEvent;
import com.codename1.ui.events.ActionListener;
import com.codename1.ui.geom.Dimension;
Expand Down Expand Up @@ -284,6 +284,7 @@ public void setExpires(int millis) {
public void run() {
Display.getInstance().callSerially(new Runnable() {
public void run() {
timer.cancel();
timer = null;
Status.this.clear();
}
Expand Down Expand Up @@ -583,10 +584,10 @@ public void actionPerformed(ActionEvent evt) {
if (!oldText.equals(l.getText())) {


if (s.getUiid() != null) {
c.setUIID(s.getUiid());
} else if (defaultUIID != null) {
if (defaultUIID != null) {
c.setUIID(defaultUIID);
} else if (s.getUiid() != null) {
c.setUIID(s.getUiid());
}

if (c.isVisible()) {
Expand All @@ -606,11 +607,12 @@ public void actionPerformed(ActionEvent evt) {
} else {
newLabel.setUIID(c.label.getUIID());
}
if (s.getUiid() != null) {
c.setUIID(s.getUiid());
} else if (defaultUIID != null) {

if (defaultUIID != null) {
c.setUIID(defaultUIID);
}
} else if (s.getUiid() != null) {
c.setUIID(s.getUiid());
}
newLabel.setWidth(c.label.getWidth());

newLabel.setText(l.getText());
Expand All @@ -622,7 +624,8 @@ public void actionPerformed(ActionEvent evt) {
// are stuck in blocking mode between them and the label just got discarded see:
// https://stackoverflow.com/questions/46172993/codename-one-toastbar-nullpointerexception
if(c.label.getParent() != null) {
c.label.getParent().replaceAndWait(c.label, newLabel, CommonTransitions.createCover(CommonTransitions.SLIDE_VERTICAL, true, 300));
//c.label.getParent().replaceAndWait(c.label, newLabel, CommonTransitions.createCover(CommonTransitions.SLIDE_VERTICAL, true, 300));
c.label.getParent().replaceAndWait(c.label, newLabel, null);
c.label = newLabel;

if (oldTextAreaSize.getHeight() != newTexAreaSize.getHeight()) {
Expand All @@ -638,11 +641,11 @@ public void actionPerformed(ActionEvent evt) {
} else if (defaultMessageUIID != null) {
c.label.setUIID(defaultMessageUIID);
}
if (s.getUiid() != null) {
c.setUIID(s.getUiid());
} else if (defaultUIID != null) {
if (defaultUIID != null) {
c.setUIID(defaultUIID);
}
} else if (s.getUiid() != null) {
c.setUIID(s.getUiid());
}
c.label.setText(l.getText());
//c.label.setColumns(l.getText().length()+1);
//c.label.setRows(l.getText().length()+1);
Expand Down