Java Examples for android.util.Pair

The following java examples will help you to understand the usage of android.util.Pair. These source code samples are taken from different open source projects.

Example 1
Project: ohmagePhone-master  File: CampaignSurveyFilterActivity.java View source code
@Override
public void onContentChanged() {
    super.onContentChanged();
    mSurveyFilter = (FilterControl) findViewById(R.id.survey_filter);
    if (mSurveyFilter == null)
        throw new RuntimeException("Your activity must have a FilterControl with the id survey_filter");
    mSurveyFilter.setOnChangeListener(new FilterControl.FilterChangeListener() {

        @Override
        public void onFilterChanged(boolean selfChange, String curValue) {
            if (!selfChange)
                onSurveyFilterChanged(curValue);
        }
    });
    mDefaultSurvey = getIntent().getStringExtra(CampaignSurveyFilter.EXTRA_SURVEY_ID);
    if (mDefaultCampaign != null || ConfigHelper.isSingleCampaignMode()) {
        setLoadingVisibility(true);
        getSupportLoaderManager().initLoader(SURVEY_LOADER, null, this);
    } else {
        mSurveyFilter.add(0, new Pair<String, String>(getString(R.string.filter_all_surveys), null));
    }
}
Example 2
Project: property-db-master  File: DefaultDatabaseErrorHandler.java View source code
/**
     * defines the default method to be invoked when database corruption is detected.
     * @param dbObj the [email protected] SQLiteDatabase} object representing the database on which corruption
     * is detected.
     */
