本文整理匯總了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;
}
示例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));
}
示例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());
}
}
示例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);
// }
}
示例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);
}
}
示例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);
}
}
}
示例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;
}
示例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);
}
}
}
示例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;
}
}
示例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());
}
}
示例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);
}
示例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;
}
}
示例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());
}
}
示例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);
}
示例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);
}
}