Skip to content

Commit ee72d99

Browse files
committed
Address Lookup dark theme support
1 parent acec96b commit ee72d99

File tree

7 files changed

+120
-1
lines changed

7 files changed

+120
-1
lines changed

src/main/java/gwt/material/design/incubator/client/dark/IncubatorDarkThemeLoader.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
package gwt.material.design.incubator.client.dark;
2121

2222
import gwt.material.design.client.theme.dark.DarkThemeLoader;
23+
import gwt.material.design.incubator.client.google.addresslookup.AddressLookupDarkTheme;
2324
import gwt.material.design.incubator.client.placeholder.PlaceholderDarkTheme;
2425
import gwt.material.design.incubator.client.progress.ProgressLineBarDarkTheme;
2526
import gwt.material.design.incubator.client.tag.TagLabelDarkTheme;
@@ -28,7 +29,8 @@
2829
public class IncubatorDarkThemeLoader extends DarkThemeLoader {
2930

3031
public IncubatorDarkThemeLoader() {
31-
super(new GroupToggleDarkTheme(),
32+
super(new AddressLookupDarkTheme(),
33+
new GroupToggleDarkTheme(),
3234
new PlaceholderDarkTheme(),
3335
new ProgressLineBarDarkTheme(),
3436
new TagLabelDarkTheme());

src/main/java/gwt/material/design/incubator/client/google/addresslookup/AddressLookup.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import com.google.gwt.event.shared.HandlerRegistration;
2323
import gwt.material.design.client.ui.MaterialTextBox;
24+
import gwt.material.design.incubator.client.dark.IncubatorDarkThemeReloader;
2425
import gwt.material.design.incubator.client.google.addresslookup.constants.AddressComponentType;
2526
import gwt.material.design.incubator.client.google.addresslookup.constants.AddressType;
2627
import gwt.material.design.incubator.client.google.addresslookup.events.AddressLookupEvents;
@@ -80,6 +81,7 @@ public class AddressLookup extends MaterialTextBox
8081

8182
public AddressLookup() {
8283
setPlaceholder("");
84+
setAutocomplete(false);
8385
}
8486

8587
/**
@@ -91,6 +93,13 @@ public AddressLookup(AddressLookupOptions options) {
9193
setOptions(options);
9294
}
9395

96+
@Override
97+
protected void onLoad() {
98+
super.onLoad();
99+
100+
IncubatorDarkThemeReloader.get().reload(AddressLookupDarkTheme.class);
101+
}
102+
94103
public void load() {
95104
addressLookup = new JsAddressLookup(valueBoxBase.getElement(), options);
96105
addressLookup.addListener(AddressLookupEvents.PLACE_CHANGED, () -> PlaceChangedEvent.fire(AddressLookup.this));
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2017 GwtMaterialDesign
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
package gwt.material.design.incubator.client.google.addresslookup;
21+
22+
import com.google.gwt.core.client.GWT;
23+
import com.google.gwt.resources.client.ClientBundle;
24+
import com.google.gwt.resources.client.TextResource;
25+
import gwt.material.design.incubator.client.infinitescroll.InfiniteScrollPanel;
26+
27+
//@formatter:off
28+
29+
/**
30+
* Client Bundle for {@link InfiniteScrollPanel}
31+
*
32+
* @author kevzlou7979
33+
*/
34+
public interface AddressLookupClientBundle extends ClientBundle {
35+
AddressLookupClientBundle INSTANCE = GWT.create(AddressLookupClientBundle.class);
36+
37+
@Source("resources/css/address-lookup-dark.min.css")
38+
TextResource addressLookupDarkCss();
39+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package gwt.material.design.incubator.client.google.addresslookup;
2+
3+
import gwt.material.design.addins.client.dark.AddinsWidgetDarkTheme;
4+
import gwt.material.design.incubator.client.AddinsIncubator;
5+
6+
public class AddressLookupDarkTheme extends AddinsWidgetDarkTheme {
7+
8+
public AddressLookupDarkTheme() {
9+
super(AddinsIncubator.isDebug() ? AddressLookupDebugClientBundle.INSTANCE.addressLookupDarkCss() : AddressLookupClientBundle.INSTANCE.addressLookupDarkCss());
10+
}
11+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2017 GwtMaterialDesign
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
package gwt.material.design.incubator.client.google.addresslookup;
21+
22+
import com.google.gwt.core.client.GWT;
23+
import com.google.gwt.resources.client.ClientBundle;
24+
import com.google.gwt.resources.client.TextResource;
25+
import gwt.material.design.incubator.client.infinitescroll.InfiniteScrollPanel;
26+
27+
//@formatter:off
28+
29+
/**
30+
* Debug Client Bundle for {@link InfiniteScrollPanel}
31+
*
32+
* @author kevzlou7979
33+
*/
34+
public interface AddressLookupDebugClientBundle extends ClientBundle {
35+
AddressLookupDebugClientBundle INSTANCE = GWT.create(AddressLookupDebugClientBundle.class);
36+
37+
@Source("resources/css/address-lookup-dark.css")
38+
TextResource addressLookupDarkCss();
39+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.pac-container {
2+
background-color: #2f2f2f;
3+
color: white !important;
4+
border-top: 1px solid #222222;
5+
}
6+
7+
.pac-item {
8+
border-top: 1px solid #393939;
9+
color: #8f8f8f;
10+
}
11+
12+
.pac-item:hover {
13+
background-color: #353535;
14+
}
15+
16+
.pac-item-query {
17+
color: #fff;
18+
}

src/main/resources/gwt/material/design/incubator/client/google/addresslookup/resources/css/address-lookup-dark.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)