mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: cleanup android refs
This commit is contained in:
@@ -2,7 +2,7 @@ import { View } from '../core/view';
|
||||
import { LinearGradient } from './linear-gradient';
|
||||
import { ClipPathFunction } from './clip-path-function';
|
||||
import { isDataURI, isFileOrResourcePath, RESOURCE_PREFIX, FILE_PREFIX } from '../../utils';
|
||||
import { CSSValue, parse } from '../../css-value';
|
||||
import { CSSValue, parse } from '../../css-value/reworkcss-value';
|
||||
import { path, knownFolders } from '../../file-system';
|
||||
export * from './background-common';
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Font as FontBase, parseFontFamily, genericFontFamilies, FontWeight, FontVariationSettings, FONTS_BASE_PATH } from './font-common';
|
||||
import { FontStyleType, FontWeightType, FontVariationSettingsType } from './font-interfaces';
|
||||
import { getNativeApp } from '../../application/helpers-common';
|
||||
import { Trace } from '../../trace';
|
||||
import { SDK_VERSION } from '../../utils/constants';
|
||||
import * as fs from '../../file-system';
|
||||
import { ad } from '../../utils';
|
||||
|
||||
export * from './font-common';
|
||||
|
||||
@@ -60,7 +60,7 @@ function computeFontCacheKey(fontFamily: string, font: Font) {
|
||||
function loadFontFromFile(fontFamily: string, font: Font): android.graphics.Typeface {
|
||||
const cacheKey = SDK_VERSION >= 26 ? computeFontCacheKey(fontFamily, font) : fontFamily;
|
||||
|
||||
appAssets = appAssets || (ad.getApplicationContext() as android.content.Context).getAssets();
|
||||
appAssets = appAssets || getNativeApp<android.app.Application>().getApplicationContext().getAssets();
|
||||
if (!appAssets) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user