Search in sources :

Example 21 with CheckedTextView

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;
}
Also used : ImageView(android.widget.ImageView) View(android.view.View) GraphView(com.jjoe64.graphview.GraphView) TextView(android.widget.TextView) CheckedTextView(android.widget.CheckedTextView) LinearLayout(android.widget.LinearLayout)

Example 22 with CheckedTextView

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);
}
Also used : TextView(android.widget.TextView) CheckedTextView(android.widget.CheckedTextView) View(android.view.View)

Example 23 with CheckedTextView

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;
}
Also used : CheckedTextView(android.widget.CheckedTextView)

Example 24 with CheckedTextView

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;
}
Also used : CheckedTextView(android.widget.CheckedTextView) ArrayList(java.util.ArrayList) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) CheckedTextView(android.widget.CheckedTextView) ListView(android.widget.ListView) AdapterView(android.widget.AdapterView)

Aggregations

CheckedTextView (android.widget.CheckedTextView)24 View (android.view.View)16 TextView (android.widget.TextView)9 ListView (android.widget.ListView)6 AdapterView (android.widget.AdapterView)5 LayoutInflater (android.view.LayoutInflater)4 ArrayAdapter (android.widget.ArrayAdapter)3 SuppressLint (android.annotation.SuppressLint)2 Context (android.content.Context)2 DialogInterface (android.content.DialogInterface)2 TypedArray (android.content.res.TypedArray)2 Button (android.widget.Button)2 ImageView (android.widget.ImageView)2 GraphView (com.jjoe64.graphview.GraphView)2 Account (android.accounts.Account)1 Intent (android.content.Intent)1 ColorStateList (android.content.res.ColorStateList)1 Resources (android.content.res.Resources)1 Nullable (android.support.annotation.Nullable)1 RecyclerView (android.support.v7.widget.RecyclerView)1