MainActivity.java 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  1. package com.afollestad.materialdialogssample;
  2. import android.content.DialogInterface;
  3. import android.content.Intent;
  4. import android.graphics.Color;
  5. import android.graphics.drawable.ColorDrawable;
  6. import android.os.Build;
  7. import android.os.Bundle;
  8. import android.support.annotation.StringRes;
  9. import android.support.v7.app.AppCompatActivity;
  10. import android.text.Editable;
  11. import android.text.Html;
  12. import android.text.InputType;
  13. import android.text.TextWatcher;
  14. import android.text.method.PasswordTransformationMethod;
  15. import android.view.Menu;
  16. import android.view.MenuItem;
  17. import android.view.View;
  18. import android.widget.CheckBox;
  19. import android.widget.CompoundButton;
  20. import android.widget.EditText;
  21. import android.widget.Toast;
  22. import com.afollestad.materialdialogs.DialogAction;
  23. import com.afollestad.materialdialogs.GravityEnum;
  24. import com.afollestad.materialdialogs.MaterialDialog;
  25. import com.afollestad.materialdialogs.Theme;
  26. import com.afollestad.materialdialogs.ThemeSingleton;
  27. import com.afollestad.materialdialogs.internal.MDTintHelper;
  28. import com.afollestad.materialdialogs.simplelist.MaterialSimpleListAdapter;
  29. import com.afollestad.materialdialogs.simplelist.MaterialSimpleListItem;
  30. import java.io.File;
  31. /**
  32. * @author Aidan Follestad (afollestad)
  33. */
  34. public class MainActivity extends AppCompatActivity implements
  35. FolderSelectorDialog.FolderSelectCallback, ColorChooserDialog.Callback {
  36. private Toast mToast;
  37. private void showToast(String message) {
  38. if (mToast != null) {
  39. mToast.cancel();
  40. mToast = null;
  41. }
  42. mToast = Toast.makeText(this, message, Toast.LENGTH_SHORT);
  43. mToast.show();
  44. }
  45. private void showToast(@StringRes int message) {
  46. showToast(getString(message));
  47. }
  48. @Override
  49. protected void onCreate(Bundle savedInstanceState) {
  50. super.onCreate(savedInstanceState);
  51. setContentView(R.layout.activity_main);
  52. findViewById(R.id.basicNoTitle).setOnClickListener(new View.OnClickListener() {
  53. @Override
  54. public void onClick(View v) {
  55. showBasicNoTitle();
  56. }
  57. });
  58. findViewById(R.id.basic).setOnClickListener(new View.OnClickListener() {
  59. @Override
  60. public void onClick(View v) {
  61. showBasic();
  62. }
  63. });
  64. findViewById(R.id.basicLongContent).setOnClickListener(new View.OnClickListener() {
  65. @Override
  66. public void onClick(View v) {
  67. showBasicLongContent();
  68. }
  69. });
  70. findViewById(R.id.basicIcon).setOnClickListener(new View.OnClickListener() {
  71. @Override
  72. public void onClick(View v) {
  73. showBasicIcon();
  74. }
  75. });
  76. findViewById(R.id.stacked).setOnClickListener(new View.OnClickListener() {
  77. @Override
  78. public void onClick(View v) {
  79. showStacked();
  80. }
  81. });
  82. findViewById(R.id.neutral).setOnClickListener(new View.OnClickListener() {
  83. @Override
  84. public void onClick(View v) {
  85. showNeutral();
  86. }
  87. });
  88. findViewById(R.id.callbacks).setOnClickListener(new View.OnClickListener() {
  89. @Override
  90. public void onClick(View v) {
  91. showCallbacks();
  92. }
  93. });
  94. findViewById(R.id.list).setOnClickListener(new View.OnClickListener() {
  95. @Override
  96. public void onClick(View v) {
  97. showList();
  98. }
  99. });
  100. findViewById(R.id.listNoTitle).setOnClickListener(new View.OnClickListener() {
  101. @Override
  102. public void onClick(View v) {
  103. showListNoTitle();
  104. }
  105. });
  106. findViewById(R.id.longList).setOnClickListener(new View.OnClickListener() {
  107. @Override
  108. public void onClick(View v) {
  109. showLongList();
  110. }
  111. });
  112. findViewById(R.id.singleChoice).setOnClickListener(new View.OnClickListener() {
  113. @Override
  114. public void onClick(View v) {
  115. showSingleChoice();
  116. }
  117. });
  118. findViewById(R.id.multiChoice).setOnClickListener(new View.OnClickListener() {
  119. @Override
  120. public void onClick(View v) {
  121. showMultiChoice();
  122. }
  123. });
  124. findViewById(R.id.multiChoiceLimited).setOnClickListener(new View.OnClickListener() {
  125. @Override
  126. public void onClick(View v) {
  127. showMultiChoiceLimited();
  128. }
  129. });
  130. findViewById(R.id.simpleList).setOnClickListener(new View.OnClickListener() {
  131. @Override
  132. public void onClick(View v) {
  133. showSimpleList();
  134. }
  135. });
  136. findViewById(R.id.customListItems).setOnClickListener(new View.OnClickListener() {
  137. @Override
  138. public void onClick(View v) {
  139. showCustomList();
  140. }
  141. });
  142. findViewById(R.id.customView).setOnClickListener(new View.OnClickListener() {
  143. @Override
  144. public void onClick(View v) {
  145. showCustomView();
  146. }
  147. });
  148. findViewById(R.id.customView_webView).setOnClickListener(new View.OnClickListener() {
  149. @Override
  150. public void onClick(View v) {
  151. showCustomWebView();
  152. }
  153. });
  154. findViewById(R.id.customView_colorChooser).setOnClickListener(new View.OnClickListener() {
  155. @Override
  156. public void onClick(View v) {
  157. showCustomColorChooser();
  158. }
  159. });
  160. findViewById(R.id.themed).setOnClickListener(new View.OnClickListener() {
  161. @Override
  162. public void onClick(View v) {
  163. showThemed();
  164. }
  165. });
  166. findViewById(R.id.showCancelDismiss).setOnClickListener(new View.OnClickListener() {
  167. @Override
  168. public void onClick(View v) {
  169. showShowCancelDismissCallbacks();
  170. }
  171. });
  172. findViewById(R.id.folder_chooser).setOnClickListener(new View.OnClickListener() {
  173. @Override
  174. public void onClick(View v) {
  175. new FolderSelectorDialog().show(MainActivity.this);
  176. }
  177. });
  178. findViewById(R.id.input).setOnClickListener(new View.OnClickListener() {
  179. @Override
  180. public void onClick(View v) {
  181. showInputDialog();
  182. }
  183. });
  184. findViewById(R.id.progress1).setOnClickListener(new View.OnClickListener() {
  185. @Override
  186. public void onClick(View v) {
  187. showProgressDialog(false);
  188. }
  189. });
  190. findViewById(R.id.progress2).setOnClickListener(new View.OnClickListener() {
  191. @Override
  192. public void onClick(View v) {
  193. showProgressDialog(true);
  194. }
  195. });
  196. findViewById(R.id.preference_dialogs).setOnClickListener(new View.OnClickListener() {
  197. @Override
  198. public void onClick(View v) {
  199. if (Build.VERSION.SDK_INT > Build.VERSION_CODES.GINGERBREAD_MR1)
  200. startActivity(new Intent(getApplicationContext(), PreferenceActivity.class));
  201. else
  202. startActivity(new Intent(getApplicationContext(), PreferenceActivityCompat.class));
  203. }
  204. });
  205. }
  206. private void showBasicNoTitle() {
  207. new MaterialDialog.Builder(this)
  208. .content(R.string.shareLocationPrompt)
  209. .positiveText(R.string.agree)
  210. .negativeText(R.string.disagree)
  211. .show();
  212. }
  213. private void showBasic() {
  214. new MaterialDialog.Builder(this)
  215. .title(R.string.useGoogleLocationServices)
  216. .content(R.string.useGoogleLocationServicesPrompt)
  217. .positiveText(R.string.agree)
  218. .negativeText(R.string.disagree)
  219. .show();
  220. }
  221. private void showBasicLongContent() {
  222. new MaterialDialog.Builder(this)
  223. .title(R.string.useGoogleLocationServices)
  224. .content(R.string.loremIpsum)
  225. .positiveText(R.string.agree)
  226. .negativeText(R.string.disagree)
  227. .show();
  228. }
  229. private void showBasicIcon() {
  230. new MaterialDialog.Builder(this)
  231. .iconRes(R.drawable.ic_launcher)
  232. .limitIconToDefaultSize() // limits the displayed icon size to 48dp
  233. .title(R.string.useGoogleLocationServices)
  234. .content(R.string.useGoogleLocationServicesPrompt)
  235. .positiveText(R.string.agree)
  236. .negativeText(R.string.disagree)
  237. .show();
  238. }
  239. private void showStacked() {
  240. new MaterialDialog.Builder(this)
  241. .title(R.string.useGoogleLocationServices)
  242. .content(R.string.useGoogleLocationServicesPrompt)
  243. .positiveText(R.string.speedBoost)
  244. .negativeText(R.string.noThanks)
  245. .forceStacking(true) // this generally should not be forced, but is used for demo purposes
  246. .show();
  247. }
  248. private void showNeutral() {
  249. new MaterialDialog.Builder(this)
  250. .title(R.string.useGoogleLocationServices)
  251. .content(R.string.useGoogleLocationServicesPrompt)
  252. .positiveText(R.string.agree)
  253. .negativeText(R.string.disagree)
  254. .neutralText(R.string.more_info)
  255. .show();
  256. }
  257. private void showCallbacks() {
  258. new MaterialDialog.Builder(this)
  259. .title(R.string.useGoogleLocationServices)
  260. .content(R.string.useGoogleLocationServicesPrompt)
  261. .positiveText(R.string.agree)
  262. .negativeText(R.string.disagree)
  263. .neutralText(R.string.more_info)
  264. .callback(new MaterialDialog.ButtonCallback() {
  265. @Override
  266. public void onPositive(MaterialDialog dialog) {
  267. showToast("Positive!");
  268. }
  269. @Override
  270. public void onNeutral(MaterialDialog dialog) {
  271. showToast("Neutral");
  272. }
  273. @Override
  274. public void onNegative(MaterialDialog dialog) {
  275. showToast("Negative…");
  276. }
  277. })
  278. .show();
  279. }
  280. private void showList() {
  281. new MaterialDialog.Builder(this)
  282. .title(R.string.socialNetworks)
  283. .items(R.array.socialNetworks)
  284. .itemsCallback(new MaterialDialog.ListCallback() {
  285. @Override
  286. public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {
  287. showToast(which + ": " + text);
  288. }
  289. })
  290. .show();
  291. }
  292. private void showListNoTitle() {
  293. new MaterialDialog.Builder(this)
  294. .items(R.array.socialNetworks)
  295. .itemsCallback(new MaterialDialog.ListCallback() {
  296. @Override
  297. public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {
  298. showToast(which + ": " + text);
  299. }
  300. })
  301. .show();
  302. }
  303. private void showLongList() {
  304. new MaterialDialog.Builder(this)
  305. .title(R.string.states)
  306. .items(R.array.states)
  307. .itemsCallback(new MaterialDialog.ListCallback() {
  308. @Override
  309. public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {
  310. showToast(which + ": " + text);
  311. }
  312. })
  313. .positiveText(android.R.string.cancel)
  314. .show();
  315. }
  316. private void showSingleChoice() {
  317. new MaterialDialog.Builder(this)
  318. .title(R.string.socialNetworks)
  319. .items(R.array.socialNetworks)
  320. .itemsCallbackSingleChoice(2, new MaterialDialog.ListCallbackSingleChoice() {
  321. @Override
  322. public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {
  323. showToast(which + ": " + text);
  324. return true; // allow selection
  325. }
  326. })
  327. .positiveText(R.string.choose)
  328. .show();
  329. }
  330. private void showMultiChoice() {
  331. new MaterialDialog.Builder(this)
  332. .title(R.string.socialNetworks)
  333. .items(R.array.socialNetworks)
  334. .itemsCallbackMultiChoice(new Integer[]{1, 3}, new MaterialDialog.ListCallbackMultiChoice() {
  335. @Override
  336. public boolean onSelection(MaterialDialog dialog, Integer[] which, CharSequence[] text) {
  337. StringBuilder str = new StringBuilder();
  338. for (int i = 0; i < which.length; i++) {
  339. if (i > 0) str.append('\n');
  340. str.append(which[i]);
  341. str.append(": ");
  342. str.append(text[i]);
  343. }
  344. showToast(str.toString());
  345. return true; // allow selection
  346. }
  347. })
  348. .alwaysCallMultiChoiceCallback()
  349. .positiveText(R.string.choose)
  350. .show();
  351. }
  352. private void showMultiChoiceLimited() {
  353. new MaterialDialog.Builder(this)
  354. .title(R.string.socialNetworks)
  355. .items(R.array.socialNetworks)
  356. .itemsCallbackMultiChoice(new Integer[]{1}, new MaterialDialog.ListCallbackMultiChoice() {
  357. @Override
  358. public boolean onSelection(MaterialDialog dialog, Integer[] which, CharSequence[] text) {
  359. boolean allowSelection = which.length <= 2; // limit selection to 2, the new selection is included in the which array
  360. if (!allowSelection) {
  361. showToast(R.string.selection_limit_reached);
  362. }
  363. return allowSelection;
  364. }
  365. })
  366. .positiveText(R.string.dismiss)
  367. .alwaysCallMultiChoiceCallback() // the callback will always be called, to check if selection is still allowed
  368. .show();
  369. }
  370. private void showSimpleList() {
  371. final MaterialSimpleListAdapter adapter = new MaterialSimpleListAdapter(this);
  372. adapter.add(new MaterialSimpleListItem.Builder(this)
  373. .content("username@gmail.com")
  374. .icon(R.drawable.ic_circle_darker)
  375. .build());
  376. adapter.add(new MaterialSimpleListItem.Builder(this)
  377. .content("user02@gmail.com")
  378. .icon(R.drawable.ic_circle_darker)
  379. .build());
  380. adapter.add(new MaterialSimpleListItem.Builder(this)
  381. .content(R.string.add_account)
  382. .icon(R.drawable.ic_circle_lighter)
  383. .build());
  384. new MaterialDialog.Builder(this)
  385. .title(R.string.set_backup)
  386. .adapter(adapter, new MaterialDialog.ListCallback() {
  387. @Override
  388. public void onSelection(MaterialDialog dialog, View itemView, int which, CharSequence text) {
  389. MaterialSimpleListItem item = adapter.getItem(which);
  390. showToast(item.getContent().toString());
  391. }
  392. })
  393. .show();
  394. }
  395. private void showCustomList() {
  396. new MaterialDialog.Builder(this)
  397. .title(R.string.socialNetworks)
  398. .adapter(new ButtonItemAdapter(this, R.array.socialNetworks),
  399. new MaterialDialog.ListCallback() {
  400. @Override
  401. public void onSelection(MaterialDialog dialog, View itemView, int which, CharSequence text) {
  402. showToast("Clicked item " + which);
  403. }
  404. })
  405. .show();
  406. }
  407. private EditText passwordInput;
  408. private View positiveAction;
  409. private void showCustomView() {
  410. MaterialDialog dialog = new MaterialDialog.Builder(this)
  411. .title(R.string.googleWifi)
  412. .customView(R.layout.dialog_customview, true)
  413. .positiveText(R.string.connect)
  414. .negativeText(android.R.string.cancel)
  415. .callback(new MaterialDialog.ButtonCallback() {
  416. @Override
  417. public void onPositive(MaterialDialog dialog) {
  418. showToast("Password: " + passwordInput.getText().toString());
  419. }
  420. @Override
  421. public void onNegative(MaterialDialog dialog) {
  422. }
  423. }).build();
  424. positiveAction = dialog.getActionButton(DialogAction.POSITIVE);
  425. passwordInput = (EditText) dialog.getCustomView().findViewById(R.id.password);
  426. passwordInput.addTextChangedListener(new TextWatcher() {
  427. @Override
  428. public void beforeTextChanged(CharSequence s, int start, int count, int after) {
  429. }
  430. @Override
  431. public void onTextChanged(CharSequence s, int start, int before, int count) {
  432. positiveAction.setEnabled(s.toString().trim().length() > 0);
  433. }
  434. @Override
  435. public void afterTextChanged(Editable s) {
  436. }
  437. });
  438. // Toggling the show password CheckBox will mask or unmask the password input EditText
  439. CheckBox checkbox = (CheckBox) dialog.getCustomView().findViewById(R.id.showPassword);
  440. checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
  441. @Override
  442. public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
  443. passwordInput.setInputType(!isChecked ? InputType.TYPE_TEXT_VARIATION_PASSWORD : InputType.TYPE_CLASS_TEXT);
  444. passwordInput.setTransformationMethod(!isChecked ? PasswordTransformationMethod.getInstance() : null);
  445. }
  446. });
  447. int widgetColor = ThemeSingleton.get().widgetColor;
  448. MDTintHelper.setTint(checkbox,
  449. widgetColor == 0 ? getResources().getColor(R.color.material_teal_500) : widgetColor);
  450. MDTintHelper.setTint(passwordInput,
  451. widgetColor == 0 ? getResources().getColor(R.color.material_teal_500) : widgetColor);
  452. dialog.show();
  453. positiveAction.setEnabled(false); // disabled by default
  454. }
  455. private void showCustomWebView() {
  456. int accentColor = ThemeSingleton.get().widgetColor;
  457. if (accentColor == 0)
  458. accentColor = getResources().getColor(R.color.material_teal_500);
  459. ChangelogDialog.create(false, accentColor)
  460. .show(getSupportFragmentManager(), "changelog");
  461. }
  462. static int selectedColorIndex = -1;
  463. private void showCustomColorChooser() {
  464. new ColorChooserDialog().show(this, selectedColorIndex);
  465. }
  466. @Override
  467. public void onColorSelection(int index, int color, int darker) {
  468. selectedColorIndex = index;
  469. getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color));
  470. ThemeSingleton.get().positiveColor = color;
  471. ThemeSingleton.get().neutralColor = color;
  472. ThemeSingleton.get().negativeColor = color;
  473. ThemeSingleton.get().widgetColor = color;
  474. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
  475. getWindow().setStatusBarColor(darker);
  476. getWindow().setNavigationBarColor(color);
  477. }
  478. }
  479. private void showThemed() {
  480. new MaterialDialog.Builder(this)
  481. .title(R.string.useGoogleLocationServices)
  482. .content(R.string.useGoogleLocationServicesPrompt)
  483. .positiveText(R.string.agree)
  484. .negativeText(R.string.disagree)
  485. .positiveColorRes(R.color.material_red_400)
  486. .negativeColorRes(R.color.material_red_400)
  487. .titleGravity(GravityEnum.CENTER)
  488. .titleColorRes(R.color.material_red_400)
  489. .contentColorRes(android.R.color.white)
  490. .backgroundColorRes(R.color.material_blue_grey_800)
  491. .dividerColorRes(R.color.material_teal_500)
  492. .btnSelector(R.drawable.md_btn_selector_custom, DialogAction.POSITIVE)
  493. .positiveColor(Color.WHITE)
  494. .negativeColorAttr(android.R.attr.textColorSecondaryInverse)
  495. .theme(Theme.DARK)
  496. .show();
  497. }
  498. private void showShowCancelDismissCallbacks() {
  499. new MaterialDialog.Builder(this)
  500. .title(R.string.useGoogleLocationServices)
  501. .content(R.string.useGoogleLocationServicesPrompt)
  502. .positiveText(R.string.agree)
  503. .negativeText(R.string.disagree)
  504. .neutralText(R.string.more_info)
  505. .showListener(new DialogInterface.OnShowListener() {
  506. @Override
  507. public void onShow(DialogInterface dialog) {
  508. showToast("onShow");
  509. }
  510. })
  511. .cancelListener(new DialogInterface.OnCancelListener() {
  512. @Override
  513. public void onCancel(DialogInterface dialog) {
  514. showToast("onCancel");
  515. }
  516. })
  517. .dismissListener(new DialogInterface.OnDismissListener() {
  518. @Override
  519. public void onDismiss(DialogInterface dialog) {
  520. showToast("onDismiss");
  521. }
  522. })
  523. .show();
  524. }
  525. private void showInputDialog() {
  526. new MaterialDialog.Builder(this)
  527. .title(R.string.input)
  528. .content(R.string.input_content)
  529. .inputType(InputType.TYPE_CLASS_TEXT |
  530. InputType.TYPE_TEXT_VARIATION_PERSON_NAME |
  531. InputType.TYPE_TEXT_FLAG_CAP_WORDS)
  532. .inputMaxLength(16)
  533. .positiveText(R.string.submit)
  534. .input(R.string.input_hint, R.string.input_hint, false, new MaterialDialog.InputCallback() {
  535. @Override
  536. public void onInput(MaterialDialog dialog, CharSequence input) {
  537. showToast("Hello, " + input.toString() + "!");
  538. }
  539. }).show();
  540. }
  541. private void showProgressDialog(boolean indeterminate) {
  542. if (indeterminate) {
  543. new MaterialDialog.Builder(this)
  544. .title(R.string.progress_dialog)
  545. .content(R.string.please_wait)
  546. .progress(true, 0)
  547. .show();
  548. } else {
  549. new MaterialDialog.Builder(this)
  550. .title(R.string.progress_dialog)
  551. .content(R.string.please_wait)
  552. .contentGravity(GravityEnum.CENTER)
  553. .progress(false, 150, true)
  554. .showListener(new DialogInterface.OnShowListener() {
  555. @Override
  556. public void onShow(DialogInterface dialogInterface) {
  557. final MaterialDialog dialog = (MaterialDialog) dialogInterface;
  558. new Thread(new Runnable() {
  559. @Override
  560. public void run() {
  561. while (dialog.getCurrentProgress() != dialog.getMaxProgress()) {
  562. if (dialog.isCancelled())
  563. break;
  564. try {
  565. Thread.sleep(50);
  566. } catch (InterruptedException e) {
  567. break;
  568. }
  569. dialog.incrementProgress(1);
  570. }
  571. dialog.setContent(getString(R.string.done));
  572. }
  573. }).start();
  574. }
  575. }).show();
  576. }
  577. }
  578. @Override
  579. public boolean onCreateOptionsMenu(Menu menu) {
  580. getMenuInflater().inflate(R.menu.main, menu);
  581. return super.onCreateOptionsMenu(menu);
  582. }
  583. @Override
  584. public boolean onOptionsItemSelected(MenuItem item) {
  585. if (item.getItemId() == R.id.about) {
  586. new MaterialDialog.Builder(this)
  587. .title(R.string.about)
  588. .positiveText(R.string.dismiss)
  589. .content(Html.fromHtml(getString(R.string.about_body)))
  590. .contentLineSpacing(1.6f)
  591. .show();
  592. return true;
  593. }
  594. return super.onOptionsItemSelected(item);
  595. }
  596. @Override
  597. public void onFolderSelection(File folder) {
  598. showToast(folder.getAbsolutePath());
  599. }
  600. }