Skip to content

Commit de3b5ff

Browse files
Fixed bugs and UI problems
1 parent 8646bab commit de3b5ff

39 files changed

+446
-344
lines changed

codenameone_settings.properties

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
#
2-
#Sun Oct 18 13:04:11 IDT 2020
2+
#Thu Nov 12 10:10:01 IST 2020
33
codename1.ios.appid=Q5GHSKAL2F.com.codename1.demos.kitchen
44
baseClass=src/generated/StateMachineBase.java
5-
codename1.arg.ios.NSCameraUsageDescription=Requires access to camera for capturing video and display it on through the app.
5+
codename1.arg.android.xapplication=<meta-data android\:name\="com.google.android.maps.v2.API_KEY" android\:value\="AIzaSyAOzyccab7fGRkJx0Iya_FopmozLTFUA4A"/>
6+
codename1.arg.ios.NSCameraUsageDescription=Requires access to camera for capturing video and display it on through the app.
67
codename1.ios.certificatePassword=
78
codename1.ios.debug.certificatePassword=
8-
codename1.ios.release.certificate=
99
codename1.arg.win.desktop-vm=zuluFx8
10+
codename1.ios.release.certificate=
1011
codename1.vendor=CodenameOne
1112
codename1.ios.release.certificatePassword=
1213
codename1.ios.certificate=
1314
codename1.ios.provision=
14-
codename1.arg.build.incSources=1
1515
codename1.rim.signtoolDb=
1616
codename1.languageLevel=5
1717
guiResource=theme.res
18-
codename1.android.keystorePassword=
18+
codename1.android.keystorePassword=password
19+
codename1.arg.ios.locationUsageDescription=Some functionality of the application depends on your location
1920
mainForm=Main
2021
codename1.arg.ios.pods=,GoogleMaps ${var.ios.pods.GoogleMaps.version\:2.6.0}
2122
codename1.arg.ios.NSMicrophoneUsageDescription=Requires access to microphone for capturing video and display it on through the app.
2223
codename1.arg.android.playService.maps=true
2324
codename1.packageName=com.codename1.demos.kitchen
2425
codename1.arg.android.xpermissions=<uses-permission android\:name\="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android\:name\="com.google.android.providers.gsf.permission.READ_GSERVICES"/><uses-feature android\:glEsVersion\="0x00020000" android\:required\="true"/>
2526
codename1.secondaryTitle=KitchenSink
26-
codename1.version=1.0
27+
codename1.version=3.05
2728
codename1.arg.android.GoogleMaps.minPlayServicesVersion=9.4.0
2829
codename1.ios.debug.certificate=
2930
codename1.j2me.nativeTheme=nbproject/nativej2me.res
@@ -39,10 +40,11 @@ codename1.arg.ios.objC=true
3940
userClass=src/userclasses/StateMachine.java
4041
codename1.arg.ios.glAppDelegateHeader=\n\#import "GoogleMaps/GoogleMaps.h"
4142
codename1.cssTheme=true
43+
codename1.arg.javascript.googlemaps.key=AIzaSyD5gChODsBV6_SK6u83PN3Yvz4Z3ODEIOw
4244
codename1.arg.ios.pods.sources=,https\://github.com/CocoaPods/Specs.git
43-
codename1.android.keystoreAlias=
45+
codename1.android.keystoreAlias=codenameone
4446
codename1.rim.certificatePassword=
4547
codename1.arg.java.version=8
46-
codename1.android.keystore=
48+
codename1.android.keystore=C\:\\Users\\serge\\Desktop\\kitchenSinkVersions\\androidKeystore.ks
4749
codename1.displayName=KitchenSink
4850
codename1.arg.ios.NSContactsUsageDescription=Requires access to contacts for viewing the contact list and edit it through the app

css/theme.css

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ background-image: url(images/charts/chart-bar.png),
100100
url(images/progress/infinite-progress.png),
101101
url(images/progress/slider.png),
102102
url(images/progress/text-loading-animation.png),
103-
url(images/maps/maps-pin.png),
104103
url(images/maps/map-google-component.png),
105104
url(images/default-contact-pic.jpg),
106105
url(images/code-name-one-icon.png);
@@ -495,10 +494,11 @@ DemoToolbar{
495494
}
496495

497496
ToolbarSearch{
497+
font-family: "native:MainRegular";
498498
margin: 0;
499499
background-color: white;
500500
font-size: 3mm;
501-
padding: 1.5mm;
501+
padding: 1mm;
502502
}
503503