public void onCorruption(SQLiteDatabase dbObj) {
    Log.e(TAG, "Corruption reported by sqlite on database: " + dbObj.getPath());
    // is the corruption detected even before database could be 'opened'?
    if (!dbObj.isOpen()) {
        // database files are not even openable. delete this database file.
        // NOTE if the database has attached databases, then any of them could be corrupt.
        // and not deleting all of them could cause corrupted database file to remain and 
        // make the application crash on database open operation. To avoid this problem,
        // the application should provide its own [email protected] DatabaseErrorHandler} impl class
        // to delete ALL files of the database (including the attached databases).
        deleteDatabaseFile(dbObj.getPath());
        return;
    }
    List<Pair<String, String>> attachedDbs = null;
    try {
        // before that, get the attached database list first.
        try {
            attachedDbs = dbObj.getAttachedDbs();
        } catch (SQLiteException e) {
        }
        try {
            dbObj.close();
        } catch (SQLiteException e) {
        }
    } finally {
        // Delete all files of this corrupt database and/or attached databases
        if (attachedDbs != null) {
            for (Pair<String, String> p : attachedDbs) {
                deleteDatabaseFile(p.second);
            }
        } else {
            // attachedDbs = null is possible when the database is so corrupt that even
            // "PRAGMA database_list;" also fails. delete the main database file
            deleteDatabaseFile(dbObj.getPath());
        }
    }
}
Example 3
Project: TextSecureSMP-master  File: MmsDownloadJob.java View source code
private void storeRetrievedMms(MasterSecret masterSecret, String contentLocation, long messageId, long threadId, RetrieveConf retrieved) throws MmsException, NoSessionException, DuplicateMessageException, InvalidMessageException, LegacyMessageException {
    MmsDatabase database = DatabaseFactory.getMmsDatabase(context);
    IncomingMediaMessage message = new IncomingMediaMessage(retrieved);
    Pair<Long, Long> messageAndThreadId;
    if (retrieved.getSubject() != null && WirePrefix.isEncryptedMmsSubject(retrieved.getSubject().getString())) {
        database.markAsLegacyVersion(messageId, threadId);
        messageAndThreadId = new Pair<>(messageId, threadId);
    } else {
        messageAndThreadId = database.insertMessageInbox(masterSecret, message, contentLocation, threadId);
        database.delete(messageId);
    }
    MessageNotifier.updateNotification(context, masterSecret, messageAndThreadId.second);
}
Example 4
Project: android-sdk-sources-for-api-level-23-master  File: DebugOverlayView.java View source code
@Override
protected void onDraw(Canvas canvas) {
    if (mEnabled) {
        // Draw the outline
        canvas.drawRect(0, 0, getMeasuredWidth(), getMeasuredHeight(), mDebugOutline);
        // Draw the rects
        int numRects = mRects.size();
        for (int i = 0; i < numRects; i++) {
            Pair<Rect, Integer> r = mRects.get(i);
            mTmpPaint.setColor(r.second);
            canvas.drawRect(r.first, mTmpPaint);
        }
        // Draw the text
        if (mText != null && mText.length() > 0) {
            mTmpPaint.setColor(0xFFff0000);
            mTmpPaint.setTextSize(60);
            mTmpPaint.getTextBounds(mText, 0, 1, mTmpRect);
            canvas.drawText(mText, 10f, getMeasuredHeight() - mTmpRect.height() - mConfig.systemInsets.bottom, mTmpPaint);
        }
    }
}
Example 5
Project: iview-android-tv-master  File: AuthApi.java View source code
private void buildAuth(String stream) {
    if (stream == null) {
        stream = updateEpisodeDetails(id);
    }
    if (stream != null) {
        Pair<String, String> auth = getAuthToken();
        if (auth != null) {
            Uri.Builder builder = Uri.parse(stream).buildUpon();
            builder.authority(auth.first).appendQueryParameter("hdnea", auth.second);
            Uri url = builder.build();
            Log.d(TAG, "Stream URL:" + url);
            ContentManager.cache().putStreamUrl(id, url);
            ContentManager.getInstance().broadcastChange(ContentManager.CONTENT_AUTH_DONE, id);
        } else {
            Log.w(TAG, "Unable to build stream URL for:" + id);
        }
    } else {
        Log.w(TAG, "Unable to find stream URL for:" + id);
    }
}
Example 6
Project: xface-android-master  File: XStartAppView.java View source code
@Override
public void onReceived(Context context, XEvent evt) {
    if (evt.getType() == XEventType.XAPP_MESSAGE) {
        @SuppressWarnings("unchecked") Pair<XAppWebView, String> data = (Pair<XAppWebView, String>) evt.getData();
        handleXAppMessage(data.first, data.second);
    } else if (evt.getType() == XEventType.CLOSE_APP) {
        int viewId = (Integer) evt.getData();
        handleCloseApplication(viewId);
    } else if (evt.getType() == XEventType.CLEAR_MEMORY_CACHE) {
        mSystemCtx.runOnUiThread(new Runnable() {

            @Override
            public void run() {
                mOwnerApp.clearCache(false);
            }
        });
    } else {
        super.onReceived(context, evt);
    }
}
Example 7
Project: codereview.chromium-master  File: UnifiedDiffAdapter.java View source code
@Override
protected void rebuildWithComments(HashMap<Pair<Integer, Boolean>, List<Comment>> lineToComments) {
    for (FileDiff.DiffLine diffLine : diffLines) {
        linesWithComments.add(diffLine);
        switch(diffLine.type()) {
            case MARKER:
                break;
            case BOTH_SIDE:
                addAll(linesWithComments, lineToComments.get(new Pair<Integer, Boolean>(diffLine.leftLineNumber(), true)));
                addAll(linesWithComments, lineToComments.get(new Pair<Integer, Boolean>(diffLine.rightLineNumber(), false)));
                break;
            case RIGHT:
                addAll(linesWithComments, lineToComments.get(new Pair<Integer, Boolean>(diffLine.rightLineNumber(), false)));
                break;
            case LEFT:
                addAll(linesWithComments, lineToComments.get(new Pair<Integer, Boolean>(diffLine.leftLineNumber(), true)));
                break;
        }
    }
}
Example 8
Project: MD-BiliBili-master  File: ScreenResolution.java View source code
/**
   * Gets resolution on old devices.
   * Tries the reflection to get the real resolution first.
   * Fall back to getDisplayMetrics if the above method failed.
   * */
