当前位置: 首页>>代码示例>>Java>>正文


Java XposedHelpers.getObjectField方法代码示例

本文整理汇总了Java中de.robv.android.xposed.XposedHelpers.getObjectField方法的典型用法代码示例。如果您正苦于以下问题:Java XposedHelpers.getObjectField方法的具体用法?Java XposedHelpers.getObjectField怎么用?Java XposedHelpers.getObjectField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在de.robv.android.xposed.XposedHelpers的用法示例。


在下文中一共展示了XposedHelpers.getObjectField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getNotifCountFor

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
public int getNotifCountFor(String pkg) {
    if (pkg == null) return 0;

    int count = 0;

    try {
        Map<?,?> entries = (Map<?,?>) XposedHelpers.getObjectField(mNotifData, "mEntries");
        for (Object entry : entries.values()) {
            StatusBarNotification sbn = (StatusBarNotification)
                    XposedHelpers.getObjectField(entry, "notification");
            if (pkg.equals(sbn.getPackageName())) {
                final Notification n = sbn.getNotification();
                count += (n.number > 0 ? n.number : 1);
            }
        }
    } catch (Throwable t) {
        XposedBridge.log(t);
    }

    if (DEBUG) log("getNotifCountFor: " + pkg + "=" + count);

    return count;
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:24,代码来源:NotificationDataMonitor.java

示例2: changeDigit

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private void changeDigit(Object key, int digit) {
    XposedHelpers.setIntField(key, "mDigit", digit);
    ((TextView)XposedHelpers.getObjectField(key, "mDigitText"))
        .setText(Integer.toString(digit));

    TextView kt = (TextView) XposedHelpers.getObjectField(
            key, "mKlondikeText");
    kt.setText("");
    kt.setVisibility(View.INVISIBLE);
    if (digit >= 0) {
        String[] sKlondike = (String[]) XposedHelpers.getStaticObjectField(
                key.getClass(), "sKlondike");
        if (sKlondike != null && sKlondike.length > digit) {
            String klondike = sKlondike[digit];
            if (klondike.length() > 0) {
                kt.setText(klondike);
                kt.setVisibility(View.VISIBLE);
            }
        }
    }

    ((View)key).setContentDescription(Integer.toString(digit));
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:24,代码来源:LockscreenPinScrambler.java

示例3: launchCustomApp

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private static void launchCustomApp(String uri) {
    if (uri == null) {
        try {
            Handler handler = (Handler) XposedHelpers.getObjectField(mPhoneWindowManager, "mHandler");
            handler.post(new Runnable() {
                @Override
                public void run() {
                    Toast.makeText(mContext, mStrCustomAppNone, Toast.LENGTH_SHORT).show();
                }
            });
        } catch (Throwable t) {
        }
        return;
    }

    try {
        Intent i = Intent.parseUri(uri, 0);
        launchCustomApp(i);
    } catch (URISyntaxException e) {
        log("launchCustomApp: error parsing uri: " + e.getMessage());
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:23,代码来源:ModHwKeys.java

示例4: prepareStatusbarBackgroundColor

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private static void prepareStatusbarBackgroundColor() {
        if (!mPrefs.getBoolean(GravityBoxSettings.PREF_KEY_STATUSBAR_BG_ENABLE, false)) {
            return;
        }
        View view = (View) XposedHelpers.getObjectField(mPhoneStatusBar, "mStatusBarWindow");
        View bar = view.findViewById(view.getResources().getIdentifier("quick_settings_container", "id", "com.android.systemui"));
        if (DEBUG) {
            log("alpha:" + statusBarBgAlpha + ", color:" + Integer.toHexString(statusBarBgColor));
        }
        bar.setAlpha(1 - statusBarBgAlpha / 100.0f);
        bar.setBackgroundColor(statusBarBgColor);
//        ViewGroup viewGroup = (ViewGroup) view.findViewById(view.getResources().getIdentifier("notification_stack_scroller", "id", "com.android.systemui"));
//        View v = viewGroup.getChildAt(0);
//        XposedHelpers.callMethod(v, "setBackgroundTintColor", Color.GREEN);
//        for (int i = 1; i < viewGroup.getChildCount(); i++) {
//            View view1 = viewGroup.getChildAt(i);
//            log(view1.toString() + ";" + view1.getId());
//            view1.setAlpha(0.5f);
//        }
    }
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:21,代码来源:ModStatusBar.java

示例5: setNotificationPanelState

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private static void setNotificationPanelState(Intent intent, boolean withQs) {
    try {
        if (!intent.hasExtra(AShortcut.EXTRA_ENABLE)) {
            Object notifPanel = XposedHelpers.getObjectField(mPhoneStatusBar, "mNotificationPanel");
            if ((boolean) XposedHelpers.callMethod(notifPanel, "isFullyCollapsed")) {
                expandNotificationPanel(withQs);
            } else {
                collapseNotificationPanel();
            }
        } else {
            if (intent.getBooleanExtra(AShortcut.EXTRA_ENABLE, false)) {
                expandNotificationPanel(withQs);
            } else {
                collapseNotificationPanel();
            }
        }
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:21,代码来源:ModStatusBar.java

示例6: setColors

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
public void setColors(int mainColor, int frameColor, int chargeColor) {
    if (mBattery != null) {
        try {
            Object drawable = getDrawable();
            final int[] colors = (int[]) XposedHelpers.getObjectField(drawable, "mColors");
            colors[colors.length - 1] = mainColor;
            if (Utils.isLineageOs()) {
                Drawable frameDrawable = (Drawable) XposedHelpers.getObjectField(drawable, "mFrameDrawable");
                frameDrawable.setAlpha(mFrameAlpha);
                frameDrawable.setTint(frameColor);
                Paint paint = (Paint) XposedHelpers.getObjectField(drawable, "mTextAndBoltPaint");
                paint.setColor(chargeColor);
            } else {
                final Paint framePaint = (Paint) XposedHelpers.getObjectField(drawable, "mFramePaint");
                framePaint.setColor(frameColor);
                framePaint.setAlpha(mFrameAlpha);
                XposedHelpers.setIntField(drawable, "mChargeColor", chargeColor);
            }
            XposedHelpers.setIntField(drawable, "mIconTint", mainColor);
        } catch (Throwable t) {
            XposedBridge.log(t);
        }
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:25,代码来源:StatusbarBattery.java

示例7: 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

示例8: updateMobileIconSpacing

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private void updateMobileIconSpacing() {
    for (String spacer : MOBILE_ICON_SPACERS) {
        try {
            View v = (View) XposedHelpers.getObjectField(mView, spacer);
            if (v == null) continue;
            ViewGroup.LayoutParams lp = v.getLayoutParams();
            if (mIconSpacingDef.get(spacer) == null) {
                mIconSpacingDef.put(spacer, lp.width);
            }
            lp.width = mNarrowIcons ? mIconSpacingPx :
                mIconSpacingDef.get(spacer);
            v.setLayoutParams(lp);
        } catch (Throwable t) {
            if (DEBUG) XposedBridge.log(t);
        }
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:18,代码来源:StatusbarSignalClusterMoto.java

示例9: getObjField

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
/**
 * Gat a field from an object
 *
 * @param obj The object
 * @param fld The field
 * @return The field, or null if it doesn't exist
 */
static Object getObjField(Object obj, String fld) {
    try {
        return XposedHelpers.getObjectField(obj, fld);
    } catch (NoSuchFieldError e) {
        return null;
    }

}
 
开发者ID:xkik-dev,项目名称:XKik,代码行数:16,代码来源:Util.java

示例10: showGlobalActionsDialog

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private static void showGlobalActionsDialog() {
    try {
        Handler handler = (Handler) XposedHelpers.getObjectField(mPhoneWindowManager, "mHandler");
        handler.post(new Runnable() {
            @Override
            public void run() {
                XposedHelpers.callMethod(mPhoneWindowManager, "showGlobalActions");
            }
        });
    } catch (Throwable t) {
        log("Error executing PhoneWindowManager.showGlobalActionsDialog(): " + t.getMessage());
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:14,代码来源:ModHwKeys.java

示例11: keyguardAllowsHeadsUp

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private static boolean keyguardAllowsHeadsUp(Context context) {
    boolean isShowingAndNotOccluded;
    boolean isInputRestricted;
    Object kgViewManager = XposedHelpers.getObjectField(mStatusBar, "mStatusBarKeyguardViewManager");
    isShowingAndNotOccluded = ((boolean)XposedHelpers.callMethod(kgViewManager, "isShowing") &&
            !(boolean)XposedHelpers.callMethod(kgViewManager, "isOccluded"));
    isInputRestricted = (boolean)XposedHelpers.callMethod(kgViewManager, "isInputRestricted");
    return (!isShowingAndNotOccluded && !isInputRestricted);
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:10,代码来源:ModLedControl.java

示例12: onLongClick

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
@Override
public boolean onLongClick(View v) {
    try {
        Intent intent = new Intent(Settings.ACTION_DISPLAY_SETTINGS);
        Object host = XposedHelpers.getObjectField(mQsPanel, "mHost");
        XposedHelpers.callMethod(host, "startActivityDismissingKeyguard", intent);
        return true;
    } catch (Throwable t) {
        XposedBridge.log(t);
        return false;
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:13,代码来源:QsPanel.java

示例13: showVolumePanel

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private static void showVolumePanel() {
    try {
        Handler handler = (Handler) XposedHelpers.getObjectField(mPhoneWindowManager, "mHandler");
        handler.post(new Runnable() {
            @Override
            public void run() {
                AudioManager am = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
                am.adjustVolume(AudioManager.ADJUST_SAME, AudioManager.FLAG_SHOW_UI);
            }
        });
    } catch (Throwable t) {
        log("Error executing showVolumePanel: " + t.getMessage());
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:15,代码来源:ModHwKeys.java

示例14: onCallsManagerCreated

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private void onCallsManagerCreated(Object callsManager) {
    if (DEBUG) log("onCallsManagerCreated()");
    mContext = (Context) XposedHelpers.getObjectField(callsManager, "mContext");
    mSensorManager = (SensorManager) mContext.getSystemService(Context.SENSOR_SERVICE);
    mVibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
    mHandler = new Handler();
    PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
    mWakeLock  = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:10,代码来源:CallFeatures.java

示例15: prepareNotificationRow

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private static void prepareNotificationRow(Resources res) {
    try {
        XposedHelpers.callMethod(mVolumePanel, "addRow",
                AudioManager.STREAM_NOTIFICATION,
                mIconNotifResId, mIconNotifMuteResId, true);
        List<?> rows = (List<?>) XposedHelpers.getObjectField(mVolumePanel, "mRows");
        Object row = rows.get(rows.size() - 1);
        XposedHelpers.setAdditionalInstanceField(row, "gbNotifSlider", true);
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:13,代码来源:ModVolumePanel.java


注:本文中的de.robv.android.xposed.XposedHelpers.getObjectField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。