504504
MainWindowToolbar{
@@ -601,13 +601,6 @@ WhiteBGLabel{
601601
border-radius: 2mm;
602602
}
603603

604-
InputContainer{
605-
border: none;
606-
background-image: url(images/labels/input-demo-background.jpg);
607-
cn1-source-dpi: 0;
608-
cn1-background-type: cn1-image-scaled-fill;
609-
margin: 0;
610-
}
611604
TextComponent{
612605
background-color: rgba(0, 0, 0, 0);
613606
padding: 3mm;
@@ -1429,15 +1422,8 @@ SideNavigationPanel{
14291422

14301423
TextFieldSearch{
14311424
color: black;
1432-
border: 1px solid gray;
1433-
margin: 2mm 5mm 2mm 5mm;
1434-
padding-left: 1.5mm;
1435-
padding-top: 1mm;
1436-
padding-bottom: 1mm;
14371425
font-size: 3mm;
1438-
border-radius: 2mm;
14391426
background-color: rgba(0, 0, 0, 0);
1440-
text-align: center;
14411427
}
14421428

14431429
ToolbarSearch{

icon.png

-95.4 KB
Loading

lib/CodenameOne_SRC.zip

1.81 KB
Binary file not shown.

nbproject/project.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,4 @@ source.encoding=UTF-8
100100
src.dir=src
101101
test.src.dir=test
102102

103+
cn1.javafx.path=${user.home}/.codenameone/javafx/lib/*
3.06 KB
Binary file not shown.
-7.72 KB
Binary file not shown.

src/com/codename1/demos/kitchen/AdvancedDemo.java

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
package com.codename1.demos.kitchen;
2525

2626
import com.codename1.components.*;
27-
import com.codename1.demos.kitchen.ComponentDemos.ImageViewerDemo;
2827
import com.codename1.ui.*;
2928
import com.codename1.ui.geom.Dimension;
3029
import com.codename1.ui.layouts.BorderLayout;
@@ -45,7 +44,7 @@
4544
* @author Sergey Gerashenko.
4645
*/
4746
public class AdvancedDemo extends Demo{
48-
private HashMap<String, List<String>> allNotes = new HashMap<>();
47+
private final HashMap<String, List<String>> allNotes = new HashMap<>();
4948

5049
public AdvancedDemo(Form parentForm) {
5150
init("Advanced", getGlobalResources().getImage("advanced-icon.png"), parentForm, "https://github.com/codenameone/KitchenSink/blob/master/src/com/codename1/demos/kitchen/AdvancedDemo.java");
@@ -83,9 +82,7 @@ public Container createContentPane(){
8382
"their signature with their finger.\n\nThe user is given the option to save/reset/cancel the signature. On save, "+
8483
"the signature Image property will be set with a full-size of the signature, and the icon on the button will "+
8584
"show a thumbnail of the image.",
86-
e->{
87-
showDemo("Signature", createSignatureDemo());
88-
}));
85+
e-> showDemo("Signature", createSignatureDemo())));
8986

9087
demoContainer.add(createComponent(getGlobalResources().getImage("advanced-calendar.png"),
9188
"Calendar",
@@ -94,9 +91,7 @@ public Container createContentPane(){
9491
"the resource localization e.g. Calendar. Jan, Calendar.Feb etc …\n\nTo localize stings for day names use the values "+
9592
"Calendar. Day in the resource localization e.g. \"Calendar.Sunday\", \"Calendar.Monday\" etc …\n\nNote that we "+
9693
"recommend using the picker class which is superior when running on the device for most use cases.",
97-
e-> {
98-
showDemo("Calendar", createCalendarDemo());
99-
}));
94+
e-> showDemo("Calendar", createCalendarDemo())));
10095

10196
demoContainer.add(createComponent(getGlobalResources().getImage("advanced-tree-file.png"),
10297
"File Tree",
@@ -172,9 +167,7 @@ protected Dimension calcPreferredSize() {
172167
});
173168

174169
Button clear = new Button("Clear", "SignatureClear");
175-
clear.addActionListener(e->{
176-
sig.setSignatureImage(null);
177-
});
170+
clear.addActionListener(e-> sig.setSignatureImage(null));
178171

179172
Container confirmContainer = new Container(new BorderLayout());
180173
confirmContainer.setUIID("ConfirmContainer");
@@ -193,9 +186,9 @@ private Container createCalendarDemo(){
193186

194187
Calendar cld = new Calendar();
195188
cld.setSelectedDaysUIID("CalendarSelected");
196-
System.out.println(cld.getSelectedDaysUIID());
197189
cld.addActionListener((e)->{
198-
notes.removeAll();
190+
notes.removeAll();
191+
notes.removeAll();
199192
List<String> currentNotes = allNotes.get(cld.getDate().toString());
200193
if(currentNotes == null){
201194
currentNotes = new ArrayList<>();
@@ -218,7 +211,7 @@ private Container createCalendarDemo(){
218211
currentNotes = new ArrayList<>();
219212
allNotes.put(cld.getDate().toString(), currentNotes);
220213
}
221-
214+
222215
TextComponent currNote = new TextComponent().labelAndHint("Note");
223216
Command ok = new Command("Ok");
224217
Command cancel = new Command("Cancel");

src/com/codename1/demos/kitchen/ButtonsDemo.java

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -62,50 +62,40 @@ public Container createContentPane() {
6262
"Button is the base class for several UI",
6363
"widgets allowing clickability. It has 3 States: rollover, pressed and the default state. Button can also "+
6464
"have an Action Listener that react when the button is clicked or handle actions via a Command.Button UIID by "+
65-
"default.", e->{
66-
showDemo("Buttons", createButtonsDemo());
67-
}));
65+
"default.", e-> showDemo("Buttons", createButtonsDemo())));
6866

6967
demoContainer.add(createComponent(getGlobalResources().getImage("span-button.png"),
7068
"Span Buttons",
7169
"A complex button similar to MultiButton",
7270
"that breaks lines automatically and looks like a regular button(more or less). Unlike the multi button the "+
73-
"span buttons has the UIID style of a button.", e->{
74-
showDemo("Span Buttons", createSpanButtonsDemo());
75-
}));
71+
"span buttons has the UIID style of a button.",
72+
e-> showDemo("Span Buttons", createSpanButtonsDemo())));
7673

7774
demoContainer.add(createComponent(getGlobalResources().getImage("multi-buttons.png"),
7875
"Multi Buttons",
7976
"A powerful button like component that",
8077
"allows multiple rows/and an icon to be added every row/icon can have its own UIID.\n\nInternally the "+
81-
"multi-button is a container with a lead component. Up to 4 rows are supported.", e->{
82-
showDemo("Multi Buttons", createMultiButtonsDemo());
83-
}));
78+
"multi-button is a container with a lead component. Up to 4 rows are supported.", e-> showDemo("Multi Buttons", createMultiButtonsDemo())));
8479

