/** * Get extra boolean value. * @param key The key of the stored value. * @return The stored value or false if it doesn't exist in specified form. */ public boolean optExtraBoolean(String key) { return mExtraData.optBoolean(key); }
/** * Get extra boolean value. * @param key The key of the stored value. * @return The stored value or false if it doesn't exist in specified form. */ public boolean optExtraBoolean(String key) { return mExtraData.optBoolean(key); }
/** * Get extra boolean value. * @param key The key of the stored value. * @param defaultValue The value to return if the key does not exist or the value cannot be * coerced into the necessary type. * @return The stored value or the provided default if it doesn't exist in specified form. */ public boolean optExtraBoolean(String key, boolean defaultValue) { return mExtraData.optBoolean(key, defaultValue); }
/** * Get extra boolean value. * @param key The key of the stored value. * @param defaultValue The value to return if the key does not exist or the value cannot be * coerced into the necessary type. * @return The stored value or the provided default if it doesn't exist in specified form. */ public boolean optExtraBoolean(String key, boolean defaultValue) { return mExtraData.optBoolean(key, defaultValue); }
/** * Get an optional boolean associated with a key. It returns false if there * is no such key, or if the value is not Boolean.TRUE or the String "true". * * @param key * A key string. * @return The truth. */ public boolean optBoolean(String key) { return this.optBoolean(key, false); }
/** * Returns the value mapped by {@code name} if it exists and is a boolean or can be coerced to a * boolean, or false otherwise. * * @param name The name of the field we want. * @return The selected value if it exists. */ public boolean optBoolean(String name) { return optBoolean(name, false); }
/** * Returns the value mapped by {@code name} if it exists and is a boolean or * can be coerced to a boolean. Returns false otherwise. */ public boolean optBoolean(String name) { return optBoolean(name, false); }
public boolean getBoolean(String field) { return jsonData.optBoolean(field); }
/** * Get an optional boolean associated with a key. It returns false if there * is no such key, or if the value is not Boolean.TRUE or the String "true". * * @param key * A key string. * @return The truth. */ public boolean optBoolean(String key) { return this.optBoolean(key, false); }
public boolean getBoolean(String key) { return jsonObject.optBoolean(key); }
public boolean optBoolParam(String key) { if (extras.has(key)) { return extras.optBoolean(key); } return style != null && style.extras != null && style.extras.optBoolean(key); }
public boolean optBoolParam(String key) { if (extras.has(key)) return extras.optBoolean(key); return style != null && style.extras != null && style.extras.optBoolean(key); }
public static boolean getGateKeeperForKey( final String name, final String applicationId, final boolean defaultValue) { loadAppGateKeepersAsync(); if (applicationId == null || !fetchedAppGateKeepers.containsKey(applicationId)) { return defaultValue; } return fetchedAppGateKeepers.get(applicationId).optBoolean(name, defaultValue); }
/** * Determines if the open graph object is for posting * @param object The open graph object to check * @return True if the open graph object was created for posting */ public static boolean isOpenGraphObjectForPost(JSONObject object) { return object != null ? object.optBoolean(NativeProtocol.OPEN_GRAPH_CREATE_OBJECT_KEY) : false; } }
@Override public void onCompleted(GraphResponse response) { boolean success = false; FacebookRequestError error = response.getError(); if (error == null) { JSONObject jsonObject = response.getJSONObject(); success = jsonObject.optBoolean("success"); } else { Log.d(TAG, "response error: " + error); } Log.d( TAG, "provideCurrentPlaceFeedback: onCompleted: response: success=" + success); } };
public void collapseBrowser(long did) { try { JSONObject deck = get(did); boolean collapsed = deck.optBoolean("browserCollapsed", false); deck.put("browserCollapsed", !collapsed); save(deck); } catch (JSONException e) { throw new RuntimeException(e); } }
/** * Return an img link for LATEX. */ private static String _imgLink(String latex, JSONObject model) { String txt = _latexFromHtml(latex); String ext = "png"; if (model.optBoolean("latexsvg", false)) { ext = "svg"; } String fname = "latex-" + Utils.checksum(txt) + "." + ext; return "<img class=latex src=\"" + fname + "\">"; }
public void testIsOpenGraphObjectForPost() { JSONObject jsonObject = mock(JSONObject.class); when(jsonObject.optBoolean(NativeProtocol.OPEN_GRAPH_CREATE_OBJECT_KEY)).thenReturn(true); assertTrue(GraphUtil.isOpenGraphObjectForPost(jsonObject)); } }
private void setDeckExpander(ImageButton expander, ImageButton indent, Sched.DeckDueTreeNode node){ boolean collapsed = mCol.getDecks().get(node.did).optBoolean("collapsed", false); // Apply the correct expand/collapse drawable if (collapsed) { expander.setImageDrawable(mExpandImage); expander.setContentDescription(expander.getContext().getString(R.string.expand)); } else if (node.children.size() > 0) { expander.setImageDrawable(mCollapseImage); expander.setContentDescription(expander.getContext().getString(R.string.collapse)); } else { expander.setImageDrawable(mNoExpander); } // Add some indenting for each nested level int width = (int) indent.getResources().getDimension(R.dimen.keyline_1) * node.depth; indent.setMinimumWidth(width); }
public void fillFlashcard() { Timber.d("fillFlashcard()"); Timber.d("base url = %s", mBaseUrl); if (mCard != null) { CompatHelper.getCompat().setHTML5MediaAutoPlay(mCard.getSettings(), getConfigForCurrentCard().optBoolean("autoplay")); mCard.loadDataWithBaseURL(mBaseUrl + "__viewer__.html", mCardContent.toString(), "text/html", "utf-8", null); } if (mShowTimer && mCardTimer.getVisibility() == View.INVISIBLE) { switchTopBarVisibility(View.VISIBLE); } if (!sDisplayAnswer) { updateForNewCard(); } }