private static Pair<Integer, Integer> getRealResolutionOnOldDevice(Context ctx) {
    try {
        WindowManager wm = (WindowManager) ctx.getSystemService(Context.WINDOW_SERVICE);
        Display display = wm.getDefaultDisplay();
        Method mGetRawWidth = Display.class.getMethod("getRawWidth");
        Method mGetRawHeight = Display.class.getMethod("getRawHeight");
        Integer realWidth = (Integer) mGetRawWidth.invoke(display);
        Integer realHeight = (Integer) mGetRawHeight.invoke(display);
        return new Pair<Integer, Integer>(realWidth, realHeight);
    } catch (Exception e) {
        DisplayMetrics disp = ctx.getResources().getDisplayMetrics();
        return new Pair<Integer, Integer>(disp.widthPixels, disp.heightPixels);
    }
}
Example 9
Project: Pure-File-Manager-master  File: PasteOperation.java View source code
@Override
protected ArrayList<GenericFile> doInBackground(@NonNull final GenericFile... files) {
    ClipBoard.lock();
    final LinkedList<Pair<GenericFile, GenericFile>> filesAffected = new LinkedList<>();
    final ArrayList<GenericFile> failed = new ArrayList<>();
    final String targetPath = mTarget.getAbsolutePath();
    final boolean remounted;
    final boolean useCommandLine = mSettings.useCommandLine();
    if (useCommandLine && mSettings.isSuEnabled() && Environment.needsRemount(targetPath)) {
        RootTools.remount(targetPath, "RW");
        remounted = true;
    } else {
        remounted = false;
    }
    try {
        for (final GenericFile current : files) {
            if (isCanceled()) {
                return failed;
            }
            if (current != null && current.exists()) {
                try {
                    if (mIsMove) {
                        PFMFileUtils.moveToDirectory(current, mTarget, useCommandLine, true);
                    } else {
                        if (current.isDirectory()) {
                            PFMFileUtils.copyDirectoryToDirectory(current, mTarget, useCommandLine);
                        } else {
                            PFMFileUtils.copyFileToDirectory(current, mTarget, useCommandLine);
                        }
                    }
                    filesAffected.add(new Pair<>(current, FileFactory.newFile(mSettings, mTarget.toFile(), current.getName())));
                } catch (IOException e) {
                    failed.add(current);
                    e.printStackTrace();
                }
            }
        }
    } finally {
        if (remounted) {
            RootTools.remount(targetPath, "RO");
        }
        if (!filesAffected.isEmpty()) {
            ClipBoard.unlock();
            ClipBoard.clear();
            if (mIsMove) {
                MediaStoreUtils.moveFiles(mContext, filesAffected);
                for (final Pair<GenericFile, GenericFile> filesPair : filesAffected) {
                    FileObserverNotifier.notifyDeleted(filesPair.first);
                    FileObserverNotifier.notifyCreated(filesPair.second);
                }
            } else {
                MediaStoreUtils.copyFiles(mContext, filesAffected);
                for (final Pair<GenericFile, GenericFile> filesPair : filesAffected) {
                    FileObserverNotifier.notifyCreated(filesPair.second);
                }
            }
        }
    }
    return failed;
}
Example 10
Project: BambooPlayer-master  File: ScreenResolution.java View source code
/**
   * Gets resolution on old devices.
   * Tries the reflection to get the real resolution first.
   * Fall back to getDisplayMetrics if the above method failed.
   * */
