@OnClick(R.id.themed) public void showThemed() { new MaterialDialog.Builder(this) .title(R.string.useGoogleLocationServices) .content(R.string.useGoogleLocationServicesPrompt) .positiveText(R.string.agree) .negativeText(R.string.disagree) .positiveColorRes(R.color.material_red_400) .negativeColorRes(R.color.material_red_400) .titleGravity(GravityEnum.CENTER) .titleColorRes(R.color.material_red_400) .contentColorRes(android.R.color.white) .backgroundColorRes(R.color.material_blue_grey_800) .dividerColorRes(R.color.accent) .btnSelector(R.drawable.md_btn_selector_custom, DialogAction.POSITIVE) .positiveColor(Color.WHITE) .negativeColorAttr(android.R.attr.textColorSecondaryInverse) .theme(Theme.DARK) .show(); }
/** * Creates a dialog to type in text */ public void createDialogInput(String header, String content, MaterialDialog.InputCallback callback, MaterialDialog.SingleButtonCallback buttonCallback) { new MaterialDialog.Builder(mContext) .positiveText(R.string.Ok) .negativeText(R.string.Cancel) //.neutralText(R.string.attach_media) .autoDismiss(false) .onAny(buttonCallback) .buttonRippleColorRes(R.color.colorAccent) .positiveColorRes(R.color.colorStateBlue) .negativeColorRes(R.color.colorStateOrange) .theme(app_prefs.isLightTheme()?Theme.LIGHT:Theme.DARK) .title(header) .content(content) .inputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_IME_MULTI_LINE | InputType.TYPE_TEXT_FLAG_MULTI_LINE) .input(mContext.getString(R.string.text_enter_text), null, callback) .show(); }
/** * Creates a dialog to display a message */ public void createDialogMessage(String header, String body, String pos, String neg, MaterialDialog.SingleButtonCallback buttonCallback) { // Build the alert dialog new MaterialDialog.Builder(mContext) .onAny(buttonCallback) .positiveText(pos) .negativeText(neg) .typeface(Typeface.SANS_SERIF,Typeface.SANS_SERIF) .iconRes(app_prefs.isLightTheme()?R.drawable.ic_new_releases_black_24dp:R.drawable.ic_new_releases_white_24dp) .buttonRippleColorRes(R.color.colorAccent) .positiveColorRes(R.color.colorStateBlue) .negativeColorRes(R.color.colorStateOrange) .theme(app_prefs.isLightTheme()?Theme.LIGHT:Theme.DARK) .title(header) .content(body) .show(); }
/** * Creates a dialog to display a message */ public void createDialogMessage(String header, Spanned body, String pos, String neg, MaterialDialog.SingleButtonCallback buttonCallback) { // Build the alert dialog new MaterialDialog.Builder(mContext) .onAny(buttonCallback) .positiveText(pos) .negativeText(neg) .typeface(Typeface.SANS_SERIF,Typeface.SANS_SERIF) .iconRes(app_prefs.isLightTheme()?R.drawable.ic_new_releases_black_24dp:R.drawable.ic_new_releases_white_24dp) .buttonRippleColorRes(R.color.colorAccent) .positiveColorRes(R.color.colorStateBlue) .negativeColorRes(R.color.colorStateOrange) .theme(app_prefs.isLightTheme()?Theme.LIGHT:Theme.DARK) .title(header) .content(body) .show(); }
/** * Will not auto dismiss */ public void createDialogMessage(String header, Spanned body, String pos, String neg, String neu, MaterialDialog.SingleButtonCallback buttonCallback) { // Build the alert dialog new MaterialDialog.Builder(mContext) .onAny(buttonCallback) .positiveText(pos) .negativeText(neg) .neutralText(neu) .autoDismiss(false) .typeface(Typeface.SANS_SERIF,Typeface.SANS_SERIF) .iconRes(app_prefs.isLightTheme()?R.drawable.ic_new_releases_black_24dp:R.drawable.ic_new_releases_white_24dp) .buttonRippleColorRes(R.color.colorAccent) .positiveColorRes(R.color.colorStateBlue) .negativeColorRes(R.color.colorStateOrange) .theme(app_prefs.isLightTheme()?Theme.LIGHT:Theme.DARK) .title(header) .content(body) .show(); }
public void createDialogSelection(String title , int selection, MaterialDialog.ListCallbackSingleChoice callbackSingleChoice, MaterialDialog.SingleButtonCallback positive, int index){ new MaterialDialog.Builder(mContext) .title(title) .items(selection) .typeface(Typeface.SANS_SERIF,Typeface.SANS_SERIF) .iconRes(app_prefs.isLightTheme()?R.drawable.ic_view_list_black_24dp:R.drawable.ic_view_list_white_24dp) .buttonRippleColorRes(R.color.colorAccent) .positiveColorRes(R.color.colorStateBlue) .negativeColorRes(R.color.colorStateOrange) .theme(app_prefs.isLightTheme()?Theme.LIGHT:Theme.DARK) .itemsCallbackSingleChoice(index, callbackSingleChoice) .positiveText(R.string.Apply) .neutralText(R.string.Cancel) .onPositive(positive) .onNeutral(new MaterialDialog.SingleButtonCallback() { @Override public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { dialog.dismiss(); } }) .show(); }
public void createDialogSelection(String title, Collection selection, MaterialDialog.ListCallbackSingleChoice callbackSingleChoice, MaterialDialog.SingleButtonCallback positive, int index){ new MaterialDialog.Builder(mContext) .title(title) .items(selection) .typeface(Typeface.SANS_SERIF,Typeface.SANS_SERIF) .iconRes(app_prefs.isLightTheme()?R.drawable.ic_view_list_black_24dp:R.drawable.ic_view_list_white_24dp) .buttonRippleColorRes(R.color.colorAccent) .positiveColorRes(R.color.colorStateBlue) .negativeColorRes(R.color.colorStateOrange) .theme(app_prefs.isLightTheme()?Theme.LIGHT:Theme.DARK) .itemsCallbackSingleChoice(index, callbackSingleChoice) .positiveText(R.string.Apply) .neutralText(R.string.Cancel) .onPositive(positive) .onNeutral(new MaterialDialog.SingleButtonCallback() { @Override public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { dialog.dismiss(); } }) .show(); }
private void createSorceryDialog() { PhilosopherStone stone = new SorceryStone.Builder(getActivity()) .titleColor(Color.MAGENTA) .titleGravity(GravityEnum.CENTER) .contentColor(Color.CYAN) .contentGravity(GravityEnum.CENTER) .buttonRippleColor(Color.YELLOW) .contentLineSpacing(2.0f) .theme(Theme.DARK) .setPhilosopherStone(new ColorPaletteStone()) // special power .build(); Material.Builder builder = new Material.Builder(getActivity()) .setTitle("Sorcery Stone") .setNegativeButton(android.R.string.cancel, null) .setPositiveButton(android.R.string.ok, null) .setPhilosopherStone(stone); DialogAlchemy.show(getFragmentManager(), builder.build(), new MaterialDialogsTransmutationCircle()); }
public void showProgressDialog(@Nullable String content) { if (this.mProgressDialog == null) { this.mProgressDialog = new MaterialDialog.Builder(this) .theme(Theme.LIGHT) .content(content == null ? "请稍后..." : content) .progress(true, 0) .cancelable(false) .show(); } else { this.mProgressDialog.setContent(content == null ? "请稍后..." : content); } if (!this.mProgressDialog.isShowing()) { this.mProgressDialog.show(); } }
public void onMenuItemFontSizeClick(){ String[] fontSizes = getResources().getStringArray(R.array.readview_font_size_entries); int index = Arrays.binarySearch(fontSizes, mFontSizePref.get()); MaterialDialog.Builder dialogBuilder = new MaterialDialog.Builder(this) .title(R.string.settings_item_font_size_dialog_title) .items(fontSizes) .theme(isNightMode() ? Theme.DARK : Theme.LIGHT) .itemsCallbackSingleChoice(index, (materialDialog, view, selection, charSequence) -> { mFontSizePref.set(charSequence.toString()); mFontSize = PreferenceConverter.getFontSize(NovelReadViewActivity.this, charSequence.toString()); mNovelReadAdapter.setFontSize(mFontSize); //getPresenter().getSplitTextPainter().setTextSize(mFontSize); getPresenter().splitChapterAndDisplay(mNovelChapters.get(chapterIndex).getTitle(), mCurrentContent); return true; }) .positiveText(R.string.dialog_choose); MaterialDialog dialog = dialogBuilder.build(); dialog.setOnDismissListener(dialogInterface -> hideSystemUI()); dialog.show(); }
public void onMenuItemPageCurlModeClick(){ String[] pageCurlModes = getResources().getStringArray(R.array.scroll_mode_string_entries); String[] pageCurlModeValues = getResources().getStringArray(R.array.scroll_mode_value_entries); String currentMode = mScrollMode.get(); int index = Arrays.binarySearch(pageCurlModeValues, currentMode); MaterialDialog.Builder dialogBuilder = new MaterialDialog.Builder(this) .title(R.string.settings_item_scroll_mode_title) .items(pageCurlModes) .theme(isNightMode() ? Theme.DARK : Theme.LIGHT) .itemsCallbackSingleChoice(index, (materialDialog, view, selection, charSequence) -> { if(selection == index) return false; mScrollMode.set(pageCurlModeValues[selection]); mReadWidgetContainer.removeAllViews(); recreate(); return true; }) .positiveText(R.string.dialog_choose); MaterialDialog dialog = dialogBuilder.build(); dialog.setOnDismissListener(dialogInterface -> hideSystemUI()); dialog.show(); }
@OnClick(R.id.layout_gender) public void onClickGender() { new MaterialDialog.Builder(getActivity()) .theme(Theme.LIGHT) .title("Gender") .items(Gender.getStringValues(getActivity())) .itemsCallbackSingleChoice(mPresenter.getCurrentGender() - 1, new MaterialDialog.ListCallbackSingleChoice() { @Override public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { Gender gender = Gender.fromValue(getActivity(), text.toString()); if (gender != null) { mPresenter.setCurrentGender(gender.getIntValue()); } return true; } }) .positiveText("Done") .show(); }
@OnClick(R.id.layout_activity_factor) public void onClickActivityFactor() { new MaterialDialog.Builder(getActivity()) .theme(Theme.LIGHT) .title("Activity Level") .items(ActivityFactor.getStringValues(getActivity())) .itemsCallbackSingleChoice(mPresenter.getCurrentActivityFactor() - 1, new MaterialDialog.ListCallbackSingleChoice() { @Override public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { ActivityFactor activityFactor = ActivityFactor.fromValue(getActivity(), text.toString()); if (activityFactor != null) { mPresenter.setCurrentActivityFactor(activityFactor.getIntValue()); } return true; } }) .positiveText("Done") .show(); }
@OnClick(R.id.layout_goal) public void onClickGoal() { new MaterialDialog.Builder(getActivity()) .theme(Theme.LIGHT) .title("Goal") .items(Goal.getStringValues(getActivity())) .itemsCallbackSingleChoice(mPresenter.getCurrentGoal() - 1, new MaterialDialog.ListCallbackSingleChoice() { @Override public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { Goal goal = Goal.fromValue(getActivity(), text.toString()); if (goal != null) { mPresenter.setCurrentGoal(goal.getIntValue()); } return true; } }) .positiveText("Done") .show(); }
@OnClick(com.zireck.calories.R.id.layout_daily) public void onDailyClick() { mMaterialDialog = new MaterialDialog.Builder(getActivity()) .title("Daily Meal") .items(Mealtime.getStringValues(getActivity())) .itemsCallbackSingleChoice(0, new MaterialDialog.ListCallbackSingleChoice() { @Override public boolean onSelection(MaterialDialog materialDialog, View view, int which, CharSequence text) { mTextDaily.setText(text); return false; } }) .theme(Theme.LIGHT) .widgetColorRes(com.zireck.calories.R.color.primary) .positiveText("Choose") .positiveColorRes(com.zireck.calories.R.color.primary) .negativeText("Cancel") .negativeColorRes(com.zireck.calories.R.color.primary) .show(); }
public void showSortDialog(final Main m) { String[] sort = m.getResources().getStringArray(R.array.sortby); int current = Integer.parseInt(m.Sp.getString("sortby", "0")); MaterialDialog.Builder a = new MaterialDialog.Builder(m.getActivity()); if(m.theme1==1)a.theme(Theme.DARK); a.items(sort).itemsCallbackSingleChoice(current, new MaterialDialog.ListCallbackSingleChoice() { @Override public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { m.Sp.edit().putString("sortby", "" + which).commit(); m.getSortModes(); m.loadlist(new File(m.current), false); dialog.dismiss(); return true; } }); a.title(R.string.sortby); a.build().show(); }
public void showHistoryDialog(final Main m) { final ArrayList<String> paths = m.history.readTable(); final MaterialDialog.Builder a = new MaterialDialog.Builder(m.getActivity()); a.positiveText(R.string.cancel); a.positiveColor(Color.parseColor(m.fabSkin)); a.title(R.string.history); if(m.theme1==1) a.theme(Theme.DARK); LayoutInflater layoutInflater = (LayoutInflater) m.getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view = layoutInflater.inflate(R.layout.list_dialog, null); ListView listView = (ListView) view.findViewById(R.id.listView); listView.setDivider(null); a.customView(view, true); a.autoDismiss(true); MaterialDialog x=a.build(); HiddenAdapter adapter = new HiddenAdapter(m.getActivity(),m, R.layout.bookmarkrow, toFileArray(paths),m.hidden,x,true); listView.setAdapter(adapter); x.show(); }
public void showHiddenDialog(final Main m) { final ArrayList<String> paths = m.hidden.readTable(); final MaterialDialog.Builder a = new MaterialDialog.Builder(m.getActivity()); a.positiveText(R.string.cancel); a.positiveColor(Color.parseColor(m.fabSkin)); a.title(R.string.hiddenfiles); if(m.theme1==1) a.theme(Theme.DARK); LayoutInflater layoutInflater = (LayoutInflater) m.getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view = layoutInflater.inflate(R.layout.list_dialog, null); ListView listView = (ListView) view.findViewById(R.id.listView); a.customView(view, true); a.autoDismiss(true); listView.setDivider(null); MaterialDialog x=a.build(); HiddenAdapter adapter = new HiddenAdapter(m.getActivity(),m, R.layout.bookmarkrow, toFileArray(paths),m.hidden,x,false); listView.setAdapter(adapter); x.show(); }
public void showUpdated() { new MaterialDialog.Builder(this) .title("RadioControl has been updated") .theme(Theme.LIGHT) .positiveText("GOT IT") .negativeText("WHAT'S NEW") .onAny(new MaterialDialog.SingleButtonCallback() { @Override public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { String chk = which.name(); Log.d("RadioControl", "Updated: " + chk); if(chk.equals("POSITIVE")){ dialog.dismiss(); } else if(chk.equals("NEGATIVE")){ startChangelogActivity(); } } }) .show(); }
private void doRename(final String newName) { Async.executeAsync(device, new Async.ApiProcedure<ParticleDevice>() { @Override public Void callApi(@NonNull ParticleDevice sparkDevice) throws ParticleCloudException, IOException { device.setName(newName); EventBus.getDefault().post(device); return null; } @Override public void onFailure(@NonNull ParticleCloudException exception) { new MaterialDialog.Builder(activity) .theme(Theme.LIGHT) .title("Unable to rename core") .content(exception.getBestMessage()) .positiveText("OK"); } }).andIgnoreCallbacksIfActivityIsFinishing(activity); }
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_about: new MaterialDialog.Builder(this) .title(R.string.about_title) .content(R.string.about_content) .theme(Theme.LIGHT) .titleColor(R.color.primary_text_default_material_light) .contentColor(R.color.primary_text_default_material_light) .positiveText(R.string.dialog_close) .show(); return true; case R.id.action_settings: startActivity( new Intent(this, SettingsActivity.class) ); return true; default: return super.onOptionsItemSelected(item); } }
private void updateChart(String totalSpace, List<PieEntry> entries) { boolean isDarkTheme = appTheme.getMaterialDialogTheme() == Theme.DARK; PieDataSet set = new PieDataSet(entries, null); set.setColors(COLORS); set.setXValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE); set.setYValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE); set.setSliceSpace(5f); set.setAutomaticallyDisableSliceSpacing(true); set.setValueLinePart2Length(1.05f); set.setSelectionShift(0f); PieData pieData = new PieData(set); pieData.setValueFormatter(new GeneralDialogCreation.SizeFormatter(context)); pieData.setValueTextColor(isDarkTheme? Color.WHITE:Color.BLACK); chart.setCenterText(new SpannableString(context.getString(R.string.total) + "\n" + totalSpace)); chart.setData(pieData); }
private void invalidateColorPreference(ColorPickerDialog selectedColors) { int colorPickerPref = sharedPref.getInt(PreferencesConstants.PREFERENCE_COLOR_CONFIG, ColorPickerDialog.NO_DATA); boolean isColor = colorPickerPref != ColorPickerDialog.CUSTOM_INDEX && colorPickerPref != ColorPickerDialog.RANDOM_INDEX; if(isColor) { selectedColors.setColorsVisibility(View.VISIBLE); int skin = activity.getColorPreference().getColor(ColorUsage.PRIMARY); int skin_two = activity.getColorPreference().getColor(ColorUsage.PRIMARY_TWO); int accent_skin = activity.getColorPreference().getColor(ColorUsage.ACCENT); int icon_skin = activity.getColorPreference().getColor(ColorUsage.ICON_SKIN); selectedColors.setColors(skin, skin_two, accent_skin, icon_skin); if(activity.getAppTheme().getMaterialDialogTheme() == Theme.LIGHT) { selectedColors.setDividerColor(Color.WHITE); } else { selectedColors.setDividerColor(Color.BLACK); } } else{ selectedColors.setColorsVisibility(View.GONE); } }
@Override public void onDeleteClick(View view, final int position) { // popup to show delete new MaterialDialog.Builder(getActivity()) .callback(new MaterialDialog.ButtonCallback() { @Override public void onPositive(MaterialDialog dialog) { super.onPositive(dialog); // delete operatio, delete from cloud first, if succeed then delete from local AsyncRemoveBookFromCloud arbfc = new AsyncRemoveBookFromCloud(); arbfc.execute(listNovelItemAid.get(position)); listNovelItemAid.remove(position); refreshList(timecount ++); } }) .theme(Theme.LIGHT) .content(R.string.dialog_content_want_to_delete) .contentGravity(GravityEnum.CENTER) .positiveText(R.string.dialog_positive_sure) .negativeText(R.string.dialog_negative_preferno) .show(); }
@Override protected void onPreExecute() { super.onPreExecute(); loadAllLocal(); isLoading = true; md = new MaterialDialog.Builder(getActivity()) .theme(Theme.LIGHT) .content(R.string.dialog_content_sync) .progress(false, 1, true) .cancelable(true) .cancelListener(new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { isLoading = false; md.dismiss(); } }) .show(); md.setProgress(0); md.setMaxProgress(0); md.show(); }
@Override protected void onPreExecute() { super.onPreExecute(); md = new MaterialDialog.Builder(getActivity()) .theme(Theme.LIGHT) .cancelListener(new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { isLoading = false; AsyncDeleteSlow.this.cancel(true); } }) .title(R.string.config_clear_cache) .content(R.string.dialog_content_wipe_cache_slow) .progress(true, 0) .cancelable(true) .show(); isLoading = true; }
@Override protected void onPreExecute() { super.onPreExecute(); loading = true; md = new MaterialDialog.Builder(NovelInfoActivity.this) .theme(Theme.LIGHT) .content(R.string.dialog_content_downloading) .progress(false, 1, true) .cancelable(true) .cancelListener(new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { loading = false; } }) .show(); md.setProgress(0); md.setMaxProgress(1); size_a = 0; }
@Override public void onItemLongClick(View view, final int postion) { //Toast.makeText(this, postion + ": Long Click Detected", Toast.LENGTH_SHORT).show(); new MaterialDialog.Builder(this) .callback(new MaterialDialog.ButtonCallback() { @Override public void onPositive(MaterialDialog dialog) { super.onPositive(dialog); GlobalConfig.deleteSearchHistory(historyList.get(postion)); refreshHistoryList(); } }) .theme(Theme.LIGHT) .backgroundColorRes(R.color.dlgBackgroundColor) .contentColorRes(R.color.dlgContentColor) .positiveColorRes(R.color.dlgPositiveButtonColor) .negativeColorRes(R.color.dlgNegativeButtonColor) .title(getResources().getString(R.string.dialog_content_delete_one_search_record)) .content(historyList.get(postion)) .contentGravity(GravityEnum.CENTER) .positiveText(R.string.dialog_positive_likethis) .negativeText(R.string.dialog_negative_preferno) .show(); }
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { return new MaterialDialog.Builder(activity) .items(R.array.track_actions) .itemsCallback(new MaterialDialog.ListCallback() { @Override public void onSelection(MaterialDialog materialDialog, View view, int i, CharSequence charSequence) { switch (i) { case 0: // Love loveTrack(); break; } } }) .theme(Theme.DARK) .build(); }
@OnClick(R.id.themed) public void showThemed() { new MaterialDialog.Builder(this) .title(R.string.useGoogleLocationServices) .content(R.string.useGoogleLocationServicesPrompt, true) .positiveText(R.string.agree) .negativeText(R.string.disagree) .positiveColorRes(R.color.material_red_400) .negativeColorRes(R.color.material_red_400) .titleGravity(GravityEnum.CENTER) .titleColorRes(R.color.material_red_400) .contentColorRes(android.R.color.white) .backgroundColorRes(R.color.material_blue_grey_800) .dividerColorRes(R.color.accent) .btnSelector(R.drawable.md_btn_selector_custom, DialogAction.POSITIVE) .positiveColor(Color.WHITE) .negativeColorAttr(android.R.attr.textColorSecondaryInverse) .theme(Theme.DARK) .show(); }
private void ensureDialog() { if (mNodeInfoDialog == null) { mNodeInfoView = new NodeInfoView(getContext()); mNodeInfoDialog = new MaterialDialog.Builder(getContext()) .customView(mNodeInfoView, false) .theme(Theme.LIGHT) .build(); mNodeInfoDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_PHONE); } }
private void ensureNodeInfoDialog() { if (mNodeInfoDialog == null) { mNodeInfoView = new NodeInfoView(getContext()); mNodeInfoDialog = new MaterialDialog.Builder(getContext()) .customView(mNodeInfoView, false) .theme(Theme.LIGHT) .build(); if (mNodeInfoDialog.getWindow() != null) mNodeInfoDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_PHONE); } }
private BlockedMaterialDialog.Builder dialogBuilder() { Context context = mAppUtils.getCurrentActivity(); if (context == null || ((Activity) context).isFinishing()) { context = getContext(); } return (BlockedMaterialDialog.Builder) new BlockedMaterialDialog.Builder(context, mUiHandler) .theme(Theme.LIGHT); }
private void ensureDialog() { if (mNodeInfoDialog == null) { mNodeInfoView = new NodeInfoView(mContext); mNodeInfoDialog = new MaterialDialog.Builder(mContext) .customView(mNodeInfoView, false) .theme(Theme.LIGHT) .build(); mNodeInfoDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_PHONE); } }
private void ensureNodeInfoDialog() { if (mNodeInfoDialog == null) { mNodeInfoView = new NodeInfoView(mContext); mNodeInfoDialog = new MaterialDialog.Builder(mContext) .customView(mNodeInfoView, false) .theme(Theme.LIGHT) .build(); if (mNodeInfoDialog.getWindow() != null) mNodeInfoDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_PHONE); } }
private BlockedMaterialDialog.Builder dialogBuilder(Object callback) { Context context = mAppUtils.getCurrentActivity(); if (context == null || ((Activity) context).isFinishing()) { context = getContext(); } return (BlockedMaterialDialog.Builder) new BlockedMaterialDialog.Builder(context, mUiHandler, mScriptBridges, callback) .theme(Theme.LIGHT); }
public Builder(Context context, UiHandler uiHandler, ScriptBridges scriptBridges, Object callback) { super(context); super.theme(Theme.LIGHT); mUiHandler = uiHandler; mScriptBridges = scriptBridges; mCallback = callback; if (Looper.getMainLooper() != Looper.myLooper()) { mResultBox = new VolatileDispose<>(); } }
private void init(){ logoutBtn = (Button)findViewById(R.id.btn_logout); logoutBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { logout(SupporterMainActivity.this); } }); tv_msg = (TextView)findViewById(R.id.tv_msg); tv_msg.setVisibility(View.GONE); mLinearLayoutManager = new LinearLayoutManager(getApplicationContext()); mLinearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL); rv = (RecyclerView) findViewById(R.id.rv); rv.setHasFixedSize(true); rv.setLayoutManager(mLinearLayoutManager); // rv.addItemDecoration(new DividerItemDecoration(getApplicationContext(), DividerItemDecoration.VERTICAL_LIST)); loading = (AVLoadingIndicatorView)findViewById(R.id.loading); progressDialog = new MaterialDialog.Builder(this) .content(R.string.please_wait) .progress(true, 0) .progressIndeterminateStyle(true) .theme(Theme.LIGHT) .build(); }
private void init(){ kenBurnsView = (KenBurnsView)findViewById(R.id.image); kenBurnsView.setImageResource(R.drawable.loading); rl_background = (RelativeLayout)findViewById(R.id.rl_background); initLoginForm(); tv_signupSupporterBtn = (TextView)findViewById(R.id.tv_signup_supporter); tv_signupSupporterBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(StartActivity.this, RegisterSupporterActivity.class); startActivity(intent); } }); progressDialog = new MaterialDialog.Builder(this) .content(R.string.please_wait) .progress(true, 0) .progressIndeterminateStyle(true) .theme(Theme.LIGHT) .build(); findViewById(R.id.rl_background).setVisibility(View.GONE); }
private void initProgressDialog(){ if(progressDialog != null){ progressDialog.dismiss(); } progressDialog = new MaterialDialog.Builder(this) .content(R.string.please_wait) .progress(true, 0) .progressIndeterminateStyle(true) .theme(Theme.LIGHT) .cancelable(false) .build(); }