8580
demoContainer.add(createComponent(getGlobalResources().getImage("scale-image-label.png"),
8681
"Scale Image Button",
8782
"Button that simplifies the usage of scale to",
8883
"fill/fit. This is effectively equivalent to just setting the style image on a button but more convenient "+
89-
"for some special circumstances.\n\nOne major difference is that preferred size equals the image in this case.", e->{
90-
showDemo("Scale Image Button", createScaleImageButton());
91-
}));
84+
"for some special circumstances.\n\nOne major difference is that preferred size equals the image in this case.",
85+
e-> showDemo("Scale Image Button", createScaleImageButton())));
9286

9387
demoContainer.add(createComponent(getGlobalResources().getImage("floating-action-button.png"),
9488
"Floating Action Button",
9589
"Floating action buttons are a material design",
9690
"element used to promote a special action in a form. They are represented as a floating circle with a "+
97-
"flat icon floating above the UI typically in the bottom right area.", e->{
98-
showDemo("Floating Action Button", createFloatingActionButtonDemo());
99-
}));
91+
"flat icon floating above the UI typically in the bottom right area.", e-> showDemo("Floating Action Button", createFloatingActionButtonDemo())));
10092

10193
demoContainer.add(createComponent(getGlobalResources().getImage("share-button.png"),
10294
"Share Button",
10395
"The share button allows sharing a String",
10496
"or an image either thru the defined sharing services or thru native OS sharing support. On Android & iOS the "+
10597
"native sharing API is invoked for this class.\n\nThe code below demonstrates image sharing, notice that an "+
106-
"image must be stored using the FileSystemStorage API and shouldn't use a different API like Storage.", e->{
107-
showDemo("Share Button", createShareButtonDemo());
108-
}));
98+
"image must be stored using the FileSystemStorage API and shouldn't use a different API like Storage.", e-> showDemo("Share Button", createShareButtonDemo())));
10999
return demoContainer;
110100
}
111101

