use of android.widget.CheckedTextView in project WordPress-Android by wordpress-mobile.
the class StatsVisitorsAndViewsFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.stats_visitors_and_views_fragment, container, false);
mDateTextView = (TextView) view.findViewById(R.id.stats_summary_date);
mGraphContainer = (LinearLayout) view.findViewById(R.id.stats_bar_chart_fragment_container);
mModuleButtonsContainer = (LinearLayout) view.findViewById(R.id.stats_pager_tabs);
mNoActivtyThisPeriodContainer = (LinearLayout) view.findViewById(R.id.stats_bar_chart_no_activity);
mLegendContainer = (LinearLayout) view.findViewById(R.id.stats_legend_container);
mLegendLabel = (CheckedTextView) view.findViewById(R.id.stats_legend_label);
// Make sure to set a null drawable here. Otherwise the touching area is the same of a TextView
mLegendLabel.setCheckMarkDrawable(null);
mVisitorsCheckboxContainer = (LinearLayout) view.findViewById(R.id.stats_checkbox_visitors_container);
mVisitorsCheckbox = (CheckBox) view.findViewById(R.id.stats_checkbox_visitors);
mVisitorsCheckbox.setOnClickListener(onCheckboxClicked);
// causes the issue report here https://github.com/wordpress-mobile/WordPress-Android/pull/2377#issuecomment-77067993
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
mVisitorsCheckbox.setPadding(getResources().getDimensionPixelSize(R.dimen.margin_medium), 0, 0, 0);
}
// Make sure we've all the info to build the tab correctly. This is ALWAYS true
if (mModuleButtonsContainer.getChildCount() == overviewItems.length) {
for (int i = 0; i < mModuleButtonsContainer.getChildCount(); i++) {
LinearLayout currentTab = (LinearLayout) mModuleButtonsContainer.getChildAt(i);
boolean isLastItem = i == (overviewItems.length - 1);
boolean isChecked = i == mSelectedOverviewItemIndex;
TabViewHolder currentTabViewHolder = new TabViewHolder(currentTab, overviewItems[i], isChecked, isLastItem);
currentTab.setOnClickListener(TopButtonsOnClickListener);
currentTab.setTag(currentTabViewHolder);
}
mModuleButtonsContainer.setVisibility(View.VISIBLE);
}
return view;
}
use of android.widget.CheckedTextView in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BugreportPreference method onPrepareDialogBuilder.
@Override
protected void onPrepareDialogBuilder(Builder builder, DialogInterface.OnClickListener listener) {
super.onPrepareDialogBuilder(builder, listener);
final View dialogView = View.inflate(getContext(), R.layout.bugreport_options_dialog, null);
mInteractiveTitle = (CheckedTextView) dialogView.findViewById(R.id.bugreport_option_interactive_title);
mInteractiveSummary = (TextView) dialogView.findViewById(R.id.bugreport_option_interactive_summary);
mFullTitle = (CheckedTextView) dialogView.findViewById(R.id.bugreport_option_full_title);
mFullSummary = (TextView) dialogView.findViewById(R.id.bugreport_option_full_summary);
final View.OnClickListener l = new View.OnClickListener() {
@Override
public void onClick(View v) {
if (v == mFullTitle || v == mFullSummary) {
mInteractiveTitle.setChecked(false);
mFullTitle.setChecked(true);
}
if (v == mInteractiveTitle || v == mInteractiveSummary) {
mInteractiveTitle.setChecked(true);
mFullTitle.setChecked(false);
}
}
};
mInteractiveTitle.setOnClickListener(l);
mFullTitle.setOnClickListener(l);
mInteractiveSummary.setOnClickListener(l);
mFullSummary.setOnClickListener(l);
builder.setPositiveButton(com.android.internal.R.string.report, listener);
builder.setView(dialogView);
}
use of android.widget.CheckedTextView in project apps-android-commons by commons-app.
the class CategoriesAdapter method getView.
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
CheckedTextView checkedView;
if (view == null) {
checkedView = (CheckedTextView) mInflater.inflate(R.layout.layout_categories_item, null);
} else {
checkedView = (CheckedTextView) view;
}
CategorizationFragment.CategoryItem item = (CategorizationFragment.CategoryItem) this.getItem(i);
checkedView.setChecked(item.selected);
checkedView.setText(item.name);
checkedView.setTag(i);
return checkedView;
}
use of android.widget.CheckedTextView in project apps-android-commons by commons-app.
the class CategorizationFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_categorization, null);
categoriesList = (ListView) rootView.findViewById(R.id.categoriesListBox);
categoriesFilter = (EditText) rootView.findViewById(R.id.categoriesSearchBox);
categoriesSearchInProgress = (ProgressBar) rootView.findViewById(R.id.categoriesSearchInProgress);
categoriesNotFoundView = (TextView) rootView.findViewById(R.id.categoriesNotFound);
categoriesSkip = (TextView) rootView.findViewById(R.id.categoriesExplanation);
categoriesSkip.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
getActivity().onBackPressed();
getActivity().finish();
}
});
ArrayList<CategoryItem> items;
if (savedInstanceState == null) {
items = new ArrayList<>();
categoriesCache = new HashMap<>();
} else {
items = savedInstanceState.getParcelableArrayList("currentCategories");
categoriesCache = (HashMap<String, ArrayList<String>>) savedInstanceState.getSerializable("categoriesCache");
}
categoriesAdapter = new CategoriesAdapter(getActivity(), items);
categoriesList.setAdapter(categoriesAdapter);
categoriesList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int index, long id) {
CheckedTextView checkedView = (CheckedTextView) view;
CategoryItem item = (CategoryItem) adapterView.getAdapter().getItem(index);
item.selected = !item.selected;
checkedView.setChecked(item.selected);
if (item.selected) {
updateCategoryCount(item.name);
}
}
});
categoriesFilter.addTextChangedListener(textWatcher);
startUpdatingCategoryList();
return rootView;
}
Aggregations