GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Status bar pick by PanayotCankov · Pull Request #3522 · NativeScript/NativeScript

Status bar pick #3522

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.

Sign up for GitHub

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

Merged
PanayotCankov merged 3 commits into release from status-bar-pick
Jan 24, 2017

Uh oh!

There was an error while loading. Please reload this page.

Merged

Status bar pick #3522

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
3 commits
Select commit Hold shift + click to select a range
05e247d
backgroundColor added in ActionBarStyler
zh-m Jan 11, 2017
5b2d130
Fix crash when status bar is set on Android in API level 21 or below
PanayotCankov Jan 23, 2017
bfc9cf1
Try add some output to track the build failure. Too much > dev/nulls
PanayotCankov Jan 24, 2017
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

19 changes: 10 additions & 9 deletions 19 .travis.yml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,17 @@ before_script:
- adb shell input keyevent 82 &
script:
- jdk_switcher use oraclejdk8
- grunt default --verbose &&
FULL_PACKAGE_VERSION=`node -e 'console.log(require("./bin/dist/tns-core-modules/package.json").version);'` &&
(cd tns-platform-declarations && npm pack) &&
wget -O ./nativescript.tgz "https://s3.amazonaws.com/nativescript-ci/build_result/nativescript.tgz" &&
echo no | npm install -g nativescript.tgz --ignore-scripts > /dev/null && tns usage-reporting disable && tns error-reporting disable &&
grunt buildOnlyTestsApp --verbose --platform=Android --modulesPath=./bin/dist/$PACKAGE_NAME-$FULL_PACKAGE_VERSION.tgz --runtimeVersion=$RUNTIMEVERSION --emuPId=.*emulator.* --avd=$AVD_NAME --showEmu=false > /dev/null &&
grunt runOnlyTestsApp --verbose --platform=Android --modulesPath=./bin/dist/$PACKAGE_NAME-$FULL_PACKAGE_VERSION.tgz --emuPId=.*emulator.* --avd=$AVD_NAME --showEmu=false
- grunt default --verbose
- FULL_PACKAGE_VERSION=$(node build/version.js)
- (cd tns-platform-declarations && npm pack)
- wget -O ./nativescript.tgz "https://s3.amazonaws.com/nativescript-ci/build_result/nativescript.tgz"
- echo no | npm install -g nativescript.tgz --ignore-scripts
- tns usage-reporting disable && tns error-reporting disable
- grunt buildOnlyTestsApp --platform=Android --modulesPath=./bin/dist/$PACKAGE_NAME-$FULL_PACKAGE_VERSION.tgz --runtimeVersion=$RUNTIMEVERSION --emuPId=.*emulator.* --avd=$AVD_NAME --showEmu=false
- grunt runOnlyTestsApp --verbose --platform=Android --modulesPath=./bin/dist/$PACKAGE_NAME-$FULL_PACKAGE_VERSION.tgz --emuPId=.*emulator.* --avd=$AVD_NAME --showEmu=false
- node ./build/travis-scripts/check-testrun-broken.js
- adb pull /storage/sdcard/Documents/test-results.xml &&
mv test-results.xml ~/test-run-results$PACKAGE_VERSION.xml
- adb pull /storage/sdcard/Documents/test-results.xml
- mv test-results.xml ~/test-run-results$PACKAGE_VERSION.xml
before_deploy:
- mv bin/dist/$PACKAGE_NAME-$FULL_PACKAGE_VERSION.tgz ../.deploymentpackage
- mv build ../
Expand Down
69 changes: 38 additions & 31 deletions 69 apps/app/ui-tests-app/page/page-status-bar-css.xml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,42 @@
<ActionBar title="Sample title" />
</Page.actionBar>

<WrapLayout>
<!-- status-bar-style -->
<Button text="11" tap="applyTap" tag="status-bar-style: light;" style.fontSize="8" width="40" height="40" automationText="light;" />
<Button text="12" tap="applyTap" tag="status-bar-style: dark;" style.fontSize="8" width="40" height="40" automationText="dark;" />

<!-- status-bar-style - action-bar - background -->
<Button text="21" tap="applyTapOnStyledActionBar" tag="status-bar-style: light;" style.fontSize="8" width="40" height="40" automationText="light-abb-ruby" />
<Button text="22" tap="applyTapOnStyledActionBar" tag="status-bar-style: dark;" style.fontSize="8" width="40" height="40" automationText="dark-abb-ruby" />

