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