當前位置: 首頁>>代碼示例>>Java>>正文


Java XposedHelpers.getIntField方法代碼示例

本文整理匯總了Java中de.robv.android.xposed.XposedHelpers.getIntField方法的典型用法代碼示例。如果您正苦於以下問題:Java XposedHelpers.getIntField方法的具體用法?Java XposedHelpers.getIntField怎麽用?Java XposedHelpers.getIntField使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在de.robv.android.xposed.XposedHelpers的用法示例。


在下文中一共展示了XposedHelpers.getIntField方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: StatusbarBattery

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
public StatusbarBattery(View batteryView) {
        mBattery = batteryView;
        createHooks();
        try {
            Object drawable = getDrawable();
            final int[] colors = (int[]) XposedHelpers.getObjectField(drawable, "mColors");
            mDefaultColor = colors[colors.length - 1];
            if (Utils.isLineageOs()) {

                Drawable frameDrawable = (Drawable) XposedHelpers.getObjectField(drawable, "mFrameDrawable");
//                mDefaultFrameColor = frameDrawable.setTint();
                mFrameAlpha = frameDrawable.getAlpha();
            } else {
                final Paint framePaint = (Paint) XposedHelpers.getObjectField(drawable, "mFramePaint");
                mDefaultFrameColor = framePaint.getColor();
                mFrameAlpha = framePaint.getAlpha();
            }

            mDefaultChargeColor = XposedHelpers.getIntField(drawable, "mChargeColor");
        } catch (Throwable t) {
            log("Error backing up original colors: " + t.getMessage());
        }
        if (SysUiManagers.IconManager != null) {
            SysUiManagers.IconManager.registerListener(this);
        }
    }
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:27,代碼來源:StatusbarBattery.java

