Search in sources :

Example 96 with View

use of android.view.View in project cheesesquare by chrisbanes.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    final ActionBar ab = getSupportActionBar();
    ab.setHomeAsUpIndicator(R.drawable.ic_menu);
    ab.setDisplayHomeAsUpEnabled(true);
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    if (navigationView != null) {
        setupDrawerContent(navigationView);
    }
    ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
    if (viewPager != null) {
        setupViewPager(viewPager);
    }
    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            Snackbar.make(view, "Here's a Snackbar", Snackbar.LENGTH_LONG).setAction("Action", null).show();
        }
    });
    TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
    tabLayout.setupWithViewPager(viewPager);
}
Also used : NavigationView(android.support.design.widget.NavigationView) TabLayout(android.support.design.widget.TabLayout) FloatingActionButton(android.support.design.widget.FloatingActionButton) ViewPager(android.support.v4.view.ViewPager) NavigationView(android.support.design.widget.NavigationView) View(android.view.View) AdapterView(android.widget.AdapterView) ActionBar(android.support.v7.app.ActionBar) Toolbar(android.support.v7.widget.Toolbar)

Example 97 with View

use of android.view.View in project cw-omnibus by commonsguy.

the class ConstantsBrowser method add.

private void add() {
    LayoutInflater inflater = LayoutInflater.from(this);
    View addView = inflater.inflate(R.layout.add_edit, null);
    final DialogWrapper wrapper = new DialogWrapper(addView);
    new AlertDialog.Builder(this).setTitle(R.string.add_title).setView(addView).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int whichButton) {
            processAdd(wrapper);
        }
    }).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int whichButton) {
        // ignore,
        // just
        // dismiss
        }
    }).show();
}
Also used : AlertDialog(android.app.AlertDialog) DialogInterface(android.content.DialogInterface) LayoutInflater(android.view.LayoutInflater) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 98 with View

use of android.view.View in project cw-omnibus by commonsguy.

the class BatteryFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
    View result = inflater.inflate(R.layout.batt, parent, false);
    bar = (ProgressBar) result.findViewById(R.id.bar);
    status = (ImageView) result.findViewById(R.id.status);
    level = (TextView) result.findViewById(R.id.level);
    return (result);
}
Also used : ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View)

Example 99 with View

use of android.view.View in project cw-omnibus by commonsguy.

the class DownloadFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
    mgr = (DownloadManager) getActivity().getSystemService(Context.DOWNLOAD_SERVICE);
    View result = inflater.inflate(R.layout.main, parent, false);
    query = result.findViewById(R.id.query);
    query.setOnClickListener(this);
    start = result.findViewById(R.id.start);
    start.setOnClickListener(this);
    result.findViewById(R.id.view).setOnClickListener(this);
    return (result);
}
Also used : View(android.view.View)

Example 100 with View

use of android.view.View in project cw-omnibus by commonsguy.

the class ActionBarSherlockCompat method installDecor.

private void installDecor() {
    if (BuildConfig.DEBUG)
        Log.d(TAG, "[installDecor]");
    if (mDecor == null) {
        mDecor = (ViewGroup) mActivity.getWindow().getDecorView().findViewById(android.R.id.content);
    }
    if (mContentParent == null) {
        //Since we are not operating at the window level we need to take
        //into account the fact that the true decor may have already been
        //initialized and had content attached to it. If that is the case,
        //copy over its children to our new content container.
        List<View> views = null;
        if (mDecor.getChildCount() > 0) {
            //Usually there's only one child
            views = new ArrayList<View>(1);
            for (int i = 0, children = mDecor.getChildCount(); i < children; i++) {
                View child = mDecor.getChildAt(0);
                mDecor.removeView(child);
                views.add(child);
            }
        }
        mContentParent = generateLayout();
        //Copy over the old children. See above for explanation.
        if (views != null) {
            for (View child : views) {
                mContentParent.addView(child);
            }
        }
        wActionBar = (ActionBarView) mDecor.findViewById(R.id.abs__action_bar);
        if (wActionBar != null) {
            wActionBar.setWindowCallback(this);
            if (wActionBar.getTitle() == null) {
                wActionBar.setWindowTitle(mActivity.getTitle());
            }
            if (hasFeature(Window.FEATURE_PROGRESS)) {
                wActionBar.initProgress();
            }
            if (hasFeature(Window.FEATURE_INDETERMINATE_PROGRESS)) {
                wActionBar.initIndeterminateProgress();
            }
            //Since we don't require onCreate dispatching, parse for uiOptions here
            int uiOptions = loadUiOptionsFromManifest(mActivity);
            if (uiOptions != 0) {
                mUiOptions = uiOptions;
            }
            boolean splitActionBar = false;
            final boolean splitWhenNarrow = (mUiOptions & ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW) != 0;
            if (splitWhenNarrow) {
                splitActionBar = getResources_getBoolean(mActivity, R.bool.abs__split_action_bar_is_narrow);
            } else {
                splitActionBar = mActivity.getTheme().obtainStyledAttributes(R.styleable.SherlockTheme).getBoolean(R.styleable.SherlockTheme_windowSplitActionBar, false);
            }
            final ActionBarContainer splitView = (ActionBarContainer) mDecor.findViewById(R.id.abs__split_action_bar);
            if (splitView != null) {
                wActionBar.setSplitView(splitView);
                wActionBar.setSplitActionBar(splitActionBar);
                wActionBar.setSplitWhenNarrow(splitWhenNarrow);
                mActionModeView = (ActionBarContextView) mDecor.findViewById(R.id.abs__action_context_bar);
                mActionModeView.setSplitView(splitView);
                mActionModeView.setSplitActionBar(splitActionBar);
                mActionModeView.setSplitWhenNarrow(splitWhenNarrow);
            } else if (splitActionBar) {
                Log.e(TAG, "Requested split action bar with incompatible window decor! Ignoring request.");
            }
            // Post the panel invalidate for later; avoid application onCreateOptionsMenu
            // being called in the middle of onCreate or similar.
            mDecor.post(new Runnable() {

                @Override
                public void run() {
                    //Invalidate if the panel menu hasn't been created before this.
                    if (!mIsDestroyed && !mActivity.isFinishing() && mMenu == null) {
                        dispatchInvalidateOptionsMenu();
                    }
                }
            });
        }
    }
}
Also used : ActionBarContainer(com.actionbarsherlock.internal.widget.ActionBarContainer) ActionBarContextView(com.actionbarsherlock.internal.widget.ActionBarContextView) ActionBarView(com.actionbarsherlock.internal.widget.ActionBarView) View(android.view.View)

Aggregations

View (android.view.View)29669 TextView (android.widget.TextView)12068 ImageView (android.widget.ImageView)6582 RecyclerView (android.support.v7.widget.RecyclerView)3799 ListView (android.widget.ListView)3356 AdapterView (android.widget.AdapterView)3162 ViewGroup (android.view.ViewGroup)2623 Intent (android.content.Intent)2579 LayoutInflater (android.view.LayoutInflater)1742 Button (android.widget.Button)1650 Paint (android.graphics.Paint)1399 ArrayList (java.util.ArrayList)1365 LinearLayout (android.widget.LinearLayout)1343 OnClickListener (android.view.View.OnClickListener)1341 SuppressLint (android.annotation.SuppressLint)1141 AbsListView (android.widget.AbsListView)1135 BindView (butterknife.BindView)1072 Context (android.content.Context)985 Bundle (android.os.Bundle)944 DialogInterface (android.content.DialogInterface)915