private static Pair<Integer, Integer> getRealResolutionOnOldDevice(Context ctx) {
    try {
        WindowManager wm = (WindowManager) ctx.getSystemService(Context.WINDOW_SERVICE);
        Display display = wm.getDefaultDisplay();
        Method mGetRawWidth = Display.class.getMethod("getRawWidth");
        Method mGetRawHeight = Display.class.getMethod("getRawHeight");
        Integer realWidth = (Integer) mGetRawWidth.invoke(display);
        Integer realHeight = (Integer) mGetRawHeight.invoke(display);
        return new Pair<Integer, Integer>(realWidth, realHeight);
    } catch (Exception e) {
        DisplayMetrics disp = ctx.getResources().getDisplayMetrics();
        return new Pair<Integer, Integer>(disp.widthPixels, disp.heightPixels);
    }
}
Example 11
Project: financius-public-master  File: SmoothPathMaker.java View source code
private void addCurveToPath(Path outPath, List<PointF> curve) {
    List<Pair<PointF, PointF>> bezierControlPoints = Collections.emptyList();
    if (curve.size() > 1) {
        bezierControlPoints = getBezierControlPoints(curve);
    }
    for (int i = 0, size = curve.size(); i < size; i++) {
        final PointF point = curve.get(i);
        if (i == 0) {
            outPath.moveTo(point.x, point.y);
        } else {
            final Pair<PointF, PointF> bezierControlPointPair = bezierControlPoints.get(i - 1);
            outPath.cubicTo(bezierControlPointPair.first.x, bezierControlPointPair.first.y, bezierControlPointPair.second.x, bezierControlPointPair.second.y, point.x, point.y);
        }
    }
}
Example 12
Project: platform_packages_providers_downloadprovider-master  File: ThreadingTest.java View source code
public void testFilenameRace() throws Exception {
    final List<Pair<Download, String>> downloads = Lists.newArrayList();
    final HashSet<String> expectedBodies = Sets.newHashSet();
    // Request dozen files at once with same name
    for (int i = 0; i < 32; i++) {
        final String body = "DOWNLOAD " + i + " CONTENTS";
        enqueueResponse(new MockResponse().setResponseCode(HTTP_OK).setBody(body).setHeader("Content-type", "text/plain").setSocketPolicy(SocketPolicy.DISCONNECT_AT_END));
        final Download d = enqueueRequest(getRequest());
        downloads.add(Pair.create(d, body));
        expectedBodies.add(body);
        startDownload(d.mId);
    }
    final long startMillis = mSystemFacade.currentTimeMillis();
    for (Pair<Download, String> d : downloads) {
        d.first.waitForStatus(DownloadManager.STATUS_SUCCESSFUL, startMillis);
    }
    // Ensure that contents are clean and filenames unique
    final Set<String> seenFiles = Sets.newHashSet();
    final HashSet<String> actualBodies = Sets.newHashSet();
    for (Pair<Download, String> d : downloads) {
        final String file = d.first.getStringField(DownloadManager.COLUMN_LOCAL_FILENAME);
        if (!seenFiles.add(file)) {
            fail("Another download already claimed " + file);
        }
        final String expected = d.second;
        final String actual = d.first.getContents();
        actualBodies.add(actual);
    }
    assertEquals(expectedBodies, actualBodies);
}
Example 13
Project: MHacksAndroid-Public-master  File: NativeAppCallContentProvider.java View source code
@Override
public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
    Pair<UUID, String> callIdAndAttachmentName = parseCallIdAndAttachmentName(uri);
    if (callIdAndAttachmentName == null) {
        throw new FileNotFoundException();
    }
    try {
        File file = dataSource.openAttachment(callIdAndAttachmentName.first, callIdAndAttachmentName.second);
        return ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
    } catch (FileNotFoundException exception) {
        Log.e(TAG, "Got unexpected exception:" + exception);
        throw exception;
    }
}
Example 14
Project: CReader-master  File: AutoUpdate.java View source code
private void initData() {
    // TODO
    bookNameList = new ArrayList<Pair<String, String>>();
    isCheckedList = new ArrayList<Boolean>();
    bd = BookDao.getInstance(AutoUpdate.this);
    basic_list = bd.getBook_list();
    if (basic_list != null) {
        for (BookBasicBean book : basic_list) {
            bookNameList.add(new Pair<String, String>(book.getBook_name(), book.getAuthor_name()));
            if (book.getNeed_post() == 1)
                isCheckedList.add(true);
            else
                isCheckedList.add(false);
        }
    }
    selectAll.setChecked(cheak_all(isCheckedList));
}
Example 15
Project: android-15-master  File: DefaultDatabaseErrorHandler.java View source code
/**
     * defines the default method to be invoked when database corruption is detected.
     * @param dbObj the [email protected] SQLiteDatabase} object representing the database on which corruption
     * is detected.
     */
