Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Commit

Permalink
format & update contribs
Browse files Browse the repository at this point in the history
  • Loading branch information
bradmartin committed Jul 9, 2018
1 parent 504ad5e commit a836061
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/cardview.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

import * as application from 'tns-core-modules/application';
import { Color } from 'tns-core-modules/color';
import { CardViewCommon, backgroundColorProperty, backgroundInternalProperty, elevationProperty, radiusProperty, rippleProperty } from './cardview-common';
import {
CardViewCommon,
backgroundColorProperty,
backgroundInternalProperty,
elevationProperty,
radiusProperty,
rippleProperty
} from './cardview-common';

export class CardView extends CardViewCommon {
private _androidViewId: number;
Expand All @@ -27,15 +34,14 @@ export class CardView extends CardViewCommon {
const attr = java.lang.Class.forName('android.support.v7.appcompat.R$attr');
const field = attr.getField('selectableItemBackground');

if (field && android.os.Build.VERSION.SDK_INT >= 23 ) {
if (field && android.os.Build.VERSION.SDK_INT >= 23) {
const resId = field.getInt(null);

const attrs = Array.create('int', 1);
attrs[0] = resId;
const activity = application.android.foregroundActivity;
const typedValue = activity.obtainStyledAttributes(attrs);
const selectedItemDrawable = typedValue.getDrawable(0);

this.nativeView.setForeground(selectedItemDrawable);
this.nativeView.setClickable(true);
}
Expand Down
13 changes: 13 additions & 0 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@
{
"name": "Daniel Leal",
"url": "https://github.com/danielgek"
},
{
"name": "Shiva Prasad",
"email": "[email protected]",
"url": "https://github.com/shiv19"
},
{
"url": "https://github.com/YvesCandel",
"name": "Yves Candel"
},
{
"name": "Garth Smedley",
"url": "https://github.com/gsmedley"
}
],
"author": {
Expand Down

0 comments on commit a836061

Please sign in to comment.