示例2: isSignalNull

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private boolean isSignalNull(Object info) {
    try {
        boolean noSim = XposedHelpers.getBooleanField(info, "noSim");
        boolean enabled = XposedHelpers.getBooleanField(info, "enabled");
        boolean airplane = XposedHelpers.getBooleanField(info, "airplaneModeEnabled");
        int iconId = 1;
        try {
            iconId = XposedHelpers.getIntField(info, "mobileSignalIconId");
        } catch (Throwable t1) {
            iconId = XposedHelpers.getIntField(info, "mobileSimIconId");
        }
        return (noSim || !enabled || airplane || iconId <= 0);
    } catch (Throwable t2) {
        return false;
    }
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:17,代碼來源:CellularTile.java

示例3: updateBatteryPadding

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
protected void updateBatteryPadding() {
    if (Utils.isXperiaDevice()) return;

    try {
        if (mBatteryPaddingOriginal == null) {
            mBatteryPaddingOriginal = XposedHelpers.getIntField(mView, "mEndPadding");
        }
        int padding = mBatteryPaddingOriginal;
        if (mBatteryStyle == GravityBoxSettings.BATTERY_STYLE_NONE) {
            if ((mContainerType == ContainerType.STATUSBAR && !mPercentTextSb) ||
                    (mContainerType == ContainerType.KEYGUARD)) {
                padding = Math.round((float) mBatteryPaddingOriginal / 4f);
            }
        }
        XposedHelpers.setIntField(mView, "mEndPadding", padding);
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:20,代碼來源:StatusbarSignalCluster.java

示例4: setNavBarDimensions

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
public static void setNavBarDimensions(Object sPhoneWindowManager, int hp) {
    int[] navigationBarHeightForRotation;
    if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) {
        navigationBarHeightForRotation = (int[]) XposedHelpers.getObjectField(
                sPhoneWindowManager, "mNavigationBarHeightForRotation");
    } else {
        navigationBarHeightForRotation = (int[]) XposedHelpers.getObjectField(
                sPhoneWindowManager, "mNavigationBarHeightForRotationDefault");
    }

    final int portraitRotation = XposedHelpers.getIntField(sPhoneWindowManager, "mPortraitRotation");
    final int upsideDownRotation = XposedHelpers.getIntField(sPhoneWindowManager, "mUpsideDownRotation");
    if (navigationBarHeightForRotation[portraitRotation] == hp)
        return;

    navigationBarHeightForRotation[portraitRotation] =
            navigationBarHeightForRotation[upsideDownRotation] =
                    hp;
    XposedHelpers.callMethod(sPhoneWindowManager, "updateRotation", false);
}
 
開發者ID:EggUncle,項目名稱:XposedNavigationBar,代碼行數:21,代碼來源:PhoneWindowManagerHook.java

示例5: isOfficialConversation

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private boolean isOfficialConversation(Object value, Object messageStatus) {
    String username = XposedHelpers.getObjectField(messageStatus, Constants.Value_Message_Bean_NickName).toString();

    ArrayList<String> list = AppSaveInfoUtils.INSTANCE.getWhiteList("white_list_official");

    boolean wcY = XposedHelpers.getBooleanField(messageStatus, Value_Message_Status_Is_OFFICIAL_1);
    int wcU = XposedHelpers.getIntField(messageStatus, Value_Message_Status_Is_OFFICIAL_2);
    String field_username = ((String) XposedHelpers.getObjectField(value, Value_Message_Status_Is_OFFICIAL_3));

    boolean isOfficial = !"gh_43f2581f6fd6".equals(field_username) && wcY && (wcU == 1 || wcU == 2 || wcU == 3);

    if (isOfficial) {
        officialNickNameEntries.add(username);

        for (String s : list) {
            if (s.trim().equals(username)) return false;
        }
    }

    return isOfficial;
}
 
開發者ID:zhudongya123,項目名稱:WechatChatroomHelper,代碼行數:22,代碼來源:HookLogic.java

示例6: isRingerSliderEnabled

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private static boolean isRingerSliderEnabled() {
    try {
        List<?> rows = (List<?>) XposedHelpers.getObjectField(mVolumePanel, "mRows");
        for (Object row : rows) {
            if (XposedHelpers.getIntField(row, "stream") == AudioManager.STREAM_RING) {
                return ((View) XposedHelpers.getObjectField(row, "slider")).isEnabled();
            }
        }
        return true;
    } catch (Throwable t) {
        XposedBridge.log(t);
        return true;
    }
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:15,代碼來源:ModVolumePanel.java

示例7: getCurrentUserId

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
public int getCurrentUserId() {
    try {
        return XposedHelpers.getIntField(mMonitor, "mCurrentUser");
    } catch (Throwable t) {
        return 0;
    }
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:8,代碼來源:KeyguardStateMonitor.java

示例8: setCustomKeyVisibility

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private static void setCustomKeyVisibility() {
    try {
        final int disabledFlags = XposedHelpers.getIntField(mNavigationBarView, "mDisabledFlags");
        final boolean visible = mCustomKeyEnabled &&
                !((disabledFlags & STATUS_BAR_DISABLE_RECENT) != 0);
        for (int i = 0; i <= 1; i++) {
            if (mNavbarViewInfo[i] == null) continue;

            if (mNavbarViewInfo[i].visible != visible) {
                if (mNavbarViewInfo[i].originalView != null) {
                    mNavbarViewInfo[i].navButtons.removeViewAt(mNavbarViewInfo[i].customKeyPosition);
                    mNavbarViewInfo[i].navButtons.addView(visible ?
                                    mNavbarViewInfo[i].customKey : mNavbarViewInfo[i].originalView,
                            mNavbarViewInfo[i].customKeyPosition);
                } else {
                    if (visible) {
                        mNavbarViewInfo[i].navButtons.addView(mNavbarViewInfo[i].customKey,
                                mNavbarViewInfo[i].customKeyPosition);
                    } else {
                        mNavbarViewInfo[i].navButtons.removeView(mNavbarViewInfo[i].customKey);
                    }
                }
                mNavbarViewInfo[i].visible = visible;
                if (DEBUG) log("setAppKeyVisibility: visible=" + visible);
            }

            // swap / unswap with menu key if necessary
            if ((!mCustomKeyEnabled || !mCustomKeySwapEnabled) &&
                    mNavbarViewInfo[i].menuCustomSwapped) {
                swapMenuAndCustom(mNavbarViewInfo[i]);
            } else if (mCustomKeyEnabled && mCustomKeySwapEnabled &&
                    !mNavbarViewInfo[i].menuCustomSwapped) {
                swapMenuAndCustom(mNavbarViewInfo[i]);
            }
        }
    } catch (Throwable t) {
        log("Error setting app key visibility: " + t.getMessage());
    }
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:40,代碼來源:ModNavigationBar.java

示例9: setMenuKeyVisibility

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private static void setMenuKeyVisibility() {
    try {
        final boolean showMenu = XposedHelpers.getBooleanField(mNavigationBarView, "mShowMenu");
        final int disabledFlags = XposedHelpers.getIntField(mNavigationBarView, "mDisabledFlags");
        final boolean visible = (showMenu || mAlwaysShowMenukey) &&
                !((disabledFlags & STATUS_BAR_DISABLE_RECENT) != 0);
        int menuResId = mResources.getIdentifier("menu", "id", PACKAGE_NAME);
        int imeSwitcherResId = mResources.getIdentifier("ime_switcher", "id", PACKAGE_NAME);
        for (int i = 0; i <= 1; i++) {
            if (mNavbarViewInfo[i] == null) continue;

            boolean isImeSwitcherVisible = false;
            View v = null;
            if (imeSwitcherResId != 0) {
                v = mNavbarViewInfo[i].navButtons.findViewById(imeSwitcherResId);
                if (v != null) {
                    isImeSwitcherVisible = v.getVisibility() == View.VISIBLE;
                }
            }
            v = mNavbarViewInfo[i].navButtons.findViewById(menuResId);
            if (v != null) {
                v.setVisibility(mDpadKeysVisible || isImeSwitcherVisible ? View.GONE :
                        visible ? View.VISIBLE : View.INVISIBLE);
            }
        }
    } catch (Throwable t) {
        log("Error setting menu key visibility:" + t.getMessage());
    }

}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:31,代碼來源:ModNavigationBar.java

示例10: onCreateTileView

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
@Override
public void onCreateTileView(View tileView) throws Throwable {
    XposedHelpers.setAdditionalInstanceField(tileView, TILE_KEY_NAME, mKey);

    mScalingFactor = QsPanel.getScalingFactor(Integer.valueOf(mPrefs.getString(
            GravityBoxSettings.PREF_KEY_QUICK_SETTINGS_TILES_PER_ROW, "0")),
            mPrefs.getInt(GravityBoxSettings.PREF_KEY_QS_SCALE_CORRECTION, 0));
    if (mScalingFactor != 1f) {
        int iconSizePx = XposedHelpers.getIntField(tileView, "mIconSizePx");
        XposedHelpers.setIntField(tileView, "mIconSizePx", Math.round(iconSizePx*mScalingFactor));
        int tileSpacingPx = XposedHelpers.getIntField(tileView, "mTileSpacingPx");
        XposedHelpers.setIntField(tileView, "mTileSpacingPx", Math.round(tileSpacingPx*mScalingFactor));
        int tilePaddingBelowIconPx = XposedHelpers.getIntField(tileView, "mTilePaddingBelowIconPx");
        XposedHelpers.setIntField(tileView, "mTilePaddingBelowIconPx",
                Math.round(tilePaddingBelowIconPx*mScalingFactor));
        int dualTileVerticalPaddingPx = XposedHelpers.getIntField(tileView, "mDualTileVerticalPaddingPx");
        XposedHelpers.setIntField(tileView, "mDualTileVerticalPaddingPx", 
                Math.round(dualTileVerticalPaddingPx*mScalingFactor));

        updateLabelLayout(tileView);
        updatePaddingTop(tileView);

        if (tileView.getClass().getName().equals(CLASS_SIGNAL_TILE_VIEW) &&
                Utils.isMotoXtDevice()) {
            updateMotoXtSignalIconLayout(tileView);
        }
    }
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:29,代碼來源:BaseTile.java

示例11: isDataTypeIconVisible

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private boolean isDataTypeIconVisible(Object state) {
    try {
        return (XposedHelpers.getIntField(state, "overlayIconId") != 0);
    } catch (Throwable t) {
        return false;
    }
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:8,代碼來源:CellularTile.java

示例12: setDpadKeyVisibility

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private static void setDpadKeyVisibility() {
    if (!mCursorControlEnabled) return;
    try {
        final int iconHints = XposedHelpers.getIntField(mNavigationBarView, "mNavigationIconHints");
        final int disabledFlags = XposedHelpers.getIntField(mNavigationBarView, "mDisabledFlags");
        mDpadKeysVisible = !((disabledFlags & STATUS_BAR_DISABLE_RECENT) != 0) &&
                (iconHints & NAVIGATION_HINT_BACK_ALT) != 0;

        for (int i = 0; i <= 1; i++) {
            // hide/unhide app key or whatever view at that position
            View v = mNavbarViewInfo[i].navButtons.getChildAt(mNavbarViewInfo[i].customKeyPosition);
            if (v != null) {
                v.setVisibility(mDpadKeysVisible ? View.GONE : View.VISIBLE);
            }
            // hide/unhide menu key
            int menuResId = mResources.getIdentifier("menu", "id", PACKAGE_NAME);
            v = mNavbarViewInfo[i].navButtons.findViewById(menuResId);
            if (v != null) {
                if (mDpadKeysVisible) {
                    v.setVisibility(View.GONE);
                } else {
                    setMenuKeyVisibility();
                }
            }
            // Hide view group holding menu/customkey and ime switcher if all children hidden
            if (mNavbarViewInfo[i].menuImeGroup != null) {
                boolean allHidden = true;
                for (int j = 0; j < mNavbarViewInfo[i].menuImeGroup.getChildCount(); j++) {
                    allHidden &= mNavbarViewInfo[i].menuImeGroup.getChildAt(j)
                            .getVisibility() != View.VISIBLE;
                }
                mNavbarViewInfo[i].menuImeGroup.setVisibility(
                        mDpadKeysVisible && allHidden ? View.GONE : View.VISIBLE);
            }
            mNavbarViewInfo[i].dpadLeft.setVisibility(mDpadKeysVisible ? View.VISIBLE : View.GONE);
            mNavbarViewInfo[i].dpadRight.setVisibility(mDpadKeysVisible ? View.VISIBLE : View.GONE);
            if (DEBUG) log("setDpadKeyVisibility: visible=" + mDpadKeysVisible);
        }
    } catch (Throwable t) {
        log("Error setting dpad key visibility: " + t.getMessage());
    }
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:43,代碼來源:ModNavigationBar.java

示例13: updateSettings

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private static void updateSettings() {
    if (mContext == null || mPhoneWindowManager == null) return;

    try {
        final boolean expandedDesktop = Settings.Global.getInt(mContext.getContentResolver(),
                SETTING_EXPANDED_DESKTOP_STATE, 0) == 1;
        if (mExpandedDesktopMode == GravityBoxSettings.ED_DISABLED && expandedDesktop) {
            Settings.Global.putInt(mContext.getContentResolver(),
                    SETTING_EXPANDED_DESKTOP_STATE, 0);
            return;
        }

        if (mExpandedDesktop != expandedDesktop) {
            mExpandedDesktop = expandedDesktop;
        }

        XposedHelpers.callMethod(mPhoneWindowManager, "updateSettings");

        int[] navigationBarWidthForRotation = (int[]) XposedHelpers.getObjectField(
                mPhoneWindowManager, "mNavigationBarWidthForRotationDefault");
        int[] navigationBarHeightForRotation = (int[]) XposedHelpers.getObjectField(
                mPhoneWindowManager, "mNavigationBarHeightForRotationDefault");
        final int portraitRotation = XposedHelpers.getIntField(mPhoneWindowManager, "mPortraitRotation");
        final int upsideDownRotation = XposedHelpers.getIntField(mPhoneWindowManager, "mUpsideDownRotation");
        final int landscapeRotation = XposedHelpers.getIntField(mPhoneWindowManager, "mLandscapeRotation");
        final int seascapeRotation = XposedHelpers.getIntField(mPhoneWindowManager, "mSeascapeRotation");

        if (isNavbarHidden()) {
            navigationBarWidthForRotation[portraitRotation]
                    = navigationBarWidthForRotation[upsideDownRotation]
                    = navigationBarWidthForRotation[landscapeRotation]
                    = navigationBarWidthForRotation[seascapeRotation]
                    = navigationBarHeightForRotation[portraitRotation]
                    = navigationBarHeightForRotation[upsideDownRotation]
                    = navigationBarHeightForRotation[landscapeRotation]
                    = navigationBarHeightForRotation[seascapeRotation] = 0;
        } else if (mNavbarDimensions != null) {
            navigationBarHeightForRotation[portraitRotation] =
                    navigationBarHeightForRotation[upsideDownRotation] =
                            mNavbarDimensions.hPort;
            navigationBarHeightForRotation[landscapeRotation] =
                    navigationBarHeightForRotation[seascapeRotation] =
                            mNavbarDimensions.hLand;

            navigationBarWidthForRotation[portraitRotation] =
                    navigationBarWidthForRotation[upsideDownRotation] =
                            navigationBarWidthForRotation[landscapeRotation] =
                                    navigationBarWidthForRotation[seascapeRotation] =
                                            mNavbarDimensions.wPort;
        }

        XposedHelpers.callMethod(mPhoneWindowManager, "updateRotation", false);
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:57,代碼來源:ModExpandedDesktop.java

示例14: getInt

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private static int getInt(String field) {
    return XposedHelpers.getIntField(mPhoneWindowManager, field);
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:4,代碼來源:ModExpandedDesktop.java

示例15: updatePaddingTop

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private void updatePaddingTop(View tileView) {
    int tilePaddingTopPx = XposedHelpers.getIntField(tileView, "mTilePaddingTopPx");
    XposedHelpers.setIntField(tileView, "mTilePaddingTopPx",
            Math.round(tilePaddingTopPx*mScalingFactor));
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:6,代碼來源:BaseTile.java


注:本文中的de.robv.android.xposed.XposedHelpers.getIntField方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。