Esempio n. 1
0
 public DraftsAdapter(final Context context) {
   super(context, R.layout.list_item_draft, null, new String[0], new int[0], 0);
   DaggerGeneralComponent.builder()
       .applicationModule(ApplicationModule.get(context))
       .build()
       .inject(this);
   mMediaLoadingHandler = new MediaLoadingHandler(R.id.media_preview_progress);
   mMediaPreviewStyle =
       Utils.getMediaPreviewStyle(mPreferences.getString(KEY_MEDIA_PREVIEW_STYLE, null));
 }
 @NonNull
 @Override
 public Dialog onCreateDialog(final Bundle savedInstanceState) {
   final FragmentActivity activity = getActivity();
   final Context wrapped = ThemeUtils.getDialogThemedContext(activity);
   final AlertDialog.Builder builder = new AlertDialog.Builder(wrapped);
   final ParcelableUser user = getUser();
   if (user != null) {
     final UserColorNameManager manager = UserColorNameManager.getInstance(activity);
     final SharedPreferencesWrapper prefs =
         SharedPreferencesWrapper.getInstance(
             activity,
             SharedPreferencesWrapper.SHARED_PREFERENCES_NAME,
             Context.MODE_PRIVATE,
             SharedPreferenceConstants.class);
     final boolean nameFirst = prefs.getBoolean(KEY_NAME_FIRST);
     final String displayName = manager.getDisplayName(user, nameFirst, false);
     builder.setTitle(getString(R.string.report_user, displayName));
     builder.setMessage(getString(R.string.report_user_confirm_message, displayName));
   }
   builder.setPositiveButton(android.R.string.ok, this);
   builder.setNegativeButton(android.R.string.cancel, null);
   return builder.create();
 }