public void onCorruption(SQLiteDatabase dbObj) {
    Log.e(TAG, "Corruption reported by sqlite on database: " + dbObj.getPath());
    // is the corruption detected even before database could be 'opened'?
    if (!dbObj.isOpen()) {
        // database files are not even openable. delete this database file.
        // NOTE if the database has attached databases, then any of them could be corrupt.
        // and not deleting all of them could cause corrupted database file to remain and 
        // make the application crash on database open operation. To avoid this problem,
        // the application should provide its own [email protected] DatabaseErrorHandler} impl class
        // to delete ALL files of the database (including the attached databases).
        deleteDatabaseFile(dbObj.getPath());
        return;
    }
    List<Pair<String, String>> attachedDbs = null;
    try {
        // before that, get the attached database list first.
        try {
            attachedDbs = dbObj.getAttachedDbs();
        } catch (SQLiteException e) {
        }
        try {
            dbObj.close();
        } catch (SQLiteException e) {
        }
    } finally {
        // Delete all files of this corrupt database and/or attached databases
        if (attachedDbs != null) {
            for (Pair<String, String> p : attachedDbs) {
                deleteDatabaseFile(p.second);
            }
        } else {
            // attachedDbs = null is possible when the database is so corrupt that even
            // "PRAGMA database_list;" also fails. delete the main database file
            deleteDatabaseFile(dbObj.getPath());
        }
    }
}
Example 16
Project: GeoSMS-Release-master  File: NotificationHelper.java View source code
//    public void clearAllFailedThreadNotifications(int threadId){
//
//    }
/**
     * Pair<Integer,Integer> first param is sms_id , second one is thread_id
     *
     * if has zero elements , returns null.
     */
public List<Pair<Long, Long>> getAllFailedNotifications() {
    Cursor c = mDb.query("NOTIFICATIONS", null, "TYPE=?", new String[] { "1" }, null, null, null);
    try {
        if (c == null || !c.moveToFirst())
            return null;
        ArrayList<Pair<Long, Long>> failedNotifs = new ArrayList<>();
        do {
            long smsId = c.getLong(c.getColumnIndex("SMS_ID"));
            long threadId = c.getLong(c.getColumnIndex("THREAD_ID"));
            Pair<Long, Long> notification = new Pair<>(smsId, threadId);
            failedNotifs.add(notification);
        } while (c.moveToNext());
        return failedNotifs;
    } finally {
        if (c != null)
            c.close();
    }
}
Example 17
Project: platform-friends-android-master  File: NativeAppCallContentProvider.java View source code
@Override
public android.os.ParcelFileDescriptor openFile(android.net.Uri uri, java.lang.String mode) throws java.io.FileNotFoundException {
    Pair<UUID, String> callIdAndAttachmentName = parseCallIdAndAttachmentName(uri);
    if (callIdAndAttachmentName == null) {
        throw new FileNotFoundException();
    }
    try {
        File file = dataSource.openAttachment(callIdAndAttachmentName.first, callIdAndAttachmentName.second);
        return ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
    } catch (FileNotFoundException exception) {
        Log.e(TAG, "Got unexpected exception:" + exception);
        throw exception;
    }
}
Example 18
Project: openxface-android-master  File: XRuntime.java View source code
@SuppressWarnings("unchecked")
@Override
public void onReceived(Context context, XEvent evt) {
    if (evt.getType() == XEventType.CLOSE_APP) {
        int viewId = (Integer) evt.getData();
        mStartApp.getEventHandler().onCloseApplication(viewId);
    } else if (evt.getType() == XEventType.CLOSE_ENGINE) {
        mSystemContext.getActivity().finish();
    } else if (evt.getType() == XEventType.XAPP_MESSAGE) {
        Pair<XAppWebView, String> data = (Pair<XAppWebView, String>) evt.getData();
        mStartApp.getEventHandler().onXAppMessageReceived(data.first, data.second);
    }
}
Example 19
Project: Appsii-master  File: WeatherDataLoader.java View source code
/**
     * Called when there is new data to deliver to the client.  The
     * super class will take care of delivering it; the implementation
     * here just adds a little more logic.
     */
