Search in sources :

Example 11 with AppCompatImageButton

use of android.support.v7.widget.AppCompatImageButton in project MTweaks-KernelAdiutorMOD by morogoku.

the class FrequencyButtonView method onCreateView.

@Override
public void onCreateView(View view) {
    AppCompatImageButton refresh = (AppCompatImageButton) view.findViewById(R.id.frequency_refresh);
    AppCompatImageButton reset = (AppCompatImageButton) view.findViewById(R.id.frequency_reset);
    AppCompatImageButton restore = (AppCompatImageButton) view.findViewById(R.id.frequency_restore);
    refresh.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            rotate(v, false);
            if (mRefreshListener != null) {
                mRefreshListener.onClick(v);
            }
        }
    });
    reset.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            rotate(v, true);
            if (mResetListener != null) {
                mResetListener.onClick(v);
            }
        }
    });
    restore.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            rotate(v, true);
            if (mRestoreListener != null) {
                mRestoreListener.onClick(v);
            }
        }
    });
    setFullSpan(true);
    super.onCreateView(view);
}
Also used : AppCompatImageButton(android.support.v7.widget.AppCompatImageButton) View(android.view.View)

Example 12 with AppCompatImageButton

use of android.support.v7.widget.AppCompatImageButton in project PhoneProfiles by henrichg.

the class ApplicationsDialogPreference method showDialog.

@Override
protected void showDialog(Bundle state) {
    MaterialDialog.Builder mBuilder = new MaterialDialog.Builder(getContext()).title(getDialogTitle()).icon(getDialogIcon()).autoDismiss(false).content(getDialogMessage()).customView(R.layout.activity_applications_pref_dialog, false).dividerColor(0);
    mBuilder.positiveText(getPositiveButtonText()).negativeText(getNegativeButtonText());
    mBuilder.onPositive(new MaterialDialog.SingleButtonCallback() {

        @SuppressWarnings("StringConcatenationInLoop")
        @Override
        public void onClick(@NonNull MaterialDialog materialDialog, @NonNull DialogAction dialogAction) {
            if (shouldPersist()) {
                value = "";
                if (applicationsList != null) {
                    for (Application application : applicationsList) {
                        if (!value.isEmpty())
                            value = value + "|";
                        if (application.shortcut)
                            value = value + "(s)";
                        value = value + application.packageName + "/" + application.activityName;
                        if (application.shortcut && (application.shortcutId > 0))
                            value = value + "#" + application.shortcutId;
                        value = value + "#" + application.startApplicationDelay;
                        PPApplication.logE("ApplicationsDialogPreference.onPositive", "value=" + value);
                    }
                }
                persistString(value);
                setIcons();
                setSummaryAMSDP();
            }
            mDialog.dismiss();
        }
    });
    mBuilder.onNegative(new MaterialDialog.SingleButtonCallback() {

        @Override
        public void onClick(@NonNull MaterialDialog materialDialog, @NonNull DialogAction dialogAction) {
            mDialog.dismiss();
        }
    });
    mBuilder.showListener(new DialogInterface.OnShowListener() {

        @Override
        public void onShow(DialogInterface dialog) {
            ApplicationsDialogPreference.this.onShow();
        }
    });
    mDialog = mBuilder.build();
    View layout = mDialog.getCustomView();
    // noinspection ConstantConditions
    AppCompatImageButton addButton = layout.findViewById(R.id.applications_pref_dlg_add);
    RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getContext());
    // noinspection ConstantConditions
    applicationsListView = layout.findViewById(R.id.applications_pref_dlg_listview);
    // applicationsListView.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
    applicationsListView.setLayoutManager(layoutManager);
    applicationsListView.setHasFixedSize(true);
    // noinspection ConstantConditions
    linlaProgress = layout.findViewById(R.id.applications_pref_dlg_linla_progress);
    // noinspection ConstantConditions
    rellaDialog = layout.findViewById(R.id.applications_pref_dlg_rella_dialog);
    listAdapter = new ApplicationsDialogPreferenceAdapter(context, this, this);
    // added touch helper for drag and drop items
    ItemTouchHelper.Callback callback = new ItemTouchHelperCallback(listAdapter, false, false);
    itemTouchHelper = new ItemTouchHelper(callback);
    itemTouchHelper.attachToRecyclerView(applicationsListView);
    addButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            startEditor(null);
        }
    });
    GlobalGUIRoutines.registerOnActivityDestroyListener(this, this);
    if (state != null)
        mDialog.onRestoreInstanceState(state);
    mDialog.setOnDismissListener(this);
    mDialog.show();
}
Also used : MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) DialogInterface(android.content.DialogInterface) AppCompatImageButton(android.support.v7.widget.AppCompatImageButton) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) ItemTouchHelper(android.support.v7.widget.helper.ItemTouchHelper) DialogAction(com.afollestad.materialdialogs.DialogAction) RecyclerView(android.support.v7.widget.RecyclerView)

Example 13 with AppCompatImageButton

use of android.support.v7.widget.AppCompatImageButton in project EssayJoke by qiyei2015.

the class SkinAppCompatViewInflater method createView.

