当前位置: 首页>>代码示例>>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;未经允许,请勿转载。