List of usage examples for android.view ViewGroup setEnabled
@RemotableViewMethod public void setEnabled(boolean enabled)
From source file:com.silentcircle.common.util.ViewUtil.java
/** * Sets state (enabled/disabled) for viewGroup and its children. * * @param viewGroup ViewGroup for which to set state. * @param enabled State to set.//from w ww . j a va2 s. c om */ public static void setEnabled(final ViewGroup viewGroup, boolean enabled) { viewGroup.setEnabled(enabled); for (int i = 0; i < viewGroup.getChildCount(); i++) { View view = viewGroup.getChildAt(i); view.setEnabled(enabled); } }
From source file:org.alfresco.mobile.android.application.fragments.preferences.PasscodePreferences.java
private void disableEnableControls(boolean enable, ViewGroup vg) { for (int i = 0; i < vg.getChildCount(); i++) { View child = vg.getChildAt(i); child.setEnabled(enable);//from w w w. ja v a 2s . c om child.setFocusable(enable); if (child instanceof ViewGroup) { disableEnableControls(enable, (ViewGroup) child); } } vg.setEnabled(enable); vg.setFocusable(enable); }
From source file:de.mrapp.android.validation.AbstractValidateableView.java
/** * Adapts the enable state of all children of a specific view group. * * @param viewGroup/*from www . j a v a2 s . co m*/ * The view group, whose children's enabled states should be adapted, as an instance of * the class {@link ViewGroup}. The view group may not be null * @param enabled * True, if the children should be enabled, false otherwise */ private void setEnabledOnViewGroup(@NonNull final ViewGroup viewGroup, final boolean enabled) { viewGroup.setEnabled(enabled); for (int i = 0; i < viewGroup.getChildCount(); i++) { View child = viewGroup.getChildAt(i); if (child instanceof ViewGroup) { setEnabledOnViewGroup((ViewGroup) child, enabled); } else { child.setEnabled(enabled); } } }
From source file:com.android.vending.billing.InAppBillingService.LACK.listAppsFragment.java
public void contextCorePatch() { runWithWait(new Runnable() { public void run() { listAppsFragment.xposedNotify = true; if (((!Utils.checkCoreJarPatch11()) || (!Utils.checkCoreJarPatch12())) && ((Utils.exists("/system/framework/core.jar.jex")) || (Utils.exists("/system/framework/core-libart.jar.jex")) || (Utils.exists("/system/framework/services.jar.jex")))) { listAppsFragment.this.showMessage(Utils.getText(2131165748), Utils.getText(2131165819)); return; }/*w w w . j a v a 2s . c o m*/ try { listAppsFragment.fileNotSpace = Utils.exists("/system/framework/not.space"); listAppsFragment.filePatch3 = Utils.exists("/system/framework/patch3.done"); listAppsFragment.this.runToMain(new Runnable() { public void run() { ArrayList localArrayList = new ArrayList(); localArrayList.add(new CoreItem(Utils.getText(2131165300), false)); localArrayList.add(new CoreItem(Utils.getText(2131165302), false)); localArrayList.add(new CoreItem(Utils.getText(2131165304), false)); localArrayList.add(new CoreItem(Utils.getText(2131165307), false)); localArrayList.add(new CoreItem(Utils.getText(2131165311), false)); localArrayList.add(new CoreItem(Utils.getText(2131165312), false)); if ((listAppsFragment.all_d != null) && (listAppsFragment.all_d.adapter != null)) { listAppsFragment.all_d.adapter.notifyDataSetChanged(); } listAppsFragment.removeDialogAll(24); listAppsFragment.showDialogAll(24, new ArrayAdapter(listAppsFragment.this.getContext(), 2130968605, localArrayList) { TextView txtStatus; TextView txtStatusPatch; TextView txtTitle; public View getView(int paramAnonymous3Int, View paramAnonymous3View, ViewGroup paramAnonymous3ViewGroup) { if (listAppsFragment.xposedNotify) { paramAnonymous3View = listAppsFragment.frag; listAppsFragment.patchAct.runOnUiThread(new Runnable() { public void run() { if (Utils.hasXposed()) { listAppsFragment.frag.showMessage(Utils.getText(2131165748), Utils.getText(2131165751)); } } }); listAppsFragment.xposedNotify = false; } Object localObject = (CoreItem) getItem(paramAnonymous3Int); paramAnonymous3ViewGroup = ((LayoutInflater) listAppsFragment.getInstance() .getSystemService("layout_inflater")).inflate(2130968607, paramAnonymous3ViewGroup, false); this.txtTitle = ((TextView) paramAnonymous3ViewGroup.findViewById(2131558483)); this.txtStatus = ((TextView) paramAnonymous3ViewGroup.findViewById(2131558484)); this.txtStatusPatch = ((TextView) paramAnonymous3ViewGroup .findViewById(2131558536)); this.txtTitle.setTextAppearance(getContext(), listAppsFragment.getSizeText()); this.txtStatus.setTextAppearance(getContext(), listAppsFragment.getSizeText()); this.txtStatusPatch.setTextAppearance(getContext(), listAppsFragment.getSizeText()); paramAnonymous3View = (CheckBox) paramAnonymous3ViewGroup .findViewById(2131558535); paramAnonymous3View.setChecked(((CoreItem) localObject).Status); if (paramAnonymous3Int == 3) { paramAnonymous3View.setVisibility(8); paramAnonymous3View.setChecked(false); } if (paramAnonymous3Int == 0) { if (!Utils.checkCoreJarPatch11()) { break label716; } int i = 0; if (Utils.checkCoreJarPatch11()) { i = 0 + 1; } int j = i; if (Utils.checkCoreJarPatch12()) { j = i + 1; } if (j == 2) { paramAnonymous3View.setEnabled(false); ((CoreItem) localObject).disabled = true; this.txtStatusPatch.setText("2/2 " + Utils.getText(2131165372)); } if (j == 1) { this.txtStatusPatch.setText("1/2 " + Utils.getText(2131165372)); } } if (paramAnonymous3Int == 1) { if (Utils.checkCoreJarPatch20()) { paramAnonymous3View.setEnabled(false); ((CoreItem) localObject).disabled = true; this.txtStatusPatch.setText(Utils.getText(2131165372)); } } else { label330: if (paramAnonymous3Int == 2) { if ((!listAppsFragment.filePatch3) && (!Utils.checkCoreJarPatch30(listAppsFragment.getPkgMng()))) { break label788; } paramAnonymous3View.setEnabled(false); ((CoreItem) localObject).disabled = true; this.txtStatusPatch.setText(Utils.getText(2131165372)); } label373: if (paramAnonymous3Int == 3) { paramAnonymous3View.setEnabled(false); if ((!listAppsFragment.filePatch3) && (!Utils.checkCoreJarPatch40())) { break label824; } paramAnonymous3View.setEnabled(false); paramAnonymous3ViewGroup.setEnabled(false); ((CoreItem) localObject).disabled = true; this.txtStatusPatch.setText(Utils.getText(2131165372)); label423: this.txtStatusPatch.append(Utils.getColoredText( "\n" + Utils.getText(2131165310), "#FF0000", "normal")); } if (paramAnonymous3Int == 4) { localObject = Utils.getText(2131165314); this.txtStatusPatch.setText(Utils.getColoredText((String) localObject, "#ff888888", "italic")); } if (paramAnonymous3Int == 5) { localObject = Utils.getText(2131165313); this.txtStatusPatch.setText(Utils.getColoredText((String) localObject, "#ff888888", "italic")); } paramAnonymous3View.setClickable(false); this.txtStatus.setTextAppearance(getContext(), 16973894); this.txtStatus.setTextColor(-7829368); this.txtTitle.setTextColor(-1); this.txtTitle.setText(((CoreItem) getItem(paramAnonymous3Int)).Name); this.txtTitle.setTypeface(null, 1); paramAnonymous3View = ((CoreItem) getItem(paramAnonymous3Int)).Name; if ((paramAnonymous3Int != 0) && (paramAnonymous3Int != 1)) { break label860; } this.txtTitle.setText( Utils.getColoredText(paramAnonymous3View, "#ff00ff00", "bold")); } for (;;) { if (paramAnonymous3Int == 0) { paramAnonymous3View = Utils.getText(2131165301); } if (paramAnonymous3Int == 1) { paramAnonymous3View = Utils.getText(2131165303); } if (paramAnonymous3Int == 2) { paramAnonymous3View = Utils.getText(2131165305) + "\n" + Utils.getText(2131165306); } if (paramAnonymous3Int == 3) { paramAnonymous3View = Utils.getText(2131165308); } if (paramAnonymous3Int == 4) { paramAnonymous3View = ""; } if (paramAnonymous3Int == 5) { paramAnonymous3View = ""; } this.txtStatus.append( Utils.getColoredText(paramAnonymous3View, "#ff888888", "italic")); return paramAnonymous3ViewGroup; label716: if (listAppsFragment.fileNotSpace) { this.txtStatusPatch.setText(Utils.getText(2131165374)); break; } this.txtStatusPatch.setText(Utils.getText(2131165373)); break; if (listAppsFragment.fileNotSpace) { this.txtStatusPatch.setText(Utils.getText(2131165374)); break label330; } this.txtStatusPatch.setText(Utils.getText(2131165373)); break label330; label788: if (listAppsFragment.fileNotSpace) { this.txtStatusPatch.setText(Utils.getText(2131165374)); break label373; } this.txtStatusPatch.setText(Utils.getText(2131165373)); break label373; label824: if (listAppsFragment.fileNotSpace) { this.txtStatusPatch.setText(Utils.getText(2131165374)); break label423; } this.txtStatusPatch.setText(Utils.getText(2131165373)); break label423; label860: if ((paramAnonymous3Int == 4) || (paramAnonymous3Int == 5)) { this.txtTitle.setText( Utils.getColoredText(paramAnonymous3View, "#ffff0000", "bold")); } else { this.txtTitle.setText( Utils.getColoredText(paramAnonymous3View, "#ff00ff00", "bold")); } } } }); listAppsFragment.removeDialogLP(11); } }); return; } catch (Exception localException) { System.out.println("LuckyPatcher: handler Null."); } } }); System.out.println("LuckyPatcher: Start core.jar test!"); }