@@ -138,9 +128,9 @@ private Container createSpanButtonsDemo(){
138128
button.setUIID("DemoButton");
139129
button.addActionListener(e-> ToastBar.showInfoMessage("Button was pressed"));
140130

141-
Container SpanLabelContainer = BoxLayout.encloseY(new Label("SpanButton:", "DemoLabel"), button);
142-
SpanLabelContainer.setUIID("ButtonContainer");
143-
return BoxLayout.encloseY(SpanLabelContainer);
131+
Container spanLabelContainer = BoxLayout.encloseY(new Label("SpanButton:", "DemoLabel"), button);
132+
spanLabelContainer.setUIID("ButtonContainer");
133+
return BoxLayout.encloseY(spanLabelContainer);
144134
}
145135

146136
private Container createMultiButtonsDemo(){
@@ -272,7 +262,7 @@ private Container createFloatingActionButtonDemo(){
272262
Container tasksContainer = new Container(new BoxLayout(BoxLayout.Y_AXIS));
273263
tasksContainer.setScrollableY(true);
274264
FloatingActionButton addNew = FloatingActionButton.createFAB(FontImage.MATERIAL_ADD, "RedFabDemo");
275-
badge = FloatingActionButton.createBadge(String.valueOf("0"));
265+
badge = FloatingActionButton.createBadge("0");
276266

277267
FloatingActionButton greenButton = addNew.createSubFAB(FontImage.MATERIAL_ADD_TASK, "");
278268
greenButton.setUIID("GreenFabDemo");
@@ -283,7 +273,7 @@ private Container createFloatingActionButtonDemo(){
283273
Command cancel = new Command("Cancel");
284274
if (Dialog.show("Enter Note", BoxLayout.encloseY(header, body), ok, cancel) == ok && header.getText().length() != 0){
285275
tasksContainer.add(createNote(header.getText(), body.getText(), tasksContainer, true));
286-
int taskCount = Integer.valueOf(badge.getText()) + 1;
276+
int taskCount = Integer.parseInt(badge.getText()) + 1;
287277
badge.setText(String.valueOf(taskCount));
288278
tasksContainer.revalidate();
289279
}
@@ -298,7 +288,7 @@ private Container createFloatingActionButtonDemo(){
298288
Command cancel = new Command("Cancel");
299289
if (Dialog.show("Enter Note", BoxLayout.encloseY(header, body), ok, cancel) == ok && header.getText().length() != 0){
300290
tasksContainer.add(createNote(header.getText(), body.getText(), tasksContainer, false));
301-
int taskCount = Integer.valueOf(badge.getText()) + 1;
291+
int taskCount = Integer.parseInt(badge.getText()) + 1;
302292
badge.setText(String.valueOf(taskCount));
303293
tasksContainer.revalidate();
304294
}
@@ -329,7 +319,7 @@ private Component createNote(String header, String body, Container notes, boolea
329319
SwipeableContainer note = new SwipeableContainer(deleteButton, noteContainer);
330320
deleteButton.addActionListener(e->{
331321
notes.removeComponent(note);
332-
int taskCount = Integer.valueOf(badge.getText()) - 1;
322+
int taskCount = Integer.parseInt(badge.getText()) - 1;
333323
badge.setText(String.valueOf(taskCount));
334324
notes.revalidate();
335325
});

src/com/codename1/demos/kitchen/ChartsDemo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public Container createContentPane(){
9797

9898
demoContainer.add(createComponent(getGlobalResources().getImage("chart-line.png"),
9999
"Line Chart",
100-
"The linechart rendering class", e->{
100+
"The line chart rendering class", e->{
101101
TrigonometricFunctionsChart chart = new TrigonometricFunctionsChart();
102102
showChart(chart);
103103
}));
@@ -118,7 +118,7 @@ public Container createContentPane(){
118118

119119
demoContainer.add(createComponent(getGlobalResources().getImage("chart-scatter.png"),
120120
"Scatter Chart",
121-
"The scater chart rendering class", e->{
121+
"The scatter chart rendering class", e->{
122122
ScatterChart chart = new ScatterChart();
123123
showChart(chart);
124124
}));

0 commit comments

Comments
 (0)