@Override
public void deliverResult(Pair<WeatherData, SparseArray<WeatherUtils.ForecastInfo>> apps) {
    if (isReset()) {
        // don't need the result.
        if (apps != null) {
            onReleaseResources(apps);
        }
    }
    Pair<WeatherData, SparseArray<WeatherUtils.ForecastInfo>> oldApps = mLastResult;
    mLastResult = apps;
    if (isStarted()) {
        // If the Loader is currently started, we can immediately
        // deliver its results.
        super.deliverResult(apps);
    }
    // know that it is no longer in use.
    if (oldApps != null) {
        onReleaseResources(oldApps);
    }
}
Example 20
Project: TestingStuff-master  File: ImageWallView.java View source code
public Pair<Integer, Integer> getNextLoadTarget() {
    int nextElement;
    do {
        if (unInitializedImages.isEmpty()) {
            // Don't choose the first or last columns (since they are partly hidden)
            nextElement = random.nextInt((numberOfColumns - 2) * numberOfRows) + numberOfRows;
        } else {
            nextElement = unInitializedImages.get(random.nextInt(unInitializedImages.size()));
        }
    } while (images[nextElement].getVisibility() != View.VISIBLE);
    int col = nextElement / numberOfRows;
    int row = nextElement % numberOfRows;
    return new Pair<Integer, Integer>(col, row);
}
Example 21
Project: Klyph-master  File: NativeAppCallContentProvider.java View source code
@Override
public android.os.ParcelFileDescriptor openFile(android.net.Uri uri, java.lang.String mode) throws java.io.FileNotFoundException {
    Pair<UUID, String> callIdAndAttachmentName = parseCallIdAndAttachmentName(uri);
    if (callIdAndAttachmentName == null) {
        throw new FileNotFoundException();
    }
    try {
        File file = dataSource.openAttachment(callIdAndAttachmentName.first, callIdAndAttachmentName.second);
        return ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
    } catch (FileNotFoundException exception) {
        Log.e(TAG, "Got unexpected exception:" + exception);
        throw exception;
    }
}
Example 22
Project: PaintDrip-master  File: NativeAppCallContentProvider.java View source code
@Override
public android.os.ParcelFileDescriptor openFile(android.net.Uri uri, java.lang.String mode) throws java.io.FileNotFoundException {
    Pair<UUID, String> callIdAndAttachmentName = parseCallIdAndAttachmentName(uri);
    if (callIdAndAttachmentName == null) {
        throw new FileNotFoundException();
    }
    try {
        File file = dataSource.openAttachment(callIdAndAttachmentName.first, callIdAndAttachmentName.second);
        return ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
    } catch (FileNotFoundException exception) {
        Log.e(TAG, "Got unexpected exception:" + exception);
        throw exception;
    }
}
Example 23
Project: Yhb-2.0-master  File: InsertQueue.java View source code
public void insert(final List<Pair<Integer, T>> indexItemPairs) {
    if (mActiveIndexes.isEmpty() && mPendingItemsToInsert.isEmpty()) {
        for (Pair<Integer, T> pair : indexItemPairs) {
            for (AtomicInteger existing : mActiveIndexes) {
                if (existing.intValue() >= pair.first) {
                    existing.incrementAndGet();
                }
            }
            mActiveIndexes.add(new AtomicInteger(pair.first));
            mInsertable.add(pair.first, pair.second);
        }
    } else {
        mPendingItemsToInsert.addAll(indexItemPairs);
    }
}
Example 24
Project: BioWiki-master  File: InsertQueue.java View source code
public void insert(final List<Pair<Integer, T>> indexItemPairs) {
    if (mActiveIndexes.isEmpty() && mPendingItemsToInsert.isEmpty()) {
        for (Pair<Integer, T> pair : indexItemPairs) {
            for (AtomicInteger existing : mActiveIndexes) {
                if (existing.intValue() >= pair.first) {
                    existing.incrementAndGet();
                }
            }
            mActiveIndexes.add(new AtomicInteger(pair.first));
            mInsertable.add(pair.first, pair.second);
        }
    } else {
        mPendingItemsToInsert.addAll(indexItemPairs);
    }
}
Example 25
Project: XieDaDeng-master  File: DebugOverlayView.java View source code
@Override
protected void onDraw(Canvas canvas) {
    if (mEnabled) {
        // Draw the outline
        canvas.drawRect(0, 0, getMeasuredWidth(), getMeasuredHeight(), mDebugOutline);
        // Draw the rects
        int numRects = mRects.size();
        for (int i = 0; i < numRects; i++) {
            Pair<Rect, Integer> r = mRects.get(i);
            mTmpPaint.setColor(r.second);
            canvas.drawRect(r.first, mTmpPaint);
        }
        // Draw the text
        if (mText != null && mText.length() > 0) {
            mTmpPaint.setColor(0xFFff0000);
            mTmpPaint.setTextSize(60);
            mTmpPaint.getTextBounds(mText, 0, 1, mTmpRect);
            canvas.drawText(mText, 10f, getMeasuredHeight() - mTmpRect.height() - mConfig.systemInsets.bottom, mTmpPaint);
        }
    }
}