<!-- status-bar-style - action-bar - hidden -->
<Button text="31" tap="applyTapWithHiddenActionBar" tag="status-bar-style: light;" style.fontSize="8" width="40" height="40" automationText="light-ab-hidden" />
<Button text="32" tap="applyTapWithHiddenActionBar" tag="status-bar-style: dark;" style.fontSize="8" width="40" height="40" automationText="ark-ab-hidden" />

<!-- android-status-bar-background -->
<Button text="41" tap="applyTap" tag="android-status-bar-background: #E0115F;" style.fontSize="8" width="40" height="40" automationText="asbb-blue" />

<!-- status-bar-style - page - background -->
<Button text="51" tap="applyTap" tag="status-bar-style: light;background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="light-bckg-ruby" />
<Button text="52" tap="applyTap" tag="status-bar-style: dark; background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="dark-bckg-ruby" />

<!-- status-bar-style - page - and - action-bar - background -->
<Button text="61" tap="applyTapOnStyledActionBar" tag="status-bar-style: light;background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="light-bckg-yellow-abbckg-ruby" />
<Button text="62" tap="applyTapOnStyledActionBar" tag="status-bar-style: dark; ;background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="dark-bckg-yellow-abbckg-ruby" />

<!-- status-bar-style - action-bar - hidden - and - backgroundSpanUnderStatusBar -->
<Button text="71" tap="applyTapWithSpan" tag="status-bar-style: light;background-color: yellow" style.fontSize="8" width="40" height="40" automationText="dark-bckg-yellow-bckgsusb-true" />
<Button text="72" tap="applyTapOnStyledActionBarAndSpan" tag="status-bar-style: light;background-color: yellow;" style.fontSize="8" width="40" height="40" automationText="light-bckg-yellow-abbck-ruby-bckgsusb-true" />

<Button text="73" tap="applyTapWithSpan" tag="status-bar-style: dark;background-color: yellow;" style.fontSize="8" width="40" height="40" automationText="light-ab-hidden-bckgsusb-true" />
<Button text="74" tap="applyTapWithActionBarHiddenAndSpan" tag="status-bar-style: dark;background-color: yellow;" style.fontSize="8" width="40" height="40" automationText="dark-ab-hidden-bckgsusb-true" />
</WrapLayout>
<StackLayout padding="10">
<Label text="IOS and Android" fontSize="14"/>
<WrapLayout>
<!-- status-bar-style -->
<Button text="11" tap="applyTap" tag="status-bar-style: light;" style.fontSize="8" width="40" height="40" automationText="light;" />
<Button text="12" tap="applyTap" tag="status-bar-style: dark;" style.fontSize="8" width="40" height="40" automationText="dark;" />

<!-- status-bar-style - action-bar - background -->
<Button text="21" tap="applyTapOnStyledActionBar" tag="status-bar-style: light;" style.fontSize="8" width="40" height="40" automationText="light-abb-ruby" />
<Button text="22" tap="applyTapOnStyledActionBar" tag="status-bar-style: dark;" style.fontSize="8" width="40" height="40" automationText="dark-abb-ruby" />

<!-- status-bar-style - page - background -->
<Button text="51" tap="applyTap" tag="status-bar-style: light;background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="light-bckg-ruby" />
<Button text="52" tap="applyTap" tag="status-bar-style: dark; background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="dark-bckg-ruby" />

<!-- status-bar-style - page - and - action-bar - background -->
<Button text="61" tap="applyTapOnStyledActionBar" tag="status-bar-style: light;background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="light-bckg-yellow-abbckg-ruby" />
<Button text="62" tap="applyTapOnStyledActionBar" tag="status-bar-style: dark; ;background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="dark-bckg-yellow-abbckg-ruby" />

<!-- status-bar-style - action-bar - hidden - and - backgroundSpanUnderStatusBar -->
<Button text="71" tap="applyTapWithSpan" tag="status-bar-style: light;background-color: yellow" style.fontSize="8" width="40" height="40" automationText="dark-bckg-yellow-bckgsusb-true" />
<Button text="72" tap="applyTapOnStyledActionBarAndSpan" tag="status-bar-style: light;background-color: yellow;" style.fontSize="8" width="40" height="40" automationText="light-bckg-yellow-abbck-ruby-bckgsusb-true" />

