android.content.res.Resources Java Examples
The following examples show how to use
android.content.res.Resources.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SuperTools.java From AndroidAnimationExercise with Apache License 2.0 | 7 votes |
/** * 获取导航栏高度 * * @param context * @return */ public static int getNavigationBarHeight(Context context) { boolean hasMenuKey = ViewConfiguration.get(context).hasPermanentMenuKey(); boolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK); if (!hasMenuKey && !hasBackKey) { //没有物理按钮(虚拟导航栏) print("没有物理按钮(虚拟导航栏)"); Resources resources = context.getResources(); int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android"); //获取NavigationBar的高度 int height = resources.getDimensionPixelSize(resourceId); return height; } else { print("有物理导航栏,小米非全面屏"); //有物理导航栏,小米非全面屏 return 0; } }
Example #2
Source File: BaseMenu.java From DataInspector with Apache License 2.0 | 6 votes |
public static WindowManager.LayoutParams createLayoutParams(Context context) { Resources res = context.getResources(); int width = res.getDimensionPixelSize(R.dimen.data_inspector_menu_width); final WindowManager.LayoutParams params = new WindowManager.LayoutParams(width, WRAP_CONTENT, TYPE_SYSTEM_ERROR, FLAG_NOT_FOCUSABLE | FLAG_NOT_TOUCH_MODAL | FLAG_LAYOUT_NO_LIMITS | FLAG_LAYOUT_INSET_DECOR | FLAG_LAYOUT_IN_SCREEN, TRANSLUCENT); params.y = res.getDimensionPixelSize(R.dimen.data_inspector_toolbar_height); if (Build.VERSION.SDK_INT == 23) { // MARSHMALLOW params.y = res.getDimensionPixelSize(R.dimen.data_inspector_toolbar_height_m); } params.gravity = Gravity.TOP | Gravity.RIGHT; return params; }
Example #3
Source File: QrCodeFinderView.java From QrCodeScanner with GNU General Public License v3.0 | 6 votes |
public QrCodeFinderView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); mPaint = new Paint(); Resources resources = getResources(); mMaskColor = resources.getColor(R.color.qr_code_finder_mask); mFrameColor = resources.getColor(R.color.qr_code_finder_frame); mLaserColor = resources.getColor(R.color.qr_code_finder_laser); mTextColor = resources.getColor(R.color.qr_code_white); mFocusThick = 1; mAngleThick = 8; mAngleLength = 40; mScannerAlpha = 0; init(context); }
Example #4
Source File: TimeLineUtility.java From iBeebo with GNU General Public License v3.0 | 6 votes |
private static void addEmotions(SpannableString value) { // Paint.FontMetrics fontMetrics = mEditText.getPaint().getFontMetrics(); // int size = (int)(fontMetrics.descent-fontMetrics.ascent); int size = 50; Map<String, Integer> smiles = SmileyMap.getInstance().getSmiles(); Resources resources = BeeboApplication.getAppContext().getResources(); Matcher localMatcher = EMOTION_URL.matcher(value); while (localMatcher.find()) { String key = localMatcher.group(0); if (smiles.containsKey(key)) { int k = localMatcher.start(); int m = localMatcher.end(); if (m - k < 8) { Drawable drawable = resources.getDrawable(smiles.get(key)); if (drawable != null) { drawable.setBounds(0, 0, size, size); } ImageSpan localImageSpan = new ImageSpan(drawable, ImageSpan.ALIGN_BASELINE); value.setSpan(localImageSpan, k, m, Spanned.SPAN_INCLUSIVE_EXCLUSIVE); } } } }
Example #5
Source File: ExpandNetworkImageView.java From android-common-utils with Apache License 2.0 | 6 votes |
private Drawable resolveResource() { Resources rsrc = getResources(); if (rsrc == null) { return null; } Drawable d = null; if (mResource != 0) { try { d = rsrc.getDrawable(mResource); } catch (Exception e) { Log.w(TAG, "Unable to find resource: " + mResource, e); // Don't try again. mResource = 0; } } return RoundedDrawable.fromDrawable(d); }
Example #6
Source File: FingerprintHelper.java From arcusandroid with Apache License 2.0 | 6 votes |
public FingerprintHelper initialize(@NonNull Resources resources) { if (mAuthenticator != null) return this; sensorMissing = resources.getString(R.string.fingerprint_sensor_hardware_missing); fingerprintNotSetup = resources.getString(R.string.fingerprint_not_set_up); // Try Pass first try { mAuthenticator = new SamsungPass(); registerAuthenticator(mAuthenticator); } catch (Exception e) { // nothing to do. Try native next logger.debug("Couldn't use Pass. Trying native fingerprint."); } // Native fingerprint is supported on M+ only. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { registerAuthenticator(new NativeFingerprint()); } return this; }
Example #7
Source File: VectorDrawable.java From CanDialog with Apache License 2.0 | 6 votes |
@Override public void inflate(Resources res, XmlPullParser parser, AttributeSet attrs, Theme theme) throws XmlPullParserException, IOException { final VectorDrawableState state = mVectorState; final VPathRenderer pathRenderer = new VPathRenderer(); state.mVPathRenderer = pathRenderer; final TypedArray a = obtainAttributes(res, theme, attrs, R.styleable.VectorDrawable); updateStateFromTypedArray(a); a.recycle(); state.mCacheDirty = true; inflateInternal(res, parser, attrs, theme); mTintFilter = updateTintFilter(mTintFilter, state.mTint, state.mTintMode); }
Example #8
Source File: Settings.java From AOSP-Kayboard-7.1.2 with Apache License 2.0 | 6 votes |
private void upgradeAutocorrectionSettings(final SharedPreferences prefs, final Resources res) { final String thresholdSetting = prefs.getString(PREF_AUTO_CORRECTION_THRESHOLD_OBSOLETE, null); if (thresholdSetting != null) { SharedPreferences.Editor editor = prefs.edit(); editor.remove(PREF_AUTO_CORRECTION_THRESHOLD_OBSOLETE); final String autoCorrectionOff = res.getString(R.string.auto_correction_threshold_mode_index_off); if (thresholdSetting.equals(autoCorrectionOff)) { editor.putBoolean(PREF_AUTO_CORRECTION, false); } else { editor.putBoolean(PREF_AUTO_CORRECTION, true); } editor.commit(); } }
Example #9
Source File: SoundStore.java From android-Soundboard with Apache License 2.0 | 6 votes |
public static Sound[] getSounds(Context context) { Resources res = context.getApplicationContext().getResources(); TypedArray labels = res.obtainTypedArray(R.array.labels); TypedArray ids = res.obtainTypedArray(R.array.ids); Sound[] sounds = new Sound[labels.length()]; for (int i = 0; i < sounds.length; i++) { sounds[i] = new Sound(labels.getString(i), ids.getResourceId(i, -1)); } labels.recycle(); ids.recycle(); return sounds; }
Example #10
Source File: SystemBarTintManager.java From XanderPanel with Apache License 2.0 | 6 votes |
@TargetApi(14) private int getNavigationBarHeight(Context context) { Resources res = context.getResources(); int result = 0; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { if (hasNavBar(context)) { String key; if (mInPortrait) { key = NAV_BAR_HEIGHT_RES_NAME; } else { key = NAV_BAR_HEIGHT_LANDSCAPE_RES_NAME; } return getInternalDimensionSize(res, key); } } return result; }
Example #11
Source File: ScreenUtils.java From BaseProject with Apache License 2.0 | 6 votes |
public static String getDisplayMetricsDesc() { DisplayMetrics curDisplayMetrics = null; Resources res = null; int swdp = 0; if (sContext != null) { res = sContext.getResources(); } if (res != null) { curDisplayMetrics = res.getDisplayMetrics(); swdp = res.getConfiguration().smallestScreenWidthDp; } StringBuilder sb = new StringBuilder(); sb.append("当前显示信息:").append(curDisplayMetrics) .append(" --> 实际显示信息:").append(displayMetrics) .append(" 最短宽 dpi:").append(swdp) ; return sb.toString(); }
Example #12
Source File: RunInLocale.java From Indic-Keyboard with Apache License 2.0 | 6 votes |
/** * Execute {@link #job(Resources)} method in specified system locale exclusively. * * @param res the resources to use. * @param newLocale the locale to change to. Run in system locale if null. * @return the value returned from {@link #job(Resources)}. */ public T runInLocale(final Resources res, final Locale newLocale) { synchronized (sLockForRunInLocale) { final Configuration conf = res.getConfiguration(); if (newLocale == null || newLocale.equals(conf.locale)) { return job(res); } final Locale savedLocale = conf.locale; try { conf.locale = newLocale; res.updateConfiguration(conf, null); return job(res); } finally { conf.locale = savedLocale; res.updateConfiguration(conf, null); } } }
Example #13
Source File: HolographicOutlineHelper.java From Trebuchet with GNU General Public License v3.0 | 6 votes |
private HolographicOutlineHelper(Context context) { Resources res = context.getResources(); float mediumBlur = res.getDimension(R.dimen.blur_size_medium_outline); mMediumOuterBlurMaskFilter = new BlurMaskFilter(mediumBlur, BlurMaskFilter.Blur.OUTER); mMediumInnerBlurMaskFilter = new BlurMaskFilter(mediumBlur, BlurMaskFilter.Blur.NORMAL); mThinOuterBlurMaskFilter = new BlurMaskFilter( res.getDimension(R.dimen.blur_size_thin_outline), BlurMaskFilter.Blur.OUTER); mShadowBlurMaskFilter = new BlurMaskFilter( res.getDimension(R.dimen.blur_size_click_shadow), BlurMaskFilter.Blur.NORMAL); mDrawPaint.setFilterBitmap(true); mDrawPaint.setAntiAlias(true); mBlurPaint.setFilterBitmap(true); mBlurPaint.setAntiAlias(true); mErasePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OUT)); mErasePaint.setFilterBitmap(true); mErasePaint.setAntiAlias(true); }
Example #14
Source File: DiskInfo.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
public @Nullable String getDescription() { final Resources res = Resources.getSystem(); if ((flags & FLAG_SD) != 0) { if (isInteresting(label)) { return res.getString(com.android.internal.R.string.storage_sd_card_label, label); } else { return res.getString(com.android.internal.R.string.storage_sd_card); } } else if ((flags & FLAG_USB) != 0) { if (isInteresting(label)) { return res.getString(com.android.internal.R.string.storage_usb_drive_label, label); } else { return res.getString(com.android.internal.R.string.storage_usb_drive); } } else { return null; } }
Example #15
Source File: FixedRecyclerView.java From FairEmail with GNU General Public License v3.0 | 6 votes |
private void initFastScrollerEx(Context context, AttributeSet attrs, int defStyleAttr) { TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RecyclerView, defStyleAttr, 0); StateListDrawable verticalThumbDrawable = (StateListDrawable) a .getDrawable(R.styleable.RecyclerView_fastScrollVerticalThumbDrawable); Drawable verticalTrackDrawable = a .getDrawable(R.styleable.RecyclerView_fastScrollVerticalTrackDrawable); StateListDrawable horizontalThumbDrawable = (StateListDrawable) a .getDrawable(R.styleable.RecyclerView_fastScrollHorizontalThumbDrawable); Drawable horizontalTrackDrawable = a .getDrawable(R.styleable.RecyclerView_fastScrollHorizontalTrackDrawable); Resources resources = getContext().getResources(); new FastScrollerEx(this, verticalThumbDrawable, verticalTrackDrawable, horizontalThumbDrawable, horizontalTrackDrawable, resources.getDimensionPixelSize(R.dimen.fastscroll_default_thickness), resources.getDimensionPixelSize(R.dimen.fastscroll_minimum_range), resources.getDimensionPixelOffset(R.dimen.fastscroll_margin)); }
Example #16
Source File: StatusText.java From dhis2-android-capture-app with BSD 3-Clause "New" or "Revised" License | 5 votes |
public static String getTextSubmissionType(Resources r, InputArguments inputArguments) { switch (inputArguments.getSubmissionType()) { case ENROLLMENT: return r.getString(R.string.sms_title_enrollment); case DATA_SET: return r.getString(R.string.sms_title_data_set); case SIMPLE_EVENT: case TRACKER_EVENT: return r.getString(R.string.sms_title_event); } return ""; }
Example #17
Source File: PluginManager.java From hackerskeyboard with Apache License 2.0 | 5 votes |
@Override InputStream[] getStreams(Resources res) { if (mRawIds == null || mRawIds.length == 0) return null; InputStream[] streams = new InputStream[mRawIds.length]; for (int i = 0; i < mRawIds.length; ++i) { streams[i] = res.openRawResource(mRawIds[i]); } return streams; }
Example #18
Source File: ChatSelectTouchListener.java From revolution-irc with GNU General Public License v3.0 | 5 votes |
@Override public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e) { if (((ChatMessagesAdapter) mRecyclerView.getAdapter()).getSelectedItems().size() > 0) return false; if (e.getActionMasked() == MotionEvent.ACTION_DOWN) { mTouchDownX = e.getX(); mTouchDownY = e.getY(); hideActionModeForSelection(); } if (e.getActionMasked() == MotionEvent.ACTION_UP || e.getActionMasked() == MotionEvent.ACTION_CANCEL) { if (!mSelectionLongPressMode && e.getEventTime() - e.getDownTime() < MAX_CLICK_DURATION && Math.sqrt(Math.pow(e.getX() - mTouchDownX, 2) + Math.pow(e.getY() - mTouchDownY, 2)) < MAX_CLICK_DISTANCE * Resources.getSystem().getDisplayMetrics().density) { clearSelection(); } mRecyclerView.getParent().requestDisallowInterceptTouchEvent(false); mSelectionLongPressMode = false; if (mSelectionStartId != -1) { showHandles(); showActionMode(); } } if (mSelectionLongPressMode) { if (e.getActionMasked() == MotionEvent.ACTION_UP) mScroller.setScrollDir(0); else if (e.getY() < 0) mScroller.setScrollDir(-1); else if (e.getY() > mRecyclerView.getHeight()) mScroller.setScrollDir(1); else mScroller.setScrollDir(0); } return handleSelection(e.getX(), e.getY(), e.getRawX(), e.getRawY()); }
Example #19
Source File: MaterialLabel.java From KickAssSlidingMenu with Apache License 2.0 | 5 votes |
@Override public View init(View view) { text = (TextView) view.findViewById(R.id.section_label); Resources.Theme theme = ctx.getTheme(); TypedValue typedValue = new TypedValue(); theme.resolveAttribute(R.attr.labelColor, typedValue, true); int textColor = typedValue.data; text.setTextColor(textColor); text.setText(label); this.view = view; return view; }
Example #20
Source File: AllAppsRecyclerView.java From LaunchEnr with GNU General Public License v3.0 | 5 votes |
public AllAppsRecyclerView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr); mContext = context; Resources res = getResources(); addOnItemTouchListener(this); mScrollbar.setDetachThumbOnFastScroll(); mEmptySearchBackgroundTopOffset = res.getDimensionPixelSize( R.dimen.all_apps_empty_search_bg_top_offset); }
Example #21
Source File: AndroidUtils.java From PHONK with GNU General Public License v3.0 | 5 votes |
public static int pixelsToDp(Context c, int px) { Resources resources = c.getResources(); DisplayMetrics metrics = resources.getDisplayMetrics(); float dp = px / (metrics.densityDpi / 160f); return (int) dp; }
Example #22
Source File: GifDrawable.java From Overchan-Android with GNU General Public License v3.0 | 5 votes |
/** * An {@link GifDrawable#GifDrawable(Resources, int)} wrapper but returns null * instead of throwing exception if creation fails. * * @param res resources to read from * @param resourceId resource id * @return correct drawable or null if creation failed */ public static GifDrawable createFromResource(Resources res, int resourceId) { try { return new GifDrawable(res, resourceId); } catch (IOException ignored) { //ignored } return null; }
Example #23
Source File: DisplayUtil.java From CardStackView with Apache License 2.0 | 5 votes |
/** * 获取导航栏高度 */ public static int getNavigationBarHeight(Context context) { Resources resources = context.getResources(); int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android"); if (resourceId > 0) { return resources.getDimensionPixelSize(resourceId); } return 0; }
Example #24
Source File: ResourceArrayChoicesAdapter.java From opentasks with Apache License 2.0 | 5 votes |
/** * Constructor uses the resource id of the values array and the titles array and the context to load the array * * @param valuesResource * The resource id of the values array * @param titlesResource * The resource id of the titles array * @param drawablesResource * The resource id of the drawables array * @param context * The context */ public ResourceArrayChoicesAdapter(int valuesResource, int titlesResource, int drawablesResource, Context context) { Resources resources = context.getResources(); mTitles = Arrays.asList(resources.getStringArray(titlesResource)); mChoices = mVisibleChoices = new ArrayList<Object>(Arrays.asList(resources.getStringArray(valuesResource))); TypedArray drawables = resources.obtainTypedArray(drawablesResource); mDrawables = new ArrayList<Drawable>(); for (int i = 0; i < drawables.length(); i++) { mDrawables.add(drawables.getDrawable(i)); } drawables.recycle(); }
Example #25
Source File: UnderlinePageIndicator.java From InfiniteViewPager with MIT License | 5 votes |
public UnderlinePageIndicator(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); if (isInEditMode()) return; final Resources res = getResources(); //Load defaults from resources final boolean defaultFades = res.getBoolean(R.bool.default_underline_indicator_fades); final int defaultFadeDelay = res.getInteger(R.integer.default_underline_indicator_fade_delay); final int defaultFadeLength = res.getInteger(R.integer.default_underline_indicator_fade_length); final int defaultSelectedColor = res.getColor(R.color.default_underline_indicator_selected_color); //Retrieve styles attributes TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.UnderlinePageIndicator, defStyle, 0); setFades(a.getBoolean(R.styleable.UnderlinePageIndicator_fades, defaultFades)); setSelectedColor(a.getColor(R.styleable.UnderlinePageIndicator_selectedColor, defaultSelectedColor)); setFadeDelay(a.getInteger(R.styleable.UnderlinePageIndicator_fadeDelay, defaultFadeDelay)); setFadeLength(a.getInteger(R.styleable.UnderlinePageIndicator_fadeLength, defaultFadeLength)); Drawable background = a.getDrawable(R.styleable.UnderlinePageIndicator_android_background); if (background != null) { setBackgroundDrawable(background); } a.recycle(); final ViewConfiguration configuration = ViewConfiguration.get(context); mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration); }
Example #26
Source File: MyToolBar.java From MarketAndroidApp with Apache License 2.0 | 5 votes |
public MyToolBar(Context context, AttributeSet attrs) { super(context, attrs); init(); TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.CollapsingAvatarToolbar, 0, 0); try { collapsedPadding = a.getDimension(R.styleable.CollapsingAvatarToolbar_collapsedPadding, -1); expandedPadding = a.getDimension(R.styleable.CollapsingAvatarToolbar_expandedPadding, -1); collapsedImageSize = a.getDimension(R.styleable.CollapsingAvatarToolbar_collapsedImageSize, -1); expandedImageSize = a.getDimension(R.styleable.CollapsingAvatarToolbar_expandedImageSize, -1); collapsedTextSize = a.getDimension(R.styleable.CollapsingAvatarToolbar_collapsedTextSize, -1); expandedTextSize = a.getDimension(R.styleable.CollapsingAvatarToolbar_expandedTextSize, -1); } finally { a.recycle(); } final Resources resources = getResources(); if (collapsedPadding < 0) { collapsedPadding = resources.getDimension(R.dimen.default_collapsed_padding); } if (expandedPadding < 0) { expandedPadding = resources.getDimension(R.dimen.default_expanded_padding); } if (collapsedImageSize < 0) { collapsedImageSize = resources.getDimension(R.dimen.default_collapsed_image_size); } if (expandedImageSize < 0) { expandedImageSize = resources.getDimension(R.dimen.default_expanded_image_size); } if (collapsedTextSize < 0) { collapsedTextSize = resources.getDimension(R.dimen.default_collapsed_text_size); } if (expandedTextSize < 0) { expandedTextSize = resources.getDimension(R.dimen.default_expanded_text_size); } }
Example #27
Source File: AptoideUtils.java From aptoide-client-v8 with GNU General Public License v3.0 | 5 votes |
private static String parseScreenshotUrl(String screenshotUrl, String orientation, WindowManager windowManager, Resources resources) { String sizeString = generateSizeStringScreenshotsdd(orientation, windowManager, resources); String[] splitUrl = splitUrlExtension(screenshotUrl); return splitUrl[0] + "_" + sizeString + "." + splitUrl[1]; }
Example #28
Source File: Preferences.java From VIA-AI with MIT License | 5 votes |
@Override public void save(Context context, SharedPreferences.Editor editor) { Resources resources = context.getResources(); editor.putBoolean(resources.getString(R.string.prefKey_Recoder_VideoRecord), mEnableRecord); editor.putString(resources.getString(R.string.prefKey_Recoder_VideoRecordPath), mRecordPath); editor.putString(resources.getString(R.string.prefKey_Recoder_VideoRecordFPS), String.valueOf(mRecordFPS)); editor.putString(resources.getString(R.string.prefKey_Recoder_VideoRecordInterval), String.valueOf(mRecordInterval)); editor.putString(resources.getString(R.string.prefKey_Recoder_VideoRecordBitrate), String.valueOf(mEncodeBitRate)); }
Example #29
Source File: SettingsValues.java From simple-keyboard with Apache License 2.0 | 5 votes |
public SettingsValues(final SharedPreferences prefs, final Resources res, final InputAttributes inputAttributes) { mLocale = res.getConfiguration().locale; // Get the resources mSpacingAndPunctuations = new SpacingAndPunctuations(res); // Store the input attributes mInputAttributes = inputAttributes; // Get the settings preferences mAutoCap = prefs.getBoolean(Settings.PREF_AUTO_CAP, true); mVibrateOn = Settings.readVibrationEnabled(prefs, res); mSoundOn = Settings.readKeypressSoundEnabled(prefs, res); mKeyPreviewPopupOn = Settings.readKeyPreviewPopupEnabled(prefs, res); mShowsLanguageSwitchKey = Settings.readShowsLanguageSwitchKey(prefs); mHasHardwareKeyboard = Settings.readHasHardwareKeyboard(res.getConfiguration()); // Compute other readable settings mKeyLongpressTimeout = Settings.readKeyLongpressTimeout(prefs, res); mKeypressVibrationDuration = Settings.readKeypressVibrationDuration(prefs, res); mKeypressSoundVolume = Settings.readKeypressSoundVolume(prefs, res); mKeyPreviewPopupDismissDelay = res.getInteger(R.integer.config_key_preview_linger_timeout); mKeyboardHeightScale = Settings.readKeyboardHeight(prefs, DEFAULT_SIZE_SCALE); mDisplayOrientation = res.getConfiguration().orientation; mHideSpecialChars = Settings.readHideSpecialChars(prefs); mShowNumberRow = Settings.readShowNumberRow(prefs); mSpaceSwipeEnabled = Settings.readSpaceSwipeEnabled(prefs); mDeleteSwipeEnabled = Settings.readDeleteSwipeEnabled(prefs); mUseMatchingNavbarColor = Settings.readUseMatchingNavbarColor(prefs); }
Example #30
Source File: HomeDiagram.java From UltimateAndroid with Apache License 2.0 | 5 votes |
public void init(List<Integer> milliliter) { if (null == milliliter || milliliter.size() == 0) return; this.milliliter = delZero(milliliter); Resources res = getResources(); tb = res.getDimension(R.dimen.historyscore_tb); interval_left_right = tb * 2.0f; interval_left = tb * 0.5f; paint_date = new Paint(); paint_date.setStrokeWidth(tb * 0.1f); paint_date.setTextSize(tb * 1.2f); paint_date.setColor(fineLineColor); paint_brokenLine = new Paint(); paint_brokenLine.setStrokeWidth(tb * 0.1f); paint_brokenLine.setColor(blueLineColor); paint_brokenLine.setAntiAlias(true); paint_dottedline = new Paint(); paint_dottedline.setStyle(Paint.Style.STROKE); paint_dottedline.setColor(fineLineColor); paint_brokenline_big = new Paint(); paint_brokenline_big.setStrokeWidth(tb * 0.4f); paint_brokenline_big.setColor(fineLineColor); paint_brokenline_big.setAntiAlias(true); framPanint = new Paint(); framPanint.setAntiAlias(true); framPanint.setStrokeWidth(2f); path = new Path(); bitmap_point = BitmapFactory.decodeResource(getResources(), R.drawable.wire_frame_icon_point_blue); setLayoutParams(new LayoutParams( (int) (this.milliliter.size() * interval_left_right), LayoutParams.MATCH_PARENT)); }