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);
}
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();
}
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;
}
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;
}
Aggregations