Search in sources :

Example 51 with ActionBar

use of android.app.ActionBar in project AndroidSwipeLayout by daimajia.

the class ListViewExample method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.listview);
    mListView = (ListView) findViewById(R.id.listview);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        ActionBar actionBar = getActionBar();
        if (actionBar != null) {
            actionBar.setTitle("ListView");
        }
    }
    /**
         * The following comment is the sample usage of ArraySwipeAdapter.
         */
    //        String[] adapterData = new String[]{"Activity", "Service", "Content Provider", "Intent", "BroadcastReceiver", "ADT", "Sqlite3", "HttpClient",
    //                "DDMS", "Android Studio", "Fragment", "Loader", "Activity", "Service", "Content Provider", "Intent",
    //                "BroadcastReceiver", "ADT", "Sqlite3", "HttpClient", "Activity", "Service", "Content Provider", "Intent",
    //                "BroadcastReceiver", "ADT", "Sqlite3", "HttpClient"};
    //        mListView.setAdapter(new ArraySwipeAdapterSample<String>(this, R.layout.listview_item, R.id.position, adapterData));
    mAdapter = new ListViewAdapter(this);
    mListView.setAdapter(mAdapter);
    mAdapter.setMode(Attributes.Mode.Single);
    mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            ((SwipeLayout) (mListView.getChildAt(position - mListView.getFirstVisiblePosition()))).open(true);
        }
    });
    mListView.setOnTouchListener(new View.OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            Log.e("ListView", "OnTouch");
            return false;
        }
    });
    mListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {

        @Override
        public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
            Toast.makeText(mContext, "OnItemLongClickListener", Toast.LENGTH_SHORT).show();
            return true;
        }
    });
    mListView.setOnScrollListener(new AbsListView.OnScrollListener() {

        @Override
        public void onScrollStateChanged(AbsListView view, int scrollState) {
            Log.e("ListView", "onScrollStateChanged");
        }

        @Override
        public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
        }
    });
    mListView.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {

        @Override
        public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            Log.e("ListView", "onItemSelected:" + position);
        }

        @Override
        public void onNothingSelected(AdapterView<?> parent) {
            Log.e("ListView", "onNothingSelected:");
        }
    });
}
Also used : AbsListView(android.widget.AbsListView) AbsListView(android.widget.AbsListView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView) MotionEvent(android.view.MotionEvent) ListViewAdapter(com.daimajia.swipedemo.adapter.ListViewAdapter) AdapterView(android.widget.AdapterView) ActionBar(android.app.ActionBar)

Example 52 with ActionBar

use of android.app.ActionBar in project circular-progress-button by dmytrodanylyk.

the class Sample3Activity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.ac_sample_3);
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setTitle(R.string.StateChangeSample);
    }
    final CircularProgressButton circularButton1 = (CircularProgressButton) findViewById(R.id.circularButton1);
    circularButton1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton1.getProgress() == 0) {
                circularButton1.setProgress(100);
            } else {
                circularButton1.setProgress(0);
            }
        }
    });
    final CircularProgressButton circularButton2 = (CircularProgressButton) findViewById(R.id.circularButton2);
    circularButton2.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton2.getProgress() == 0) {
                circularButton2.setProgress(-1);
            } else {
                circularButton2.setProgress(0);
            }
        }
    });
}
Also used : CircularProgressButton(com.dd.CircularProgressButton) View(android.view.View) ActionBar(android.app.ActionBar)

Example 53 with ActionBar

use of android.app.ActionBar in project circular-progress-button by dmytrodanylyk.

the class Sample4Activity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.ac_sample_4);
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setTitle(R.string.ProgressPaddingSample);
    }
    final CircularProgressButton circularButton1 = (CircularProgressButton) findViewById(R.id.circularButton1);
    circularButton1.setIndeterminateProgressMode(true);
    circularButton1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton1.getProgress() == 0) {
                circularButton1.setProgress(50);
            } else if (circularButton1.getProgress() == 100) {
                circularButton1.setProgress(0);
            } else {
                circularButton1.setProgress(100);
            }
        }
    });
    final CircularProgressButton circularButton2 = (CircularProgressButton) findViewById(R.id.circularButton2);
    circularButton2.setIndeterminateProgressMode(true);
    circularButton2.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton2.getProgress() == 0) {
                circularButton2.setProgress(50);
            } else if (circularButton2.getProgress() == -1) {
                circularButton2.setProgress(0);
            } else {
                circularButton2.setProgress(-1);
            }
        }
    });
}
Also used : CircularProgressButton(com.dd.CircularProgressButton) View(android.view.View) ActionBar(android.app.ActionBar)

Example 54 with ActionBar

use of android.app.ActionBar in project circular-progress-button by dmytrodanylyk.

the class Sample5Activity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.ac_sample_5);
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setTitle(R.string.CustomSelectorSample);
    }
    final CircularProgressButton circularButton1 = (CircularProgressButton) findViewById(R.id.circularButton1);
    circularButton1.setIndeterminateProgressMode(true);
    circularButton1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton1.getProgress() == 0) {
                circularButton1.setProgress(50);
            } else if (circularButton1.getProgress() == 100) {
                circularButton1.setProgress(0);
            } else {
                circularButton1.setProgress(100);
            }
        }
    });
    final CircularProgressButton circularButton2 = (CircularProgressButton) findViewById(R.id.circularButton2);
    circularButton2.setIndeterminateProgressMode(true);
    circularButton2.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton2.getProgress() == 0) {
                circularButton2.setProgress(50);
            } else if (circularButton2.getProgress() == -1) {
                circularButton2.setProgress(0);
            } else {
                circularButton2.setProgress(-1);
            }
        }
    });
}
Also used : CircularProgressButton(com.dd.CircularProgressButton) View(android.view.View) ActionBar(android.app.ActionBar)

Example 55 with ActionBar

use of android.app.ActionBar in project cw-omnibus by commonsguy.

the class MainActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    widget = findViewById(R.id.widget);
    ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    for (int i = 0; i < TABS.length; i++) {
        bar.addTab(bar.newTab().setText(getString(TABS[i])).setTabListener(this));
    }
}
Also used : ActionBar(android.app.ActionBar)

Aggregations

ActionBar (android.app.ActionBar)158 View (android.view.View)37 Intent (android.content.Intent)19 AdapterView (android.widget.AdapterView)11 TextView (android.widget.TextView)11 ListView (android.widget.ListView)9 SharedPreferences (android.content.SharedPreferences)8 Uri (android.net.Uri)7 ArrayAdapter (android.widget.ArrayAdapter)7 FrameLayout (android.widget.FrameLayout)7 SpannableString (android.text.SpannableString)6 BitmapRegionTileSource (com.android.photos.BitmapRegionTileSource)6 GridLayoutManager (android.support.v7.widget.GridLayoutManager)5 RecyclerView (android.support.v7.widget.RecyclerView)5 CircularProgressButton (com.dd.CircularProgressButton)5 CircularProgressButton (com.marshalchen.common.uimodule.circularProgressButton.CircularProgressButton)5 SuppressLint (android.annotation.SuppressLint)4 Bundle (android.os.Bundle)4 ViewPager (android.support.v4.view.ViewPager)4 MenuInflater (android.view.MenuInflater)4