public final View createView(View parent, final String name, @NonNull Context context, @NonNull AttributeSet attrs, boolean inheritContext, boolean readAndroidTheme, boolean readAppTheme) {
    final Context originalContext = context;
    // by using the parent's context
    if (inheritContext && parent != null) {
        context = parent.getContext();
    }
    if (readAndroidTheme || readAppTheme) {
        // We then apply the theme on the context, if specified
        context = themifyContext(context, attrs, readAndroidTheme, readAppTheme);
    }
    View view = null;
    // We need to 'inject' our tint aware Views in place of the standard framework versions
    switch(name) {
        case "TextView":
            view = new AppCompatTextView(context, attrs);
            break;
        case "ImageView":
            view = new AppCompatImageView(context, attrs);
            break;
        case "Button":
            view = new AppCompatButton(context, attrs);
            break;
        case "EditText":
            view = new AppCompatEditText(context, attrs);
            break;
        case "Spinner":
            view = new AppCompatSpinner(context, attrs);
            break;
        case "ImageButton":
            view = new AppCompatImageButton(context, attrs);
            break;
        case "CheckBox":
            view = new AppCompatCheckBox(context, attrs);
            break;
        case "RadioButton":
            view = new AppCompatRadioButton(context, attrs);
            break;
        case "CheckedTextView":
            view = new AppCompatCheckedTextView(context, attrs);
            break;
        case "AutoCompleteTextView":
            view = new AppCompatAutoCompleteTextView(context, attrs);
            break;
        case "MultiAutoCompleteTextView":
            view = new AppCompatMultiAutoCompleteTextView(context, attrs);
            break;
        case "RatingBar":
            view = new AppCompatRatingBar(context, attrs);
            break;
        case "SeekBar":
            view = new AppCompatSeekBar(context, attrs);
            break;
    }
    if (view == null) {
        // If the original context does not equal our themed context, then we need to manually
        // inflate it using the name so that android:theme takes effect.
        view = createViewFromTag(context, name, attrs);
    }
    if (view != null) {
        // If we have created a view, check it's android:onClick
        checkOnClickListener(view, attrs);
    }
    return view;
}
Also used : Context(android.content.Context) AppCompatSeekBar(android.support.v7.widget.AppCompatSeekBar) AppCompatRadioButton(android.support.v7.widget.AppCompatRadioButton) AppCompatRatingBar(android.support.v7.widget.AppCompatRatingBar) AppCompatTextView(android.support.v7.widget.AppCompatTextView) AppCompatImageButton(android.support.v7.widget.AppCompatImageButton) AppCompatCheckedTextView(android.support.v7.widget.AppCompatCheckedTextView) AppCompatAutoCompleteTextView(android.support.v7.widget.AppCompatAutoCompleteTextView) View(android.view.View) AppCompatImageView(android.support.v7.widget.AppCompatImageView) AppCompatMultiAutoCompleteTextView(android.support.v7.widget.AppCompatMultiAutoCompleteTextView) AppCompatTextView(android.support.v7.widget.AppCompatTextView) AppCompatImageView(android.support.v7.widget.AppCompatImageView) AppCompatSpinner(android.support.v7.widget.AppCompatSpinner) AppCompatButton(android.support.v7.widget.AppCompatButton) AppCompatCheckBox(android.support.v7.widget.AppCompatCheckBox) AppCompatEditText(android.support.v7.widget.AppCompatEditText) AppCompatCheckedTextView(android.support.v7.widget.AppCompatCheckedTextView) AppCompatMultiAutoCompleteTextView(android.support.v7.widget.AppCompatMultiAutoCompleteTextView) AppCompatAutoCompleteTextView(android.support.v7.widget.AppCompatAutoCompleteTextView)

Example 14 with AppCompatImageButton

use of android.support.v7.widget.AppCompatImageButton in project ps-advisor-app by wpi-poverty-stoplight.

the class SurveyIndicatorsSummary method onCreateView.

@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_surveysummary, container, false);
    AppCompatImageButton mSubmitButton = view.findViewById(R.id.btn_surveysummary_submit);
    AppCompatImageButton mBackButton = view.findViewById(R.id.btn_surveysummary_back);
    numSkipped = view.findViewById(R.id.surveysummary_layout_numskipped);
    mIndicatorList = view.findViewById(R.id.surveysummary_layout_recyclerview);
    mIndicatorList.setLayoutManager(new LinearLayoutManager(getContext()));
    mSubmitButton.setOnClickListener((event) -> {
        mSurveyViewModel.setSurveyState(SharedSurveyViewModel.SurveyState.LIFEMAP);
    });
    mBackButton.setOnClickListener((event) -> {
        mSurveyViewModel.setFocusedIndicator(mSurveyViewModel.getSurveyInProgress().getIndicatorQuestions().size() - 1);
    });
    mSurveySummaryAdapter = new IndicatorsSummaryAdapter();
    mSurveySummaryAdapter.setClickListener(this::onItemClick);
    mSurveyViewModel.getIndicatorResponses().observe(this, responses -> {
        mSurveySummaryAdapter.setSkippedIndicators(mSurveyViewModel.getSkippedIndicators());
        setNumSkipped(mSurveySummaryAdapter.getItemCount());
    });
    mIndicatorList.setAdapter(mSurveySummaryAdapter);
    return view;
}
Also used : AppCompatImageButton(android.support.v7.widget.AppCompatImageButton) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View)

Aggregations

AppCompatImageButton (android.support.v7.widget.AppCompatImageButton)14 View (android.view.View)11 ImageView (android.widget.ImageView)6 ViewGroup (android.view.ViewGroup)5 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)4 RecyclerView (android.support.v7.widget.RecyclerView)4 SearchManager (android.app.SearchManager)3 Context (android.content.Context)3 SearchView (android.support.v7.widget.SearchView)3 TypedValue (android.util.TypedValue)3 MenuItem (android.view.MenuItem)3 TextView (android.widget.TextView)3 DialogAction (com.afollestad.materialdialogs.DialogAction)3 MaterialDialog (com.afollestad.materialdialogs.MaterialDialog)3 DialogInterface (android.content.DialogInterface)2 Intent (android.content.Intent)2 Bundle (android.os.Bundle)2 Fragment (android.support.v4.app.Fragment)2 AlertDialog (android.support.v7.app.AlertDialog)2 AppCompatEditText (android.support.v7.widget.AppCompatEditText)2