androidx.appcompat.app.AppCompatDialogFragment Java Examples

The following examples show how to use androidx.appcompat.app.AppCompatDialogFragment. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SessionListAdapter.java    From RedReader with GNU General Public License v3.0 5 votes vote down vote up
public SessionListAdapter(final Context context, final URI url, final UUID current, SessionChangeListener.SessionChangeType type, final AppCompatDialogFragment fragment) {
	this.context = context;
	this.current = current;
	this.type = type;
	this.fragment = fragment;

	sessions = new ArrayList<>(
		CacheManager.getInstance(context).getSessions(url, RedditAccountManager.getInstance(context).getDefaultAccount()));

	final TypedArray attr = context.obtainStyledAttributes(new int[]{R.attr.rrIconRefresh,});
	rrIconRefresh = ContextCompat.getDrawable(context, attr.getResourceId(0, 0));
	attr.recycle();
}
 
Example #2
Source File: TimePickerDialog.java    From MaterialDateTimePicker with Apache License 2.0 4 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setStyle(AppCompatDialogFragment.STYLE_NO_TITLE, 0);
    if (savedInstanceState != null && savedInstanceState.containsKey(KEY_INITIAL_TIME)
                && savedInstanceState.containsKey(KEY_IS_24_HOUR_VIEW)) {
        mInitialTime = savedInstanceState.getParcelable(KEY_INITIAL_TIME);
        mIs24HourMode = savedInstanceState.getBoolean(KEY_IS_24_HOUR_VIEW);
        mInKbMode = savedInstanceState.getBoolean(KEY_IN_KB_MODE);
        mTitle = savedInstanceState.getString(KEY_TITLE);
        mThemeDark = savedInstanceState.getBoolean(KEY_THEME_DARK);
        mThemeDarkChanged = savedInstanceState.getBoolean(KEY_THEME_DARK_CHANGED);
        if (savedInstanceState.containsKey(KEY_ACCENT)) mAccentColor = savedInstanceState.getInt(KEY_ACCENT);
        mVibrate = savedInstanceState.getBoolean(KEY_VIBRATE);
        mDismissOnPause = savedInstanceState.getBoolean(KEY_DISMISS);
        mEnableSeconds = savedInstanceState.getBoolean(KEY_ENABLE_SECONDS);
        mEnableMinutes = savedInstanceState.getBoolean(KEY_ENABLE_MINUTES);
        mOkResid = savedInstanceState.getInt(KEY_OK_RESID);
        mOkString = savedInstanceState.getString(KEY_OK_STRING);
        if (savedInstanceState.containsKey(KEY_OK_COLOR)) mOkColor = savedInstanceState.getInt(KEY_OK_COLOR);
        if (mOkColor == Integer.MAX_VALUE) mOkColor = null;
        mCancelResid = savedInstanceState.getInt(KEY_CANCEL_RESID);
        mCancelString = savedInstanceState.getString(KEY_CANCEL_STRING);
        if (savedInstanceState.containsKey(KEY_CANCEL_COLOR)) mCancelColor = savedInstanceState.getInt(KEY_CANCEL_COLOR);
        mVersion = (Version) savedInstanceState.getSerializable(KEY_VERSION);
        mLimiter = savedInstanceState.getParcelable(KEY_TIMEPOINTLIMITER);
        mLocale = (Locale) savedInstanceState.getSerializable(KEY_LOCALE);

        /*
        If the user supplied a custom limiter, we need to create a new default one to prevent
        null pointer exceptions on the configuration methods
        If the user did not supply a custom limiter we need to ensure both mDefaultLimiter
        and mLimiter are the same reference, so that the config methods actually
        affect the behaviour of the picker (in the unlikely event the user reconfigures
        the picker when it is shown)
         */
        mDefaultLimiter = mLimiter instanceof DefaultTimepointLimiter
                ? (DefaultTimepointLimiter) mLimiter
                : new DefaultTimepointLimiter();
    }
}
 
Example #3
Source File: ShareOrderAdapter.java    From RedReader with GNU General Public License v3.0 4 votes vote down vote up
public ShareOrderAdapter(Context context, List<ResolveInfo> appList, AppCompatDialogFragment fragment) {
	this.context = context;
	this.appList = appList;
	this.packageManager = context.getPackageManager();
	this.fragment = fragment;
}