Skip to content

Instantly share code, notes, and snippets.

View marcel-ploch's full-sized avatar

Marcel Ploch marcel-ploch

View GitHub Profile
export abstract class NewUITableViewDelegateImpl {
static initWithOriginalDelegate(originalDelegate: UITableViewDelegate, loadMorePlayers: any): any {
}
}
import {NewUITableViewDelegateImpl as NewUITableViewDelegateImplBase} from './NewUITableViewDelegateImpl';
export class NewUITableViewDelegateImpl {
initWithOriginalDelegate(): any {
}
}
@marcel-ploch
marcel-ploch / UITableViewDelegate.TS
Last active September 28, 2018 07:30
Own UITableViewDelegate
import {NewUITableViewDelegateImpl as NewUITableViewDelegateImplBase} from './NewUITableViewDelegateImpl';
export class NewUITableViewDelegateImpl extends NSObject implements UITableViewDelegate {
public static ObjCProtocols: any = [ UITableViewDelegate ];
private _originalDelegate: UITableViewDelegate;
private _callback: any;
private _isLoading: Boolean = false;
public static initWithOriginalDelegate(originalDelegate: UITableViewDelegate, loadMorePlayers: any): NewUITableViewDelegateImpl {
@marcel-ploch
marcel-ploch / registerListener.ts
Last active September 28, 2018 07:57
Register Listener
public listViewLoaded(args: any): void {
this.listView = this.page.getViewById('playerListView');
if (isAndroid) {
this.listAdapter = this.listView.android.getAdapter();
}
if (isAndroid) {
const that: any = this;
public textChanged(): void {
if (isIOS) {
if (this.textView) {
if (this.textView.ios.contentSize.height > (100)) {
this.textViewHeight = 100;
this.textHeight = this.textView.ios.contentSize.height = 100 + this.contentSizeStartValue
} else {
this.textViewHeight = this.textView.ios.contentSize.height;
this.textHeight = this.contentSizeStartValue + this.textView.ios.contentSize.height;
}
@marcel-ploch
marcel-ploch / keyboardevents.js
Last active October 11, 2019 10:40
Keyboard Events for IOs in NativeScript
// Keyboard up event on ios
if (application.ios) {
// First Event is Catched before the Keyboard Jumps Up
// We Save the Height of the Keyboard for the Positioning of the LayoutElement
application.ios.addNotificationObserver(UIKeyboardWillShowNotification, (event) => {
// console.log('WillShow', typeof event.userInfo, event.userInfo.valueForKey(UIKeyboardFrameEndUserInfoKey).CGRectValue.size.height);
// console.log(this.textView.ios.contentSize);
this.contentSizeStartValue = event.userInfo.valueForKey(UIKeyboardFrameEndUserInfoKey).CGRectValue.size.height + 10;
});
// Second Event is Catched when the Keyboard is Up to Reposition our Element
@marcel-ploch
marcel-ploch / gist:e5b76be7784fc4f0c15ca33b71b11e44
Created September 21, 2018 13:54
Keyboard Events for IOs in NativeScript
// Keyboard up event on ios
if (application.ios) {
// First Event is Catched before the Keyboard Jumps Up
// We Save the Height of the Keyboard for the Positioning of the LayoutElement
application.ios.addNotificationObserver(UIKeyboardWillShowNotification, (event) => {
// console.log('WillShow', typeof event.userInfo, event.userInfo.valueForKey(UIKeyboardFrameEndUserInfoKey).CGRectValue.size.height);
// console.log(this.textView.ios.contentSize);
this.contentSizeStartValue = event.userInfo.valueForKey(UIKeyboardFrameEndUserInfoKey).CGRectValue.size.height + 10;
});
// Second Event is Catched when the Keyboard is Up to Reposition our Element
@marcel-ploch
marcel-ploch / web-view-ios.js
Created March 16, 2018 08:30
Änderungen an der Datei damit wieder Cookies in der WebView gesetzt werden
...
function WebView() {
var _this = _super.call(this) || this;
var configuration = WKWebViewConfiguration.new();
_this._delegate = WKNavigationDelegateImpl.initWithOwner(new WeakRef(_this));
var jScript
= 'var meta = document.createElement(\'meta\'); meta.setAttribute(\'name\', \'viewport\'); meta.setAttribute(\'content\', \'initial-scale=1.0\'); document.getElementsByTagName(\'head\')[0].appendChild(meta);';
var cookieScript = '';
import {async, TestBed} from '@angular/core/testing';
import {AppComponent} from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed
.configureTestingModule({
declarations: [AppComponent],
})
import {Component} from '@angular/core';
import {DialogButtonPosition} from './modules/dialog/models/DialogButtonPosition.model';
import {DialogConfiguration} from './modules/dialog/models/DialogConfiguration.model';
import {DialogSettings} from './modules/dialog/models/DialogSettings.model';
import {Dialog} from './modules/dialog/services/Dialog.service';
@Component({ selector : 'tbody', templateUrl : './app.component.html', styleUrls : [ './app.component.css' ] })
export class AppComponent {
@marcel-ploch
marcel-ploch / package.json
Created April 27, 2017 08:40
Updated npm-watch Config with separate Tasks
{
"watch": {
"run_android": {
"patterns": [
"app"
],
"extensions": "ts,html,scss",
"quiet": true
},
"run_ios": {