<Button text="73" tap="applyTapWithSpan" tag="status-bar-style: dark;background-color: yellow;" style.fontSize="8" width="40" height="40" automationText="light-ab-hidden-bckgsusb-true" />
<Button text="74" tap="applyTapWithActionBarHiddenAndSpan" tag="status-bar-style: dark;background-color: yellow;" style.fontSize="8" width="40" height="40" automationText="dark-ab-hidden-bckgsusb-true" />

</WrapLayout>

<Label text="Android" fontSize="14" marginTop="10"/>
<WrapLayout>
<!-- status-bar-style - action-bar - hidden -->
<Button text="31" tap="applyTapWithHiddenActionBar" tag="status-bar-style: light;" style.fontSize="8" width="40" height="40" automationText="light-ab-hidden" />
<Button text="32" tap="applyTapWithHiddenActionBar" tag="status-bar-style: dark;" style.fontSize="8" width="40" height="40" automationText="ark-ab-hidden" />

<!-- android-status-bar-background -->
<Button text="41" tap="applyTap" tag="android-status-bar-background: #E0115F;" style.fontSize="8" width="40" height="40" automationText="asbb-ruby" />
</WrapLayout>
</StackLayout>
</Page>
2 changes: 2 additions & 0 deletions 2 build/version.js
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
var fs = require("fs");
console.log(JSON.parse(fs.readFileSync("./bin/dist/tns-core-modules/package.json")).version);
24 changes: 24 additions & 0 deletions 24 tns-core-modules/ui/action-bar/action-bar.android.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,34 @@ export class ActionBarStyler implements style.Styler {
(<android.support.v7.widget.Toolbar>v._nativeView).setTitleTextColor(nativeValue);
}

// background-color
private static getBackgroundColorProperty(view: view.View): any {
let toolbar = <android.support.v7.widget.Toolbar>view._nativeView;
return toolbar.getBackground();
}

private static setBackgroundColorProperty(v: view.View, newValue: any) {
var toolbar = (<android.support.v7.widget.Toolbar>v._nativeView);
if (toolbar) {
toolbar.setBackgroundColor(newValue);
}
}

private static resetBackgroundColorProperty(v: view.View, nativeValue: any) {
var toolbar = (<android.support.v7.widget.Toolbar>v._nativeView);
if (toolbar) {
toolbar.setBackgroundColor(nativeValue);
}
}

public static registerHandlers() {
style.registerHandler(style.colorProperty, new style.StylePropertyChangedHandler(
ActionBarStyler.setColorProperty,
ActionBarStyler.resetColorProperty), "ActionBar");
style.registerHandler(style.backgroundColorProperty, new style.StylePropertyChangedHandler(
ActionBarStyler.setBackgroundColorProperty,
ActionBarStyler.resetBackgroundColorProperty,
ActionBarStyler.getBackgroundColorProperty), "ActionBar");
}
}

Expand Down
16 changes: 10 additions & 6 deletions 16 tns-core-modules/ui/page/page.android.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,19 @@ export class PageStyler implements style.Styler {

// android-status-bar-background-property
private static setAndroidStatusBarBackgroundProperty(v: view.View, newValue: any) {
let window = app.android.startActivity.getWindow();
let nativeColor = new colorModule.Color(newValue).android;
window.setStatusBarColor(nativeColor);
if (platform.device.sdkVersion >= "21") {
let window = app.android.startActivity.getWindow();
let nativeColor = new colorModule.Color(newValue).android;
window.setStatusBarColor(nativeColor);
}
}

private static resetAndroidStatusBarBackgroundProperty(v: view.View, nativeValue: any) {
let window = app.android.startActivity.getWindow();
let nativeColor = (nativeValue instanceof colorModule.Color) ? (<colorModule.Color>nativeValue).android : new colorModule.Color(nativeValue).android;
window.setStatusBarColor(nativeColor);
if (platform.device.sdkVersion >= "21") {
let window = app.android.startActivity.getWindow();
let nativeColor = (nativeValue instanceof colorModule.Color) ? (<colorModule.Color>nativeValue).android : new colorModule.Color(nativeValue).android;
window.setStatusBarColor(nativeColor);
}
}

private static getAndroidStatusBarBackgroundProperty(v: view.View): any {
Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.